# REST Resource: projects.locations.corpora.assets.annotations

- [Resource: Annotation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#Annotation)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#Annotation.SCHEMA_REPRESENTATION)
- [UserSpecifiedAnnotation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#UserSpecifiedAnnotation)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#UserSpecifiedAnnotation.SCHEMA_REPRESENTATION)
- [AnnotationValue](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#AnnotationValue)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#AnnotationValue.SCHEMA_REPRESENTATION)
- [GeoCoordinate](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#GeoCoordinate)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#GeoCoordinate.SCHEMA_REPRESENTATION)
- [AnnotationList](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#AnnotationList)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#AnnotationList.SCHEMA_REPRESENTATION)
- [AnnotationCustomizedStruct](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#AnnotationCustomizedStruct)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#AnnotationCustomizedStruct.SCHEMA_REPRESENTATION)
- [Partition](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#Partition)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#Partition.SCHEMA_REPRESENTATION)
- [TemporalPartition](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#TemporalPartition)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#TemporalPartition.SCHEMA_REPRESENTATION)
- [SpatialPartition](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#SpatialPartition)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#SpatialPartition.SCHEMA_REPRESENTATION)
- [RelativeTemporalPartition](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#RelativeTemporalPartition)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#RelativeTemporalPartition.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#METHODS_SUMMARY)

## Resource: Annotation

An annotation is a resource in asset. It represents a key-value mapping of content in asset.

| JSON representation |
|---|
| ``` { "name": string, "userSpecifiedAnnotation": { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#UserSpecifiedAnnotation`) } } ``` |

| Fields ||
|---|---|
| `name` | `string` Resource name of the annotation. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` |
| `userSpecifiedAnnotation` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#UserSpecifiedAnnotation`)`` User provided annotation. |

## UserSpecifiedAnnotation

Annotation provided by users.

| JSON representation |
|---|
| ``` { "key": string, "value": { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#AnnotationValue`) }, "partition": { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#Partition`) } } ``` |

| Fields ||
|---|---|
| `key` | `string` Required. Key of the annotation. The key must be set with type by CreateDataSchema. |
| `value` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#AnnotationValue`)`` Value of the annotation. The value must be able to convert to the type according to the data schema. |
| `partition` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#Partition`)`` Partition information in time and space for the sub-asset level annotation. |

## AnnotationValue

Value of annotation, including all types available in data schema.

| JSON representation |
|---|
| ``` { // Union field `value` can be only one of the following: "intValue": string, "floatValue": number, "strValue": string, "datetimeValue": string, "geoCoordinate": { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#GeoCoordinate`) }, "protoAnyValue": { "@type": string, field1: ..., ... }, "boolValue": boolean, "customizedStructDataValue": { object }, "listValue": { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#AnnotationList`) }, "customizedStructValue": { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#AnnotationCustomizedStruct`) } // End of list of possible types for union field `value`. } ``` |

| Fields ||
|---|---|
| Union field `value`. `value` can be only one of the following: ||
| `intValue` | `string (https://developers.google.com/discovery/v1/type-format format)` Value of int type annotation. |
| `floatValue` | `number` Value of float type annotation. |
| `strValue` | `string` Value of string type annotation. |
| `datetimeValue` | `string` Value of date time type annotation. |
| `geoCoordinate` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#GeoCoordinate`)`` Value of geo coordinate type annotation. |
| `protoAnyValue` | `object` Value of any proto value. An object containing fields of an arbitrary type. An additional field `"@type"` contains a URI identifying the type. Example: `{ "id": 1234, "@type": "types.example.com/standard/id" }`. |
| `boolValue` | `boolean` Value of boolean type annotation. |
| `customizedStructDataValue` | ``object (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Struct` format)`` Value of customized struct annotation. This field does not have effects. Use customizedStructValue instead for customized struct annotation. |
| `listValue` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#AnnotationList`)`` Value of list type annotation. |
| `customizedStructValue` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#AnnotationCustomizedStruct`)`` Value of custom struct type annotation. |

## GeoCoordinate

Location Coordinate Representation

| JSON representation |
|---|
| ``` { "latitude": number, "longitude": number } ``` |

| Fields ||
|---|---|
| `latitude` | `number` Latitude Coordinate. Degrees \[-90 .. 90\] |
| `longitude` | `number` Longitude Coordinate. Degrees \[-180 .. 180\] |

## AnnotationList

List representation in annotation.

| JSON representation |
|---|
| ``` { "values": [ { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#AnnotationValue`) } ] } ``` |

| Fields ||
|---|---|
| `values[]` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#AnnotationValue`)`` The values of `LIST` data type annotation. |

## AnnotationCustomizedStruct

Customized struct represnation in annotation.

| JSON representation |
|---|
| ``` { "elements": { string: { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#AnnotationValue`) }, ... } } ``` |

| Fields ||
|---|---|
| `elements` | ``map (key: string, value: object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#AnnotationValue`))`` A map from elements' keys to element's annotation value. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |

## Partition

Partition to specify the partition in time and space for sub-asset level annotation.

| JSON representation |
|---|
| ``` { "temporalPartition": { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#TemporalPartition`) }, "spatialPartition": { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#SpatialPartition`) }, "relativeTemporalPartition": { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#RelativeTemporalPartition`) } } ``` |

| Fields ||
|---|---|
| `temporalPartition` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#TemporalPartition`)`` Partition of asset in time. |
| `spatialPartition` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#SpatialPartition`)`` Partition of asset in space. |
| `relativeTemporalPartition` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations#RelativeTemporalPartition`)`` Partition of asset in time. |

## TemporalPartition

Partition of asset in UTC Epoch time. Supported by STREAM_VIDEO corpus type.

| JSON representation |
|---|
| ``` { "startTime": string, "endTime": string } ``` |

| Fields ||
|---|---|
| `startTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Start time of the partition. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `endTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` End time of the partition. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |

## SpatialPartition

Partition of asset in space.

| JSON representation |
|---|
| ``` { "xMin": string, "yMin": string, "xMax": string, "yMax": string } ``` |

| Fields ||
|---|---|
| `xMin` | `string (https://developers.google.com/discovery/v1/type-format format)` The minimum x coordinate value. |
| `yMin` | `string (https://developers.google.com/discovery/v1/type-format format)` The minimum y coordinate value. |
| `xMax` | `string (https://developers.google.com/discovery/v1/type-format format)` The maximum x coordinate value. |
| `yMax` | `string (https://developers.google.com/discovery/v1/type-format format)` The maximum y coordinate value. |

## RelativeTemporalPartition

Partition of asset in relative time. Supported by VIDEO_ON_DEMAND corpus type.

| JSON representation |
|---|
| ``` { "startOffset": string, "endOffset": string } ``` |

| Fields ||
|---|---|
| `startOffset` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration` format)`` Start time offset of the partition. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |
| `endOffset` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration` format)`` End time offset of the partition. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations/create` | Creates annotation inside asset. |
| ### `https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations/delete` | Deletes annotation inside asset. |
| ### `https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations/get` | Reads annotation inside asset. |
| ### `https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations/list` | Lists a list of annotations inside asset. |
| ### `https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/projects.locations.corpora.assets.annotations/patch` | Updates annotation inside asset. |