Class MapsPlatformDatasetsV1AlphaClient

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

    @BetaApi
    @Generated("by gapic-generator-java")
    public class MapsPlatformDatasetsV1AlphaClient
    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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
         MapsPlatformDatasetsV1AlphaClient.create()) {
       ProjectName parent = ProjectName.of("[PROJECT]");
       Dataset dataset = Dataset.newBuilder().build();
       Dataset response = mapsPlatformDatasetsV1AlphaClient.createDataset(parent, dataset);
     }
     

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

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

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

    See the individual methods for example code.

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

    This class can be customized by passing in a custom instance of MapsPlatformDatasetsV1AlphaSettings 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
     MapsPlatformDatasetsV1AlphaSettings mapsPlatformDatasetsV1AlphaSettings =
         MapsPlatformDatasetsV1AlphaSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
         MapsPlatformDatasetsV1AlphaClient.create(mapsPlatformDatasetsV1AlphaSettings);
     

    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
     MapsPlatformDatasetsV1AlphaSettings mapsPlatformDatasetsV1AlphaSettings =
         MapsPlatformDatasetsV1AlphaSettings.newBuilder().setEndpoint(myEndpoint).build();
     MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
         MapsPlatformDatasetsV1AlphaClient.create(mapsPlatformDatasetsV1AlphaSettings);
     

    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
     MapsPlatformDatasetsV1AlphaSettings mapsPlatformDatasetsV1AlphaSettings =
         MapsPlatformDatasetsV1AlphaSettings.newHttpJsonBuilder().build();
     MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
         MapsPlatformDatasetsV1AlphaClient.create(mapsPlatformDatasetsV1AlphaSettings);
     

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

    • Constructor Detail

      • MapsPlatformDatasetsV1AlphaClient

        protected MapsPlatformDatasetsV1AlphaClient​(MapsPlatformDatasetsV1AlphaSettings settings)
                                             throws IOException
        Constructs an instance of MapsPlatformDatasetsV1AlphaClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
        Throws:
        IOException
    • Method Detail

      • 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           ProjectName parent = ProjectName.of("[PROJECT]");
           Dataset dataset = Dataset.newBuilder().build();
           Dataset response = mapsPlatformDatasetsV1AlphaClient.createDataset(parent, dataset);
         }
         
        Parameters:
        parent - Required. Parent project that will own the dataset. Format: projects/{$project_number}
        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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           String parent = ProjectName.of("[PROJECT]").toString();
           Dataset dataset = Dataset.newBuilder().build();
           Dataset response = mapsPlatformDatasetsV1AlphaClient.createDataset(parent, dataset);
         }
         
        Parameters:
        parent - Required. Parent project that will own the dataset. Format: projects/{$project_number}
        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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           CreateDatasetRequest request =
               CreateDatasetRequest.newBuilder()
                   .setParent(ProjectName.of("[PROJECT]").toString())
                   .setDataset(Dataset.newBuilder().build())
                   .build();
           Dataset response = mapsPlatformDatasetsV1AlphaClient.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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           CreateDatasetRequest request =
               CreateDatasetRequest.newBuilder()
                   .setParent(ProjectName.of("[PROJECT]").toString())
                   .setDataset(Dataset.newBuilder().build())
                   .build();
           ApiFuture<Dataset> future =
               mapsPlatformDatasetsV1AlphaClient.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. To update the data use: UploadDataset.

        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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           Dataset dataset = Dataset.newBuilder().build();
           FieldMask updateMask = FieldMask.newBuilder().build();
           Dataset response =
               mapsPlatformDatasetsV1AlphaClient.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. To update the data use: UploadDataset.

        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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           UpdateDatasetMetadataRequest request =
               UpdateDatasetMetadataRequest.newBuilder()
                   .setDataset(Dataset.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .build();
           Dataset response = mapsPlatformDatasetsV1AlphaClient.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. To update the data use: UploadDataset.

        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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           UpdateDatasetMetadataRequest request =
               UpdateDatasetMetadataRequest.newBuilder()
                   .setDataset(Dataset.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .build();
           ApiFuture<Dataset> future =
               mapsPlatformDatasetsV1AlphaClient.updateDatasetMetadataCallable().futureCall(request);
           // Do something.
           Dataset response = future.get();
         }
         
      • getDataset

        public final Dataset getDataset​(DatasetName name)
        Get the published or latest version of 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]");
           Dataset response = mapsPlatformDatasetsV1AlphaClient.getDataset(name);
         }
         
        Parameters:
        name - Required. Resource name. Can also fetch a specified version projects/{project}/datasets/{dataset_id} projects/{project}/datasets/{dataset_id}@{version-id}

        In order to retrieve a previous version of the dataset, also provide the version ID. Example: projects/123/datasets/assisted-driving-preferences@c7cfa2a8

        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getDataset

        public final Dataset getDataset​(String name)
        Get the published or latest version of 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           String name = DatasetName.of("[PROJECT]", "[DATASET]").toString();
           Dataset response = mapsPlatformDatasetsV1AlphaClient.getDataset(name);
         }
         
        Parameters:
        name - Required. Resource name. Can also fetch a specified version projects/{project}/datasets/{dataset_id} projects/{project}/datasets/{dataset_id}@{version-id}

        In order to retrieve a previous version of the dataset, also provide the version ID. Example: projects/123/datasets/assisted-driving-preferences@c7cfa2a8

        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getDataset

        public final Dataset getDataset​(GetDatasetRequest request)
        Get the published or latest version of 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           GetDatasetRequest request =
               GetDatasetRequest.newBuilder()
                   .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
                   .setPublishedUsage(Usage.forNumber(0))
                   .build();
           Dataset response = mapsPlatformDatasetsV1AlphaClient.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 published or latest version of 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           GetDatasetRequest request =
               GetDatasetRequest.newBuilder()
                   .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
                   .setPublishedUsage(Usage.forNumber(0))
                   .build();
           ApiFuture<Dataset> future =
               mapsPlatformDatasetsV1AlphaClient.getDatasetCallable().futureCall(request);
           // Do something.
           Dataset response = future.get();
         }
         
      • listDatasetVersions

        public final MapsPlatformDatasetsV1AlphaClient.ListDatasetVersionsPagedResponse listDatasetVersions​(DatasetName name)
        List all the versions of a dataset.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]");
           for (Dataset element :
               mapsPlatformDatasetsV1AlphaClient.listDatasetVersions(name).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        name - Required. The name of the dataset to list all the versions for.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listDatasetVersions

        public final MapsPlatformDatasetsV1AlphaClient.ListDatasetVersionsPagedResponse listDatasetVersions​(String name)
        List all the versions of a dataset.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           String name = DatasetName.of("[PROJECT]", "[DATASET]").toString();
           for (Dataset element :
               mapsPlatformDatasetsV1AlphaClient.listDatasetVersions(name).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        name - Required. The name of the dataset to list all the versions for.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listDatasetVersions

        public final MapsPlatformDatasetsV1AlphaClient.ListDatasetVersionsPagedResponse listDatasetVersions​(ListDatasetVersionsRequest request)
        List all the versions of a dataset.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           ListDatasetVersionsRequest request =
               ListDatasetVersionsRequest.newBuilder()
                   .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           for (Dataset element :
               mapsPlatformDatasetsV1AlphaClient.listDatasetVersions(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
      • listDatasetVersionsPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListDatasetVersionsRequest,​MapsPlatformDatasetsV1AlphaClient.ListDatasetVersionsPagedResponse> listDatasetVersionsPagedCallable()
        List all the versions of a dataset.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           ListDatasetVersionsRequest request =
               ListDatasetVersionsRequest.newBuilder()
                   .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           ApiFuture<Dataset> future =
               mapsPlatformDatasetsV1AlphaClient.listDatasetVersionsPagedCallable().futureCall(request);
           // Do something.
           for (Dataset element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listDatasetVersionsCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListDatasetVersionsRequest,​ListDatasetVersionsResponse> listDatasetVersionsCallable()
        List all the versions of a dataset.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           ListDatasetVersionsRequest request =
               ListDatasetVersionsRequest.newBuilder()
                   .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           while (true) {
             ListDatasetVersionsResponse response =
                 mapsPlatformDatasetsV1AlphaClient.listDatasetVersionsCallable().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;
             }
           }
         }
         
      • listDatasets

        public final MapsPlatformDatasetsV1AlphaClient.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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           ProjectName parent = ProjectName.of("[PROJECT]");
           for (Dataset element : mapsPlatformDatasetsV1AlphaClient.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 MapsPlatformDatasetsV1AlphaClient.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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           String parent = ProjectName.of("[PROJECT]").toString();
           for (Dataset element : mapsPlatformDatasetsV1AlphaClient.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 MapsPlatformDatasetsV1AlphaClient.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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           ListDatasetsRequest request =
               ListDatasetsRequest.newBuilder()
                   .setParent(ProjectName.of("[PROJECT]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           for (Dataset element : mapsPlatformDatasetsV1AlphaClient.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,​MapsPlatformDatasetsV1AlphaClient.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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           ListDatasetsRequest request =
               ListDatasetsRequest.newBuilder()
                   .setParent(ProjectName.of("[PROJECT]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           ApiFuture<Dataset> future =
               mapsPlatformDatasetsV1AlphaClient.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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           ListDatasetsRequest request =
               ListDatasetsRequest.newBuilder()
                   .setParent(ProjectName.of("[PROJECT]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           while (true) {
             ListDatasetsResponse response =
                 mapsPlatformDatasetsV1AlphaClient.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 and optionally all its corresponding versions.

        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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]");
           mapsPlatformDatasetsV1AlphaClient.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 and optionally all its corresponding versions.

        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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           String name = DatasetName.of("[PROJECT]", "[DATASET]").toString();
           mapsPlatformDatasetsV1AlphaClient.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 and optionally all its corresponding versions.

        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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           DeleteDatasetRequest request =
               DeleteDatasetRequest.newBuilder()
                   .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
                   .setForce(true)
                   .build();
           mapsPlatformDatasetsV1AlphaClient.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 and optionally all its corresponding versions.

        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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           DeleteDatasetRequest request =
               DeleteDatasetRequest.newBuilder()
                   .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
                   .setForce(true)
                   .build();
           ApiFuture<Empty> future =
               mapsPlatformDatasetsV1AlphaClient.deleteDatasetCallable().futureCall(request);
           // Do something.
           future.get();
         }
         
      • deleteDatasetVersion

        public final void deleteDatasetVersion​(DatasetName name)
        Delete a specific version of 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]");
           mapsPlatformDatasetsV1AlphaClient.deleteDatasetVersion(name);
         }
         
        Parameters:
        name - Required. Format: projects/${project}/datasets/{dataset_id}@{version-id}
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteDatasetVersion

        public final void deleteDatasetVersion​(String name)
        Delete a specific version of 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           String name = DatasetName.of("[PROJECT]", "[DATASET]").toString();
           mapsPlatformDatasetsV1AlphaClient.deleteDatasetVersion(name);
         }
         
        Parameters:
        name - Required. Format: projects/${project}/datasets/{dataset_id}@{version-id}
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteDatasetVersion

        public final void deleteDatasetVersion​(DeleteDatasetVersionRequest request)
        Delete a specific version of 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           DeleteDatasetVersionRequest request =
               DeleteDatasetVersionRequest.newBuilder()
                   .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
                   .build();
           mapsPlatformDatasetsV1AlphaClient.deleteDatasetVersion(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
      • deleteDatasetVersionCallable

        public final com.google.api.gax.rpc.UnaryCallable<DeleteDatasetVersionRequest,​com.google.protobuf.Empty> deleteDatasetVersionCallable()
        Delete a specific version of 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
             MapsPlatformDatasetsV1AlphaClient.create()) {
           DeleteDatasetVersionRequest request =
               DeleteDatasetVersionRequest.newBuilder()
                   .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
                   .build();
           ApiFuture<Empty> future =
               mapsPlatformDatasetsV1AlphaClient.deleteDatasetVersionCallable().futureCall(request);
           // Do something.
           future.get();
         }
         
      • shutdown

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

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

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

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