Method: albums.addEnrichment

在指定影集中的指定位置添加扩充项。

HTTP 请求

POST https://photoslibrary.googleapis.com/v1/albums/{albumId}:addEnrichment

网址采用 gRPC 转码语法。

路径参数

参数
albumId

string

必需。要添加扩充项的影集的标识符。

请求正文

请求正文中包含结构如下的数据:

JSON 表示法
{
  "newEnrichmentItem": {
    object (NewEnrichmentItem)
  },
  "albumPosition": {
    object (AlbumPosition)
  }
}
字段
newEnrichmentItem

object (NewEnrichmentItem)

必需。要添加的扩充项。

albumPosition

object (AlbumPosition)

必需。在影集中要插入扩充项的位置。

响应正文

已创建的扩充项内容。

如果成功,响应正文将包含结构如下的数据:

JSON 表示法
{
  "enrichmentItem": {
    object (EnrichmentItem)
  }
}
字段
enrichmentItem

object (EnrichmentItem)

仅供输出。已添加的扩充项。

授权范围

需要以下 OAuth 范围之一:

  • https://www.googleapis.com/auth/photoslibrary
  • https://www.googleapis.com/auth/photoslibrary.appendonly
  • https://www.googleapis.com/auth/photoslibrary.sharing

NewEnrichmentItem

要添加到影集的新扩充项内容,供 albums.addEnrichment 调用使用。

JSON 表示法
{

  // Union field enrichment can be only one of the following:
  "textEnrichment": {
    object (TextEnrichment)
  },
  "locationEnrichment": {
    object (LocationEnrichment)
  },
  "mapEnrichment": {
    object (MapEnrichment)
  }
  // End of list of possible types for union field enrichment.
}
字段
联合字段 enrichment。要添加到影集的扩充项。它可以是文本、位置或地图。enrichment 只能是下列其中一项:
textEnrichment

object (TextEnrichment)

要添加到影集的文本。

locationEnrichment

object (LocationEnrichment)

要添加到影集的位置。

mapEnrichment

object (MapEnrichment)

要添加到影集的地图。

TextEnrichment

包含文本的扩充项。

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

string

此扩充项内容的文本。

LocationEnrichment

包含单个位置的扩充项。

JSON 表示法
{
  "location": {
    object (Location)
  }
}
字段
location

object (Location)

此扩充项内容的位置。

位置

表示实际位置。

JSON 表示法
{
  "locationName": string,
  "latlng": {
    object (LatLng)
  }
}
字段
locationName

string

要显示的地点的名称。

latlng

object (LatLng)

相应位置在地图上的位置。

LatLng

表示纬度/经度对的对象。该对象以一对双精度数表示,分别代表纬度度数和经度度数。除非另有说明,否则该对象必须符合 WGS84 标准。值必须介于标准化范围内。

JSON 表示法
{
  "latitude": number,
  "longitude": number
}
字段
latitude

number

纬度(以度为单位)。它必须在 [-90.0, +90.0] 范围内。

longitude

number

经度(以度为单位)。它必须在 [-180.0, +180.0] 范围内。

MapEnrichment

包含地图的扩充项,显示出发地和目的地位置。

JSON 表示法
{
  "origin": {
    object (Location)
  },
  "destination": {
    object (Location)
  }
}
字段
origin

object (Location)

此扩充项内容的出发地。

destination

object (Location)

此扩充项内容的目标位置。

EnrichmentItem

扩充项内容。

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

string

扩充项内容的标识符。