Skip to content

Commit

Permalink
Merge pull request #212 from apivideo/Update-get-live-streams-sortby-…
Browse files Browse the repository at this point in the history
…attribute

Update get live streams sortby attribute
  • Loading branch information
bot-api-video authored Dec 20, 2023
2 parents 0c896a2 + 1ba5e37 commit 35430c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/api/LiveStreamsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
10 changes: 7 additions & 3 deletions src/api/LiveStreamsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 35430c3

Please sign in to comment.