Method: projects.locations.products.patch

对一项 Product 资源执行更改。目前只能更新 displayNamedescriptionlabels 字段。

如果更新了标签,则更改要到下一次索引时,才会体现在查询中。

可能出现的错误:

  • 如果 Product 不存在,则返回 NOT_FOUND。
  • 如果 updateMask 中存在 displayName,但请求中 displayName 缺失或长度超过 4096 个字符,则返回 INVALID_ARGUMENT。
  • 如果 updateMask 中存在说明,但说明长度超过 4096 个字符,则返回 INVALID_ARGUMENT。
  • 如果 updateMask 中存在 productCategory,则返回 INVALID_ARGUMENT。

HTTP 请求

PATCH https://vision.googleapis.com/v1/{product.name=projects/*/locations/*/products/*}

网址采用 gRPC 转码语法。

路径参数

参数
product.name

string

商品的资源名称。

格式为:projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

创建 Product 时,此字段会予以忽略。

查询参数

参数
updateMask

string (FieldMask format)

用于指定要更新的字段的 FieldMask。如果未指定 updateMask,则所有可变字段都将更新。有效掩码路径包括 productLabelsdisplayNamedescription

以逗号分隔的完全限定字段名称列表。示例:"user.displayName,photo"

请求正文

请求正文包含一个 Product 实例。

响应正文

如果成功,则响应正文包含一个 Product 实例。

授权范围

需要以下 OAuth 范围之一:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/cloud-vision

如需了解详情,请参阅身份验证概览