diff --git a/VectorSearch/metadata/V1/EncryptionSpec.php b/VectorSearch/metadata/V1/EncryptionSpec.php new file mode 100644 index 000000000000..af0cb82e4992 --- /dev/null +++ b/VectorSearch/metadata/V1/EncryptionSpec.php @@ -0,0 +1,26 @@ +internalAddGeneratedFile( + "\x0A\xA8\x04\x0A2google/cloud/vectorsearch/v1/encryption_spec.proto\x12\x1Cgoogle.cloud.vectorsearch.v1\x1A\x19google/api/resource.proto\"T\x0A\x0EEncryptionSpec\x12B\x0A\x0Fcrypto_key_name\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x0A!cloudkms.googleapis.com/CryptoKeyB\xDA\x02\x0A com.google.cloud.vectorsearch.v1B\x13EncryptionSpecProtoP\x01ZDcloud.google.com/go/vectorsearch/apiv1/vectorsearchpb;vectorsearchpb\xAA\x02\x1CGoogle.Cloud.VectorSearch.V1\xCA\x02\x1CGoogle\\Cloud\\VectorSearch\\V1\xEA\x02\x1FGoogle::Cloud::VectorSearch::V1\xEAAx\x0A!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/VectorSearch/metadata/V1/VectorsearchService.php b/VectorSearch/metadata/V1/VectorsearchService.php index cffa51fcfaa9..163e08d1aa1e 100644 --- a/VectorSearch/metadata/V1/VectorsearchService.php +++ b/VectorSearch/metadata/V1/VectorsearchService.php @@ -21,6 +21,7 @@ public static function initOnce() { \GPBMetadata\Google\Api\Resource::initOnce(); \GPBMetadata\Google\Cloud\Vectorsearch\V1\Common::initOnce(); \GPBMetadata\Google\Cloud\Vectorsearch\V1\EmbeddingConfig::initOnce(); + \GPBMetadata\Google\Cloud\Vectorsearch\V1\EncryptionSpec::initOnce(); \GPBMetadata\Google\Longrunning\Operations::initOnce(); \GPBMetadata\Google\Protobuf\GPBEmpty::initOnce(); \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); @@ -28,7 +29,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); \GPBMetadata\Google\Rpc\Status::initOnce(); $pool->internalAddGeneratedFile( - "\x0A\x99C\x0A7google/cloud/vectorsearch/v1/vectorsearch_service.proto\x12\x1Cgoogle.cloud.vectorsearch.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x1Bgoogle/api/field_info.proto\x1A\x19google/api/resource.proto\x1A)google/cloud/vectorsearch/v1/common.proto\x1A3google/cloud/vectorsearch/v1/embedding_config.proto\x1A#google/longrunning/operations.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\x1A\x1Cgoogle/protobuf/struct.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\x1A\x17google/rpc/status.proto\"\xAF\x05\x0A\x0ACollection\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x08\x12\x19\x0A\x0Cdisplay_name\x18\x08 \x01(\x09B\x03\xE0A\x01\x12\x18\x0A\x0Bdescription\x18\x09 \x01(\x09B\x03\xE0A\x01\x124\x0A\x0Bcreate_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12I\x0A\x06labels\x18\x04 \x03(\x0B24.google.cloud.vectorsearch.v1.Collection.LabelsEntryB\x03\xE0A\x01\x12V\x0A\x0Dvector_schema\x18\x07 \x03(\x0B2:.google.cloud.vectorsearch.v1.Collection.VectorSchemaEntryB\x03\xE0A\x01\x121\x0A\x0Bdata_schema\x18\x0A \x01(\x0B2\x17.google.protobuf.StructB\x03\xE0A\x01\x1A-\x0A\x0BLabelsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\x1A^\x0A\x11VectorSchemaEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x128\x0A\x05value\x18\x02 \x01(\x0B2).google.cloud.vectorsearch.v1.VectorField:\x028\x01:\x87\x01\xEAA\x83\x01\x0A&vectorsearch.googleapis.com/Collection\x12@projects/{project}/locations/{location}/collections/{collection}*\x0Bcollections2\x0Acollection\"\xB5\x01\x0A\x0BVectorField\x12F\x0A\x0Cdense_vector\x18\x03 \x01(\x0B2..google.cloud.vectorsearch.v1.DenseVectorFieldH\x00\x12H\x0A\x0Dsparse_vector\x18\x04 \x01(\x0B2/.google.cloud.vectorsearch.v1.SparseVectorFieldH\x00B\x14\x0A\x12vector_type_config\"\x81\x01\x0A\x10DenseVectorField\x12\x12\x0A\x0Adimensions\x18\x01 \x01(\x05\x12Y\x0A\x17vertex_embedding_config\x18\x03 \x01(\x0B23.google.cloud.vectorsearch.v1.VertexEmbeddingConfigB\x03\xE0A\x01\"\x13\x0A\x11SparseVectorField\"\xB5\x01\x0A\x16ListCollectionsRequest\x12>\x0A\x06parent\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x12&vectorsearch.googleapis.com/Collection\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x15\x0A\x08order_by\x18\x05 \x01(\x09B\x03\xE0A\x01\"\x8B\x01\x0A\x17ListCollectionsResponse\x12=\x0A\x0Bcollections\x18\x01 \x03(\x0B2(.google.cloud.vectorsearch.v1.Collection\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\x12\x18\x0A\x0Bunreachable\x18\x03 \x03(\x09B\x03\xE0A\x06\"T\x0A\x14GetCollectionRequest\x12<\x0A\x04name\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x0A&vectorsearch.googleapis.com/Collection\"\xD9\x01\x0A\x17CreateCollectionRequest\x12>\x0A\x06parent\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x12&vectorsearch.googleapis.com/Collection\x12\x1A\x0A\x0Dcollection_id\x18\x02 \x01(\x09B\x03\xE0A\x02\x12A\x0A\x0Acollection\x18\x03 \x01(\x0B2(.google.cloud.vectorsearch.v1.CollectionB\x03\xE0A\x02\x12\x1F\x0A\x0Arequest_id\x18\x04 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"\xB3\x01\x0A\x17UpdateCollectionRequest\x124\x0A\x0Bupdate_mask\x18\x01 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x01\x12A\x0A\x0Acollection\x18\x02 \x01(\x0B2(.google.cloud.vectorsearch.v1.CollectionB\x03\xE0A\x02\x12\x1F\x0A\x0Arequest_id\x18\x03 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"x\x0A\x17DeleteCollectionRequest\x12<\x0A\x04name\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x0A&vectorsearch.googleapis.com/Collection\x12\x1F\x0A\x0Arequest_id\x18\x02 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"\xA0\x06\x0A\x05Index\x12^\x0A\x18dedicated_infrastructure\x18\x0B \x01(\x0B25.google.cloud.vectorsearch.v1.DedicatedInfrastructureB\x03\xE0A\x01H\x00\x12I\x0A\x0Bdense_scann\x18\x0C \x01(\x0B2-.google.cloud.vectorsearch.v1.DenseScannIndexB\x03\xE0A\x01H\x01\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x08\x12\x19\x0A\x0Cdisplay_name\x18\x08 \x01(\x09B\x03\xE0A\x01\x12\x18\x0A\x0Bdescription\x18\x09 \x01(\x09B\x03\xE0A\x01\x12D\x0A\x06labels\x18\x0A \x03(\x0B2/.google.cloud.vectorsearch.v1.Index.LabelsEntryB\x03\xE0A\x01\x124\x0A\x0Bcreate_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12J\x0A\x0Fdistance_metric\x18\x04 \x01(\x0E2,.google.cloud.vectorsearch.v1.DistanceMetricB\x03\xE0A\x01\x12\x18\x0A\x0Bindex_field\x18\x05 \x01(\x09B\x03\xE0A\x02\x12\x1A\x0A\x0Dfilter_fields\x18\x06 \x03(\x09B\x03\xE0A\x01\x12\x19\x0A\x0Cstore_fields\x18\x07 \x03(\x09B\x03\xE0A\x01\x1A-\x0A\x0BLabelsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01:\x89\x01\xEAA\x85\x01\x0A!vectorsearch.googleapis.com/Index\x12Pprojects/{project}/locations/{location}/collections/{collection}/indexes/{index}*\x07indexes2\x05indexB\x0C\x0A\x0Ainfra_typeB\x0C\x0A\x0Aindex_type\"\xC5\x01\x0A\x12CreateIndexRequest\x12>\x0A\x06parent\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x0A&vectorsearch.googleapis.com/Collection\x12\x15\x0A\x08index_id\x18\x02 \x01(\x09B\x03\xE0A\x02\x127\x0A\x05index\x18\x03 \x01(\x0B2#.google.cloud.vectorsearch.v1.IndexB\x03\xE0A\x02\x12\x1F\x0A\x0Arequest_id\x18\x04 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"n\x0A\x12DeleteIndexRequest\x127\x0A\x04name\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x0A!vectorsearch.googleapis.com/Index\x12\x1F\x0A\x0Arequest_id\x18\x02 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"\xAC\x01\x0A\x12ListIndexesRequest\x129\x0A\x06parent\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x12!vectorsearch.googleapis.com/Index\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x15\x0A\x08order_by\x18\x05 \x01(\x09B\x03\xE0A\x01\"d\x0A\x13ListIndexesResponse\x124\x0A\x07indexes\x18\x01 \x03(\x0B2#.google.cloud.vectorsearch.v1.Index\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"J\x0A\x0FGetIndexRequest\x127\x0A\x04name\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x0A!vectorsearch.googleapis.com/Index\"\x80\x02\x0A\x11OperationMetadata\x124\x0A\x0Bcreate_time\x18\x01 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x121\x0A\x08end_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12\x13\x0A\x06target\x18\x03 \x01(\x09B\x03\xE0A\x03\x12\x11\x0A\x04verb\x18\x04 \x01(\x09B\x03\xE0A\x03\x12\x1B\x0A\x0Estatus_message\x18\x05 \x01(\x09B\x03\xE0A\x03\x12#\x0A\x16requested_cancellation\x18\x06 \x01(\x08B\x03\xE0A\x03\x12\x18\x0A\x0Bapi_version\x18\x07 \x01(\x09B\x03\xE0A\x03\"\x9F\x02\x0A\x18ImportDataObjectsRequest\x12\\\x0A\x0Agcs_import\x18\x02 \x01(\x0B2F.google.cloud.vectorsearch.v1.ImportDataObjectsRequest.GcsImportConfigH\x00\x12<\x0A\x04name\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x0A&vectorsearch.googleapis.com/Collection\x1A]\x0A\x0FGcsImportConfig\x12\x19\x0A\x0Ccontents_uri\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x16\x0A\x09error_uri\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\x17\x0A\x0Aoutput_uri\x18\x03 \x01(\x09B\x03\xE0A\x01B\x08\x0A\x06config\"\xBF\x01\x0A\x19ImportDataObjectsMetadata\x124\x0A\x0Bcreate_time\x18\x01 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12\x1A\x0A\x0Dsuccess_count\x18\x03 \x01(\x03B\x03\xE0A\x03\x12\x1A\x0A\x0Dfailure_count\x18\x04 \x01(\x03B\x03\xE0A\x03\"?\x0A\x19ImportDataObjectsResponse\x12\"\x0A\x06status\x18\x01 \x01(\x0B2\x12.google.rpc.Status\"\x97\x03\x0A\x18ExportDataObjectsRequest\x12f\x0A\x0Fgcs_destination\x18\x02 \x01(\x0B2K.google.cloud.vectorsearch.v1.ExportDataObjectsRequest.GcsExportDestinationH\x00\x12<\x0A\x04name\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x0A&vectorsearch.googleapis.com/Collection\x1A\xC5\x01\x0A\x14GcsExportDestination\x12\x17\x0A\x0Aexport_uri\x18\x01 \x01(\x09B\x03\xE0A\x02\x12g\x0A\x06format\x18\x02 \x01(\x0E2R.google.cloud.vectorsearch.v1.ExportDataObjectsRequest.GcsExportDestination.FormatB\x03\xE0A\x02\"+\x0A\x06Format\x12\x16\x0A\x12FORMAT_UNSPECIFIED\x10\x00\x12\x09\x0A\x05JSONL\x10\x02B\x0D\x0A\x0Bdestination\"\x87\x01\x0A\x19ExportDataObjectsMetadata\x124\x0A\x0Bcreate_time\x18\x01 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bfinish_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\"\x1B\x0A\x19ExportDataObjectsResponse\"\xFF\x02\x0A\x17DedicatedInfrastructure\x12R\x0A\x04mode\x18\x01 \x01(\x0E2:.google.cloud.vectorsearch.v1.DedicatedInfrastructure.ModeB\x03\xE0A\x01H\x00\x88\x01\x01\x12d\x0A\x10autoscaling_spec\x18\x02 \x01(\x0B2E.google.cloud.vectorsearch.v1.DedicatedInfrastructure.AutoscalingSpecB\x03\xE0A\x01\x1AQ\x0A\x0FAutoscalingSpec\x12\x1E\x0A\x11min_replica_count\x18\x01 \x01(\x05B\x03\xE0A\x01\x12\x1E\x0A\x11max_replica_count\x18\x02 \x01(\x05B\x03\xE0A\x01\"N\x0A\x04Mode\x12\x14\x0A\x10MODE_UNSPECIFIED\x10\x00\x12\x15\x0A\x11STORAGE_OPTIMIZED\x10\x01\x12\x19\x0A\x15PERFORMANCE_OPTIMIZED\x10\x02B\x07\x0A\x05_mode\"\xC2\x01\x0A\x0FDenseScannIndex\x12]\x0A\x11feature_norm_type\x18\x02 \x01(\x0E2=.google.cloud.vectorsearch.v1.DenseScannIndex.FeatureNormTypeB\x03\xE0A\x01\"P\x0A\x0FFeatureNormType\x12!\x0A\x1DFEATURE_NORM_TYPE_UNSPECIFIED\x10\x00\x12\x08\x0A\x04NONE\x10\x01\x12\x10\x0A\x0CUNIT_L2_NORM\x10\x022\xAB\x13\x0A\x13VectorSearchService\x12\xC0\x01\x0A\x0FListCollections\x124.google.cloud.vectorsearch.v1.ListCollectionsRequest\x1A5.google.cloud.vectorsearch.v1.ListCollectionsResponse\"@\xDAA\x06parent\x82\xD3\xE4\x93\x021\x12//v1/{parent=projects/*/locations/*}/collections\x12\xAD\x01\x0A\x0DGetCollection\x122.google.cloud.vectorsearch.v1.GetCollectionRequest\x1A(.google.cloud.vectorsearch.v1.Collection\">\xDAA\x04name\x82\xD3\xE4\x93\x021\x12//v1/{name=projects/*/locations/*/collections/*}\x12\xF2\x01\x0A\x10CreateCollection\x125.google.cloud.vectorsearch.v1.CreateCollectionRequest\x1A\x1D.google.longrunning.Operation\"\x87\x01\xCAA\x1F\x0A\x0ACollection\x12\x11OperationMetadata\xDAA\x1Fparent,collection,collection_id\x82\xD3\xE4\x93\x02=\"//v1/{parent=projects/*/locations/*}/collections:\x0Acollection\x12\xF4\x01\x0A\x10UpdateCollection\x125.google.cloud.vectorsearch.v1.UpdateCollectionRequest\x1A\x1D.google.longrunning.Operation\"\x89\x01\xCAA\x1F\x0A\x0ACollection\x12\x11OperationMetadata\xDAA\x16collection,update_mask\x82\xD3\xE4\x93\x02H2:/v1/{collection.name=projects/*/locations/*/collections/*}:\x0Acollection\x12\xD5\x01\x0A\x10DeleteCollection\x125.google.cloud.vectorsearch.v1.DeleteCollectionRequest\x1A\x1D.google.longrunning.Operation\"k\xCAA*\x0A\x15google.protobuf.Empty\x12\x11OperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x021*//v1/{name=projects/*/locations/*/collections/*}\x12\xBE\x01\x0A\x0BListIndexes\x120.google.cloud.vectorsearch.v1.ListIndexesRequest\x1A1.google.cloud.vectorsearch.v1.ListIndexesResponse\"J\xDAA\x06parent\x82\xD3\xE4\x93\x02;\x129/v1/{parent=projects/*/locations/*/collections/*}/indexes\x12\xA8\x01\x0A\x08GetIndex\x12-.google.cloud.vectorsearch.v1.GetIndexRequest\x1A#.google.cloud.vectorsearch.v1.Index\"H\xDAA\x04name\x82\xD3\xE4\x93\x02;\x129/v1/{name=projects/*/locations/*/collections/*/indexes/*}\x12\xDD\x01\x0A\x0BCreateIndex\x120.google.cloud.vectorsearch.v1.CreateIndexRequest\x1A\x1D.google.longrunning.Operation\"}\xCAA\x1A\x0A\x05Index\x12\x11OperationMetadata\xDAA\x15parent,index,index_id\x82\xD3\xE4\x93\x02B\"9/v1/{parent=projects/*/locations/*/collections/*}/indexes:\x05index\x12\xD5\x01\x0A\x0BDeleteIndex\x120.google.cloud.vectorsearch.v1.DeleteIndexRequest\x1A\x1D.google.longrunning.Operation\"u\xCAA*\x0A\x15google.protobuf.Empty\x12\x11OperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x02;*9/v1/{name=projects/*/locations/*/collections/*/indexes/*}\x12\xF2\x01\x0A\x11ImportDataObjects\x126.google.cloud.vectorsearch.v1.ImportDataObjectsRequest\x1A\x1D.google.longrunning.Operation\"\x85\x01\xCAA6\x0A\x19ImportDataObjectsResponse\x12\x19ImportDataObjectsMetadata\x82\xD3\xE4\x93\x02F\"A/v1/{name=projects/*/locations/*/collections/*}:importDataObjects:\x01*\x12\xF2\x01\x0A\x11ExportDataObjects\x126.google.cloud.vectorsearch.v1.ExportDataObjectsRequest\x1A\x1D.google.longrunning.Operation\"\x85\x01\xCAA6\x0A\x19ExportDataObjectsResponse\x12\x19ExportDataObjectsMetadata\x82\xD3\xE4\x93\x02F\"A/v1/{name=projects/*/locations/*/collections/*}:exportDataObjects:\x01*\x1AO\xCAA\x1Bvectorsearch.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xE4\x01\x0A com.google.cloud.vectorsearch.v1B\x18VectorSearchServiceProtoP\x01ZDcloud.google.com/go/vectorsearch/apiv1/vectorsearchpb;vectorsearchpb\xAA\x02\x1CGoogle.Cloud.VectorSearch.V1\xCA\x02\x1CGoogle\\Cloud\\VectorSearch\\V1\xEA\x02\x1FGoogle::Cloud::VectorSearch::V1b\x06proto3" + "\x0A\xA5G\x0A7google/cloud/vectorsearch/v1/vectorsearch_service.proto\x12\x1Cgoogle.cloud.vectorsearch.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x1Bgoogle/api/field_info.proto\x1A\x19google/api/resource.proto\x1A)google/cloud/vectorsearch/v1/common.proto\x1A3google/cloud/vectorsearch/v1/embedding_config.proto\x1A2google/cloud/vectorsearch/v1/encryption_spec.proto\x1A#google/longrunning/operations.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\x1A\x1Cgoogle/protobuf/struct.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\x1A\x17google/rpc/status.proto\"\xFE\x05\x0A\x0ACollection\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x08\x12\x19\x0A\x0Cdisplay_name\x18\x08 \x01(\x09B\x03\xE0A\x01\x12\x18\x0A\x0Bdescription\x18\x09 \x01(\x09B\x03\xE0A\x01\x124\x0A\x0Bcreate_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12I\x0A\x06labels\x18\x04 \x03(\x0B24.google.cloud.vectorsearch.v1.Collection.LabelsEntryB\x03\xE0A\x01\x12V\x0A\x0Dvector_schema\x18\x07 \x03(\x0B2:.google.cloud.vectorsearch.v1.Collection.VectorSchemaEntryB\x03\xE0A\x01\x121\x0A\x0Bdata_schema\x18\x0A \x01(\x0B2\x17.google.protobuf.StructB\x03\xE0A\x01\x12M\x0A\x0Fencryption_spec\x18\x0B \x01(\x0B2,.google.cloud.vectorsearch.v1.EncryptionSpecB\x06\xE0A\x05\xE0A\x01\x1A-\x0A\x0BLabelsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\x1A^\x0A\x11VectorSchemaEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x128\x0A\x05value\x18\x02 \x01(\x0B2).google.cloud.vectorsearch.v1.VectorField:\x028\x01:\x87\x01\xEAA\x83\x01\x0A&vectorsearch.googleapis.com/Collection\x12@projects/{project}/locations/{location}/collections/{collection}*\x0Bcollections2\x0Acollection\"\xB5\x01\x0A\x0BVectorField\x12F\x0A\x0Cdense_vector\x18\x03 \x01(\x0B2..google.cloud.vectorsearch.v1.DenseVectorFieldH\x00\x12H\x0A\x0Dsparse_vector\x18\x04 \x01(\x0B2/.google.cloud.vectorsearch.v1.SparseVectorFieldH\x00B\x14\x0A\x12vector_type_config\"\x81\x01\x0A\x10DenseVectorField\x12\x12\x0A\x0Adimensions\x18\x01 \x01(\x05\x12Y\x0A\x17vertex_embedding_config\x18\x03 \x01(\x0B23.google.cloud.vectorsearch.v1.VertexEmbeddingConfigB\x03\xE0A\x01\"\x13\x0A\x11SparseVectorField\"\xB5\x01\x0A\x16ListCollectionsRequest\x12>\x0A\x06parent\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x12&vectorsearch.googleapis.com/Collection\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x15\x0A\x08order_by\x18\x05 \x01(\x09B\x03\xE0A\x01\"\x8B\x01\x0A\x17ListCollectionsResponse\x12=\x0A\x0Bcollections\x18\x01 \x03(\x0B2(.google.cloud.vectorsearch.v1.Collection\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\x12\x18\x0A\x0Bunreachable\x18\x03 \x03(\x09B\x03\xE0A\x06\"T\x0A\x14GetCollectionRequest\x12<\x0A\x04name\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x0A&vectorsearch.googleapis.com/Collection\"\xD9\x01\x0A\x17CreateCollectionRequest\x12>\x0A\x06parent\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x12&vectorsearch.googleapis.com/Collection\x12\x1A\x0A\x0Dcollection_id\x18\x02 \x01(\x09B\x03\xE0A\x02\x12A\x0A\x0Acollection\x18\x03 \x01(\x0B2(.google.cloud.vectorsearch.v1.CollectionB\x03\xE0A\x02\x12\x1F\x0A\x0Arequest_id\x18\x04 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"\xB3\x01\x0A\x17UpdateCollectionRequest\x124\x0A\x0Bupdate_mask\x18\x01 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x01\x12A\x0A\x0Acollection\x18\x02 \x01(\x0B2(.google.cloud.vectorsearch.v1.CollectionB\x03\xE0A\x02\x12\x1F\x0A\x0Arequest_id\x18\x03 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"x\x0A\x17DeleteCollectionRequest\x12<\x0A\x04name\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x0A&vectorsearch.googleapis.com/Collection\x12\x1F\x0A\x0Arequest_id\x18\x02 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"\xA0\x06\x0A\x05Index\x12^\x0A\x18dedicated_infrastructure\x18\x0B \x01(\x0B25.google.cloud.vectorsearch.v1.DedicatedInfrastructureB\x03\xE0A\x01H\x00\x12I\x0A\x0Bdense_scann\x18\x0C \x01(\x0B2-.google.cloud.vectorsearch.v1.DenseScannIndexB\x03\xE0A\x01H\x01\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x08\x12\x19\x0A\x0Cdisplay_name\x18\x08 \x01(\x09B\x03\xE0A\x01\x12\x18\x0A\x0Bdescription\x18\x09 \x01(\x09B\x03\xE0A\x01\x12D\x0A\x06labels\x18\x0A \x03(\x0B2/.google.cloud.vectorsearch.v1.Index.LabelsEntryB\x03\xE0A\x01\x124\x0A\x0Bcreate_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12J\x0A\x0Fdistance_metric\x18\x04 \x01(\x0E2,.google.cloud.vectorsearch.v1.DistanceMetricB\x03\xE0A\x01\x12\x18\x0A\x0Bindex_field\x18\x05 \x01(\x09B\x03\xE0A\x02\x12\x1A\x0A\x0Dfilter_fields\x18\x06 \x03(\x09B\x03\xE0A\x01\x12\x19\x0A\x0Cstore_fields\x18\x07 \x03(\x09B\x03\xE0A\x01\x1A-\x0A\x0BLabelsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01:\x89\x01\xEAA\x85\x01\x0A!vectorsearch.googleapis.com/Index\x12Pprojects/{project}/locations/{location}/collections/{collection}/indexes/{index}*\x07indexes2\x05indexB\x0C\x0A\x0Ainfra_typeB\x0C\x0A\x0Aindex_type\"\xC5\x01\x0A\x12CreateIndexRequest\x12>\x0A\x06parent\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x0A&vectorsearch.googleapis.com/Collection\x12\x15\x0A\x08index_id\x18\x02 \x01(\x09B\x03\xE0A\x02\x127\x0A\x05index\x18\x03 \x01(\x0B2#.google.cloud.vectorsearch.v1.IndexB\x03\xE0A\x02\x12\x1F\x0A\x0Arequest_id\x18\x04 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"\xA4\x01\x0A\x12UpdateIndexRequest\x127\x0A\x05index\x18\x01 \x01(\x0B2#.google.cloud.vectorsearch.v1.IndexB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x01\x12\x1F\x0A\x0Arequest_id\x18\x03 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"n\x0A\x12DeleteIndexRequest\x127\x0A\x04name\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x0A!vectorsearch.googleapis.com/Index\x12\x1F\x0A\x0Arequest_id\x18\x02 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"\xAC\x01\x0A\x12ListIndexesRequest\x129\x0A\x06parent\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x12!vectorsearch.googleapis.com/Index\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x15\x0A\x08order_by\x18\x05 \x01(\x09B\x03\xE0A\x01\"d\x0A\x13ListIndexesResponse\x124\x0A\x07indexes\x18\x01 \x03(\x0B2#.google.cloud.vectorsearch.v1.Index\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"J\x0A\x0FGetIndexRequest\x127\x0A\x04name\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x0A!vectorsearch.googleapis.com/Index\"\x80\x02\x0A\x11OperationMetadata\x124\x0A\x0Bcreate_time\x18\x01 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x121\x0A\x08end_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12\x13\x0A\x06target\x18\x03 \x01(\x09B\x03\xE0A\x03\x12\x11\x0A\x04verb\x18\x04 \x01(\x09B\x03\xE0A\x03\x12\x1B\x0A\x0Estatus_message\x18\x05 \x01(\x09B\x03\xE0A\x03\x12#\x0A\x16requested_cancellation\x18\x06 \x01(\x08B\x03\xE0A\x03\x12\x18\x0A\x0Bapi_version\x18\x07 \x01(\x09B\x03\xE0A\x03\"\x9F\x02\x0A\x18ImportDataObjectsRequest\x12\\\x0A\x0Agcs_import\x18\x02 \x01(\x0B2F.google.cloud.vectorsearch.v1.ImportDataObjectsRequest.GcsImportConfigH\x00\x12<\x0A\x04name\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x0A&vectorsearch.googleapis.com/Collection\x1A]\x0A\x0FGcsImportConfig\x12\x19\x0A\x0Ccontents_uri\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x16\x0A\x09error_uri\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\x17\x0A\x0Aoutput_uri\x18\x03 \x01(\x09B\x03\xE0A\x01B\x08\x0A\x06config\"\xBF\x01\x0A\x19ImportDataObjectsMetadata\x124\x0A\x0Bcreate_time\x18\x01 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12\x1A\x0A\x0Dsuccess_count\x18\x03 \x01(\x03B\x03\xE0A\x03\x12\x1A\x0A\x0Dfailure_count\x18\x04 \x01(\x03B\x03\xE0A\x03\"?\x0A\x19ImportDataObjectsResponse\x12\"\x0A\x06status\x18\x01 \x01(\x0B2\x12.google.rpc.Status\"\x97\x03\x0A\x18ExportDataObjectsRequest\x12f\x0A\x0Fgcs_destination\x18\x02 \x01(\x0B2K.google.cloud.vectorsearch.v1.ExportDataObjectsRequest.GcsExportDestinationH\x00\x12<\x0A\x04name\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x0A&vectorsearch.googleapis.com/Collection\x1A\xC5\x01\x0A\x14GcsExportDestination\x12\x17\x0A\x0Aexport_uri\x18\x01 \x01(\x09B\x03\xE0A\x02\x12g\x0A\x06format\x18\x02 \x01(\x0E2R.google.cloud.vectorsearch.v1.ExportDataObjectsRequest.GcsExportDestination.FormatB\x03\xE0A\x02\"+\x0A\x06Format\x12\x16\x0A\x12FORMAT_UNSPECIFIED\x10\x00\x12\x09\x0A\x05JSONL\x10\x02B\x0D\x0A\x0Bdestination\"\x87\x01\x0A\x19ExportDataObjectsMetadata\x124\x0A\x0Bcreate_time\x18\x01 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bfinish_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\"\x1B\x0A\x19ExportDataObjectsResponse\"\xFF\x02\x0A\x17DedicatedInfrastructure\x12R\x0A\x04mode\x18\x01 \x01(\x0E2:.google.cloud.vectorsearch.v1.DedicatedInfrastructure.ModeB\x03\xE0A\x01H\x00\x88\x01\x01\x12d\x0A\x10autoscaling_spec\x18\x02 \x01(\x0B2E.google.cloud.vectorsearch.v1.DedicatedInfrastructure.AutoscalingSpecB\x03\xE0A\x01\x1AQ\x0A\x0FAutoscalingSpec\x12\x1E\x0A\x11min_replica_count\x18\x01 \x01(\x05B\x03\xE0A\x01\x12\x1E\x0A\x11max_replica_count\x18\x02 \x01(\x05B\x03\xE0A\x01\"N\x0A\x04Mode\x12\x14\x0A\x10MODE_UNSPECIFIED\x10\x00\x12\x15\x0A\x11STORAGE_OPTIMIZED\x10\x01\x12\x19\x0A\x15PERFORMANCE_OPTIMIZED\x10\x02B\x07\x0A\x05_mode\"\xC2\x01\x0A\x0FDenseScannIndex\x12]\x0A\x11feature_norm_type\x18\x02 \x01(\x0E2=.google.cloud.vectorsearch.v1.DenseScannIndex.FeatureNormTypeB\x03\xE0A\x01\"P\x0A\x0FFeatureNormType\x12!\x0A\x1DFEATURE_NORM_TYPE_UNSPECIFIED\x10\x00\x12\x08\x0A\x04NONE\x10\x01\x12\x10\x0A\x0CUNIT_L2_NORM\x10\x022\x8D\x15\x0A\x13VectorSearchService\x12\xC0\x01\x0A\x0FListCollections\x124.google.cloud.vectorsearch.v1.ListCollectionsRequest\x1A5.google.cloud.vectorsearch.v1.ListCollectionsResponse\"@\xDAA\x06parent\x82\xD3\xE4\x93\x021\x12//v1/{parent=projects/*/locations/*}/collections\x12\xAD\x01\x0A\x0DGetCollection\x122.google.cloud.vectorsearch.v1.GetCollectionRequest\x1A(.google.cloud.vectorsearch.v1.Collection\">\xDAA\x04name\x82\xD3\xE4\x93\x021\x12//v1/{name=projects/*/locations/*/collections/*}\x12\xF2\x01\x0A\x10CreateCollection\x125.google.cloud.vectorsearch.v1.CreateCollectionRequest\x1A\x1D.google.longrunning.Operation\"\x87\x01\xCAA\x1F\x0A\x0ACollection\x12\x11OperationMetadata\xDAA\x1Fparent,collection,collection_id\x82\xD3\xE4\x93\x02=\"//v1/{parent=projects/*/locations/*}/collections:\x0Acollection\x12\xF4\x01\x0A\x10UpdateCollection\x125.google.cloud.vectorsearch.v1.UpdateCollectionRequest\x1A\x1D.google.longrunning.Operation\"\x89\x01\xCAA\x1F\x0A\x0ACollection\x12\x11OperationMetadata\xDAA\x16collection,update_mask\x82\xD3\xE4\x93\x02H2:/v1/{collection.name=projects/*/locations/*/collections/*}:\x0Acollection\x12\xD5\x01\x0A\x10DeleteCollection\x125.google.cloud.vectorsearch.v1.DeleteCollectionRequest\x1A\x1D.google.longrunning.Operation\"k\xCAA*\x0A\x15google.protobuf.Empty\x12\x11OperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x021*//v1/{name=projects/*/locations/*/collections/*}\x12\xBE\x01\x0A\x0BListIndexes\x120.google.cloud.vectorsearch.v1.ListIndexesRequest\x1A1.google.cloud.vectorsearch.v1.ListIndexesResponse\"J\xDAA\x06parent\x82\xD3\xE4\x93\x02;\x129/v1/{parent=projects/*/locations/*/collections/*}/indexes\x12\xA8\x01\x0A\x08GetIndex\x12-.google.cloud.vectorsearch.v1.GetIndexRequest\x1A#.google.cloud.vectorsearch.v1.Index\"H\xDAA\x04name\x82\xD3\xE4\x93\x02;\x129/v1/{name=projects/*/locations/*/collections/*/indexes/*}\x12\xDD\x01\x0A\x0BCreateIndex\x120.google.cloud.vectorsearch.v1.CreateIndexRequest\x1A\x1D.google.longrunning.Operation\"}\xCAA\x1A\x0A\x05Index\x12\x11OperationMetadata\xDAA\x15parent,index,index_id\x82\xD3\xE4\x93\x02B\"9/v1/{parent=projects/*/locations/*/collections/*}/indexes:\x05index\x12\xDF\x01\x0A\x0BUpdateIndex\x120.google.cloud.vectorsearch.v1.UpdateIndexRequest\x1A\x1D.google.longrunning.Operation\"\x7F\xCAA\x1A\x0A\x05Index\x12\x11OperationMetadata\xDAA\x11index,update_mask\x82\xD3\xE4\x93\x02H2?/v1/{index.name=projects/*/locations/*/collections/*/indexes/*}:\x05index\x12\xD5\x01\x0A\x0BDeleteIndex\x120.google.cloud.vectorsearch.v1.DeleteIndexRequest\x1A\x1D.google.longrunning.Operation\"u\xCAA*\x0A\x15google.protobuf.Empty\x12\x11OperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x02;*9/v1/{name=projects/*/locations/*/collections/*/indexes/*}\x12\xF2\x01\x0A\x11ImportDataObjects\x126.google.cloud.vectorsearch.v1.ImportDataObjectsRequest\x1A\x1D.google.longrunning.Operation\"\x85\x01\xCAA6\x0A\x19ImportDataObjectsResponse\x12\x19ImportDataObjectsMetadata\x82\xD3\xE4\x93\x02F\"A/v1/{name=projects/*/locations/*/collections/*}:importDataObjects:\x01*\x12\xF2\x01\x0A\x11ExportDataObjects\x126.google.cloud.vectorsearch.v1.ExportDataObjectsRequest\x1A\x1D.google.longrunning.Operation\"\x85\x01\xCAA6\x0A\x19ExportDataObjectsResponse\x12\x19ExportDataObjectsMetadata\x82\xD3\xE4\x93\x02F\"A/v1/{name=projects/*/locations/*/collections/*}:exportDataObjects:\x01*\x1AO\xCAA\x1Bvectorsearch.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xE4\x01\x0A com.google.cloud.vectorsearch.v1B\x18VectorSearchServiceProtoP\x01ZDcloud.google.com/go/vectorsearch/apiv1/vectorsearchpb;vectorsearchpb\xAA\x02\x1CGoogle.Cloud.VectorSearch.V1\xCA\x02\x1CGoogle\\Cloud\\VectorSearch\\V1\xEA\x02\x1FGoogle::Cloud::VectorSearch::V1b\x06proto3" , true); static::$is_initialized = true; diff --git a/VectorSearch/samples/V1/DataObjectSearchServiceClient/list_locations.php b/VectorSearch/samples/V1/DataObjectSearchServiceClient/list_locations.php index 3cbda8122f71..37706aa0e667 100644 --- a/VectorSearch/samples/V1/DataObjectSearchServiceClient/list_locations.php +++ b/VectorSearch/samples/V1/DataObjectSearchServiceClient/list_locations.php @@ -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: diff --git a/VectorSearch/samples/V1/DataObjectServiceClient/list_locations.php b/VectorSearch/samples/V1/DataObjectServiceClient/list_locations.php index df6a8138cd7f..9af82c4d0882 100644 --- a/VectorSearch/samples/V1/DataObjectServiceClient/list_locations.php +++ b/VectorSearch/samples/V1/DataObjectServiceClient/list_locations.php @@ -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: diff --git a/VectorSearch/samples/V1/VectorSearchServiceClient/list_locations.php b/VectorSearch/samples/V1/VectorSearchServiceClient/list_locations.php index 03b13fe77816..6a4b493270e4 100644 --- a/VectorSearch/samples/V1/VectorSearchServiceClient/list_locations.php +++ b/VectorSearch/samples/V1/VectorSearchServiceClient/list_locations.php @@ -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: diff --git a/VectorSearch/samples/V1/VectorSearchServiceClient/update_index.php b/VectorSearch/samples/V1/VectorSearchServiceClient/update_index.php new file mode 100644 index 000000000000..91bbca2bab09 --- /dev/null +++ b/VectorSearch/samples/V1/VectorSearchServiceClient/update_index.php @@ -0,0 +1,84 @@ +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] diff --git a/VectorSearch/src/V1/Client/DataObjectSearchServiceClient.php b/VectorSearch/src/V1/Client/DataObjectSearchServiceClient.php index c3ce8ab5cb4e..9bfe20796f91 100644 --- a/VectorSearch/src/V1/Client/DataObjectSearchServiceClient.php +++ b/VectorSearch/src/V1/Client/DataObjectSearchServiceClient.php @@ -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()} * . diff --git a/VectorSearch/src/V1/Client/DataObjectServiceClient.php b/VectorSearch/src/V1/Client/DataObjectServiceClient.php index a4c54240ca89..c7c7b92003b3 100644 --- a/VectorSearch/src/V1/Client/DataObjectServiceClient.php +++ b/VectorSearch/src/V1/Client/DataObjectServiceClient.php @@ -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()} . * diff --git a/VectorSearch/src/V1/Client/VectorSearchServiceClient.php b/VectorSearch/src/V1/Client/VectorSearchServiceClient.php index 524d07ff44bd..56b7b5cdf47a 100644 --- a/VectorSearch/src/V1/Client/VectorSearchServiceClient.php +++ b/VectorSearch/src/V1/Client/VectorSearchServiceClient.php @@ -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; @@ -84,6 +85,7 @@ * @method PromiseInterface listCollectionsAsync(ListCollectionsRequest $request, array $optionalArgs = []) * @method PromiseInterface listIndexesAsync(ListIndexesRequest $request, array $optionalArgs = []) * @method PromiseInterface updateCollectionAsync(UpdateCollectionRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateIndexAsync(UpdateIndexRequest $request, array $optionalArgs = []) * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) */ @@ -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. @@ -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} * @@ -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 + * + * @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. * @@ -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()} . * diff --git a/VectorSearch/src/V1/Collection.php b/VectorSearch/src/V1/Collection.php index 326b681fa417..da1eeca2f43f 100644 --- a/VectorSearch/src/V1/Collection.php +++ b/VectorSearch/src/V1/Collection.php @@ -63,10 +63,20 @@ class Collection extends \Google\Protobuf\Internal\Message * Optional. JSON Schema for data. * Field names must contain only alphanumeric characters, * underscores, and hyphens. + * The schema must be compliant with + * [JSON Schema Draft 7](https://json-schema.org/draft-07/schema). * * Generated from protobuf field .google.protobuf.Struct data_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; */ protected $data_schema = null; + /** + * Optional. Immutable. Specifies the customer-managed encryption key spec for + * a Collection. If set, this Collection and all sub-resources of this + * Collection will be secured by this key. + * + * Generated from protobuf field .google.cloud.vectorsearch.v1.EncryptionSpec encryption_spec = 11 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption_spec = null; /** * Constructor. @@ -94,6 +104,12 @@ class Collection extends \Google\Protobuf\Internal\Message * Optional. JSON Schema for data. * Field names must contain only alphanumeric characters, * underscores, and hyphens. + * The schema must be compliant with + * [JSON Schema Draft 7](https://json-schema.org/draft-07/schema). + * @type \Google\Cloud\VectorSearch\V1\EncryptionSpec $encryption_spec + * Optional. Immutable. Specifies the customer-managed encryption key spec for + * a Collection. If set, this Collection and all sub-resources of this + * Collection will be secured by this key. * } */ public function __construct($data = NULL) { @@ -311,6 +327,8 @@ public function setVectorSchema($var) * Optional. JSON Schema for data. * Field names must contain only alphanumeric characters, * underscores, and hyphens. + * The schema must be compliant with + * [JSON Schema Draft 7](https://json-schema.org/draft-07/schema). * * Generated from protobuf field .google.protobuf.Struct data_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Protobuf\Struct|null @@ -334,6 +352,8 @@ public function clearDataSchema() * Optional. JSON Schema for data. * Field names must contain only alphanumeric characters, * underscores, and hyphens. + * The schema must be compliant with + * [JSON Schema Draft 7](https://json-schema.org/draft-07/schema). * * Generated from protobuf field .google.protobuf.Struct data_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Protobuf\Struct $var @@ -347,5 +367,45 @@ public function setDataSchema($var) return $this; } + /** + * Optional. Immutable. Specifies the customer-managed encryption key spec for + * a Collection. If set, this Collection and all sub-resources of this + * Collection will be secured by this key. + * + * Generated from protobuf field .google.cloud.vectorsearch.v1.EncryptionSpec encryption_spec = 11 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\VectorSearch\V1\EncryptionSpec|null + */ + public function getEncryptionSpec() + { + return $this->encryption_spec; + } + + public function hasEncryptionSpec() + { + return isset($this->encryption_spec); + } + + public function clearEncryptionSpec() + { + unset($this->encryption_spec); + } + + /** + * Optional. Immutable. Specifies the customer-managed encryption key spec for + * a Collection. If set, this Collection and all sub-resources of this + * Collection will be secured by this key. + * + * Generated from protobuf field .google.cloud.vectorsearch.v1.EncryptionSpec encryption_spec = 11 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\VectorSearch\V1\EncryptionSpec $var + * @return $this + */ + public function setEncryptionSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VectorSearch\V1\EncryptionSpec::class); + $this->encryption_spec = $var; + + return $this; + } + } diff --git a/VectorSearch/src/V1/EncryptionSpec.php b/VectorSearch/src/V1/EncryptionSpec.php new file mode 100644 index 000000000000..82c9f1b9b187 --- /dev/null +++ b/VectorSearch/src/V1/EncryptionSpec.php @@ -0,0 +1,80 @@ +google.cloud.vectorsearch.v1.EncryptionSpec + */ +class EncryptionSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the Cloud KMS key used to protect the resource. + * The Cloud KMS key must be in the same region as the resource. It must have + * the format + * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + * + * Generated from protobuf field string crypto_key_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $crypto_key_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $crypto_key_name + * Required. Resource name of the Cloud KMS key used to protect the resource. + * The Cloud KMS key must be in the same region as the resource. It must have + * the format + * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vectorsearch\V1\EncryptionSpec::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the Cloud KMS key used to protect the resource. + * The Cloud KMS key must be in the same region as the resource. It must have + * the format + * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + * + * Generated from protobuf field string crypto_key_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getCryptoKeyName() + { + return $this->crypto_key_name; + } + + /** + * Required. Resource name of the Cloud KMS key used to protect the resource. + * The Cloud KMS key must be in the same region as the resource. It must have + * the format + * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + * + * Generated from protobuf field string crypto_key_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCryptoKeyName($var) + { + GPBUtil::checkString($var, True); + $this->crypto_key_name = $var; + + return $this; + } + +} + diff --git a/VectorSearch/src/V1/UpdateIndexRequest.php b/VectorSearch/src/V1/UpdateIndexRequest.php new file mode 100644 index 000000000000..5591f43847a6 --- /dev/null +++ b/VectorSearch/src/V1/UpdateIndexRequest.php @@ -0,0 +1,272 @@ +google.cloud.vectorsearch.v1.UpdateIndexRequest + */ +class UpdateIndexRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource being updated. + * + * Generated from protobuf field .google.cloud.vectorsearch.v1.Index index = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $index = null; + /** + * 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. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\VectorSearch\V1\Index $index Required. The resource being updated. + * @param \Google\Protobuf\FieldMask $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. + * + * @return \Google\Cloud\VectorSearch\V1\UpdateIndexRequest + * + * @experimental + */ + public static function build(\Google\Cloud\VectorSearch\V1\Index $index, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setIndex($index) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VectorSearch\V1\Index $index + * Required. The resource being updated. + * @type \Google\Protobuf\FieldMask $update_mask + * 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. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vectorsearch\V1\VectorsearchService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource being updated. + * + * Generated from protobuf field .google.cloud.vectorsearch.v1.Index index = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\VectorSearch\V1\Index|null + */ + public function getIndex() + { + return $this->index; + } + + public function hasIndex() + { + return isset($this->index); + } + + public function clearIndex() + { + unset($this->index); + } + + /** + * Required. The resource being updated. + * + * Generated from protobuf field .google.cloud.vectorsearch.v1.Index index = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\VectorSearch\V1\Index $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VectorSearch\V1\Index::class); + $this->index = $var; + + return $this; + } + + /** + * 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. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * 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. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/VectorSearch/src/V1/gapic_metadata.json b/VectorSearch/src/V1/gapic_metadata.json index 1e63d85d5ae1..4e80203638a5 100644 --- a/VectorSearch/src/V1/gapic_metadata.json +++ b/VectorSearch/src/V1/gapic_metadata.json @@ -158,6 +158,11 @@ "updateCollection" ] }, + "UpdateIndex": { + "methods": [ + "updateIndex" + ] + }, "GetLocation": { "methods": [ "getLocation" diff --git a/VectorSearch/src/V1/resources/vector_search_service_client_config.json b/VectorSearch/src/V1/resources/vector_search_service_client_config.json index b12401d4259e..e055528d9e03 100644 --- a/VectorSearch/src/V1/resources/vector_search_service_client_config.json +++ b/VectorSearch/src/V1/resources/vector_search_service_client_config.json @@ -95,6 +95,11 @@ "retry_codes_name": "retry_policy_3_codes", "retry_params_name": "retry_policy_3_params" }, + "UpdateIndex": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "GetLocation": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", diff --git a/VectorSearch/src/V1/resources/vector_search_service_descriptor_config.php b/VectorSearch/src/V1/resources/vector_search_service_descriptor_config.php index 84102a30af02..5e588fcd5a52 100644 --- a/VectorSearch/src/V1/resources/vector_search_service_descriptor_config.php +++ b/VectorSearch/src/V1/resources/vector_search_service_descriptor_config.php @@ -157,6 +157,26 @@ ], ], ], + 'UpdateIndex' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\VectorSearch\V1\Index', + 'metadataReturnType' => '\Google\Cloud\VectorSearch\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'index.name', + 'fieldAccessors' => [ + 'getIndex', + 'getName', + ], + ], + ], + ], 'GetCollection' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\VectorSearch\V1\Collection', @@ -257,6 +277,7 @@ ], 'templateMap' => [ '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}', ], diff --git a/VectorSearch/src/V1/resources/vector_search_service_rest_client_config.php b/VectorSearch/src/V1/resources/vector_search_service_rest_client_config.php index 83b6c4befda9..e6f18f8e46f2 100644 --- a/VectorSearch/src/V1/resources/vector_search_service_rest_client_config.php +++ b/VectorSearch/src/V1/resources/vector_search_service_rest_client_config.php @@ -180,6 +180,19 @@ ], ], ], + 'UpdateIndex' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{index.name=projects/*/locations/*/collections/*/indexes/*}', + 'body' => 'index', + 'placeholders' => [ + 'index.name' => [ + 'getters' => [ + 'getIndex', + 'getName', + ], + ], + ], + ], ], 'google.longrunning.Operations' => [ 'CancelOperation' => [ diff --git a/VectorSearch/tests/Unit/V1/Client/VectorSearchServiceClientTest.php b/VectorSearch/tests/Unit/V1/Client/VectorSearchServiceClientTest.php index 485c7021b73d..aa47e7d6cbbe 100644 --- a/VectorSearch/tests/Unit/V1/Client/VectorSearchServiceClientTest.php +++ b/VectorSearch/tests/Unit/V1/Client/VectorSearchServiceClientTest.php @@ -48,6 +48,7 @@ use Google\Cloud\VectorSearch\V1\ListIndexesRequest; use Google\Cloud\VectorSearch\V1\ListIndexesResponse; use Google\Cloud\VectorSearch\V1\UpdateCollectionRequest; +use Google\Cloud\VectorSearch\V1\UpdateIndexRequest; use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; @@ -1274,6 +1275,140 @@ public function updateCollectionExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function updateIndexTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateIndexTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $indexField = 'indexField1673840461'; + $expectedResponse = new Index(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setIndexField($indexField); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateIndexTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $index = new Index(); + $indexIndexField = 'indexIndexField-1984372294'; + $index->setIndexField($indexIndexField); + $request = (new UpdateIndexRequest())->setIndex($index); + $response = $gapicClient->updateIndex($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.vectorsearch.v1.VectorSearchService/UpdateIndex', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getIndex(); + $this->assertProtobufEquals($index, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateIndexTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateIndexExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateIndexTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $index = new Index(); + $indexIndexField = 'indexIndexField-1984372294'; + $index->setIndexField($indexIndexField); + $request = (new UpdateIndexRequest())->setIndex($index); + $response = $gapicClient->updateIndex($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateIndexTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function getLocationTest() {