# REST Resource: projects.locations.assets

- [Resource: Asset](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets#Asset)
  - [JSON representation](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets#Asset.SCHEMA_REPRESENTATION)
- [VideoAsset](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets#VideoAsset)
  - [JSON representation](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets#VideoAsset.SCHEMA_REPRESENTATION)
- [ImageAsset](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets#ImageAsset)
  - [JSON representation](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets#ImageAsset.SCHEMA_REPRESENTATION)
- [State](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets#State)
- [Methods](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets#METHODS_SUMMARY)

## Resource: Asset

An asset represents a video or an image.

| JSON representation |
|---|
| ``` { "name": string, "createTime": string, "updateTime": string, "labels": { string: string, ... }, "crc32c": string, "state": enum (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets#State`), "error": { object (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/Status`) }, // Union field `resource` can be only one of the following: "video": { object (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets#VideoAsset`) }, "image": { object (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets#ImageAsset`) } // End of list of possible types for union field `resource`. } ``` |

| Fields ||
|---|---|
| `name` | `string` The resource name of the asset, in the form of: `projects/{project}/locations/{location}/assets/{assetId}`. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The creation time. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `updateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The update time. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `labels` | `map (key: string, value: string)` User-defined key/value metadata. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `crc32c` | `string` Based64-encoded CRC32c checksum of the asset file. For more information, see the crc32c checksum of the [Cloud Storage Objects resource](https://cloud.google.com/storage/docs/json_api/v1/objects). If crc32c is omitted or left empty when the asset is created, this field is filled by the crc32c checksum of the Cloud Storage object indicated by `https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets#VideoAsset.FIELDS.uri` or `https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets#ImageAsset.FIELDS.uri`. If crc32c is set, the asset can't be created if the crc32c value does not match with the crc32c checksum of the Cloud Storage object indicated by `https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets#VideoAsset.FIELDS.uri` or `https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets#ImageAsset.FIELDS.uri`. |
| `state` | ``enum (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets#State`)`` Output only. The state of the asset resource. |
| `error` | ``object (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/Status`)`` Output only. Only present when `state` is `ERROR`. The reason for the error state of the asset. |
| Union field `resource`. The reference to the asset. The maximum size of the resource is 250 MB. `resource` can be only one of the following: ||
| `video` | ``object (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets#VideoAsset`)`` VideoAsset represents a video. |
| `image` | ``object (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets#ImageAsset`)`` ImageAsset represents an image. |

## VideoAsset

VideoAsset represents a video. The supported formats are MP4, MPEG-TS, and FLV. The supported video codec is H264. The supported audio codecs are AAC, AC3, MP2, and MP3.

| JSON representation |
|---|
| ``` { "uri": string } ``` |

| Fields ||
|---|---|
| `uri` | `string` Cloud Storage URI of the video. The format is `gs://my-bucket/my-object`. |

## ImageAsset

Image represents an image. The supported formats are JPEG, PNG.

| JSON representation |
|---|
| ``` { "uri": string } ``` |

| Fields ||
|---|---|
| `uri` | `string` Cloud Storage URI of the image. The format is `gs://my-bucket/my-object`. |

## State

State of the asset resource.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | State is not specified. |
| `CREATING` | The asset is being created. |
| `ACTIVE` | The asset is ready for use. |
| `DELETING` | The asset is being deleted. |
| `ERROR` | The asset has an error. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets/create` | Creates a Asset with the provided unique ID in the specified region. |
| ### `https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets/delete` | Deletes the specified asset if it is not used. |
| ### `https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets/get` | Returns the specified asset. |
| ### `https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.assets/list` | Returns a list of all assets in the specified region. |