Class DatasetServiceClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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 (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().
| Method | Description | Method Variants |
|---|---|---|
CreateDataset |
Creates a Dataset. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetDataset |
Gets a Dataset. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateDataset |
Updates a Dataset. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListDatasets |
Lists Datasets in a Location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteDataset |
Deletes a Dataset. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ImportData |
Imports data into a Dataset. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ExportData |
Exports data from a Dataset. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateDatasetVersion |
Create a version from a Dataset. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateDatasetVersion |
Updates a DatasetVersion. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteDatasetVersion |
Deletes a Dataset version. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetDatasetVersion |
Gets a Dataset version. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListDatasetVersions |
Lists DatasetVersions in a Dataset. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RestoreDatasetVersion |
Restores a dataset version. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListDataItems |
Lists DataItems in a Dataset. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SearchDataItems |
Searches DataItems in a Dataset. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListSavedQueries |
Lists SavedQueries in a Dataset. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteSavedQuery |
Deletes a SavedQuery. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetAnnotationSpec |
Gets an AnnotationSpec. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListAnnotations |
Lists Annotations belongs to a dataitem. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replacesany existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIamPolicy |
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
TestIamPermissions |
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return 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:
// 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
DatasetServiceSettings datasetServiceSettings =
DatasetServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DatasetServiceClient datasetServiceClient = DatasetServiceClient.create(datasetServiceSettings);
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
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDatasetServiceClient(DatasetServiceSettings settings) Constructs an instance of DatasetServiceClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final DatasetServiceClientcreate()Constructs an instance of DatasetServiceClient with default settings.static final DatasetServiceClientcreate(DatasetServiceSettings settings) Constructs an instance of DatasetServiceClient, using the given settings.static final DatasetServiceClientcreate(DatasetServiceStub stub) Constructs an instance of DatasetServiceClient, using the given stub for making calls.createDatasetAsync(CreateDatasetRequest request) Creates a Dataset.createDatasetAsync(LocationName parent, Dataset dataset) Creates a Dataset.createDatasetAsync(String parent, Dataset dataset) Creates a Dataset.Creates a Dataset.Creates a Dataset.Create a version from a Dataset.createDatasetVersionAsync(DatasetName parent, DatasetVersion datasetVersion) Create a version from a Dataset.createDatasetVersionAsync(String parent, DatasetVersion datasetVersion) Create a version from a Dataset.Create a version from a Dataset.final OperationCallable<CreateDatasetVersionRequest,DatasetVersion, CreateDatasetVersionOperationMetadata> Create a version from a Dataset.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a Dataset.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteDatasetAsync(DeleteDatasetRequest request) Deletes a Dataset.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteDatasetAsync(String name) Deletes a Dataset.Deletes a Dataset.final OperationCallable<DeleteDatasetRequest,com.google.protobuf.Empty, DeleteOperationMetadata> Deletes a Dataset.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a Dataset version.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a Dataset version.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a Dataset version.Deletes a Dataset version.final OperationCallable<DeleteDatasetVersionRequest,com.google.protobuf.Empty, DeleteOperationMetadata> Deletes a Dataset version.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a SavedQuery.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a SavedQuery.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteSavedQueryAsync(String name) Deletes a SavedQuery.Deletes a SavedQuery.final OperationCallable<DeleteSavedQueryRequest,com.google.protobuf.Empty, DeleteOperationMetadata> Deletes a SavedQuery.exportDataAsync(DatasetName name, ExportDataConfig exportConfig) Exports data from a Dataset.exportDataAsync(ExportDataRequest request) Exports data from a Dataset.exportDataAsync(String name, ExportDataConfig exportConfig) Exports data from a Dataset.Exports data from a Dataset.Exports data from a Dataset.final AnnotationSpecGets an AnnotationSpec.final AnnotationSpecGets an AnnotationSpec.final AnnotationSpecgetAnnotationSpec(String name) Gets an AnnotationSpec.Gets an AnnotationSpec.final DatasetgetDataset(DatasetName name) Gets a Dataset.final DatasetgetDataset(GetDatasetRequest request) Gets a Dataset.final DatasetgetDataset(String name) Gets a Dataset.Gets a Dataset.final DatasetVersionGets a Dataset version.final DatasetVersionGets a Dataset version.final DatasetVersiongetDatasetVersion(String name) Gets a Dataset version.Gets a Dataset version.final PolicygetIamPolicy(GetIamPolicyRequest request) Gets the access control policy for a resource.Gets the access control policy for a resource.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final DatasetServiceSettingsgetStub()importDataAsync(DatasetName name, List<ImportDataConfig> importConfigs) Imports data into a Dataset.importDataAsync(ImportDataRequest request) Imports data into a Dataset.importDataAsync(String name, List<ImportDataConfig> importConfigs) Imports data into a Dataset.Imports data into a Dataset.Imports data into a Dataset.booleanbooleanlistAnnotations(DataItemName parent) Lists Annotations belongs to a dataitem.listAnnotations(ListAnnotationsRequest request) Lists Annotations belongs to a dataitem.listAnnotations(String parent) Lists Annotations belongs to a dataitem.Lists Annotations belongs to a dataitem.Lists Annotations belongs to a dataitem.listDataItems(DatasetName parent) Lists DataItems in a Dataset.listDataItems(ListDataItemsRequest request) Lists DataItems in a Dataset.listDataItems(String parent) Lists DataItems in a Dataset.Lists DataItems in a Dataset.Lists DataItems in a Dataset.listDatasets(ListDatasetsRequest request) Lists Datasets in a Location.listDatasets(LocationName parent) Lists Datasets in a Location.listDatasets(String parent) Lists Datasets in a Location.Lists Datasets in a Location.Lists Datasets in a Location.listDatasetVersions(DatasetName parent) Lists DatasetVersions in a Dataset.Lists DatasetVersions in a Dataset.listDatasetVersions(String parent) Lists DatasetVersions in a Dataset.Lists DatasetVersions in a Dataset.final UnaryCallable<ListDatasetVersionsRequest,DatasetServiceClient.ListDatasetVersionsPagedResponse> Lists DatasetVersions in a Dataset.listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists information about the supported locations for this service.listSavedQueries(DatasetName parent) Lists SavedQueries in a Dataset.listSavedQueries(ListSavedQueriesRequest request) Lists SavedQueries in a Dataset.listSavedQueries(String parent) Lists SavedQueries in a Dataset.Lists SavedQueries in a Dataset.Lists SavedQueries in a Dataset.Restores a dataset version.Restores a dataset version.Restores a dataset version.Restores a dataset version.final OperationCallable<RestoreDatasetVersionRequest,DatasetVersion, RestoreDatasetVersionOperationMetadata> Restores a dataset version.searchDataItems(SearchDataItemsRequest request) Searches DataItems in a Dataset.Searches DataItems in a Dataset.Searches DataItems in a Dataset.final PolicysetIamPolicy(SetIamPolicyRequest request) Sets the access control policy on the specified resource.Sets the access control policy on the specified resource.voidshutdown()voidReturns permissions that a caller has on the specified resource.Returns permissions that a caller has on the specified resource.final DatasetupdateDataset(Dataset dataset, com.google.protobuf.FieldMask updateMask) Updates a Dataset.final DatasetupdateDataset(UpdateDatasetRequest request) Updates a Dataset.Updates a Dataset.final DatasetVersionupdateDatasetVersion(DatasetVersion datasetVersion, com.google.protobuf.FieldMask updateMask) Updates a DatasetVersion.final DatasetVersionUpdates a DatasetVersion.Updates a DatasetVersion.
-
Constructor Details
-
DatasetServiceClient
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.- Throws:
IOException
-
DatasetServiceClient
-
-
Method Details
-
create
Constructs an instance of DatasetServiceClient with default settings.- Throws:
IOException
-
create
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.- Throws:
IOException
-
create
Constructs an instance of DatasetServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(DatasetServiceSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
createDatasetAsync
public final OperationFuture<Dataset,CreateDatasetOperationMetadata> createDatasetAsync(LocationName parent, Dataset dataset) Creates a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Dataset dataset = Dataset.newBuilder().build(); Dataset response = datasetServiceClient.createDatasetAsync(parent, dataset).get(); }- Parameters:
parent- Required. The resource name of the Location to create the Dataset in. Format: `projects/{project}/locations/{location}`dataset- Required. The Dataset to create.- Throws:
ApiException- if the remote call fails
-
createDatasetAsync
public final OperationFuture<Dataset,CreateDatasetOperationMetadata> createDatasetAsync(String parent, Dataset dataset) Creates a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Dataset dataset = Dataset.newBuilder().build(); Dataset response = datasetServiceClient.createDatasetAsync(parent, dataset).get(); }- Parameters:
parent- Required. The resource name of the Location to create the Dataset in. Format: `projects/{project}/locations/{location}`dataset- Required. The Dataset to create.- Throws:
ApiException- if the remote call fails
-
createDatasetAsync
public final OperationFuture<Dataset,CreateDatasetOperationMetadata> createDatasetAsync(CreateDatasetRequest request) Creates a Dataset.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 (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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createDatasetOperationCallable
public final OperationCallable<CreateDatasetRequest,Dataset, createDatasetOperationCallable()CreateDatasetOperationMetadata> Creates a Dataset.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 (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(); } -
createDatasetCallable
Creates a Dataset.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 (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(); } -
getDataset
Gets a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); Dataset response = datasetServiceClient.getDataset(name); }- Parameters:
name- Required. The name of the Dataset resource.- Throws:
ApiException- if the remote call fails
-
getDataset
Gets a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); Dataset response = datasetServiceClient.getDataset(name); }- Parameters:
name- Required. The name of the Dataset resource.- Throws:
ApiException- if the remote call fails
-
getDataset
Gets a Dataset.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 (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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getDatasetCallable
Gets a Dataset.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 (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(); } -
updateDataset
Updates a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { Dataset dataset = Dataset.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Dataset response = datasetServiceClient.updateDataset(dataset, updateMask); }- Parameters:
dataset- Required. The Dataset which replaces the resource on the server.updateMask- Required. The update mask applies to the resource. For the `FieldMask` definition, see [google.protobuf.FieldMask][google.protobuf.FieldMask]. Updatable fields:* `display_name` * `description` * `labels`
- Throws:
ApiException- if the remote call fails
-
updateDataset
Updates a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder() .setDataset(Dataset.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Dataset response = datasetServiceClient.updateDataset(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateDatasetCallable
Updates a Dataset.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 (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(); } -
listDatasets
Lists Datasets in 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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Dataset element : datasetServiceClient.listDatasets(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The name of the Dataset's parent resource. Format: `projects/{project}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listDatasets
Lists Datasets in 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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Dataset element : datasetServiceClient.listDatasets(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The name of the Dataset's parent resource. Format: `projects/{project}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listDatasets
public final DatasetServiceClient.ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request) Lists Datasets in 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 (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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listDatasetsPagedCallable
public final UnaryCallable<ListDatasetsRequest,DatasetServiceClient.ListDatasetsPagedResponse> listDatasetsPagedCallable()Lists Datasets in 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 (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); } } -
listDatasetsCallable
Lists Datasets in 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 (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.getDatasetsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
deleteDatasetAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteDatasetAsync(DatasetName name) Deletes a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); datasetServiceClient.deleteDatasetAsync(name).get(); }- Parameters:
name- Required. The resource name of the Dataset to delete. Format: `projects/{project}/locations/{location}/datasets/{dataset}`- Throws:
ApiException- if the remote call fails
-
deleteDatasetAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteDatasetAsync(String name) Deletes a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); datasetServiceClient.deleteDatasetAsync(name).get(); }- Parameters:
name- Required. The resource name of the Dataset to delete. Format: `projects/{project}/locations/{location}/datasets/{dataset}`- Throws:
ApiException- if the remote call fails
-
deleteDatasetAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteDatasetAsync(DeleteDatasetRequest request) Deletes a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .build(); datasetServiceClient.deleteDatasetAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteDatasetOperationCallable
public final OperationCallable<DeleteDatasetRequest,com.google.protobuf.Empty, deleteDatasetOperationCallable()DeleteOperationMetadata> Deletes a Dataset.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 (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(); } -
deleteDatasetCallable
Deletes a Dataset.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 (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(); } -
importDataAsync
public final OperationFuture<ImportDataResponse,ImportDataOperationMetadata> importDataAsync(DatasetName name, List<ImportDataConfig> importConfigs) Imports data into a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); List<ImportDataConfig> importConfigs = new ArrayList<>(); ImportDataResponse response = datasetServiceClient.importDataAsync(name, importConfigs).get(); }- Parameters:
name- Required. The name of the Dataset resource. Format: `projects/{project}/locations/{location}/datasets/{dataset}`importConfigs- Required. The desired input locations. The contents of all input locations will be imported in one batch.- Throws:
ApiException- if the remote call fails
-
importDataAsync
public final OperationFuture<ImportDataResponse,ImportDataOperationMetadata> importDataAsync(String name, List<ImportDataConfig> importConfigs) Imports data into a Dataset.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 (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:
name- Required. The name of the Dataset resource. Format: `projects/{project}/locations/{location}/datasets/{dataset}`importConfigs- Required. The desired input locations. The contents of all input locations will be imported in one batch.- Throws:
ApiException- if the remote call fails
-
importDataAsync
public final OperationFuture<ImportDataResponse,ImportDataOperationMetadata> importDataAsync(ImportDataRequest request) Imports data into a Dataset.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 (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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
importDataOperationCallable
public final OperationCallable<ImportDataRequest,ImportDataResponse, importDataOperationCallable()ImportDataOperationMetadata> Imports data into a Dataset.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 (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(); } -
importDataCallable
Imports data into a Dataset.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 (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(); } -
exportDataAsync
public final OperationFuture<ExportDataResponse,ExportDataOperationMetadata> exportDataAsync(DatasetName name, ExportDataConfig exportConfig) Exports data from a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); ExportDataConfig exportConfig = ExportDataConfig.newBuilder().build(); ExportDataResponse response = datasetServiceClient.exportDataAsync(name, exportConfig).get(); }- Parameters:
name- Required. The name of the Dataset resource. Format: `projects/{project}/locations/{location}/datasets/{dataset}`exportConfig- Required. The desired output location.- Throws:
ApiException- if the remote call fails
-
exportDataAsync
public final OperationFuture<ExportDataResponse,ExportDataOperationMetadata> exportDataAsync(String name, ExportDataConfig exportConfig) Exports data from a Dataset.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 (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:
name- Required. The name of the Dataset resource. Format: `projects/{project}/locations/{location}/datasets/{dataset}`exportConfig- Required. The desired output location.- Throws:
ApiException- if the remote call fails
-
exportDataAsync
public final OperationFuture<ExportDataResponse,ExportDataOperationMetadata> exportDataAsync(ExportDataRequest request) Exports data from a Dataset.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 (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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
exportDataOperationCallable
public final OperationCallable<ExportDataRequest,ExportDataResponse, exportDataOperationCallable()ExportDataOperationMetadata> Exports data from a Dataset.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 (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(); } -
exportDataCallable
Exports data from a Dataset.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 (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(); } -
createDatasetVersionAsync
public final OperationFuture<DatasetVersion,CreateDatasetVersionOperationMetadata> createDatasetVersionAsync(DatasetName parent, DatasetVersion datasetVersion) Create a version from a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); DatasetVersion datasetVersion = DatasetVersion.newBuilder().build(); DatasetVersion response = datasetServiceClient.createDatasetVersionAsync(parent, datasetVersion).get(); }- Parameters:
parent- Required. The name of the Dataset resource. Format: `projects/{project}/locations/{location}/datasets/{dataset}`datasetVersion- Required. The version to be created. The same CMEK policies with the original Dataset will be applied the dataset version. So here we don't need to specify the EncryptionSpecType here.- Throws:
ApiException- if the remote call fails
-
createDatasetVersionAsync
public final OperationFuture<DatasetVersion,CreateDatasetVersionOperationMetadata> createDatasetVersionAsync(String parent, DatasetVersion datasetVersion) Create a version from a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { String parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); DatasetVersion datasetVersion = DatasetVersion.newBuilder().build(); DatasetVersion response = datasetServiceClient.createDatasetVersionAsync(parent, datasetVersion).get(); }- Parameters:
parent- Required. The name of the Dataset resource. Format: `projects/{project}/locations/{location}/datasets/{dataset}`datasetVersion- Required. The version to be created. The same CMEK policies with the original Dataset will be applied the dataset version. So here we don't need to specify the EncryptionSpecType here.- Throws:
ApiException- if the remote call fails
-
createDatasetVersionAsync
public final OperationFuture<DatasetVersion,CreateDatasetVersionOperationMetadata> createDatasetVersionAsync(CreateDatasetVersionRequest request) Create a version from a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { CreateDatasetVersionRequest request = CreateDatasetVersionRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .setDatasetVersion(DatasetVersion.newBuilder().build()) .build(); DatasetVersion response = datasetServiceClient.createDatasetVersionAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createDatasetVersionOperationCallable
public final OperationCallable<CreateDatasetVersionRequest,DatasetVersion, createDatasetVersionOperationCallable()CreateDatasetVersionOperationMetadata> Create a version from a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { CreateDatasetVersionRequest request = CreateDatasetVersionRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .setDatasetVersion(DatasetVersion.newBuilder().build()) .build(); OperationFuture<DatasetVersion, CreateDatasetVersionOperationMetadata> future = datasetServiceClient.createDatasetVersionOperationCallable().futureCall(request); // Do something. DatasetVersion response = future.get(); } -
createDatasetVersionCallable
Create a version from a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { CreateDatasetVersionRequest request = CreateDatasetVersionRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .setDatasetVersion(DatasetVersion.newBuilder().build()) .build(); ApiFuture<Operation> future = datasetServiceClient.createDatasetVersionCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateDatasetVersion
public final DatasetVersion updateDatasetVersion(DatasetVersion datasetVersion, com.google.protobuf.FieldMask updateMask) Updates a DatasetVersion.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DatasetVersion datasetVersion = DatasetVersion.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); DatasetVersion response = datasetServiceClient.updateDatasetVersion(datasetVersion, updateMask); }- Parameters:
datasetVersion- Required. The DatasetVersion which replaces the resource on the server.updateMask- Required. The update mask applies to the resource. For the `FieldMask` definition, see [google.protobuf.FieldMask][google.protobuf.FieldMask]. Updatable fields:* `display_name`
- Throws:
ApiException- if the remote call fails
-
updateDatasetVersion
Updates a DatasetVersion.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { UpdateDatasetVersionRequest request = UpdateDatasetVersionRequest.newBuilder() .setDatasetVersion(DatasetVersion.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); DatasetVersion response = datasetServiceClient.updateDatasetVersion(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateDatasetVersionCallable
public final UnaryCallable<UpdateDatasetVersionRequest,DatasetVersion> updateDatasetVersionCallable()Updates a DatasetVersion.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { UpdateDatasetVersionRequest request = UpdateDatasetVersionRequest.newBuilder() .setDatasetVersion(DatasetVersion.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<DatasetVersion> future = datasetServiceClient.updateDatasetVersionCallable().futureCall(request); // Do something. DatasetVersion response = future.get(); } -
deleteDatasetVersionAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteDatasetVersionAsync(DatasetVersionName name) Deletes a Dataset version.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DatasetVersionName name = DatasetVersionName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATASET_VERSION]"); datasetServiceClient.deleteDatasetVersionAsync(name).get(); }- Parameters:
name- Required. The resource name of the Dataset version to delete. Format: `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}`- Throws:
ApiException- if the remote call fails
-
deleteDatasetVersionAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteDatasetVersionAsync(String name) Deletes a Dataset version.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { String name = DatasetVersionName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATASET_VERSION]") .toString(); datasetServiceClient.deleteDatasetVersionAsync(name).get(); }- Parameters:
name- Required. The resource name of the Dataset version to delete. Format: `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}`- Throws:
ApiException- if the remote call fails
-
deleteDatasetVersionAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteDatasetVersionAsync(DeleteDatasetVersionRequest request) Deletes a Dataset version.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DeleteDatasetVersionRequest request = DeleteDatasetVersionRequest.newBuilder() .setName( DatasetVersionName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATASET_VERSION]") .toString()) .build(); datasetServiceClient.deleteDatasetVersionAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteDatasetVersionOperationCallable
public final OperationCallable<DeleteDatasetVersionRequest,com.google.protobuf.Empty, deleteDatasetVersionOperationCallable()DeleteOperationMetadata> Deletes a Dataset version.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DeleteDatasetVersionRequest request = DeleteDatasetVersionRequest.newBuilder() .setName( DatasetVersionName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATASET_VERSION]") .toString()) .build(); OperationFuture<Empty, DeleteOperationMetadata> future = datasetServiceClient.deleteDatasetVersionOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteDatasetVersionCallable
Deletes a Dataset version.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DeleteDatasetVersionRequest request = DeleteDatasetVersionRequest.newBuilder() .setName( DatasetVersionName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATASET_VERSION]") .toString()) .build(); ApiFuture<Operation> future = datasetServiceClient.deleteDatasetVersionCallable().futureCall(request); // Do something. future.get(); } -
getDatasetVersion
Gets a Dataset version.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DatasetVersionName name = DatasetVersionName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATASET_VERSION]"); DatasetVersion response = datasetServiceClient.getDatasetVersion(name); }- Parameters:
name- Required. The resource name of the Dataset version to delete. Format: `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}`- Throws:
ApiException- if the remote call fails
-
getDatasetVersion
Gets a Dataset version.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { String name = DatasetVersionName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATASET_VERSION]") .toString(); DatasetVersion response = datasetServiceClient.getDatasetVersion(name); }- Parameters:
name- Required. The resource name of the Dataset version to delete. Format: `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}`- Throws:
ApiException- if the remote call fails
-
getDatasetVersion
Gets a Dataset version.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { GetDatasetVersionRequest request = GetDatasetVersionRequest.newBuilder() .setName( DatasetVersionName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATASET_VERSION]") .toString()) .setReadMask(FieldMask.newBuilder().build()) .build(); DatasetVersion response = datasetServiceClient.getDatasetVersion(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getDatasetVersionCallable
Gets a Dataset version.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { GetDatasetVersionRequest request = GetDatasetVersionRequest.newBuilder() .setName( DatasetVersionName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATASET_VERSION]") .toString()) .setReadMask(FieldMask.newBuilder().build()) .build(); ApiFuture<DatasetVersion> future = datasetServiceClient.getDatasetVersionCallable().futureCall(request); // Do something. DatasetVersion response = future.get(); } -
listDatasetVersions
public final DatasetServiceClient.ListDatasetVersionsPagedResponse listDatasetVersions(DatasetName parent) Lists DatasetVersions in a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); for (DatasetVersion element : datasetServiceClient.listDatasetVersions(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the Dataset to list DatasetVersions from. Format: `projects/{project}/locations/{location}/datasets/{dataset}`- Throws:
ApiException- if the remote call fails
-
listDatasetVersions
public final DatasetServiceClient.ListDatasetVersionsPagedResponse listDatasetVersions(String parent) Lists DatasetVersions in a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { String parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); for (DatasetVersion element : datasetServiceClient.listDatasetVersions(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the Dataset to list DatasetVersions from. Format: `projects/{project}/locations/{location}/datasets/{dataset}`- Throws:
ApiException- if the remote call fails
-
listDatasetVersions
public final DatasetServiceClient.ListDatasetVersionsPagedResponse listDatasetVersions(ListDatasetVersionsRequest request) Lists DatasetVersions in a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { ListDatasetVersionsRequest request = ListDatasetVersionsRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .setReadMask(FieldMask.newBuilder().build()) .setOrderBy("orderBy-1207110587") .build(); for (DatasetVersion element : datasetServiceClient.listDatasetVersions(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listDatasetVersionsPagedCallable
public final UnaryCallable<ListDatasetVersionsRequest,DatasetServiceClient.ListDatasetVersionsPagedResponse> listDatasetVersionsPagedCallable()Lists DatasetVersions in a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { ListDatasetVersionsRequest request = ListDatasetVersionsRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .setReadMask(FieldMask.newBuilder().build()) .setOrderBy("orderBy-1207110587") .build(); ApiFuture<DatasetVersion> future = datasetServiceClient.listDatasetVersionsPagedCallable().futureCall(request); // Do something. for (DatasetVersion element : future.get().iterateAll()) { // doThingsWith(element); } } -
listDatasetVersionsCallable
public final UnaryCallable<ListDatasetVersionsRequest,ListDatasetVersionsResponse> listDatasetVersionsCallable()Lists DatasetVersions in a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { ListDatasetVersionsRequest request = ListDatasetVersionsRequest.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) { ListDatasetVersionsResponse response = datasetServiceClient.listDatasetVersionsCallable().call(request); for (DatasetVersion element : response.getDatasetVersionsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
restoreDatasetVersionAsync
public final OperationFuture<DatasetVersion,RestoreDatasetVersionOperationMetadata> restoreDatasetVersionAsync(DatasetVersionName name) Restores a dataset version.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DatasetVersionName name = DatasetVersionName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATASET_VERSION]"); DatasetVersion response = datasetServiceClient.restoreDatasetVersionAsync(name).get(); }- Parameters:
name- Required. The name of the DatasetVersion resource. Format: `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}`- Throws:
ApiException- if the remote call fails
-
restoreDatasetVersionAsync
public final OperationFuture<DatasetVersion,RestoreDatasetVersionOperationMetadata> restoreDatasetVersionAsync(String name) Restores a dataset version.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { String name = DatasetVersionName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATASET_VERSION]") .toString(); DatasetVersion response = datasetServiceClient.restoreDatasetVersionAsync(name).get(); }- Parameters:
name- Required. The name of the DatasetVersion resource. Format: `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}`- Throws:
ApiException- if the remote call fails
-
restoreDatasetVersionAsync
public final OperationFuture<DatasetVersion,RestoreDatasetVersionOperationMetadata> restoreDatasetVersionAsync(RestoreDatasetVersionRequest request) Restores a dataset version.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { RestoreDatasetVersionRequest request = RestoreDatasetVersionRequest.newBuilder() .setName( DatasetVersionName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATASET_VERSION]") .toString()) .build(); DatasetVersion response = datasetServiceClient.restoreDatasetVersionAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
restoreDatasetVersionOperationCallable
public final OperationCallable<RestoreDatasetVersionRequest,DatasetVersion, restoreDatasetVersionOperationCallable()RestoreDatasetVersionOperationMetadata> Restores a dataset version.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { RestoreDatasetVersionRequest request = RestoreDatasetVersionRequest.newBuilder() .setName( DatasetVersionName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATASET_VERSION]") .toString()) .build(); OperationFuture<DatasetVersion, RestoreDatasetVersionOperationMetadata> future = datasetServiceClient.restoreDatasetVersionOperationCallable().futureCall(request); // Do something. DatasetVersion response = future.get(); } -
restoreDatasetVersionCallable
Restores a dataset version.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { RestoreDatasetVersionRequest request = RestoreDatasetVersionRequest.newBuilder() .setName( DatasetVersionName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATASET_VERSION]") .toString()) .build(); ApiFuture<Operation> future = datasetServiceClient.restoreDatasetVersionCallable().futureCall(request); // Do something. Operation response = future.get(); } -
listDataItems
Lists DataItems in a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); for (DataItem element : datasetServiceClient.listDataItems(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the Dataset to list DataItems from. Format: `projects/{project}/locations/{location}/datasets/{dataset}`- Throws:
ApiException- if the remote call fails
-
listDataItems
Lists DataItems in a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { String parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); for (DataItem element : datasetServiceClient.listDataItems(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the Dataset to list DataItems from. Format: `projects/{project}/locations/{location}/datasets/{dataset}`- Throws:
ApiException- if the remote call fails
-
listDataItems
public final DatasetServiceClient.ListDataItemsPagedResponse listDataItems(ListDataItemsRequest request) Lists DataItems in a Dataset.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 (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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listDataItemsPagedCallable
public final UnaryCallable<ListDataItemsRequest,DatasetServiceClient.ListDataItemsPagedResponse> listDataItemsPagedCallable()Lists DataItems in a Dataset.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 (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); } } -
listDataItemsCallable
Lists DataItems in a Dataset.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 (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.getDataItemsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
searchDataItems
public final DatasetServiceClient.SearchDataItemsPagedResponse searchDataItems(SearchDataItemsRequest request) Searches DataItems in a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { SearchDataItemsRequest request = SearchDataItemsRequest.newBuilder() .setDataset(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .setSavedQuery( SavedQueryName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[SAVED_QUERY]") .toString()) .setDataLabelingJob("dataLabelingJob951814757") .setDataItemFilter("dataItemFilter1487804341") .setAnnotationsFilter("annotationsFilter-583841860") .addAllAnnotationFilters(new ArrayList<String>()) .setFieldMask(FieldMask.newBuilder().build()) .setAnnotationsLimit(134561504) .setPageSize(883849137) .setOrderBy("orderBy-1207110587") .setPageToken("pageToken873572522") .build(); for (DataItemView element : datasetServiceClient.searchDataItems(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
searchDataItemsPagedCallable
public final UnaryCallable<SearchDataItemsRequest,DatasetServiceClient.SearchDataItemsPagedResponse> searchDataItemsPagedCallable()Searches DataItems in a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { SearchDataItemsRequest request = SearchDataItemsRequest.newBuilder() .setDataset(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .setSavedQuery( SavedQueryName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[SAVED_QUERY]") .toString()) .setDataLabelingJob("dataLabelingJob951814757") .setDataItemFilter("dataItemFilter1487804341") .setAnnotationsFilter("annotationsFilter-583841860") .addAllAnnotationFilters(new ArrayList<String>()) .setFieldMask(FieldMask.newBuilder().build()) .setAnnotationsLimit(134561504) .setPageSize(883849137) .setOrderBy("orderBy-1207110587") .setPageToken("pageToken873572522") .build(); ApiFuture<DataItemView> future = datasetServiceClient.searchDataItemsPagedCallable().futureCall(request); // Do something. for (DataItemView element : future.get().iterateAll()) { // doThingsWith(element); } } -
searchDataItemsCallable
public final UnaryCallable<SearchDataItemsRequest,SearchDataItemsResponse> searchDataItemsCallable()Searches DataItems in a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { SearchDataItemsRequest request = SearchDataItemsRequest.newBuilder() .setDataset(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .setSavedQuery( SavedQueryName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[SAVED_QUERY]") .toString()) .setDataLabelingJob("dataLabelingJob951814757") .setDataItemFilter("dataItemFilter1487804341") .setAnnotationsFilter("annotationsFilter-583841860") .addAllAnnotationFilters(new ArrayList<String>()) .setFieldMask(FieldMask.newBuilder().build()) .setAnnotationsLimit(134561504) .setPageSize(883849137) .setOrderBy("orderBy-1207110587") .setPageToken("pageToken873572522") .build(); while (true) { SearchDataItemsResponse response = datasetServiceClient.searchDataItemsCallable().call(request); for (DataItemView element : response.getDataItemViewsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
listSavedQueries
public final DatasetServiceClient.ListSavedQueriesPagedResponse listSavedQueries(DatasetName parent) Lists SavedQueries in a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); for (SavedQuery element : datasetServiceClient.listSavedQueries(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the Dataset to list SavedQueries from. Format: `projects/{project}/locations/{location}/datasets/{dataset}`- Throws:
ApiException- if the remote call fails
-
listSavedQueries
Lists SavedQueries in a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { String parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); for (SavedQuery element : datasetServiceClient.listSavedQueries(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the Dataset to list SavedQueries from. Format: `projects/{project}/locations/{location}/datasets/{dataset}`- Throws:
ApiException- if the remote call fails
-
listSavedQueries
public final DatasetServiceClient.ListSavedQueriesPagedResponse listSavedQueries(ListSavedQueriesRequest request) Lists SavedQueries in a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { ListSavedQueriesRequest request = ListSavedQueriesRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .setReadMask(FieldMask.newBuilder().build()) .setOrderBy("orderBy-1207110587") .build(); for (SavedQuery element : datasetServiceClient.listSavedQueries(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listSavedQueriesPagedCallable
public final UnaryCallable<ListSavedQueriesRequest,DatasetServiceClient.ListSavedQueriesPagedResponse> listSavedQueriesPagedCallable()Lists SavedQueries in a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { ListSavedQueriesRequest request = ListSavedQueriesRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .setReadMask(FieldMask.newBuilder().build()) .setOrderBy("orderBy-1207110587") .build(); ApiFuture<SavedQuery> future = datasetServiceClient.listSavedQueriesPagedCallable().futureCall(request); // Do something. for (SavedQuery element : future.get().iterateAll()) { // doThingsWith(element); } } -
listSavedQueriesCallable
public final UnaryCallable<ListSavedQueriesRequest,ListSavedQueriesResponse> listSavedQueriesCallable()Lists SavedQueries in a Dataset.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { ListSavedQueriesRequest request = ListSavedQueriesRequest.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) { ListSavedQueriesResponse response = datasetServiceClient.listSavedQueriesCallable().call(request); for (SavedQuery element : response.getSavedQueriesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
deleteSavedQueryAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteSavedQueryAsync(SavedQueryName name) Deletes a SavedQuery.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { SavedQueryName name = SavedQueryName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[SAVED_QUERY]"); datasetServiceClient.deleteSavedQueryAsync(name).get(); }- Parameters:
name- Required. The resource name of the SavedQuery to delete. Format: `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}`- Throws:
ApiException- if the remote call fails
-
deleteSavedQueryAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteSavedQueryAsync(String name) Deletes a SavedQuery.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { String name = SavedQueryName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[SAVED_QUERY]").toString(); datasetServiceClient.deleteSavedQueryAsync(name).get(); }- Parameters:
name- Required. The resource name of the SavedQuery to delete. Format: `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}`- Throws:
ApiException- if the remote call fails
-
deleteSavedQueryAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteSavedQueryAsync(DeleteSavedQueryRequest request) Deletes a SavedQuery.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DeleteSavedQueryRequest request = DeleteSavedQueryRequest.newBuilder() .setName( SavedQueryName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[SAVED_QUERY]") .toString()) .build(); datasetServiceClient.deleteSavedQueryAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteSavedQueryOperationCallable
public final OperationCallable<DeleteSavedQueryRequest,com.google.protobuf.Empty, deleteSavedQueryOperationCallable()DeleteOperationMetadata> Deletes a SavedQuery.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DeleteSavedQueryRequest request = DeleteSavedQueryRequest.newBuilder() .setName( SavedQueryName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[SAVED_QUERY]") .toString()) .build(); OperationFuture<Empty, DeleteOperationMetadata> future = datasetServiceClient.deleteSavedQueryOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteSavedQueryCallable
Deletes a SavedQuery.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DeleteSavedQueryRequest request = DeleteSavedQueryRequest.newBuilder() .setName( SavedQueryName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[SAVED_QUERY]") .toString()) .build(); ApiFuture<Operation> future = datasetServiceClient.deleteSavedQueryCallable().futureCall(request); // Do something. future.get(); } -
getAnnotationSpec
Gets an AnnotationSpec.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]"); AnnotationSpec response = datasetServiceClient.getAnnotationSpec(name); }- Parameters:
name- Required. The name of the AnnotationSpec resource. Format: `projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}`- Throws:
ApiException- if the remote call fails
-
getAnnotationSpec
Gets an AnnotationSpec.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { String name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]") .toString(); AnnotationSpec response = datasetServiceClient.getAnnotationSpec(name); }- Parameters:
name- Required. The name of the AnnotationSpec resource. Format: `projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}`- Throws:
ApiException- if the remote call fails
-
getAnnotationSpec
Gets an AnnotationSpec.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 (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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getAnnotationSpecCallable
Gets an AnnotationSpec.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 (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(); } -
listAnnotations
Lists Annotations belongs to a dataitem.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { DataItemName parent = DataItemName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATA_ITEM]"); for (Annotation element : datasetServiceClient.listAnnotations(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the DataItem to list Annotations from. Format: `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}`- Throws:
ApiException- if the remote call fails
-
listAnnotations
Lists Annotations belongs to a dataitem.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { String parent = DataItemName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATA_ITEM]").toString(); for (Annotation element : datasetServiceClient.listAnnotations(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the DataItem to list Annotations from. Format: `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}`- Throws:
ApiException- if the remote call fails
-
listAnnotations
public final DatasetServiceClient.ListAnnotationsPagedResponse listAnnotations(ListAnnotationsRequest request) Lists Annotations belongs to a dataitem.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 (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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listAnnotationsPagedCallable
public final UnaryCallable<ListAnnotationsRequest,DatasetServiceClient.ListAnnotationsPagedResponse> listAnnotationsPagedCallable()Lists Annotations belongs to a dataitem.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 (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); } } -
listAnnotationsCallable
public final UnaryCallable<ListAnnotationsRequest,ListAnnotationsResponse> listAnnotationsCallable()Lists Annotations belongs to a dataitem.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 (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.getAnnotationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
listLocations
public final DatasetServiceClient.ListLocationsPagedResponse listLocations(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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : datasetServiceClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,DatasetServiceClient.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = datasetServiceClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = datasetServiceClient.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
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = datasetServiceClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = datasetServiceClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); } -
setIamPolicy
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource( EndpointName.ofProjectLocationEndpointName( "[PROJECT]", "[LOCATION]", "[ENDPOINT]") .toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy response = datasetServiceClient.setIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
setIamPolicyCallable
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource( EndpointName.ofProjectLocationEndpointName( "[PROJECT]", "[LOCATION]", "[ENDPOINT]") .toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Policy> future = datasetServiceClient.setIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
getIamPolicy
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource( EndpointName.ofProjectLocationEndpointName( "[PROJECT]", "[LOCATION]", "[ENDPOINT]") .toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); Policy response = datasetServiceClient.getIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getIamPolicyCallable
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource( EndpointName.ofProjectLocationEndpointName( "[PROJECT]", "[LOCATION]", "[ENDPOINT]") .toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); ApiFuture<Policy> future = datasetServiceClient.getIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
testIamPermissions
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource( EndpointName.ofProjectLocationEndpointName( "[PROJECT]", "[LOCATION]", "[ENDPOINT]") .toString()) .addAllPermissions(new ArrayList<String>()) .build(); TestIamPermissionsResponse response = datasetServiceClient.testIamPermissions(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
testIamPermissionsCallable
public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource( EndpointName.ofProjectLocationEndpointName( "[PROJECT]", "[LOCATION]", "[ENDPOINT]") .toString()) .addAllPermissions(new ArrayList<String>()) .build(); ApiFuture<TestIamPermissionsResponse> future = datasetServiceClient.testIamPermissionsCallable().futureCall(request); // Do something. TestIamPermissionsResponse response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-