×

PATCH /v1/collections/{id}

描述 (Description)

参数 (Parameters)

路径参数 (Path Parameters)

名称 (Name) 描述 (Description) 必填 (Required) 默认值 (Default) 模式 (Pattern)

id

X

null

主体参数 (Body Parameter)

名称 (Name) 描述 (Description) 必填 (Required) 默认值 (Default) 模式 (Pattern)

body

CollectionServiceUpdateCollectionBody

X

返回类型 (Return Type)

内容类型 (Content Type)

  • application/json

响应 (Responses)

表1. HTTP响应代码 (Table 1. HTTP Response Codes)
代码 (Code) 消息 (Message) 数据类型 (Datatype)

200

成功的响应。(A successful response.)

V1UpdateCollectionResponse

0

意外的错误响应。(An unexpected error response.)

GooglerpcStatus

示例 (Samples)

常用对象引用 (Common object reference)

CollectionServiceUpdateCollectionBody

字段名称 (Field Name) 必填 (Required) 可空 (Nullable) 类型 (Type) 描述 (Description) 格式 (Format)

name

字符串 (String)

description

字符串 (String)

resourceSelectors

StorageResourceSelector 列表 (List of StorageResourceSelector)

embeddedCollectionIds

string 列表 (List of string)

GooglerpcStatus

字段名称 (Field Name) 必填 (Required) 可空 (Nullable) 类型 (Type) 描述 (Description) 格式 (Format)

code

整数 (Integer)

int32

message

字符串 (String)

details

ProtobufAny 列表 (List of ProtobufAny)

ProtobufAny

Any 包含任意序列化的协议缓冲区消息以及描述序列化消息类型的URL。(Any contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message.)

Protobuf 库提供实用函数或 Any 类型附加生成的函数来支持打包/解包 Any 值。

示例 1:在 C++ 中打包和解包消息。

Foo foo = ...;
Any any;
any.PackFrom(foo);
...
if (any.UnpackTo(&foo)) {
  ...
}

示例 2:在 Java 中打包和解包消息。

Foo foo = ...;
Any any = Any.pack(foo);
...
if (any.is(Foo.class)) {
  foo = any.unpack(Foo.class);
}
// or ...
if (any.isSameTypeAs(Foo.getDefaultInstance())) {
  foo = any.unpack(Foo.getDefaultInstance());
}
Example 3: Pack and unpack a message in Python.
foo = Foo(...)
any = Any()
any.Pack(foo)
...
if any.Is(Foo.DESCRIPTOR):
  any.Unpack(foo)
  ...
Example 4: Pack and unpack a message in Go
foo := &pb.Foo{...}
any, err := anypb.New(foo)
if err != nil {
  ...
}
...
foo := &pb.Foo{}
if err := any.UnmarshalTo(foo); err != nil {
  ...
}

Protobuf 库提供的打包方法默认使用 'type.googleapis.com/full.type.name' 作为类型 URL,解包方法只使用类型 URL 中最后一个 '/' 后面的完整限定类型名称,例如 "foo.bar.com/x/y.z" 将产生类型名称 "y.z"。

JSON 表示

Any 值的 JSON 表示使用反序列化的嵌入式消息的常规表示,并添加一个包含类型 URL 的附加字段 @type。示例

package google.profile;
message Person {
  string first_name = 1;
  string last_name = 2;
}
{
  "@type": "type.googleapis.com/google.profile.Person",
  "firstName": <string>,
  "lastName": <string>
}

如果嵌入式消息类型是众所周知的并且具有自定义 JSON 表示,则该表示将被嵌入,并添加一个字段 value,该字段除了 @type 字段外还包含自定义 JSON。示例(对于消息 [google.protobuf.Duration][])

{
  "@type": "type.googleapis.com/google.protobuf.Duration",
  "value": "1.212s"
}
字段名称 (Field Name) 必填 (Required) 可空 (Nullable) 类型 (Type) 描述 (Description) 格式 (Format)

@type

字符串 (String)

一个唯一标识序列化协议缓冲区消息类型的 URL/资源名称。此字符串必须包含至少一个“/”字符。URL 路径的最后一部分必须表示类型的完全限定名称(如 path/google.protobuf.Duration)。名称应采用规范形式(例如,不接受前导“.”)。实际上,团队通常会将其预期在 Any 上下文中使用的所有类型预编译到二进制文件中。但是,对于使用方案 httphttps 或无方案的 URL,可以选择设置一个类型服务器,将类型 URL 映射到消息定义,如下所示:* 如果没有提供方案,则假设为 https。* 对 URL 的 HTTP GET 请求必须产生二进制格式的 [google.protobuf.Type][] 值,或产生错误。* 应用程序允许根据 URL 缓存查找结果,或将其预编译到二进制文件中以避免任何查找。因此,需要在类型更改时保持二进制兼容性。(使用版本化的类型名称来管理重大更改。)注意:此功能目前在官方 protobuf 版本中不可用,并且不用于以 type.googleapis.com 开头的类型 URL。截至 2023 年 5 月,没有广泛使用的类型服务器实现,也没有计划实现一个。httphttps(或空方案)以外的方案可能会与特定于实现的语义一起使用。

ResourceCollectionEmbeddedResourceCollection

字段名称 (Field Name) 必填 (Required) 可空 (Nullable) 类型 (Type) 描述 (Description) 格式 (Format)

id

字符串 (String)

StorageBooleanOperator

枚举值

OR

AND

StorageMatchType

枚举值

EXACT

REGEX

StorageResourceCollection

字段名称 (Field Name) 必填 (Required) 可空 (Nullable) 类型 (Type) 描述 (Description) 格式 (Format)

id

字符串 (String)

name

字符串 (String)

description

字符串 (String)

createdAt

日期

日期时间

lastUpdated

日期

日期时间

createdBy

StorageSlimUser

updatedBy

StorageSlimUser

resourceSelectors

StorageResourceSelector 列表 (List of StorageResourceSelector)

resource_selectors 与彼此以及 embedded_collections 中的选择器构成析取 (OR)。对于 MVP,从 UX 角度来看,resource_selectors 的大小最多为 1。

embeddedCollections

ResourceCollectionEmbeddedResourceCollection 列表

StorageResourceSelector

字段名称 (Field Name) 必填 (Required) 可空 (Nullable) 类型 (Type) 描述 (Description) 格式 (Format)

rules

StorageSelectorRule 列表

rules 构成合取 (AND)。

StorageRuleValue

字段名称 (Field Name) 必填 (Required) 可空 (Nullable) 类型 (Type) 描述 (Description) 格式 (Format)

value

字符串 (String)

matchType

StorageMatchType

EXACT, REGEX,

StorageSelectorRule

字段名称 (Field Name) 必填 (Required) 可空 (Nullable) 类型 (Type) 描述 (Description) 格式 (Format)

fieldName

字符串 (String)

operator

StorageBooleanOperator

OR, AND,

values

StorageRuleValue 列表

values 根据运算符构成合取 (AND) 或析取 (OR)。对于 MVP,从 UX 角度来看,仅支持 OR。

StorageSlimUser

字段名称 (Field Name) 必填 (Required) 可空 (Nullable) 类型 (Type) 描述 (Description) 格式 (Format)

id

字符串 (String)

name

字符串 (String)

V1UpdateCollectionResponse

字段名称 (Field Name) 必填 (Required) 可空 (Nullable) 类型 (Type) 描述 (Description) 格式 (Format)

collection

StorageResourceCollection