Class DataObjectServiceClient

java.lang.Object
com.google.cloud.vectorsearch.v1beta.DataObjectServiceClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@BetaApi @Generated("by gapic-generator-java") public class DataObjectServiceClient extends Object implements BackgroundResource
Service Description: Service for creating and managing data objects.

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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
   CollectionName parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
   DataObject dataObject = DataObject.newBuilder().build();
   String dataObjectId = "dataObjectId1417732740";
   DataObject response =
       dataObjectServiceClient.createDataObject(parent, dataObject, dataObjectId);
 }
 

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

Methods
Method Description Method Variants

CreateDataObject

Creates a dataObject.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createDataObject(CreateDataObjectRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createDataObject(CollectionName parent, DataObject dataObject, String dataObjectId)

  • createDataObject(String parent, DataObject dataObject, String dataObjectId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createDataObjectCallable()

BatchCreateDataObjects

Creates a batch of dataObjects.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • batchCreateDataObjects(BatchCreateDataObjectsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • batchCreateDataObjectsCallable()

GetDataObject

Gets a data object.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getDataObject(GetDataObjectRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getDataObject(DataObjectName name)

  • getDataObject(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getDataObjectCallable()

UpdateDataObject

Updates a dataObject.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateDataObject(UpdateDataObjectRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateDataObject(DataObject dataObject, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateDataObjectCallable()

BatchUpdateDataObjects

Updates dataObjects in a batch.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • batchUpdateDataObjects(CollectionName parent, List<UpdateDataObjectRequest> requests)

  • batchUpdateDataObjects(String parent, List<UpdateDataObjectRequest> requests)

  • batchUpdateDataObjects(BatchUpdateDataObjectsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • batchUpdateDataObjectsCallable()

DeleteDataObject

Deletes a dataObject.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteDataObject(DeleteDataObjectRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteDataObject(DataObjectName name)

  • deleteDataObject(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteDataObjectCallable()

BatchDeleteDataObjects

Deletes dataObjects in a batch.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • batchDeleteDataObjects(CollectionName parent, List<DeleteDataObjectRequest> requests)

  • batchDeleteDataObjects(String parent, List<DeleteDataObjectRequest> requests)

  • batchDeleteDataObjects(BatchDeleteDataObjectsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • batchDeleteDataObjectsCallable()

ListLocations

Lists information about the supported locations for this service.

This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:

* **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listLocations(ListLocationsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getLocation(GetLocationRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getLocationCallable()

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 DataObjectServiceSettings 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
 DataObjectServiceSettings dataObjectServiceSettings =
     DataObjectServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 DataObjectServiceClient dataObjectServiceClient =
     DataObjectServiceClient.create(dataObjectServiceSettings);
 

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
 DataObjectServiceSettings dataObjectServiceSettings =
     DataObjectServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 DataObjectServiceClient dataObjectServiceClient =
     DataObjectServiceClient.create(dataObjectServiceSettings);
 

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
 DataObjectServiceSettings dataObjectServiceSettings =
     DataObjectServiceSettings.newHttpJsonBuilder().build();
 DataObjectServiceClient dataObjectServiceClient =
     DataObjectServiceClient.create(dataObjectServiceSettings);
 

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

  • Constructor Details

    • DataObjectServiceClient

      protected DataObjectServiceClient(DataObjectServiceSettings settings) throws IOException
      Constructs an instance of DataObjectServiceClient, 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
    • DataObjectServiceClient

      protected DataObjectServiceClient(DataObjectServiceStub stub)
  • Method Details

    • create

      public static final DataObjectServiceClient create() throws IOException
      Constructs an instance of DataObjectServiceClient with default settings.
      Throws:
      IOException
    • create

      public static final DataObjectServiceClient create(DataObjectServiceSettings settings) throws IOException
      Constructs an instance of DataObjectServiceClient, 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 DataObjectServiceClient create(DataObjectServiceStub stub)
      Constructs an instance of DataObjectServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(DataObjectServiceSettings).
    • getSettings

      public final DataObjectServiceSettings getSettings()
    • getStub

      public DataObjectServiceStub getStub()
    • createDataObject

      public final DataObject createDataObject(CollectionName parent, DataObject dataObject, String dataObjectId)
      Creates a dataObject.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         CollectionName parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
         DataObject dataObject = DataObject.newBuilder().build();
         String dataObjectId = "dataObjectId1417732740";
         DataObject response =
             dataObjectServiceClient.createDataObject(parent, dataObject, dataObjectId);
       }
       
      Parameters:
      parent - Required. The resource name of the Collection to create the DataObject in. Format: `projects/{project}/locations/{location}/collections/{collection}`
      dataObject - Required. The DataObject to create.
      dataObjectId - Required. The id of the dataObject to create. The id must be 1-63 characters long, and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). Specifically, it must be 1-63 characters long and match the regular expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`.
      Throws:
      ApiException - if the remote call fails
    • createDataObject

      public final DataObject createDataObject(String parent, DataObject dataObject, String dataObjectId)
      Creates a dataObject.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         String parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString();
         DataObject dataObject = DataObject.newBuilder().build();
         String dataObjectId = "dataObjectId1417732740";
         DataObject response =
             dataObjectServiceClient.createDataObject(parent, dataObject, dataObjectId);
       }
       
      Parameters:
      parent - Required. The resource name of the Collection to create the DataObject in. Format: `projects/{project}/locations/{location}/collections/{collection}`
      dataObject - Required. The DataObject to create.
      dataObjectId - Required. The id of the dataObject to create. The id must be 1-63 characters long, and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). Specifically, it must be 1-63 characters long and match the regular expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`.
      Throws:
      ApiException - if the remote call fails
    • createDataObject

      public final DataObject createDataObject(CreateDataObjectRequest request)
      Creates a dataObject.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         CreateDataObjectRequest request =
             CreateDataObjectRequest.newBuilder()
                 .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .setDataObjectId("dataObjectId1417732740")
                 .setDataObject(DataObject.newBuilder().build())
                 .build();
         DataObject response = dataObjectServiceClient.createDataObject(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createDataObjectCallable

      public final UnaryCallable<CreateDataObjectRequest,DataObject> createDataObjectCallable()
      Creates a dataObject.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         CreateDataObjectRequest request =
             CreateDataObjectRequest.newBuilder()
                 .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .setDataObjectId("dataObjectId1417732740")
                 .setDataObject(DataObject.newBuilder().build())
                 .build();
         ApiFuture<DataObject> future =
             dataObjectServiceClient.createDataObjectCallable().futureCall(request);
         // Do something.
         DataObject response = future.get();
       }
       
    • batchCreateDataObjects

      public final BatchCreateDataObjectsResponse batchCreateDataObjects(BatchCreateDataObjectsRequest request)
      Creates a batch of dataObjects.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         BatchCreateDataObjectsRequest request =
             BatchCreateDataObjectsRequest.newBuilder()
                 .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .addAllRequests(new ArrayList<CreateDataObjectRequest>())
                 .build();
         BatchCreateDataObjectsResponse response =
             dataObjectServiceClient.batchCreateDataObjects(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • batchCreateDataObjectsCallable

      public final UnaryCallable<BatchCreateDataObjectsRequest,BatchCreateDataObjectsResponse> batchCreateDataObjectsCallable()
      Creates a batch of dataObjects.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         BatchCreateDataObjectsRequest request =
             BatchCreateDataObjectsRequest.newBuilder()
                 .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .addAllRequests(new ArrayList<CreateDataObjectRequest>())
                 .build();
         ApiFuture<BatchCreateDataObjectsResponse> future =
             dataObjectServiceClient.batchCreateDataObjectsCallable().futureCall(request);
         // Do something.
         BatchCreateDataObjectsResponse response = future.get();
       }
       
    • getDataObject

      public final DataObject getDataObject(DataObjectName name)
      Gets a data object.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         DataObjectName name =
             DataObjectName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATAOBJECT]");
         DataObject response = dataObjectServiceClient.getDataObject(name);
       }
       
      Parameters:
      name - Required. The name of the DataObject resource. Format: `projects/{project}/locations/{location}/collections/{collection}/dataObjects/{dataObject}`
      Throws:
      ApiException - if the remote call fails
    • getDataObject

      public final DataObject getDataObject(String name)
      Gets a data object.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         String name =
             DataObjectName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATAOBJECT]").toString();
         DataObject response = dataObjectServiceClient.getDataObject(name);
       }
       
      Parameters:
      name - Required. The name of the DataObject resource. Format: `projects/{project}/locations/{location}/collections/{collection}/dataObjects/{dataObject}`
      Throws:
      ApiException - if the remote call fails
    • getDataObject

      public final DataObject getDataObject(GetDataObjectRequest request)
      Gets a data object.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         GetDataObjectRequest request =
             GetDataObjectRequest.newBuilder()
                 .setName(
                     DataObjectName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATAOBJECT]")
                         .toString())
                 .build();
         DataObject response = dataObjectServiceClient.getDataObject(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getDataObjectCallable

      public final UnaryCallable<GetDataObjectRequest,DataObject> getDataObjectCallable()
      Gets a data object.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         GetDataObjectRequest request =
             GetDataObjectRequest.newBuilder()
                 .setName(
                     DataObjectName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATAOBJECT]")
                         .toString())
                 .build();
         ApiFuture<DataObject> future =
             dataObjectServiceClient.getDataObjectCallable().futureCall(request);
         // Do something.
         DataObject response = future.get();
       }
       
    • updateDataObject

      public final DataObject updateDataObject(DataObject dataObject, com.google.protobuf.FieldMask updateMask)
      Updates a dataObject.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         DataObject dataObject = DataObject.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         DataObject response = dataObjectServiceClient.updateDataObject(dataObject, updateMask);
       }
       
      Parameters:
      dataObject - Required. The DataObject which replaces the resource on the server.
      updateMask - Optional. The update mask applies to the resource. See [google.protobuf.FieldMask][google.protobuf.FieldMask].
      Throws:
      ApiException - if the remote call fails
    • updateDataObject

      public final DataObject updateDataObject(UpdateDataObjectRequest request)
      Updates a dataObject.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         UpdateDataObjectRequest request =
             UpdateDataObjectRequest.newBuilder()
                 .setDataObject(DataObject.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         DataObject response = dataObjectServiceClient.updateDataObject(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateDataObjectCallable

      public final UnaryCallable<UpdateDataObjectRequest,DataObject> updateDataObjectCallable()
      Updates a dataObject.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         UpdateDataObjectRequest request =
             UpdateDataObjectRequest.newBuilder()
                 .setDataObject(DataObject.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         ApiFuture<DataObject> future =
             dataObjectServiceClient.updateDataObjectCallable().futureCall(request);
         // Do something.
         DataObject response = future.get();
       }
       
    • batchUpdateDataObjects

      public final BatchUpdateDataObjectsResponse batchUpdateDataObjects(CollectionName parent, List<UpdateDataObjectRequest> requests)
      Updates dataObjects in a batch.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         CollectionName parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
         List<UpdateDataObjectRequest> requests = new ArrayList<>();
         BatchUpdateDataObjectsResponse response =
             dataObjectServiceClient.batchUpdateDataObjects(parent, requests);
       }
       
      Parameters:
      parent - Required. The resource name of the Collection to update the DataObjects in. Format: `projects/{project}/locations/{location}/collections/{collection}`. The parent field in the UpdateDataObjectRequest messages must match this field.
      requests - Required. The request message specifying the resources to update. A maximum of 1000 DataObjects can be updated in a batch.
      Throws:
      ApiException - if the remote call fails
    • batchUpdateDataObjects

      public final BatchUpdateDataObjectsResponse batchUpdateDataObjects(String parent, List<UpdateDataObjectRequest> requests)
      Updates dataObjects in a batch.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         String parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString();
         List<UpdateDataObjectRequest> requests = new ArrayList<>();
         BatchUpdateDataObjectsResponse response =
             dataObjectServiceClient.batchUpdateDataObjects(parent, requests);
       }
       
      Parameters:
      parent - Required. The resource name of the Collection to update the DataObjects in. Format: `projects/{project}/locations/{location}/collections/{collection}`. The parent field in the UpdateDataObjectRequest messages must match this field.
      requests - Required. The request message specifying the resources to update. A maximum of 1000 DataObjects can be updated in a batch.
      Throws:
      ApiException - if the remote call fails
    • batchUpdateDataObjects

      public final BatchUpdateDataObjectsResponse batchUpdateDataObjects(BatchUpdateDataObjectsRequest request)
      Updates dataObjects in a batch.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         BatchUpdateDataObjectsRequest request =
             BatchUpdateDataObjectsRequest.newBuilder()
                 .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .addAllRequests(new ArrayList<UpdateDataObjectRequest>())
                 .build();
         BatchUpdateDataObjectsResponse response =
             dataObjectServiceClient.batchUpdateDataObjects(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • batchUpdateDataObjectsCallable

      public final UnaryCallable<BatchUpdateDataObjectsRequest,BatchUpdateDataObjectsResponse> batchUpdateDataObjectsCallable()
      Updates dataObjects in a batch.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         BatchUpdateDataObjectsRequest request =
             BatchUpdateDataObjectsRequest.newBuilder()
                 .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .addAllRequests(new ArrayList<UpdateDataObjectRequest>())
                 .build();
         ApiFuture<BatchUpdateDataObjectsResponse> future =
             dataObjectServiceClient.batchUpdateDataObjectsCallable().futureCall(request);
         // Do something.
         BatchUpdateDataObjectsResponse response = future.get();
       }
       
    • deleteDataObject

      public final void deleteDataObject(DataObjectName name)
      Deletes a dataObject.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         DataObjectName name =
             DataObjectName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATAOBJECT]");
         dataObjectServiceClient.deleteDataObject(name);
       }
       
      Parameters:
      name - Required. The name of the DataObject resource to be deleted. Format: `projects/{project}/locations/{location}/collections/{collection}/dataObjects/{dataObject}`
      Throws:
      ApiException - if the remote call fails
    • deleteDataObject

      public final void deleteDataObject(String name)
      Deletes a dataObject.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         String name =
             DataObjectName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATAOBJECT]").toString();
         dataObjectServiceClient.deleteDataObject(name);
       }
       
      Parameters:
      name - Required. The name of the DataObject resource to be deleted. Format: `projects/{project}/locations/{location}/collections/{collection}/dataObjects/{dataObject}`
      Throws:
      ApiException - if the remote call fails
    • deleteDataObject

      public final void deleteDataObject(DeleteDataObjectRequest request)
      Deletes a dataObject.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         DeleteDataObjectRequest request =
             DeleteDataObjectRequest.newBuilder()
                 .setName(
                     DataObjectName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATAOBJECT]")
                         .toString())
                 .setEtag("etag3123477")
                 .build();
         dataObjectServiceClient.deleteDataObject(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteDataObjectCallable

      public final UnaryCallable<DeleteDataObjectRequest,com.google.protobuf.Empty> deleteDataObjectCallable()
      Deletes a dataObject.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         DeleteDataObjectRequest request =
             DeleteDataObjectRequest.newBuilder()
                 .setName(
                     DataObjectName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATAOBJECT]")
                         .toString())
                 .setEtag("etag3123477")
                 .build();
         ApiFuture<Empty> future =
             dataObjectServiceClient.deleteDataObjectCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • batchDeleteDataObjects

      public final void batchDeleteDataObjects(CollectionName parent, List<DeleteDataObjectRequest> requests)
      Deletes dataObjects in a batch.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         CollectionName parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
         List<DeleteDataObjectRequest> requests = new ArrayList<>();
         dataObjectServiceClient.batchDeleteDataObjects(parent, requests);
       }
       
      Parameters:
      parent - Required. The resource name of the Collection to delete the DataObjects in. Format: `projects/{project}/locations/{location}/collections/{collection}`.
      requests - Required. The request message specifying the resources to delete. A maximum of 1000 DataObjects can be deleted in a batch.
      Throws:
      ApiException - if the remote call fails
    • batchDeleteDataObjects

      public final void batchDeleteDataObjects(String parent, List<DeleteDataObjectRequest> requests)
      Deletes dataObjects in a batch.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         String parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString();
         List<DeleteDataObjectRequest> requests = new ArrayList<>();
         dataObjectServiceClient.batchDeleteDataObjects(parent, requests);
       }
       
      Parameters:
      parent - Required. The resource name of the Collection to delete the DataObjects in. Format: `projects/{project}/locations/{location}/collections/{collection}`.
      requests - Required. The request message specifying the resources to delete. A maximum of 1000 DataObjects can be deleted in a batch.
      Throws:
      ApiException - if the remote call fails
    • batchDeleteDataObjects

      public final void batchDeleteDataObjects(BatchDeleteDataObjectsRequest request)
      Deletes dataObjects in a batch.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         BatchDeleteDataObjectsRequest request =
             BatchDeleteDataObjectsRequest.newBuilder()
                 .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .addAllRequests(new ArrayList<DeleteDataObjectRequest>())
                 .build();
         dataObjectServiceClient.batchDeleteDataObjects(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • batchDeleteDataObjectsCallable

      public final UnaryCallable<BatchDeleteDataObjectsRequest,com.google.protobuf.Empty> batchDeleteDataObjectsCallable()
      Deletes dataObjects in a batch.

      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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         BatchDeleteDataObjectsRequest request =
             BatchDeleteDataObjectsRequest.newBuilder()
                 .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .addAllRequests(new ArrayList<DeleteDataObjectRequest>())
                 .build();
         ApiFuture<Empty> future =
             dataObjectServiceClient.batchDeleteDataObjectsCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listLocations

      Lists information about the supported locations for this service.

      This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:

      * **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

      For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (Location element : dataObjectServiceClient.listLocations(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listLocationsPagedCallable

      Lists information about the supported locations for this service.

      This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:

      * **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

      For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<Location> future =
             dataObjectServiceClient.listLocationsPagedCallable().futureCall(request);
         // Do something.
         for (Location element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listLocationsCallable

      public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()
      Lists information about the supported locations for this service.

      This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:

      * **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

      For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListLocationsResponse response =
               dataObjectServiceClient.listLocationsCallable().call(request);
           for (Location element : response.getLocationsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getLocation

      public final Location getLocation(GetLocationRequest request)
      Gets information about a location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         Location response = dataObjectServiceClient.getLocation(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getLocationCallable

      public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()
      Gets information about a location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         ApiFuture<Location> future =
             dataObjectServiceClient.getLocationCallable().futureCall(request);
         // Do something.
         Location response = future.get();
       }
       
    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface BackgroundResource
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface BackgroundResource
    • isTerminated

      public boolean isTerminated()
      Specified by:
      isTerminated in interface BackgroundResource
    • shutdownNow

      public void shutdownNow()
      Specified by:
      shutdownNow in interface BackgroundResource
    • awaitTermination

      public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
      Specified by:
      awaitTermination in interface BackgroundResource
      Throws:
      InterruptedException