Skip to content

Commit 6f2a669

Browse files
author
olivierapivideo
authored
Add discarded videos feature
1 parent 7a3f72e commit 6f2a669

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+765
-89
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,10 @@ Method | Description | HTTP request
184184
[**list()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#list) | List all video objects | **GET** `/videos`
185185
[**uploadThumbnail()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#uploadThumbnail) | Upload a thumbnail | **POST** `/videos/{videoId}/thumbnail`
186186
[**pickThumbnail()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#pickThumbnail) | Set a thumbnail | **PATCH** `/videos/{videoId}/thumbnail`
187+
[**getDiscarded()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#getDiscarded) | Retrieve a discarded video object | **GET** `/discarded/videos/{videoId}`
187188
[**getStatus()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#getStatus) | Retrieve video status and details | **GET** `/videos/{videoId}/status`
189+
[**listDiscarded()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#listDiscarded) | List all discarded video objects | **GET** `/discarded/videos`
190+
[**updateDiscarded()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#updateDiscarded) | Update a discarded video object | **PATCH** `/discarded/videos/{videoId}`
188191

189192

190193
#### WatermarksApi
@@ -231,6 +234,7 @@ Method | Description | HTTP request
231234
- [CaptionsUpdatePayload](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/CaptionsUpdatePayload.md)
232235
- [Chapter](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/Chapter.md)
233236
- [ChaptersListResponse](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/ChaptersListResponse.md)
237+
- [DiscardedVideoUpdatePayload](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/DiscardedVideoUpdatePayload.md)
234238
- [FilterBy](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/FilterBy.md)
235239
- [FilterBy1](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/FilterBy1.md)
236240
- [FilterBy2](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/FilterBy2.md)

docs/api/LiveStreamsApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Get the list of livestreams on the workspace.
115115
| ------------- | ------------- | ------------- | ------------- |
116116
| **streamKey** | **string**| no| The unique stream key that allows you to stream videos. |
117117
| **name** | **string**| no| You can filter live streams by their name or a part of their name. |
118-
| **sortBy** | **'name' \| 'createdAt' \| 'updatedAt'**| no| Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ISO-8601 time format. |
118+
| **sortBy** | **'name' \| 'createdAt' \| 'updatedAt'**| no| Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ATOM UTC time format. |
119119
| **sortOrder** | **'asc' \| 'desc'**| no| Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending. |
120120
| **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 |
121121
| **pageSize** | **number**| no| Results per page. Allowed values 1-100, default is 25. |

docs/api/PlayerThemesApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Retrieve a list of all the player themes you created, as well as details about e
114114

115115
| Name | Type | Required | Description |
116116
| ------------- | ------------- | ------------- | ------------- |
117-
| **sortBy** | **'name' \| 'createdAt' \| 'updatedAt'**| no| createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ISO-8601 format. |
117+
| **sortBy** | **'name' \| 'createdAt' \| 'updatedAt'**| no| createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ATOM UTC format. |
118118
| **sortOrder** | **'asc' \| 'desc'**| no| Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. |
119119
| **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 |
120120
| **pageSize** | **number**| no| Results per page. Allowed values 1-100, default is 25. |

docs/api/UploadTokensApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Retrieve a list of all currently active delegated tokens.
8686

8787
| Name | Type | Required | Description |
8888
| ------------- | ------------- | ------------- | ------------- |
89-
| **sortBy** | **'createdAt' \| 'ttl'**| no| Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ISO-8601 format. |
89+
| **sortBy** | **'createdAt' \| 'ttl'**| no| Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ATOM UTC format. |
9090
| **sortOrder** | **'asc' \| 'desc'**| no| Allowed: asc, desc. Ascending is 0-9 or A-Z. Descending is 9-0 or Z-A. |
9191
| **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 |
9292
| **pageSize** | **number**| no| Results per page. Allowed values 1-100, default is 25. |

docs/api/VideosApi.md

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ All URIs are relative to *https://ws.api.video*
1313
| [**list()**](VideosApi.md#list) | List all video objects | **GET** /videos |
1414
| [**uploadThumbnail()**](VideosApi.md#uploadThumbnail) | Upload a thumbnail | **POST** /videos/{videoId}/thumbnail |
1515
| [**pickThumbnail()**](VideosApi.md#pickThumbnail) | Set a thumbnail | **PATCH** /videos/{videoId}/thumbnail |
16+
| [**getDiscarded()**](VideosApi.md#getDiscarded) | Retrieve a discarded video object | **GET** /discarded/videos/{videoId} |
1617
| [**getStatus()**](VideosApi.md#getStatus) | Retrieve video status and details | **GET** /videos/{videoId}/status |
18+
| [**listDiscarded()**](VideosApi.md#listDiscarded) | List all discarded video objects | **GET** /discarded/videos |
19+
| [**updateDiscarded()**](VideosApi.md#updateDiscarded) | Update a discarded video object | **PATCH** /discarded/videos/{videoId} |
1720

1821

1922
<a name="create"></a>
@@ -217,7 +220,7 @@ Promise<[**Video**](../model/Video.md)>.
217220
## **`delete()` - Delete a video object**
218221

219222

220-
If you do not need a video any longer, you can send a request to delete it. All you need is the videoId.
223+
If you do not need a video any longer, you can send a request to delete it. All you need is the videoId. By default, deleted videos cannot be recovered. If you have the Video Restore feature enabled, this operation will discard the video instead of permanently deleting it. Make sure you subscribe to the Video Restore feature if you want to be able to restore deleted videos! The Video Restore feature retains videos for 90 days, after which the videos are permanently deleted
221224

222225
### Parameters
223226

@@ -247,7 +250,7 @@ This method returns a list of your videos (with all their details). With no para
247250
| ------------- | ------------- | ------------- | ------------- |
248251
| **title** | **string**| no| The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles. |
249252
| **tags** | **Array&lt;string&gt;**| no| A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned. |
250-
| **metadata** | **{ [key: string]: string; }**| no| Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair. |
253+
| **metadata** | **{ [key: string]: string; }**| no| Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. |
251254
| **description** | **string**| no| Retrieve video objects by &#x60;description&#x60;. |
252255
| **liveStreamId** | **string**| no| Retrieve video objects that were recorded from a live stream by &#x60;liveStreamId&#x60;. |
253256
| **sortBy** | **&#39;title&#39; \| &#39;createdAt&#39; \| &#39;publishedAt&#39; \| &#39;updatedAt&#39;**| no| Use this parameter to sort videos by the their created time, published time, updated time, or by title. |
@@ -331,6 +334,28 @@ Promise<[**Video**](../model/Video.md)>.
331334

332335

333336

337+
---
338+
339+
<a name="getDiscarded"></a>
340+
## **`getDiscarded()` - Retrieve a discarded video object**
341+
342+
343+
This call provides the same information provided on video creation. For private videos, it will generate a unique token url. Use this to retrieve any details you need about a video, or set up a private viewing URL.
344+
345+
### Parameters
346+
347+
| Name | Type | Required | Description |
348+
| ------------- | ------------- | ------------- | ------------- |
349+
| **videoId** | **string**| **yes**| The unique identifier for the video you want details about. |
350+
351+
352+
### Return type
353+
354+
Promise<[**Video**](../model/Video.md)>.
355+
356+
357+
358+
334359
---
335360

336361
<a name="getStatus"></a>
@@ -353,5 +378,60 @@ Promise<[**VideoStatus**](../model/VideoStatus.md)>.
353378

354379

355380

381+
---
382+
383+
<a name="listDiscarded"></a>
384+
## **`listDiscarded()` - List all discarded video objects**
385+
386+
387+
This method returns a list of your discarded videos (with all their details). With no parameters added, the API returns the first page of all discarded videos. You can filter discarded videos using the parameters described below.
388+
389+
### Parameters
390+
391+
| Name | Type | Required | Description |
392+
| ------------- | ------------- | ------------- | ------------- |
393+
| **title** | **string**| no| The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles. |
394+
| **tags** | **Array&lt;string&gt;**| no| A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned. |
395+
| **metadata** | **{ [key: string]: string; }**| no| Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. |
396+
| **description** | **string**| no| Retrieve video objects by &#x60;description&#x60;. |
397+
| **liveStreamId** | **string**| no| Retrieve video objects that were recorded from a live stream by &#x60;liveStreamId&#x60;. |
398+
| **sortBy** | **&#39;title&#39; \| &#39;createdAt&#39; \| &#39;publishedAt&#39; \| &#39;updatedAt&#39;**| no| Use this parameter to sort videos by the their created time, published time, updated time, or by title. |
399+
| **sortOrder** | **&#39;asc&#39; \| &#39;desc&#39;**| no| Use this parameter to sort results. &#x60;asc&#x60; is ascending and sorts from A to Z. &#x60;desc&#x60; is descending and sorts from Z to A. |
400+
| **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 |
401+
| **pageSize** | **number**| no| Results per page. Allowed values 1-100, default is 25. |
402+
403+
404+
### Return type
405+
406+
Promise<[**VideosListResponse**](../model/VideosListResponse.md)>.
407+
408+
409+
410+
411+
---
412+
413+
<a name="updateDiscarded"></a>
414+
## **`updateDiscarded()` - Update a discarded video object**
415+
416+
417+
Use this endpoint to restore a discarded video when you have the Video Restore feature enabled.
418+
419+
420+
421+
### Parameters
422+
423+
| Name | Type | Required | Description |
424+
| ------------- | ------------- | ------------- | ------------- |
425+
| **videoId** | **string**| **yes**| The video ID for the video you want to restore. |
426+
| **discardedVideoUpdatePayload** | [**DiscardedVideoUpdatePayload**](../model/DiscardedVideoUpdatePayload.md)| **yes**| |
427+
428+
429+
### Return type
430+
431+
Promise<[**Video**](../model/Video.md)>.
432+
433+
434+
435+
356436
---
357437

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
# DiscardedVideoUpdatePayload
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**discarded** | **boolean** | Use this parameter to restore a discarded video when you have the Video Restore feature enabled. This parameter only accepts &#x60;false&#x60; as a value! | [optional]
9+
10+
11+

docs/model/LiveStream.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Name | Type | Description | Notes
1313
**playerId** | **string** | The unique identifier for the player. | [optional]
1414
**broadcasting** | **boolean** | Whether or not you are broadcasting the live video you recorded for others to see. True means you are broadcasting to viewers, false means you are not. | [optional]
1515
**restreams** | [**Array&lt;RestreamsResponseObject&gt;**](RestreamsResponseObject.md) | Returns the list of restream destinations. |
16-
**createdAt** | **Date** | When the player was created, presented in ISO-8601 format. | [optional]
17-
**updatedAt** | **Date** | When the player was last updated, presented in ISO-8601 format. | [optional]
16+
**createdAt** | **Date** | When the player was created, presented in ATOM UTC format. | [optional]
17+
**updatedAt** | **Date** | When the player was last updated, presented in ATOM UTC format. | [optional]
1818

1919

2020

docs/model/PlayerSessionEvent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**type** | **string** | Possible values are: ready, play, pause, resume, seek.backward, seek.forward, end | [optional]
9-
**emittedAt** | **Date** | When an event occurred, presented in ISO-8601 format. | [optional]
9+
**emittedAt** | **Date** | When an event occurred, presented in ATOM UTC format. | [optional]
1010
**at** | **number** | | [optional]
1111
**from** | **number** | | [optional]
1212
**to** | **number** | | [optional]

docs/model/PlayerTheme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Name | Type | Description | Notes
2222
**hideTitle** | **boolean** | enable/disable title. Default: false | [optional]
2323
**forceLoop** | **boolean** | enable/disable looping. Default: false | [optional]
2424
**playerId** | **string** | |
25-
**createdAt** | **Date** | When the player was created, presented in ISO-8601 format. | [optional]
26-
**updatedAt** | **Date** | When the player was last updated, presented in ISO-8601 format. | [optional]
25+
**createdAt** | **Date** | When the player was created, presented in ATOM UTC format. | [optional]
26+
**updatedAt** | **Date** | When the player was last updated, presented in ATOM UTC format. | [optional]
2727
**assets** | [**PlayerThemeAssets**](PlayerThemeAssets.md) | | [optional]
2828

2929

docs/model/UploadToken.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**token** | **string** | The unique identifier for the token you will use to authenticate an upload. | [optional]
99
**ttl** | **number** | Time-to-live - how long the upload token is valid for. | [optional]
10-
**createdAt** | **Date** | When the token was created, displayed in ISO-8601 format. | [optional]
11-
**expiresAt** | **Date** | When the token expires, displayed in ISO-8601 format. | [optional]
10+
**createdAt** | **Date** | When the token was created, displayed in ATOM UTC format. | [optional]
11+
**expiresAt** | **Date** | When the token expires, displayed in ATOM UTC format. | [optional]
1212

1313

1414

docs/model/Video.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**videoId** | **string** | The unique identifier of the video object. |
9-
**createdAt** | **Date** | When a video was created, presented in ISO-8601 format. | [optional]
9+
**createdAt** | **Date** | When a video was created, presented in ATOM UTC format. | [optional]
1010
**title** | **string** | The title of the video content. | [optional]
1111
**description** | **string** | A description for the video content. | [optional]
12-
**publishedAt** | **Date** | The date and time the API created the video. Date and time are provided using ISO-8601 UTC format. | [optional]
13-
**updatedAt** | **Date** | The date and time the video was updated. Date and time are provided using ISO-8601 UTC format. | [optional]
12+
**publishedAt** | **Date** | The date and time the API created the video. Date and time are provided using ATOM UTC format. | [optional]
13+
**updatedAt** | **Date** | The date and time the video was updated. Date and time are provided using ATOM UTC format. | [optional]
14+
**discardedAt** | **Date** | The date and time the video was discarded. The API populates this field only if you have the Video Restore feature enabled and discard a video. Date and time are provided using ATOM UTC format. | [optional]
15+
**deletesAt** | **Date** | The date and time the video will be permanently deleted. The API populates this field only if you have the Video Restore feature enabled and discard a video. Discarded videos are pemanently deleted after 90 days. Date and time are provided using ATOM UTC format. | [optional]
16+
**discarded** | **boolean** | Returns &#x60;true&#x60; for videos you discarded when you have the Video Restore feature enabled. Returns &#x60;false&#x60; for every other video. | [optional]
1417
**tags** | **Array&lt;string&gt;** | One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces. | [optional]
15-
**metadata** | [**Array&lt;Metadata&gt;**](Metadata.md) | Metadata you can use to categorise and filter videos. Metadata is a list of dictionaries, where each dictionary represents a key value pair for categorising a video. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair. | [optional]
18+
**metadata** | [**Array&lt;Metadata&gt;**](Metadata.md) | Metadata you can use to categorise and filter videos. Metadata is a list of dictionaries, where each dictionary represents a key value pair for categorising a video. | [optional]
1619
**source** | [**VideoSource**](VideoSource.md) | | [optional]
1720
**assets** | [**VideoAssets**](VideoAssets.md) | | [optional]
1821
**playerId** | **string** | The id of the player that will be applied on the video. | [optional]

docs/model/VideoCreationPayload.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Name | Type | Description | Notes
1313
**mp4Support** | **boolean** | Enables mp4 version in addition to streamed version. | [optional]
1414
**playerId** | **string** | The unique identification number for your video player. | [optional]
1515
**tags** | **Array&lt;string&gt;** | A list of tags you want to use to describe your video. | [optional]
16-
**metadata** | [**Array&lt;Metadata&gt;**](Metadata.md) | A list of key value pairs that you use to provide metadata for your video. These pairs can be made dynamic, allowing you to segment your audience. Read more on [dynamic metadata](https://api.video/blog/endpoints/dynamic-metadata/). | [optional]
16+
**metadata** | [**Array&lt;Metadata&gt;**](Metadata.md) | A list of key value pairs that you use to provide metadata for your video. | [optional]
1717
**clip** | [**VideoClip**](VideoClip.md) | | [optional]
1818
**watermark** | [**VideoWatermark**](VideoWatermark.md) | | [optional]
1919

0 commit comments

Comments
 (0)