Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions VectorSearch/metadata/V1/EncryptionSpec.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion VectorSearch/metadata/V1/VectorsearchService.php

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,22 @@

/**
* Lists information about the supported locations for this service.
This method can be called in two ways:

* **List all public locations:** Use the path `GET /v1/locations`.
* **List project-visible locations:** Use the path
`GET /v1/projects/{project_id}/locations`. This may include public
locations as well as private or other locations specifically visible
to the project.
This method lists locations based on the resource scope provided in
the [ListLocationsRequest.name] field:

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

For gRPC and client library implementations, the resource name is
passed as the `name` field. For direct service calls, the resource
name is
incorporated into the request path based on the specific service
implementation and version.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,22 @@

/**
* Lists information about the supported locations for this service.
This method can be called in two ways:

* **List all public locations:** Use the path `GET /v1/locations`.
* **List project-visible locations:** Use the path
`GET /v1/projects/{project_id}/locations`. This may include public
locations as well as private or other locations specifically visible
to the project.
This method lists locations based on the resource scope provided in
the [ListLocationsRequest.name] field:

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

For gRPC and client library implementations, the resource name is
passed as the `name` field. For direct service calls, the resource
name is
incorporated into the request path based on the specific service
implementation and version.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,22 @@

/**
* Lists information about the supported locations for this service.
This method can be called in two ways:

* **List all public locations:** Use the path `GET /v1/locations`.
* **List project-visible locations:** Use the path
`GET /v1/projects/{project_id}/locations`. This may include public
locations as well as private or other locations specifically visible
to the project.
This method lists locations based on the resource scope provided in
the [ListLocationsRequest.name] field:

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

For gRPC and client library implementations, the resource name is
passed as the `name` field. For direct service calls, the resource
name is
incorporated into the request path based on the specific service
implementation and version.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?php
/*
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START vectorsearch_v1_generated_VectorSearchService_UpdateIndex_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VectorSearch\V1\Client\VectorSearchServiceClient;
use Google\Cloud\VectorSearch\V1\Index;
use Google\Cloud\VectorSearch\V1\UpdateIndexRequest;
use Google\Rpc\Status;

/**
* Updates the parameters of a single Index.
*
* @param string $indexIndexField The collection schema field to index.
*/
function update_index_sample(string $indexIndexField): void
{
// Create a client.
$vectorSearchServiceClient = new VectorSearchServiceClient();

// Prepare the request message.
$index = (new Index())
->setIndexField($indexIndexField);
$request = (new UpdateIndexRequest())
->setIndex($index);

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $vectorSearchServiceClient->updateIndex($request);
$response->pollUntilComplete();

if ($response->operationSucceeded()) {
/** @var Index $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample 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,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$indexIndexField = '[INDEX_FIELD]';

update_index_sample($indexIndexField);
}
// [END vectorsearch_v1_generated_VectorSearchService_UpdateIndex_sync]
21 changes: 15 additions & 6 deletions VectorSearch/src/V1/Client/DataObjectSearchServiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,22 @@ public function getLocation(GetLocationRequest $request, array $callOptions = []

/**
* Lists information about the supported locations for this service.
This method can be called in two ways:

* **List all public locations:** Use the path `GET /v1/locations`.
* **List project-visible locations:** Use the path
`GET /v1/projects/{project_id}/locations`. This may include public
locations as well as private or other locations specifically visible
to the project.
This method lists locations based on the resource scope provided in
the [ListLocationsRequest.name] field:

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

For gRPC and client library implementations, the resource name is
passed as the `name` field. For direct service calls, the resource
name is
incorporated into the request path based on the specific service
implementation and version.
*
* The async variant is {@see DataObjectSearchServiceClient::listLocationsAsync()}
* .
Expand Down
21 changes: 15 additions & 6 deletions VectorSearch/src/V1/Client/DataObjectServiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,13 +484,22 @@ public function getLocation(GetLocationRequest $request, array $callOptions = []

/**
* Lists information about the supported locations for this service.
This method can be called in two ways:

* **List all public locations:** Use the path `GET /v1/locations`.
* **List project-visible locations:** Use the path
`GET /v1/projects/{project_id}/locations`. This may include public
locations as well as private or other locations specifically visible
to the project.
This method lists locations based on the resource scope provided in
the [ListLocationsRequest.name] field:

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

For gRPC and client library implementations, the resource name is
passed as the `name` field. For direct service calls, the resource
name is
incorporated into the request path based on the specific service
implementation and version.
*
* The async variant is {@see DataObjectServiceClient::listLocationsAsync()} .
*
Expand Down
71 changes: 65 additions & 6 deletions VectorSearch/src/V1/Client/VectorSearchServiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
use Google\Cloud\VectorSearch\V1\ListCollectionsRequest;
use Google\Cloud\VectorSearch\V1\ListIndexesRequest;
use Google\Cloud\VectorSearch\V1\UpdateCollectionRequest;
use Google\Cloud\VectorSearch\V1\UpdateIndexRequest;
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\Operation;
use GuzzleHttp\Promise\PromiseInterface;
Expand Down Expand Up @@ -84,6 +85,7 @@
* @method PromiseInterface<PagedListResponse> listCollectionsAsync(ListCollectionsRequest $request, array $optionalArgs = [])
* @method PromiseInterface<PagedListResponse> listIndexesAsync(ListIndexesRequest $request, array $optionalArgs = [])
* @method PromiseInterface<OperationResponse> updateCollectionAsync(UpdateCollectionRequest $request, array $optionalArgs = [])
* @method PromiseInterface<OperationResponse> updateIndexAsync(UpdateIndexRequest $request, array $optionalArgs = [])
* @method PromiseInterface<Location> getLocationAsync(GetLocationRequest $request, array $optionalArgs = [])
* @method PromiseInterface<PagedListResponse> listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = [])
*/
Expand Down Expand Up @@ -202,6 +204,27 @@ public static function collectionName(string $project, string $location, string
]);
}

