Method: photos.batchUpdate
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
POST https://streetviewpublish.googleapis.com/v1/photos:batchUpdate
网址采用 gRPC 转码语法。
请求正文
请求正文中包含结构如下的数据:
JSON 表示法 |
{
"updatePhotoRequests": [
{
"photo": {
object (Photo )
},
"updateMask": string
}
]
} |
字段 |
updatePhotoRequests[] |
object
必需。UpdatePhotoRequests 的列表。
|
updatePhotoRequests[].photo |
object (Photo )
必需。包含新元数据的 Photo 对象。
|
updatePhotoRequests[].updateMask |
string (FieldMask format)
必需。用于标识要更新的照片元数据中的字段的掩码。如果不存在,则此请求中的旧 Photo 元数据会被完全替换为新的 Photo 元数据。如果指定了无效字段,更新将失败。可以用逗号分隔列表指定多个字段。 以下字段有效:
pose.heading
pose.lat_lng_pair
pose.pitch
pose.roll
pose.level
pose.altitude
connections
places
注意:如果 updateMask 包含重复字段,系统会将整组重复值替换为新内容。例如,如果 updateMask 包含 connections 且 UpdatePhotoRequest.photo.connections 为空,则系统会移除所有连接。
|
响应正文
对批量更新一个或多个 Photos
的元数据的响应。
如果成功,响应正文将包含结构如下的数据:
字段 |
results[] |
object (PhotoResponse )
每个 Photo 的结果列表都会按照与请求相同的顺序进行更新。
|
授权范围
需要以下 OAuth 范围:
https://www.googleapis.com/auth/streetviewpublish
如需了解详情,请参阅 OAuth 2.0 概览。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-10。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-09-10。"],[[["The API updates metadata of photos, such as pose, connections, and place association, but does not change pixel data."],["Requests are submitted as a batch of up to 20 `UpdatePhotoRequest` messages specifying the photo and fields to update."],["If the `updateMask` is not provided, all fields of the Photo resource will be updated with the values provided in the request."],["When updating `Pose.altitude`, `Pose.latLngPair` must also be specified, or the request will fail."],["This API requires the `https://www.googleapis.com/auth/streetviewpublish` OAuth scope for authorization."]]],["This document details the process of updating photo metadata via the `photos:batchUpdate` method. It outlines that you can update fields like pose, place association, and connections, but not photo pixels. The request involves sending `UpdatePhotoRequests` within a `BatchUpdatePhotosRequest` to `POST https://streetviewpublish.googleapis.com/v1/photos:batchUpdate`. An `updateMask` specifies which fields to modify. The response contains a list of `PhotoResponse` objects, indicating the success or failure of each photo update. A maximum of 20 `UpdatePhotoRequest` messages are allowed.\n"]]