@Generated(value="by gapic-generator-java") public class DatasetServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
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 for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
Dataset response = datasetServiceClient.getDataset(name);
}
Note: close() needs to be called on the DatasetServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
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 for illustrative purposes only.
// It may require modifications to work in your environment.
DatasetServiceSettings datasetServiceSettings =
DatasetServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DatasetServiceClient datasetServiceClient = DatasetServiceClient.create(datasetServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
DatasetServiceClient.ListAnnotationsFixedSizeCollection |
static class |
DatasetServiceClient.ListAnnotationsPage |
static class |
DatasetServiceClient.ListAnnotationsPagedResponse |
static class |
DatasetServiceClient.ListDataItemsFixedSizeCollection |
static class |
DatasetServiceClient.ListDataItemsPage |
static class |
DatasetServiceClient.ListDataItemsPagedResponse |
static class |
DatasetServiceClient.ListDatasetsFixedSizeCollection |
static class |
DatasetServiceClient.ListDatasetsPage |
static class |
DatasetServiceClient.ListDatasetsPagedResponse |
static class |
DatasetServiceClient.ListLocationsFixedSizeCollection |
static class |
DatasetServiceClient.ListLocationsPage |
static class |
DatasetServiceClient.ListLocationsPagedResponse |
static class |
DatasetServiceClient.ListSavedQueriesFixedSizeCollection |
static class |
DatasetServiceClient.ListSavedQueriesPage |
static class |
DatasetServiceClient.ListSavedQueriesPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
DatasetServiceClient(DatasetServiceSettings settings)
Constructs an instance of DatasetServiceClient, using the given settings.
|
protected |
DatasetServiceClient(DatasetServiceStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static DatasetServiceClient |
create()
Constructs an instance of DatasetServiceClient with default settings.
|
static DatasetServiceClient |
create(DatasetServiceSettings settings)
Constructs an instance of DatasetServiceClient, using the given settings.
|
static DatasetServiceClient |
create(DatasetServiceStub stub)
Constructs an instance of DatasetServiceClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Dataset,CreateDatasetOperationMetadata> |
createDatasetAsync(CreateDatasetRequest request)
Creates a Dataset.
|
com.google.api.gax.longrunning.OperationFuture<Dataset,CreateDatasetOperationMetadata> |
createDatasetAsync(LocationName parent,
Dataset dataset)
Creates a Dataset.
|
com.google.api.gax.longrunning.OperationFuture<Dataset,CreateDatasetOperationMetadata> |
createDatasetAsync(String parent,
Dataset dataset)
Creates a Dataset.
|
com.google.api.gax.rpc.UnaryCallable<CreateDatasetRequest,com.google.longrunning.Operation> |
createDatasetCallable()
Creates a Dataset.
|
com.google.api.gax.rpc.OperationCallable<CreateDatasetRequest,Dataset,CreateDatasetOperationMetadata> |
createDatasetOperationCallable()
Creates a Dataset.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteDatasetAsync(DatasetName name)
Deletes a Dataset.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteDatasetAsync(DeleteDatasetRequest request)
Deletes a Dataset.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteDatasetAsync(String name)
Deletes a Dataset.
|
com.google.api.gax.rpc.UnaryCallable<DeleteDatasetRequest,com.google.longrunning.Operation> |
deleteDatasetCallable()
Deletes a Dataset.
|
com.google.api.gax.rpc.OperationCallable<DeleteDatasetRequest,com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteDatasetOperationCallable()
Deletes a Dataset.
|
com.google.api.gax.longrunning.OperationFuture<ExportDataResponse,ExportDataOperationMetadata> |
exportDataAsync(DatasetName name,
ExportDataConfig exportConfig)
Exports data from a Dataset.
|
com.google.api.gax.longrunning.OperationFuture<ExportDataResponse,ExportDataOperationMetadata> |
exportDataAsync(ExportDataRequest request)
Exports data from a Dataset.
|
com.google.api.gax.longrunning.OperationFuture<ExportDataResponse,ExportDataOperationMetadata> |
exportDataAsync(String name,
ExportDataConfig exportConfig)
Exports data from a Dataset.
|
com.google.api.gax.rpc.UnaryCallable<ExportDataRequest,com.google.longrunning.Operation> |
exportDataCallable()
Exports data from a Dataset.
|
com.google.api.gax.rpc.OperationCallable<ExportDataRequest,ExportDataResponse,ExportDataOperationMetadata> |
exportDataOperationCallable()
Exports data from a Dataset.
|
AnnotationSpec |
getAnnotationSpec(AnnotationSpecName name)
Gets an AnnotationSpec.
|
AnnotationSpec |
getAnnotationSpec(GetAnnotationSpecRequest request)
Gets an AnnotationSpec.
|
AnnotationSpec |
getAnnotationSpec(String name)
Gets an AnnotationSpec.
|
com.google.api.gax.rpc.UnaryCallable<GetAnnotationSpecRequest,AnnotationSpec> |
getAnnotationSpecCallable()
Gets an AnnotationSpec.
|
Dataset |
getDataset(DatasetName name)
Gets a Dataset.
|
Dataset |
getDataset(GetDatasetRequest request)
Gets a Dataset.
|
Dataset |
getDataset(String name)
Gets a Dataset.
|
com.google.api.gax.rpc.UnaryCallable<GetDatasetRequest,Dataset> |
getDatasetCallable()
Gets a Dataset.
|
com.google.iam.v1.Policy |
getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Gets the access control policy for a resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> |
getIamPolicyCallable()
Gets the access control policy for a resource.
|
com.google.cloud.location.Location |
getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
getLocationCallable()
Gets information about a location.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
DatasetServiceSettings |
getSettings() |
DatasetServiceStub |
getStub() |
com.google.api.gax.longrunning.OperationFuture<ImportDataResponse,ImportDataOperationMetadata> |
importDataAsync(DatasetName name,
List<ImportDataConfig> importConfigs)
Imports data into a Dataset.
|
com.google.api.gax.longrunning.OperationFuture<ImportDataResponse,ImportDataOperationMetadata> |
importDataAsync(ImportDataRequest request)
Imports data into a Dataset.
|
com.google.api.gax.longrunning.OperationFuture<ImportDataResponse,ImportDataOperationMetadata> |
importDataAsync(String name,
List<ImportDataConfig> importConfigs)
Imports data into a Dataset.
|
com.google.api.gax.rpc.UnaryCallable<ImportDataRequest,com.google.longrunning.Operation> |
importDataCallable()
Imports data into a Dataset.
|
com.google.api.gax.rpc.OperationCallable<ImportDataRequest,ImportDataResponse,ImportDataOperationMetadata> |
importDataOperationCallable()
Imports data into a Dataset.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
DatasetServiceClient.ListAnnotationsPagedResponse |
listAnnotations(DataItemName parent)
Lists Annotations belongs to a dataitem
|
DatasetServiceClient.ListAnnotationsPagedResponse |
listAnnotations(ListAnnotationsRequest request)
Lists Annotations belongs to a dataitem
|
DatasetServiceClient.ListAnnotationsPagedResponse |
listAnnotations(String parent)
Lists Annotations belongs to a dataitem
|
com.google.api.gax.rpc.UnaryCallable<ListAnnotationsRequest,ListAnnotationsResponse> |
listAnnotationsCallable()
Lists Annotations belongs to a dataitem
|
com.google.api.gax.rpc.UnaryCallable<ListAnnotationsRequest,DatasetServiceClient.ListAnnotationsPagedResponse> |
listAnnotationsPagedCallable()
Lists Annotations belongs to a dataitem
|
DatasetServiceClient.ListDataItemsPagedResponse |
listDataItems(DatasetName parent)
Lists DataItems in a Dataset.
|
DatasetServiceClient.ListDataItemsPagedResponse |
listDataItems(ListDataItemsRequest request)
Lists DataItems in a Dataset.
|
DatasetServiceClient.ListDataItemsPagedResponse |
listDataItems(String parent)
Lists DataItems in a Dataset.
|
com.google.api.gax.rpc.UnaryCallable<ListDataItemsRequest,ListDataItemsResponse> |
listDataItemsCallable()
Lists DataItems in a Dataset.
|
com.google.api.gax.rpc.UnaryCallable<ListDataItemsRequest,DatasetServiceClient.ListDataItemsPagedResponse> |
listDataItemsPagedCallable()
Lists DataItems in a Dataset.
|
DatasetServiceClient.ListDatasetsPagedResponse |
listDatasets(ListDatasetsRequest request)
Lists Datasets in a Location.
|
DatasetServiceClient.ListDatasetsPagedResponse |
listDatasets(LocationName parent)
Lists Datasets in a Location.
|
DatasetServiceClient.ListDatasetsPagedResponse |
listDatasets(String parent)
Lists Datasets in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListDatasetsRequest,ListDatasetsResponse> |
listDatasetsCallable()
Lists Datasets in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListDatasetsRequest,DatasetServiceClient.ListDatasetsPagedResponse> |
listDatasetsPagedCallable()
Lists Datasets in a Location.
|
DatasetServiceClient.ListLocationsPagedResponse |
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
listLocationsCallable()
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,DatasetServiceClient.ListLocationsPagedResponse> |
listLocationsPagedCallable()
Lists information about the supported locations for this service.
|
DatasetServiceClient.ListSavedQueriesPagedResponse |
listSavedQueries(DatasetName parent)
Lists SavedQueries in a Dataset.
|
DatasetServiceClient.ListSavedQueriesPagedResponse |
listSavedQueries(ListSavedQueriesRequest request)
Lists SavedQueries in a Dataset.
|
DatasetServiceClient.ListSavedQueriesPagedResponse |
listSavedQueries(String parent)
Lists SavedQueries in a Dataset.
|
com.google.api.gax.rpc.UnaryCallable<ListSavedQueriesRequest,ListSavedQueriesResponse> |
listSavedQueriesCallable()
Lists SavedQueries in a Dataset.
|
com.google.api.gax.rpc.UnaryCallable<ListSavedQueriesRequest,DatasetServiceClient.ListSavedQueriesPagedResponse> |
listSavedQueriesPagedCallable()
Lists SavedQueries in a Dataset.
|
com.google.iam.v1.Policy |
setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sets the access control policy on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> |
setIamPolicyCallable()
Sets the access control policy on the specified resource.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.iam.v1.TestIamPermissionsResponse |
testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> |
testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource.
|
Dataset |
updateDataset(Dataset dataset,
com.google.protobuf.FieldMask updateMask)
Updates a Dataset.
|
Dataset |
updateDataset(UpdateDatasetRequest request)
Updates a Dataset.
|
com.google.api.gax.rpc.UnaryCallable<UpdateDatasetRequest,Dataset> |
updateDatasetCallable()
Updates a Dataset.
|
protected DatasetServiceClient(DatasetServiceSettings settings) throws IOException
IOExceptionprotected DatasetServiceClient(DatasetServiceStub stub)
public static final DatasetServiceClient create() throws IOException
IOExceptionpublic static final DatasetServiceClient create(DatasetServiceSettings settings) throws IOException
IOExceptionpublic static final DatasetServiceClient create(DatasetServiceStub stub)
public final DatasetServiceSettings getSettings()
public DatasetServiceStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
public final com.google.api.gax.longrunning.OperationFuture<Dataset,CreateDatasetOperationMetadata> createDatasetAsync(LocationName parent, Dataset dataset)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Dataset dataset = Dataset.newBuilder().build();
Dataset response = datasetServiceClient.createDatasetAsync(parent, dataset).get();
}
parent - Required. The resource name of the Location to create the Dataset in. Format:
`projects/{project}/locations/{location}`dataset - Required. The Dataset to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Dataset,CreateDatasetOperationMetadata> createDatasetAsync(String parent, Dataset dataset)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Dataset dataset = Dataset.newBuilder().build();
Dataset response = datasetServiceClient.createDatasetAsync(parent, dataset).get();
}
parent - Required. The resource name of the Location to create the Dataset in. Format:
`projects/{project}/locations/{location}`dataset - Required. The Dataset to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Dataset,CreateDatasetOperationMetadata> createDatasetAsync(CreateDatasetRequest request)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateDatasetRequest,Dataset,CreateDatasetOperationMetadata> createDatasetOperationCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateDatasetRequest,com.google.longrunning.Operation> createDatasetCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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();
}
public final Dataset getDataset(DatasetName name)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
Dataset response = datasetServiceClient.getDataset(name);
}
name - Required. The name of the Dataset resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Dataset getDataset(String name)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString();
Dataset response = datasetServiceClient.getDataset(name);
}
name - Required. The name of the Dataset resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Dataset getDataset(GetDatasetRequest request)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetDatasetRequest,Dataset> getDatasetCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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();
}
public final Dataset updateDataset(Dataset dataset, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
Dataset dataset = Dataset.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Dataset response = datasetServiceClient.updateDataset(dataset, updateMask);
}
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`
com.google.api.gax.rpc.ApiException - if the remote call failspublic final Dataset updateDataset(UpdateDatasetRequest request)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
UpdateDatasetRequest request =
UpdateDatasetRequest.newBuilder()
.setDataset(Dataset.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Dataset response = datasetServiceClient.updateDataset(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateDatasetRequest,Dataset> updateDatasetCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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();
}
public final DatasetServiceClient.ListDatasetsPagedResponse listDatasets(LocationName parent)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Dataset element : datasetServiceClient.listDatasets(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the Dataset's parent resource. Format:
`projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatasetServiceClient.ListDatasetsPagedResponse listDatasets(String parent)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Dataset element : datasetServiceClient.listDatasets(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the Dataset's parent resource. Format:
`projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatasetServiceClient.ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListDatasetsRequest,DatasetServiceClient.ListDatasetsPagedResponse> listDatasetsPagedCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListDatasetsRequest,ListDatasetsResponse> listDatasetsCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteDatasetAsync(DatasetName name)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
datasetServiceClient.deleteDatasetAsync(name).get();
}
name - Required. The resource name of the Dataset to delete. Format:
`projects/{project}/locations/{location}/datasets/{dataset}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteDatasetAsync(String name)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString();
datasetServiceClient.deleteDatasetAsync(name).get();
}
name - Required. The resource name of the Dataset to delete. Format:
`projects/{project}/locations/{location}/datasets/{dataset}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteDatasetAsync(DeleteDatasetRequest request)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
DeleteDatasetRequest request =
DeleteDatasetRequest.newBuilder()
.setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.build();
datasetServiceClient.deleteDatasetAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteDatasetRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deleteDatasetOperationCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteDatasetRequest,com.google.longrunning.Operation> deleteDatasetCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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();
}
public final com.google.api.gax.longrunning.OperationFuture<ImportDataResponse,ImportDataOperationMetadata> importDataAsync(DatasetName name, List<ImportDataConfig> importConfigs)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
List<ImportDataConfig> importConfigs = new ArrayList<>();
ImportDataResponse response = datasetServiceClient.importDataAsync(name, importConfigs).get();
}
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.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ImportDataResponse,ImportDataOperationMetadata> importDataAsync(String name, List<ImportDataConfig> importConfigs)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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();
}
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.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ImportDataResponse,ImportDataOperationMetadata> importDataAsync(ImportDataRequest request)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<ImportDataRequest,ImportDataResponse,ImportDataOperationMetadata> importDataOperationCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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();
}
public final com.google.api.gax.rpc.UnaryCallable<ImportDataRequest,com.google.longrunning.Operation> importDataCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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();
}
public final com.google.api.gax.longrunning.OperationFuture<ExportDataResponse,ExportDataOperationMetadata> exportDataAsync(DatasetName name, ExportDataConfig exportConfig)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
ExportDataConfig exportConfig = ExportDataConfig.newBuilder().build();
ExportDataResponse response = datasetServiceClient.exportDataAsync(name, exportConfig).get();
}
name - Required. The name of the Dataset resource. Format:
`projects/{project}/locations/{location}/datasets/{dataset}`exportConfig - Required. The desired output location.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ExportDataResponse,ExportDataOperationMetadata> exportDataAsync(String name, ExportDataConfig exportConfig)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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();
}
name - Required. The name of the Dataset resource. Format:
`projects/{project}/locations/{location}/datasets/{dataset}`exportConfig - Required. The desired output location.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ExportDataResponse,ExportDataOperationMetadata> exportDataAsync(ExportDataRequest request)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<ExportDataRequest,ExportDataResponse,ExportDataOperationMetadata> exportDataOperationCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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();
}
public final com.google.api.gax.rpc.UnaryCallable<ExportDataRequest,com.google.longrunning.Operation> exportDataCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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();
}
public final DatasetServiceClient.ListDataItemsPagedResponse listDataItems(DatasetName parent)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
for (DataItem element : datasetServiceClient.listDataItems(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the Dataset to list DataItems from. Format:
`projects/{project}/locations/{location}/datasets/{dataset}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatasetServiceClient.ListDataItemsPagedResponse listDataItems(String parent)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
String parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString();
for (DataItem element : datasetServiceClient.listDataItems(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the Dataset to list DataItems from. Format:
`projects/{project}/locations/{location}/datasets/{dataset}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatasetServiceClient.ListDataItemsPagedResponse listDataItems(ListDataItemsRequest request)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListDataItemsRequest,DatasetServiceClient.ListDataItemsPagedResponse> listDataItemsPagedCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListDataItemsRequest,ListDataItemsResponse> listDataItemsCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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;
}
}
}
public final DatasetServiceClient.ListSavedQueriesPagedResponse listSavedQueries(DatasetName parent)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
for (SavedQuery element : datasetServiceClient.listSavedQueries(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the Dataset to list SavedQueries from. Format:
`projects/{project}/locations/{location}/datasets/{dataset}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatasetServiceClient.ListSavedQueriesPagedResponse listSavedQueries(String parent)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
String parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString();
for (SavedQuery element : datasetServiceClient.listSavedQueries(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the Dataset to list SavedQueries from. Format:
`projects/{project}/locations/{location}/datasets/{dataset}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatasetServiceClient.ListSavedQueriesPagedResponse listSavedQueries(ListSavedQueriesRequest request)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListSavedQueriesRequest,DatasetServiceClient.ListSavedQueriesPagedResponse> listSavedQueriesPagedCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListSavedQueriesRequest,ListSavedQueriesResponse> listSavedQueriesCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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;
}
}
}
public final AnnotationSpec getAnnotationSpec(AnnotationSpecName name)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
AnnotationSpecName name =
AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
AnnotationSpec response = datasetServiceClient.getAnnotationSpec(name);
}
name - Required. The name of the AnnotationSpec resource. Format:
`projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final AnnotationSpec getAnnotationSpec(String name)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
String name =
AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]")
.toString();
AnnotationSpec response = datasetServiceClient.getAnnotationSpec(name);
}
name - Required. The name of the AnnotationSpec resource. Format:
`projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final AnnotationSpec getAnnotationSpec(GetAnnotationSpecRequest request)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetAnnotationSpecRequest,AnnotationSpec> getAnnotationSpecCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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();
}
public final DatasetServiceClient.ListAnnotationsPagedResponse listAnnotations(DataItemName parent)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
DataItemName parent = DataItemName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATA_ITEM]");
for (Annotation element : datasetServiceClient.listAnnotations(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the DataItem to list Annotations from. Format:
`projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatasetServiceClient.ListAnnotationsPagedResponse listAnnotations(String parent)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
String parent =
DataItemName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATA_ITEM]").toString();
for (Annotation element : datasetServiceClient.listAnnotations(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the DataItem to list Annotations from. Format:
`projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatasetServiceClient.ListAnnotationsPagedResponse listAnnotations(ListAnnotationsRequest request)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListAnnotationsRequest,DatasetServiceClient.ListAnnotationsPagedResponse> listAnnotationsPagedCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListAnnotationsRequest,ListAnnotationsResponse> listAnnotationsCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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;
}
}
}
public final DatasetServiceClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,DatasetServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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;
}
}
}
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = datasetServiceClient.getLocation(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
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();
}
public final com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(
EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]")
.toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Policy response = datasetServiceClient.setIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> setIamPolicyCallable()
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(
EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]")
.toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Policy> future = datasetServiceClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(
EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]")
.toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
Policy response = datasetServiceClient.getIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> getIamPolicyCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(
EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]")
.toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
ApiFuture<Policy> future = datasetServiceClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
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 for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(
EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]")
.toString())
.addAllPermissions(new ArrayList<String>())
.build();
TestIamPermissionsResponse response = datasetServiceClient.testIamPermissions(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
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 for illustrative purposes only.
// It may require modifications to work in your environment.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(
EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]")
.toString())
.addAllPermissions(new ArrayList<String>())
.build();
ApiFuture<TestIamPermissionsResponse> future =
datasetServiceClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestIamPermissionsResponse response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2022 Google LLC. All rights reserved.