# REST Resource: projects.locations.channels.clips

- [Resource: Clip](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#Clip)
  - [JSON representation](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#Clip.SCHEMA_REPRESENTATION)
- [State](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#State)
- [Slice](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#Slice)
  - [JSON representation](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#Slice.SCHEMA_REPRESENTATION)
- [TimeSlice](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#TimeSlice)
  - [JSON representation](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#TimeSlice.SCHEMA_REPRESENTATION)
- [ClipManifest](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#ClipManifest)
  - [JSON representation](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#ClipManifest.SCHEMA_REPRESENTATION)
- [OutputType](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#OutputType)
- [Methods](https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#METHODS_SUMMARY)

## Resource: Clip

Clip is a sub-resource under channel. Each clip represents a clipping operation that generates a VOD playlist from its channel given a set of timestamp ranges.

| JSON representation |
|---|
| ``` { "name": string, "createTime": string, "startTime": string, "updateTime": string, "labels": { string: string, ... }, "state": enum (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#State`), "outputUri": string, "error": { object (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/Status`) }, "slices": [ { object (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#Slice`) } ], "clipManifests": [ { object (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#ClipManifest`) } ], "outputType": enum (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#OutputType`) } ``` |

| Fields ||
|---|---|
| `name` | `string` The resource name of the clip, in the following format: `projects/{project}/locations/{location}/channels/{channelId}/clips/{clipId}`. `{clipId}` is a user-specified resource id that conforms to the following criteria: 1. 1 character minimum, 63 characters maximum 2. Only contains letters, digits, underscores, and hyphens |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The creation timestamp of the clip resource. 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"`. |
| `startTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The timestamp when the clip request starts to be processed. 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 timestamp of the clip resource. 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)` The labels associated with this resource. Each label is a key-value pair. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `state` | ``enum (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#State`)`` Output only. The state of the clip. |
| `outputUri` | `string` Specify the `outputUri` to determine where to place the clip segments and clip manifest files in Cloud Storage. The manifests specified in `clipManifests` fields will be placed under this URI. The exact URI of the generated manifests will be provided in `clipManifests.output_uri` for each manifest. Example: "outputUri": "gs://my-bucket/clip-outputs" "clipManifests.output_uri": "gs://my-bucket/clip-outputs/main.m3u8" |
| `error` | ``object (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/Status`)`` Output only. An error object that describes the reason for the failure. This property only presents when `state` is `FAILED`. |
| `slices[]` | ``object (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#Slice`)`` The specified ranges of segments to generate a clip. |
| `clipManifests[]` | ``object (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#ClipManifest`)`` Required. A list of clip manifests. Currently only one clip manifest is allowed. |
| `outputType` | ``enum (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#OutputType`)`` Optional. OutputType of the clip. If not specified, the default value is MANIFEST. |

## State

State of clipping operation.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | State is not specified. |
| `PENDING` | The operation is pending to be picked up by the server. |
| `CREATING` | The server admitted this create clip request, and outputs are under processing. |
| `SUCCEEDED` | Outputs are available in the specified Cloud Storage bucket. For additional information, see the `outputs` field. |
| `FAILED` | The operation has failed. For additional information, see the `error` field. |

## Slice

Slice represents a slice of the requested clip.

| JSON representation |
|---|
| ``` { // Union field `kind` can be only one of the following: "timeSlice": { object (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#TimeSlice`) } // End of list of possible types for union field `kind`. } ``` |

| Fields ||
|---|---|
| Union field `kind`. The allowlist forms of a slice. `kind` can be only one of the following: ||
| `timeSlice` | ``object (`https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips#TimeSlice`)`` A slice in form of a tuple of Unix epoch time. |

## TimeSlice

TimeSlice represents a tuple of Unix epoch timestamps that specifies a time range.

| JSON representation |
|---|
| ``` { "markinTime": string, "markoutTime": string } ``` |

| Fields ||
|---|---|
| `markinTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The mark-in Unix epoch time in the original live stream manifest. 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"`. |
| `markoutTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The mark-out Unix epoch time in the original live stream manifest. 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"`. |

## ClipManifest

ClipManifest identifies a source manifest for the generated clip manifest.

| JSON representation |
|---|
| ``` { "manifestKey": string, "outputUri": string } ``` |

| Fields ||
|---|---|
| `manifestKey` | `string` Required. A unique key that identifies a manifest config in the parent channel. This key is the same as `channel.manifests.key` for the selected manifest. |
| `outputUri` | `string` Output only. The output URI of the generated clip manifest. This field will be populated when the clips.create request is accepted. Current output format is provided below but may change in the future. Please read this field to get the uri to the generated clip manifest. Format: {clip.output_uri}/{channel.manifest.fileName} Example: gs://my-bucket/clip-outputs/main.m3u8 |

## OutputType

OutputType represents the output type of the clip.

| Enums ||
|---|---|
| `OUTPUT_TYPE_UNSPECIFIED` | OutputType is not specified. |
| `MANIFEST` | OutputType is a VOD manifest. This is the default value. |
| `MP4` | OutputType is an MP4 file. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips/create` | Creates a clip with the provided clip ID in the specified channel. |
| ### `https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips/delete` | Deletes the specified clip job resource. |
| ### `https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips/get` | Returns the specified clip. |
| ### `https://docs.cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels.clips/list` | Returns a list of all clips in the specified channel. |