/**
* Formats a string containing the fully-qualified path to represent a crypto_key
* resource.
*
* @param string $project
* @param string $location
* @param string $keyRing
* @param string $cryptoKey
*
* @return string The formatted crypto_key resource.
*/
public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string
{
return self::getPathTemplate('cryptoKey')->render([
'project' => $project,
'location' => $location,
'key_ring' => $keyRing,
'crypto_key' => $cryptoKey,
]);
}

/**
* Formats a string containing the fully-qualified path to represent a index
* resource.
Expand Down Expand Up @@ -245,6 +268,7 @@ public static function locationName(string $project, string $location): string
* The following name formats are supported:
* Template: Pattern
* - collection: projects/{project}/locations/{location}/collections/{collection}
* - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}
* - index: projects/{project}/locations/{location}/collections/{collection}/indexes/{index}
* - location: projects/{project}/locations/{location}
*
Expand Down Expand Up @@ -640,6 +664,32 @@ public function updateCollection(UpdateCollectionRequest $request, array $callOp
return $this->startApiCall('UpdateCollection', $request, $callOptions)->wait();
}

/**
* Updates the parameters of a single Index.
*
* The async variant is {@see VectorSearchServiceClient::updateIndexAsync()} .
*
* @example samples/V1/VectorSearchServiceClient/update_index.php
*
* @param UpdateIndexRequest $request A request to house fields associated with the call.
* @param array $callOptions {
* Optional.
*
* @type RetrySettings|array $retrySettings
* Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
* associative array of retry settings parameters. See the documentation on
* {@see RetrySettings} for example usage.
* }
*
* @return OperationResponse<Index>
*
* @throws ApiException Thrown if the API call fails.
*/
public function updateIndex(UpdateIndexRequest $request, array $callOptions = []): OperationResponse
{
return $this->startApiCall('UpdateIndex', $request, $callOptions)->wait();
}

/**
* Gets information about a location.
*
Expand Down Expand Up @@ -668,13 +718,22 @@ public function getLocation(GetLocationRequest $request, array $callOptions = []

/**
* Lists information about the supported locations for this service.
This method can be called in two ways:

* **List all public locations:** Use the path `GET /v1/locations`.
* **List project-visible locations:** Use the path
`GET /v1/projects/{project_id}/locations`. This may include public
locations as well as private or other locations specifically visible
to the project.
This method lists locations based on the resource scope provided in
the [ListLocationsRequest.name] field:

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

For gRPC and client library implementations, the resource name is
passed as the `name` field. For direct service calls, the resource
name is
incorporated into the request path based on the specific service
implementation and version.
*
* The async variant is {@see VectorSearchServiceClient::listLocationsAsync()} .
*
Expand Down
Loading
Loading