From 1ba5e37afa603d111aa702d6a4aa0a827299fd9d Mon Sep 17 00:00:00 2001 From: szekelyzol Date: Wed, 20 Dec 2023 11:17:14 +0000 Subject: [PATCH] Update get live streams sortby attribute --- docs/api/LiveStreamsApi.md | 2 +- src/api/LiveStreamsApi.ts | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/api/LiveStreamsApi.md b/docs/api/LiveStreamsApi.md index 42900c8..cf2a188 100644 --- a/docs/api/LiveStreamsApi.md +++ b/docs/api/LiveStreamsApi.md @@ -114,7 +114,7 @@ Get the list of livestreams on the workspace. | ------------- | ------------- | ------------- | ------------- | | **streamKey** | **string**| no| The unique stream key that allows you to stream videos. | | **name** | **string**| no| You can filter live streams by their name or a part of their name. | - | **sortBy** | **string**| no| Allowed: createdAt, publishedAt, name. createdAt - the time a livestream was created using the specified streamKey. publishedAt - the time a livestream was published using the specified streamKey. name - the name of the livestream. If you choose one of the time based options, the time is presented in ISO-8601 format. | + | **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. | | **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. | | **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 | | **pageSize** | **number**| no| Results per page. Allowed values 1-100, default is 25. | diff --git a/src/api/LiveStreamsApi.ts b/src/api/LiveStreamsApi.ts index fd38a21..1aca782 100644 --- a/src/api/LiveStreamsApi.ts +++ b/src/api/LiveStreamsApi.ts @@ -232,7 +232,7 @@ export default class LiveStreamsApi { * @param {Object} searchParams * @param { string } searchParams.streamKey The unique stream key that allows you to stream videos. * @param { string } searchParams.name You can filter live streams by their name or a part of their name. - * @param { string } searchParams.sortBy Allowed: createdAt, publishedAt, name. createdAt - the time a livestream was created using the specified streamKey. publishedAt - the time a livestream was published using the specified streamKey. name - the name of the livestream. If you choose one of the time based options, the time is presented in ISO-8601 format. + * @param { 'name' | 'createdAt' | 'updatedAt' } searchParams.sortBy 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. * @param { 'asc' | 'desc' } searchParams.sortOrder 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. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 * @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25. @@ -247,7 +247,7 @@ export default class LiveStreamsApi { }: { streamKey?: string; name?: string; - sortBy?: string; + sortBy?: 'name' | 'createdAt' | 'updatedAt'; sortOrder?: 'asc' | 'desc'; currentPage?: number; pageSize?: number; @@ -275,7 +275,11 @@ export default class LiveStreamsApi { if (sortBy !== undefined) { urlSearchParams.append( 'sortBy', - ObjectSerializer.serialize(sortBy, 'string', '') + ObjectSerializer.serialize( + sortBy, + "'name' | 'createdAt' | 'updatedAt'", + '' + ) ); } if (sortOrder !== undefined) {