Class VectorSearchServiceClient

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

@BetaApi @Generated("by gapic-generator-java") public class VectorSearchServiceClient extends Object implements BackgroundResource
Service Description: VectorSearchService provides methods for managing Collection resources, and Collection Index resources. The primary resources offered by this service are Collections which are a container for a set of related JSON data objects, and Collection Indexes which enable efficient ANN search across data objects within a Collection.

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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
   CollectionName name = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
   Collection response = vectorSearchServiceClient.getCollection(name);
 }
 

Note: close() needs to be called on the VectorSearchServiceClient 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

ListCollections

Lists Collections in a given project and location.

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

  • listCollections(ListCollectionsRequest request)

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

  • listCollections(LocationName parent)

  • listCollections(String parent)

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

  • listCollectionsPagedCallable()

  • listCollectionsCallable()

GetCollection

Gets details of a single Collection.

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

  • getCollection(GetCollectionRequest request)

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

  • getCollection(CollectionName name)

  • getCollection(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.

  • getCollectionCallable()

CreateCollection

Creates a new Collection in a given project and location.

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

  • createCollectionAsync(CreateCollectionRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createCollectionAsync(LocationName parent, Collection collection, String collectionId)

  • createCollectionAsync(String parent, Collection collection, String collectionId)

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

  • createCollectionOperationCallable()

  • createCollectionCallable()

UpdateCollection

Updates the parameters of a single Collection.

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

  • updateCollectionAsync(UpdateCollectionRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateCollectionAsync(Collection collection, 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.

  • updateCollectionOperationCallable()

  • updateCollectionCallable()

DeleteCollection

Deletes a single Collection.

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

  • deleteCollectionAsync(DeleteCollectionRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteCollectionAsync(CollectionName name)

  • deleteCollectionAsync(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.

  • deleteCollectionOperationCallable()

  • deleteCollectionCallable()

ListIndexes

Lists Indexes in a given project and location.

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

  • listIndexes(ListIndexesRequest request)

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

  • listIndexes(CollectionName parent)

  • listIndexes(String parent)

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

  • listIndexesPagedCallable()

  • listIndexesCallable()

GetIndex

Gets details of a single Index.

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

  • getIndex(GetIndexRequest request)

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

  • getIndex(IndexName name)

  • getIndex(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.

  • getIndexCallable()

CreateIndex

Creates a new Index in a given project and location.

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

  • createIndexAsync(CreateIndexRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createIndexAsync(CollectionName parent, Index index, String indexId)

  • createIndexAsync(String parent, Index index, String indexId)

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

  • createIndexOperationCallable()

  • createIndexCallable()

UpdateIndex

Updates the parameters of a single Index.

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

  • updateIndexAsync(UpdateIndexRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateIndexAsync(Index index, 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.

  • updateIndexOperationCallable()

  • updateIndexCallable()

DeleteIndex

Deletes a single Index.

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

  • deleteIndexAsync(DeleteIndexRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteIndexAsync(IndexName name)

  • deleteIndexAsync(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.

  • deleteIndexOperationCallable()

  • deleteIndexCallable()

ImportDataObjects

Initiates a Long-Running Operation to import DataObjects into a Collection.

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

  • importDataObjectsAsync(ImportDataObjectsRequest request)

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

  • importDataObjectsOperationCallable()

  • importDataObjectsCallable()

ExportDataObjects

Initiates a Long-Running Operation to export DataObjects from a Collection.

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

  • exportDataObjectsAsync(ExportDataObjectsRequest request)

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

  • exportDataObjectsOperationCallable()

  • exportDataObjectsCallable()

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 VectorSearchServiceSettings 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
 VectorSearchServiceSettings vectorSearchServiceSettings =
     VectorSearchServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 VectorSearchServiceClient vectorSearchServiceClient =
     VectorSearchServiceClient.create(vectorSearchServiceSettings);
 

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
 VectorSearchServiceSettings vectorSearchServiceSettings =
     VectorSearchServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 VectorSearchServiceClient vectorSearchServiceClient =
     VectorSearchServiceClient.create(vectorSearchServiceSettings);
 

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
 VectorSearchServiceSettings vectorSearchServiceSettings =
     VectorSearchServiceSettings.newHttpJsonBuilder().build();
 VectorSearchServiceClient vectorSearchServiceClient =
     VectorSearchServiceClient.create(vectorSearchServiceSettings);
 

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

  • Constructor Details

    • VectorSearchServiceClient

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

      protected VectorSearchServiceClient(VectorSearchServiceStub stub)
  • Method Details

    • create

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

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

      public final VectorSearchServiceSettings getSettings()
    • getStub

      public VectorSearchServiceStub getStub()
    • getOperationsClient

      public final OperationsClient getOperationsClient()
      Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
    • getHttpJsonOperationsClient

      @BetaApi public final OperationsClient getHttpJsonOperationsClient()
      Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
    • listCollections

      Lists Collections in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (Collection element : vectorSearchServiceClient.listCollections(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Parent value for ListCollectionsRequest
      Throws:
      ApiException - if the remote call fails
    • listCollections

      public final VectorSearchServiceClient.ListCollectionsPagedResponse listCollections(String parent)
      Lists Collections in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (Collection element : vectorSearchServiceClient.listCollections(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Parent value for ListCollectionsRequest
      Throws:
      ApiException - if the remote call fails
    • listCollections

      Lists Collections in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         ListCollectionsRequest request =
             ListCollectionsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (Collection element : vectorSearchServiceClient.listCollections(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
    • listCollectionsPagedCallable

      Lists Collections in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         ListCollectionsRequest request =
             ListCollectionsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<Collection> future =
             vectorSearchServiceClient.listCollectionsPagedCallable().futureCall(request);
         // Do something.
         for (Collection element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listCollectionsCallable

      public final UnaryCallable<ListCollectionsRequest,ListCollectionsResponse> listCollectionsCallable()
      Lists Collections in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         ListCollectionsRequest request =
             ListCollectionsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListCollectionsResponse response =
               vectorSearchServiceClient.listCollectionsCallable().call(request);
           for (Collection element : response.getCollectionsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getCollection

      public final Collection getCollection(CollectionName name)
      Gets details of a single Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         CollectionName name = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
         Collection response = vectorSearchServiceClient.getCollection(name);
       }
       
      Parameters:
      name - Required. Name of the resource
      Throws:
      ApiException - if the remote call fails
    • getCollection

      public final Collection getCollection(String name)
      Gets details of a single Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         String name = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString();
         Collection response = vectorSearchServiceClient.getCollection(name);
       }
       
      Parameters:
      name - Required. Name of the resource
      Throws:
      ApiException - if the remote call fails
    • getCollection

      public final Collection getCollection(GetCollectionRequest request)
      Gets details of a single Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         GetCollectionRequest request =
             GetCollectionRequest.newBuilder()
                 .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .build();
         Collection response = vectorSearchServiceClient.getCollection(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getCollectionCallable

      public final UnaryCallable<GetCollectionRequest,Collection> getCollectionCallable()
      Gets details of a single Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         GetCollectionRequest request =
             GetCollectionRequest.newBuilder()
                 .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .build();
         ApiFuture<Collection> future =
             vectorSearchServiceClient.getCollectionCallable().futureCall(request);
         // Do something.
         Collection response = future.get();
       }
       
    • createCollectionAsync

      public final OperationFuture<Collection,OperationMetadata> createCollectionAsync(LocationName parent, Collection collection, String collectionId)
      Creates a new Collection in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         Collection collection = Collection.newBuilder().build();
         String collectionId = "collectionId1636075609";
         Collection response =
             vectorSearchServiceClient.createCollectionAsync(parent, collection, collectionId).get();
       }
       
      Parameters:
      parent - Required. Value for parent.
      collection - Required. The resource being created
      collectionId - Required. ID of the Collection 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
    • createCollectionAsync

      public final OperationFuture<Collection,OperationMetadata> createCollectionAsync(String parent, Collection collection, String collectionId)
      Creates a new Collection in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         Collection collection = Collection.newBuilder().build();
         String collectionId = "collectionId1636075609";
         Collection response =
             vectorSearchServiceClient.createCollectionAsync(parent, collection, collectionId).get();
       }
       
      Parameters:
      parent - Required. Value for parent.
      collection - Required. The resource being created
      collectionId - Required. ID of the Collection 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
    • createCollectionAsync

      public final OperationFuture<Collection,OperationMetadata> createCollectionAsync(CreateCollectionRequest request)
      Creates a new Collection in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         CreateCollectionRequest request =
             CreateCollectionRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setCollectionId("collectionId1636075609")
                 .setCollection(Collection.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         Collection response = vectorSearchServiceClient.createCollectionAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createCollectionOperationCallable

      public final OperationCallable<CreateCollectionRequest,Collection,OperationMetadata> createCollectionOperationCallable()
      Creates a new Collection in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         CreateCollectionRequest request =
             CreateCollectionRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setCollectionId("collectionId1636075609")
                 .setCollection(Collection.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Collection, OperationMetadata> future =
             vectorSearchServiceClient.createCollectionOperationCallable().futureCall(request);
         // Do something.
         Collection response = future.get();
       }
       
    • createCollectionCallable

      public final UnaryCallable<CreateCollectionRequest,Operation> createCollectionCallable()
      Creates a new Collection in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         CreateCollectionRequest request =
             CreateCollectionRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setCollectionId("collectionId1636075609")
                 .setCollection(Collection.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             vectorSearchServiceClient.createCollectionCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateCollectionAsync

      public final OperationFuture<Collection,OperationMetadata> updateCollectionAsync(Collection collection, com.google.protobuf.FieldMask updateMask)
      Updates the parameters of a single Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         Collection collection = Collection.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         Collection response =
             vectorSearchServiceClient.updateCollectionAsync(collection, updateMask).get();
       }
       
      Parameters:
      collection - Required. The resource being updated
      updateMask - Optional. Field mask is used to specify the fields to be overwritten in the Collection resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields present in the request will be overwritten.

      The following fields support update: `display_name`, `description`, `labels`, `data_schema`, `vector_schema`. For `data_schema` and `vector_schema`, fields can only be added, not deleted, but `vertex_embedding_config` in `vector_schema` can be added or removed. Partial updates for `data_schema` and `vector_schema` are also supported by using sub-field paths in `update_mask`, e.g. `data_schema.properties.foo` or `vector_schema.my_vector_field`.

      If `*` is provided in the update_mask, full replacement will be performed.

      Throws:
      ApiException - if the remote call fails
    • updateCollectionAsync

      public final OperationFuture<Collection,OperationMetadata> updateCollectionAsync(UpdateCollectionRequest request)
      Updates the parameters of a single Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         UpdateCollectionRequest request =
             UpdateCollectionRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setCollection(Collection.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         Collection response = vectorSearchServiceClient.updateCollectionAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateCollectionOperationCallable

      public final OperationCallable<UpdateCollectionRequest,Collection,OperationMetadata> updateCollectionOperationCallable()
      Updates the parameters of a single Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         UpdateCollectionRequest request =
             UpdateCollectionRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setCollection(Collection.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Collection, OperationMetadata> future =
             vectorSearchServiceClient.updateCollectionOperationCallable().futureCall(request);
         // Do something.
         Collection response = future.get();
       }
       
    • updateCollectionCallable

      public final UnaryCallable<UpdateCollectionRequest,Operation> updateCollectionCallable()
      Updates the parameters of a single Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         UpdateCollectionRequest request =
             UpdateCollectionRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setCollection(Collection.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             vectorSearchServiceClient.updateCollectionCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteCollectionAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteCollectionAsync(CollectionName name)
      Deletes a single Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         CollectionName name = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
         vectorSearchServiceClient.deleteCollectionAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the resource
      Throws:
      ApiException - if the remote call fails
    • deleteCollectionAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteCollectionAsync(String name)
      Deletes a single Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         String name = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString();
         vectorSearchServiceClient.deleteCollectionAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the resource
      Throws:
      ApiException - if the remote call fails
    • deleteCollectionAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteCollectionAsync(DeleteCollectionRequest request)
      Deletes a single Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         DeleteCollectionRequest request =
             DeleteCollectionRequest.newBuilder()
                 .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         vectorSearchServiceClient.deleteCollectionAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteCollectionOperationCallable

      public final OperationCallable<DeleteCollectionRequest,com.google.protobuf.Empty,OperationMetadata> deleteCollectionOperationCallable()
      Deletes a single Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         DeleteCollectionRequest request =
             DeleteCollectionRequest.newBuilder()
                 .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             vectorSearchServiceClient.deleteCollectionOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteCollectionCallable

      public final UnaryCallable<DeleteCollectionRequest,Operation> deleteCollectionCallable()
      Deletes a single Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         DeleteCollectionRequest request =
             DeleteCollectionRequest.newBuilder()
                 .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             vectorSearchServiceClient.deleteCollectionCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listIndexes

      Lists Indexes in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         CollectionName parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
         for (Index element : vectorSearchServiceClient.listIndexes(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Parent value for ListIndexesRequest
      Throws:
      ApiException - if the remote call fails
    • listIndexes

      Lists Indexes in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         String parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString();
         for (Index element : vectorSearchServiceClient.listIndexes(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Parent value for ListIndexesRequest
      Throws:
      ApiException - if the remote call fails
    • listIndexes

      Lists Indexes in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         ListIndexesRequest request =
             ListIndexesRequest.newBuilder()
                 .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (Index element : vectorSearchServiceClient.listIndexes(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
    • listIndexesPagedCallable

      Lists Indexes in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         ListIndexesRequest request =
             ListIndexesRequest.newBuilder()
                 .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<Index> future =
             vectorSearchServiceClient.listIndexesPagedCallable().futureCall(request);
         // Do something.
         for (Index element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listIndexesCallable

      public final UnaryCallable<ListIndexesRequest,ListIndexesResponse> listIndexesCallable()
      Lists Indexes in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         ListIndexesRequest request =
             ListIndexesRequest.newBuilder()
                 .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListIndexesResponse response =
               vectorSearchServiceClient.listIndexesCallable().call(request);
           for (Index element : response.getIndexesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getIndex

      public final Index getIndex(IndexName name)
      Gets details of a single Index.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         IndexName name = IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]");
         Index response = vectorSearchServiceClient.getIndex(name);
       }
       
      Parameters:
      name - Required. Name of the resource
      Throws:
      ApiException - if the remote call fails
    • getIndex

      public final Index getIndex(String name)
      Gets details of a single Index.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         String name = IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString();
         Index response = vectorSearchServiceClient.getIndex(name);
       }
       
      Parameters:
      name - Required. Name of the resource
      Throws:
      ApiException - if the remote call fails
    • getIndex

      public final Index getIndex(GetIndexRequest request)
      Gets details of a single Index.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         GetIndexRequest request =
             GetIndexRequest.newBuilder()
                 .setName(
                     IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString())
                 .build();
         Index response = vectorSearchServiceClient.getIndex(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getIndexCallable

      public final UnaryCallable<GetIndexRequest,Index> getIndexCallable()
      Gets details of a single Index.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         GetIndexRequest request =
             GetIndexRequest.newBuilder()
                 .setName(
                     IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString())
                 .build();
         ApiFuture<Index> future = vectorSearchServiceClient.getIndexCallable().futureCall(request);
         // Do something.
         Index response = future.get();
       }
       
    • createIndexAsync

      public final OperationFuture<Index,OperationMetadata> createIndexAsync(CollectionName parent, Index index, String indexId)
      Creates a new Index in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         CollectionName parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
         Index index = Index.newBuilder().build();
         String indexId = "indexId1943291277";
         Index response = vectorSearchServiceClient.createIndexAsync(parent, index, indexId).get();
       }
       
      Parameters:
      parent - Required. The resource name of the Collection for which to create the Index. Format: `projects/{project}/locations/{location}/collections/{collection}`
      index - Required. The resource being created
      indexId - Required. ID of the Index 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
    • createIndexAsync

      public final OperationFuture<Index,OperationMetadata> createIndexAsync(String parent, Index index, String indexId)
      Creates a new Index in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         String parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString();
         Index index = Index.newBuilder().build();
         String indexId = "indexId1943291277";
         Index response = vectorSearchServiceClient.createIndexAsync(parent, index, indexId).get();
       }
       
      Parameters:
      parent - Required. The resource name of the Collection for which to create the Index. Format: `projects/{project}/locations/{location}/collections/{collection}`
      index - Required. The resource being created
      indexId - Required. ID of the Index 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
    • createIndexAsync

      public final OperationFuture<Index,OperationMetadata> createIndexAsync(CreateIndexRequest request)
      Creates a new Index in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         CreateIndexRequest request =
             CreateIndexRequest.newBuilder()
                 .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .setIndexId("indexId1943291277")
                 .setIndex(Index.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         Index response = vectorSearchServiceClient.createIndexAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createIndexOperationCallable

      public final OperationCallable<CreateIndexRequest,Index,OperationMetadata> createIndexOperationCallable()
      Creates a new Index in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         CreateIndexRequest request =
             CreateIndexRequest.newBuilder()
                 .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .setIndexId("indexId1943291277")
                 .setIndex(Index.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Index, OperationMetadata> future =
             vectorSearchServiceClient.createIndexOperationCallable().futureCall(request);
         // Do something.
         Index response = future.get();
       }
       
    • createIndexCallable

      public final UnaryCallable<CreateIndexRequest,Operation> createIndexCallable()
      Creates a new Index in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         CreateIndexRequest request =
             CreateIndexRequest.newBuilder()
                 .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .setIndexId("indexId1943291277")
                 .setIndex(Index.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             vectorSearchServiceClient.createIndexCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateIndexAsync

      public final OperationFuture<Index,OperationMetadata> updateIndexAsync(Index index, com.google.protobuf.FieldMask updateMask)
      Updates the parameters of a single Index.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         Index index = Index.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         Index response = vectorSearchServiceClient.updateIndexAsync(index, updateMask).get();
       }
       
      Parameters:
      index - Required. The resource being updated.
      updateMask - Optional. Specifies the fields to be overwritten in the Index resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields present in the request with non-empty values will be overwritten.

      The following fields support update: * `display_name` * `description` * `labels` * `dedicated_infrastructure.autoscaling_spec.min_replica_count` * `dedicated_infrastructure.autoscaling_spec.max_replica_count`

      If `*` is provided in the `update_mask`, full replacement of mutable fields will be performed.

      Throws:
      ApiException - if the remote call fails
    • updateIndexAsync

      public final OperationFuture<Index,OperationMetadata> updateIndexAsync(UpdateIndexRequest request)
      Updates the parameters of a single Index.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         UpdateIndexRequest request =
             UpdateIndexRequest.newBuilder()
                 .setIndex(Index.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         Index response = vectorSearchServiceClient.updateIndexAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateIndexOperationCallable

      public final OperationCallable<UpdateIndexRequest,Index,OperationMetadata> updateIndexOperationCallable()
      Updates the parameters of a single Index.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         UpdateIndexRequest request =
             UpdateIndexRequest.newBuilder()
                 .setIndex(Index.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Index, OperationMetadata> future =
             vectorSearchServiceClient.updateIndexOperationCallable().futureCall(request);
         // Do something.
         Index response = future.get();
       }
       
    • updateIndexCallable

      public final UnaryCallable<UpdateIndexRequest,Operation> updateIndexCallable()
      Updates the parameters of a single Index.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         UpdateIndexRequest request =
             UpdateIndexRequest.newBuilder()
                 .setIndex(Index.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             vectorSearchServiceClient.updateIndexCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteIndexAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteIndexAsync(IndexName name)
      Deletes a single Index.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         IndexName name = IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]");
         vectorSearchServiceClient.deleteIndexAsync(name).get();
       }
       
      Parameters:
      name - Required. The resource name of the Index to delete. Format: `projects/{project}/locations/{location}/collections/{collection}/indexes/{index}`
      Throws:
      ApiException - if the remote call fails
    • deleteIndexAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteIndexAsync(String name)
      Deletes a single Index.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         String name = IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString();
         vectorSearchServiceClient.deleteIndexAsync(name).get();
       }
       
      Parameters:
      name - Required. The resource name of the Index to delete. Format: `projects/{project}/locations/{location}/collections/{collection}/indexes/{index}`
      Throws:
      ApiException - if the remote call fails
    • deleteIndexAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteIndexAsync(DeleteIndexRequest request)
      Deletes a single Index.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         DeleteIndexRequest request =
             DeleteIndexRequest.newBuilder()
                 .setName(
                     IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         vectorSearchServiceClient.deleteIndexAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteIndexOperationCallable

      public final OperationCallable<DeleteIndexRequest,com.google.protobuf.Empty,OperationMetadata> deleteIndexOperationCallable()
      Deletes a single Index.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         DeleteIndexRequest request =
             DeleteIndexRequest.newBuilder()
                 .setName(
                     IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             vectorSearchServiceClient.deleteIndexOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteIndexCallable

      public final UnaryCallable<DeleteIndexRequest,Operation> deleteIndexCallable()
      Deletes a single Index.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         DeleteIndexRequest request =
             DeleteIndexRequest.newBuilder()
                 .setName(
                     IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             vectorSearchServiceClient.deleteIndexCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • importDataObjectsAsync

      Initiates a Long-Running Operation to import DataObjects into a Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         ImportDataObjectsRequest request =
             ImportDataObjectsRequest.newBuilder()
                 .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .build();
         ImportDataObjectsResponse response =
             vectorSearchServiceClient.importDataObjectsAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • importDataObjectsOperationCallable

      Initiates a Long-Running Operation to import DataObjects into a Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         ImportDataObjectsRequest request =
             ImportDataObjectsRequest.newBuilder()
                 .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .build();
         OperationFuture<ImportDataObjectsResponse, ImportDataObjectsMetadata> future =
             vectorSearchServiceClient.importDataObjectsOperationCallable().futureCall(request);
         // Do something.
         ImportDataObjectsResponse response = future.get();
       }
       
    • importDataObjectsCallable

      public final UnaryCallable<ImportDataObjectsRequest,Operation> importDataObjectsCallable()
      Initiates a Long-Running Operation to import DataObjects into a Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         ImportDataObjectsRequest request =
             ImportDataObjectsRequest.newBuilder()
                 .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .build();
         ApiFuture<Operation> future =
             vectorSearchServiceClient.importDataObjectsCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • exportDataObjectsAsync

      Initiates a Long-Running Operation to export DataObjects from a Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         ExportDataObjectsRequest request =
             ExportDataObjectsRequest.newBuilder()
                 .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .build();
         ExportDataObjectsResponse response =
             vectorSearchServiceClient.exportDataObjectsAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • exportDataObjectsOperationCallable

      Initiates a Long-Running Operation to export DataObjects from a Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         ExportDataObjectsRequest request =
             ExportDataObjectsRequest.newBuilder()
                 .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .build();
         OperationFuture<ExportDataObjectsResponse, ExportDataObjectsMetadata> future =
             vectorSearchServiceClient.exportDataObjectsOperationCallable().futureCall(request);
         // Do something.
         ExportDataObjectsResponse response = future.get();
       }
       
    • exportDataObjectsCallable

      public final UnaryCallable<ExportDataObjectsRequest,Operation> exportDataObjectsCallable()
      Initiates a Long-Running Operation to export DataObjects from a Collection.

      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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         ExportDataObjectsRequest request =
             ExportDataObjectsRequest.newBuilder()
                 .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
                 .build();
         ApiFuture<Operation> future =
             vectorSearchServiceClient.exportDataObjectsCallable().futureCall(request);
         // Do something.
         Operation response = 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (Location element : vectorSearchServiceClient.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<Location> future =
             vectorSearchServiceClient.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListLocationsResponse response =
               vectorSearchServiceClient.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         Location response = vectorSearchServiceClient.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         ApiFuture<Location> future =
             vectorSearchServiceClient.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