UpdateObjectCustomContext

描述更新对象自定义上下文的选项。

JSON 表示法
{

  // Union field action can be only one of the following:
  "customContextUpdates": {
    object (CustomContextUpdates)
  },
  "clearAll": boolean
  // End of list of possible types for union field action.
}
字段
联合字段 action。其中一项行动必须确定。action 只能是下列其中一项:
customContextUpdates

object (CustomContextUpdates)

一系列可应用于特定自定义上下文的更新。使用此功能可通过键添加、更新或删除单个上下文。

clearAll

boolean

如果设置,则必须设置为 true,并且所有现有的对象自定义上下文都将被删除。

CustomContextUpdates

描述要应用于由键标识的自定义上下文的一系列更新。

JSON 表示法
{
  "updates": {
    string: {
      object (ObjectCustomContextPayload)
    },
    ...
  },
  "keysToClear": [
    string
  ]
}
字段
updates

map (key: string, value: object (ObjectCustomContextPayload))

可选。插入或更新现有自定义上下文。

包含一系列 "key": value 对的对象。示例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

keysToClear[]

string

可选。要按键清除的自定义上下文。一个键不能同时存在于 updateskeysToClear 中。

ObjectCustomContextPayload

描述用户自定义对象上下文的有效载荷。

JSON 表示法
{
  "value": string
}
字段
value

string

对象自定义上下文的值。如果设置了 value,则不能为空字符串,因为它是自定义上下文中的必填字段。如果未设置,则忽略 value,并且不会对自定义上下文有效载荷的 value 字段进行任何更改。