Class MapsPlatformDatasetsClient
- java.lang.Object
-
- com.google.maps.mapsplatformdatasets.v1.MapsPlatformDatasetsClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@Generated("by gapic-generator-java") public class MapsPlatformDatasetsClient extends Object implements com.google.api.gax.core.BackgroundResource
Service Description: Service definition for the Maps Platform Datasets API.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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); Dataset dataset = Dataset.newBuilder().build(); Dataset response = mapsPlatformDatasetsClient.createDataset(parent, dataset); }
Note: close() needs to be called on the MapsPlatformDatasetsClient 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:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of MapsPlatformDatasetsSettings 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 MapsPlatformDatasetsSettings mapsPlatformDatasetsSettings = MapsPlatformDatasetsSettings.newBuilder() .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) .build(); MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create(mapsPlatformDatasetsSettings);
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 MapsPlatformDatasetsSettings mapsPlatformDatasetsSettings = MapsPlatformDatasetsSettings.newBuilder().setEndpoint(myEndpoint).build(); MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create(mapsPlatformDatasetsSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library MapsPlatformDatasetsSettings mapsPlatformDatasetsSettings = MapsPlatformDatasetsSettings.newHttpJsonBuilder().build(); MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create(mapsPlatformDatasetsSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MapsPlatformDatasetsClient.ListDatasetsFixedSizeCollection
static class
MapsPlatformDatasetsClient.ListDatasetsPage
static class
MapsPlatformDatasetsClient.ListDatasetsPagedResponse
-
Constructor Summary
Constructors Modifier Constructor Description protected
MapsPlatformDatasetsClient(MapsPlatformDatasetsSettings settings)
Constructs an instance of MapsPlatformDatasetsClient, using the given settings.protected
MapsPlatformDatasetsClient(MapsPlatformDatasetsStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
awaitTermination(long duration, TimeUnit unit)
void
close()
static MapsPlatformDatasetsClient
create()
Constructs an instance of MapsPlatformDatasetsClient with default settings.static MapsPlatformDatasetsClient
create(MapsPlatformDatasetsSettings settings)
Constructs an instance of MapsPlatformDatasetsClient, using the given settings.static MapsPlatformDatasetsClient
create(MapsPlatformDatasetsStub stub)
Constructs an instance of MapsPlatformDatasetsClient, using the given stub for making calls.Dataset
createDataset(CreateDatasetRequest request)
Create a new dataset for the specified project.Dataset
createDataset(ProjectName parent, Dataset dataset)
Create a new dataset for the specified project.Dataset
createDataset(String parent, Dataset dataset)
Create a new dataset for the specified project.com.google.api.gax.rpc.UnaryCallable<CreateDatasetRequest,Dataset>
createDatasetCallable()
Create a new dataset for the specified project.void
deleteDataset(DatasetName name)
Delete the specified dataset .void
deleteDataset(DeleteDatasetRequest request)
Delete the specified dataset .void
deleteDataset(String name)
Delete the specified dataset .com.google.api.gax.rpc.UnaryCallable<DeleteDatasetRequest,com.google.protobuf.Empty>
deleteDatasetCallable()
Delete the specified dataset .Dataset
getDataset(DatasetName name)
Get the dataset.Dataset
getDataset(GetDatasetRequest request)
Get the dataset.Dataset
getDataset(String name)
Get the dataset.com.google.api.gax.rpc.UnaryCallable<GetDatasetRequest,Dataset>
getDatasetCallable()
Get the dataset.MapsPlatformDatasetsSettings
getSettings()
MapsPlatformDatasetsStub
getStub()
boolean
isShutdown()
boolean
isTerminated()
MapsPlatformDatasetsClient.ListDatasetsPagedResponse
listDatasets(ListDatasetsRequest request)
List all the datasets for the specified project.MapsPlatformDatasetsClient.ListDatasetsPagedResponse
listDatasets(ProjectName parent)
List all the datasets for the specified project.MapsPlatformDatasetsClient.ListDatasetsPagedResponse
listDatasets(String parent)
List all the datasets for the specified project.com.google.api.gax.rpc.UnaryCallable<ListDatasetsRequest,ListDatasetsResponse>
listDatasetsCallable()
List all the datasets for the specified project.com.google.api.gax.rpc.UnaryCallable<ListDatasetsRequest,MapsPlatformDatasetsClient.ListDatasetsPagedResponse>
listDatasetsPagedCallable()
List all the datasets for the specified project.void
shutdown()
void
shutdownNow()
Dataset
updateDatasetMetadata(Dataset dataset, com.google.protobuf.FieldMask updateMask)
Update the metadata for the dataset.Dataset
updateDatasetMetadata(UpdateDatasetMetadataRequest request)
Update the metadata for the dataset.com.google.api.gax.rpc.UnaryCallable<UpdateDatasetMetadataRequest,Dataset>
updateDatasetMetadataCallable()
Update the metadata for the dataset.
-
-
-
Constructor Detail
-
MapsPlatformDatasetsClient
protected MapsPlatformDatasetsClient(MapsPlatformDatasetsSettings settings) throws IOException
Constructs an instance of MapsPlatformDatasetsClient, 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
-
MapsPlatformDatasetsClient
protected MapsPlatformDatasetsClient(MapsPlatformDatasetsStub stub)
-
-
Method Detail
-
create
public static final MapsPlatformDatasetsClient create() throws IOException
Constructs an instance of MapsPlatformDatasetsClient with default settings.- Throws:
IOException
-
create
public static final MapsPlatformDatasetsClient create(MapsPlatformDatasetsSettings settings) throws IOException
Constructs an instance of MapsPlatformDatasetsClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
public static final MapsPlatformDatasetsClient create(MapsPlatformDatasetsStub stub)
Constructs an instance of MapsPlatformDatasetsClient, using the given stub for making calls. This is for advanced usage - prefer using create(MapsPlatformDatasetsSettings).
-
getSettings
public final MapsPlatformDatasetsSettings getSettings()
-
getStub
public MapsPlatformDatasetsStub getStub()
-
createDataset
public final Dataset createDataset(ProjectName parent, Dataset dataset)
Create a new dataset for the specified project.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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); Dataset dataset = Dataset.newBuilder().build(); Dataset response = mapsPlatformDatasetsClient.createDataset(parent, dataset); }
- Parameters:
parent
- Required. Parent project that will own the dataset. Format: projects/{$project}dataset
- Required. The dataset version to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createDataset
public final Dataset createDataset(String parent, Dataset dataset)
Create a new dataset for the specified project.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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { String parent = ProjectName.of("[PROJECT]").toString(); Dataset dataset = Dataset.newBuilder().build(); Dataset response = mapsPlatformDatasetsClient.createDataset(parent, dataset); }
- Parameters:
parent
- Required. Parent project that will own the dataset. Format: projects/{$project}dataset
- Required. The dataset version to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createDataset
public final Dataset createDataset(CreateDatasetRequest request)
Create a new dataset for the specified project.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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { CreateDatasetRequest request = CreateDatasetRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setDataset(Dataset.newBuilder().build()) .build(); Dataset response = mapsPlatformDatasetsClient.createDataset(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createDatasetCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateDatasetRequest,Dataset> createDatasetCallable()
Create a new dataset for the specified project.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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { CreateDatasetRequest request = CreateDatasetRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setDataset(Dataset.newBuilder().build()) .build(); ApiFuture<Dataset> future = mapsPlatformDatasetsClient.createDatasetCallable().futureCall(request); // Do something. Dataset response = future.get(); }
-
updateDatasetMetadata
public final Dataset updateDatasetMetadata(Dataset dataset, com.google.protobuf.FieldMask updateMask)
Update the metadata for the 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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { Dataset dataset = Dataset.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Dataset response = mapsPlatformDatasetsClient.updateDatasetMetadata(dataset, updateMask); }
- Parameters:
dataset
- Required. The dataset to update. The dataset's name is used to identify the dataset to be updated. The name has the format: projects/{project}/datasets/{dataset_id}updateMask
- The list of fields to be updated. Support the value "*" for full replacement.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateDatasetMetadata
public final Dataset updateDatasetMetadata(UpdateDatasetMetadataRequest request)
Update the metadata for the 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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { UpdateDatasetMetadataRequest request = UpdateDatasetMetadataRequest.newBuilder() .setDataset(Dataset.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Dataset response = mapsPlatformDatasetsClient.updateDatasetMetadata(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateDatasetMetadataCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateDatasetMetadataRequest,Dataset> updateDatasetMetadataCallable()
Update the metadata for the 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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { UpdateDatasetMetadataRequest request = UpdateDatasetMetadataRequest.newBuilder() .setDataset(Dataset.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Dataset> future = mapsPlatformDatasetsClient.updateDatasetMetadataCallable().futureCall(request); // Do something. Dataset response = future.get(); }
-
getDataset
public final Dataset getDataset(DatasetName name)
Get the 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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); Dataset response = mapsPlatformDatasetsClient.getDataset(name); }
- Parameters:
name
- Required. Resource name. projects/{project}/datasets/{dataset_id}- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getDataset
public final Dataset getDataset(String name)
Get the 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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { String name = DatasetName.of("[PROJECT]", "[DATASET]").toString(); Dataset response = mapsPlatformDatasetsClient.getDataset(name); }
- Parameters:
name
- Required. Resource name. projects/{project}/datasets/{dataset_id}- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getDataset
public final Dataset getDataset(GetDatasetRequest request)
Get the 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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { GetDatasetRequest request = GetDatasetRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .build(); Dataset response = mapsPlatformDatasetsClient.getDataset(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getDatasetCallable
public final com.google.api.gax.rpc.UnaryCallable<GetDatasetRequest,Dataset> getDatasetCallable()
Get the 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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { GetDatasetRequest request = GetDatasetRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .build(); ApiFuture<Dataset> future = mapsPlatformDatasetsClient.getDatasetCallable().futureCall(request); // Do something. Dataset response = future.get(); }
-
listDatasets
public final MapsPlatformDatasetsClient.ListDatasetsPagedResponse listDatasets(ProjectName parent)
List all the datasets for the specified project.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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); for (Dataset element : mapsPlatformDatasetsClient.listDatasets(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The name of the project to list all the datasets for.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listDatasets
public final MapsPlatformDatasetsClient.ListDatasetsPagedResponse listDatasets(String parent)
List all the datasets for the specified project.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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { String parent = ProjectName.of("[PROJECT]").toString(); for (Dataset element : mapsPlatformDatasetsClient.listDatasets(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The name of the project to list all the datasets for.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listDatasets
public final MapsPlatformDatasetsClient.ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request)
List all the datasets for the specified project.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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { ListDatasetsRequest request = ListDatasetsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Dataset element : mapsPlatformDatasetsClient.listDatasets(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listDatasetsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListDatasetsRequest,MapsPlatformDatasetsClient.ListDatasetsPagedResponse> listDatasetsPagedCallable()
List all the datasets for the specified project.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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { ListDatasetsRequest request = ListDatasetsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Dataset> future = mapsPlatformDatasetsClient.listDatasetsPagedCallable().futureCall(request); // Do something. for (Dataset element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listDatasetsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListDatasetsRequest,ListDatasetsResponse> listDatasetsCallable()
List all the datasets for the specified project.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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { ListDatasetsRequest request = ListDatasetsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListDatasetsResponse response = mapsPlatformDatasetsClient.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; } } }
-
deleteDataset
public final void deleteDataset(DatasetName name)
Delete the specified 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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); mapsPlatformDatasetsClient.deleteDataset(name); }
- Parameters:
name
- Required. Format: projects/${project}/datasets/{dataset_id}- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteDataset
public final void deleteDataset(String name)
Delete the specified 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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { String name = DatasetName.of("[PROJECT]", "[DATASET]").toString(); mapsPlatformDatasetsClient.deleteDataset(name); }
- Parameters:
name
- Required. Format: projects/${project}/datasets/{dataset_id}- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteDataset
public final void deleteDataset(DeleteDatasetRequest request)
Delete the specified 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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .build(); mapsPlatformDatasetsClient.deleteDataset(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteDatasetCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteDatasetRequest,com.google.protobuf.Empty> deleteDatasetCallable()
Delete the specified 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 (MapsPlatformDatasetsClient mapsPlatformDatasetsClient = MapsPlatformDatasetsClient.create()) { DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .build(); ApiFuture<Empty> future = mapsPlatformDatasetsClient.deleteDatasetCallable().futureCall(request); // Do something. future.get(); }
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTermination
in interfacecom.google.api.gax.core.BackgroundResource
- Throws:
InterruptedException
-
-