From df3f6c0f4610e636be437386ec5d2c8406c26fd5 Mon Sep 17 00:00:00 2001 From: olivierapivideo Date: Mon, 21 Oct 2024 13:19:28 +0000 Subject: [PATCH] Add summary feature --- CHANGELOG.md | 3 + README.md | 35 +- api/openapi.yaml | 744 +++++++++ build.gradle | 2 +- docs/ConflictError.md | 21 + docs/NotFound.md | 8 +- docs/SummariesApi.md | 388 +++++ docs/SummariesListResponse.md | 18 + docs/Summary.md | 43 + docs/SummaryCreationPayload.md | 26 + docs/SummarySource.md | 19 + docs/SummaryUpdatePayload.md | 19 + docs/VideoCreationPayload.md | 1 + docs/VideoUpdatePayload.md | 1 + docs/VideosApi.md | 11 + pom.xml | 2 +- .../java/video/api/client/ApiVideoClient.java | 11 + .../java/video/api/client/api/ApiClient.java | 2 +- .../api/client/api/clients/SummariesApi.java | 1408 +++++++++++++++++ .../api/client/api/clients/VideosApi.java | 41 + .../api/client/api/models/ConflictError.java | 200 +++ .../video/api/client/api/models/NotFound.java | 16 +- .../api/models/SummariesListResponse.java | 128 ++ .../video/api/client/api/models/Summary.java | 342 ++++ .../api/models/SummaryCreationPayload.java | 171 ++ .../api/client/api/models/SummarySource.java | 159 ++ .../api/models/SummaryUpdatePayload.java | 158 ++ .../api/models/VideoCreationPayload.java | 35 +- .../client/api/models/VideoUpdatePayload.java | 34 +- .../client/api/clients/SummariesApiTest.java | 163 ++ .../summaries/create/responses/201.json | 8 + .../summaries/create/responses/409.json | 7 + .../getSummarySource/responses/404.json | 6 + .../summaries/list/responses/200.json | 34 + .../summaries/update/responses/409.json | 6 + .../payloads/videos/update/responses/409.json | 7 + 36 files changed, 4255 insertions(+), 22 deletions(-) create mode 100644 docs/ConflictError.md create mode 100644 docs/SummariesApi.md create mode 100644 docs/SummariesListResponse.md create mode 100644 docs/Summary.md create mode 100644 docs/SummaryCreationPayload.md create mode 100644 docs/SummarySource.md create mode 100644 docs/SummaryUpdatePayload.md create mode 100644 src/main/java/video/api/client/api/clients/SummariesApi.java create mode 100644 src/main/java/video/api/client/api/models/ConflictError.java create mode 100644 src/main/java/video/api/client/api/models/SummariesListResponse.java create mode 100644 src/main/java/video/api/client/api/models/Summary.java create mode 100644 src/main/java/video/api/client/api/models/SummaryCreationPayload.java create mode 100644 src/main/java/video/api/client/api/models/SummarySource.java create mode 100644 src/main/java/video/api/client/api/models/SummaryUpdatePayload.java create mode 100644 src/test/java/video/api/client/api/clients/SummariesApiTest.java create mode 100644 src/test/resources/payloads/summaries/create/responses/201.json create mode 100644 src/test/resources/payloads/summaries/create/responses/409.json create mode 100644 src/test/resources/payloads/summaries/getSummarySource/responses/404.json create mode 100644 src/test/resources/payloads/summaries/list/responses/200.json create mode 100644 src/test/resources/payloads/summaries/update/responses/409.json create mode 100644 src/test/resources/payloads/videos/update/responses/409.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 47ebcf0..26dd051 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All changes to this project will be documented in this file. +## [1.4.5] - 2024-10-21 +- Add summary feature + ## [1.4.4] - 2024-10-08 - Add transcript feature diff --git a/README.md b/README.md index 84ed970..556dc4c 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ - [ChaptersApi](#chaptersapi) - [LiveStreamsApi](#livestreamsapi) - [PlayerThemesApi](#playerthemesapi) + - [SummariesApi](#summariesapi) - [TagsApi](#tagsapi) - [UploadTokensApi](#uploadtokensapi) - [VideosApi](#videosapi) @@ -69,7 +70,7 @@ Add this dependency to your project's POM: video.api java-api-client - 1.4.4 + 1.4.5 compile ``` @@ -79,7 +80,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -implementation "video.api:java-api-client:1.4.4" +implementation "video.api:java-api-client:1.4.5" ``` #### Others @@ -92,7 +93,7 @@ mvn clean package Then manually install the following JARs: -* `target/java-api-client-1.4.4.jar` +* `target/java-api-client-1.4.5.jar` * `target/lib/*.jar` ### Code sample @@ -249,6 +250,28 @@ Method | HTTP request | Description [**deleteLogo**](https://github.com/apivideo/api.video-java-client/blob/main/docs/PlayerThemesApi.md#deleteLogo) | **DELETE** `/players/{playerId}/logo` | Delete logo +### SummariesApi + + +#### Retrieve an instance of SummariesApi: +```java +ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY"); +SummariesApi summaries = client.summaries() +``` + + + +#### Endpoints + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create**](https://github.com/apivideo/api.video-java-client/blob/main/docs/SummariesApi.md#create) | **POST** `/summaries` | Generate video summary +[**update**](https://github.com/apivideo/api.video-java-client/blob/main/docs/SummariesApi.md#update) | **PATCH** `/summaries/{summaryId}/source` | Update summary details +[**delete**](https://github.com/apivideo/api.video-java-client/blob/main/docs/SummariesApi.md#delete) | **DELETE** `/summaries/{summaryId}` | Delete video summary +[**list**](https://github.com/apivideo/api.video-java-client/blob/main/docs/SummariesApi.md#list) | **GET** `/summaries` | List summaries +[**getSummarySource**](https://github.com/apivideo/api.video-java-client/blob/main/docs/SummariesApi.md#getSummarySource) | **GET** `/summaries/{summaryId}/source` | Get summary details + + ### TagsApi @@ -384,6 +407,7 @@ Method | HTTP request | Description - [CaptionsUpdatePayload](https://github.com/apivideo/api.video-java-client/blob/main/docs/CaptionsUpdatePayload.md) - [Chapter](https://github.com/apivideo/api.video-java-client/blob/main/docs/Chapter.md) - [ChaptersListResponse](https://github.com/apivideo/api.video-java-client/blob/main/docs/ChaptersListResponse.md) + - [ConflictError](https://github.com/apivideo/api.video-java-client/blob/main/docs/ConflictError.md) - [DiscardedVideoUpdatePayload](https://github.com/apivideo/api.video-java-client/blob/main/docs/DiscardedVideoUpdatePayload.md) - [FilterBy](https://github.com/apivideo/api.video-java-client/blob/main/docs/FilterBy.md) - [FilterBy1](https://github.com/apivideo/api.video-java-client/blob/main/docs/FilterBy1.md) @@ -411,6 +435,11 @@ Method | HTTP request | Description - [RefreshTokenPayload](https://github.com/apivideo/api.video-java-client/blob/main/docs/RefreshTokenPayload.md) - [RestreamsRequestObject](https://github.com/apivideo/api.video-java-client/blob/main/docs/RestreamsRequestObject.md) - [RestreamsResponseObject](https://github.com/apivideo/api.video-java-client/blob/main/docs/RestreamsResponseObject.md) + - [SummariesListResponse](https://github.com/apivideo/api.video-java-client/blob/main/docs/SummariesListResponse.md) + - [Summary](https://github.com/apivideo/api.video-java-client/blob/main/docs/Summary.md) + - [SummaryCreationPayload](https://github.com/apivideo/api.video-java-client/blob/main/docs/SummaryCreationPayload.md) + - [SummarySource](https://github.com/apivideo/api.video-java-client/blob/main/docs/SummarySource.md) + - [SummaryUpdatePayload](https://github.com/apivideo/api.video-java-client/blob/main/docs/SummaryUpdatePayload.md) - [TokenCreationPayload](https://github.com/apivideo/api.video-java-client/blob/main/docs/TokenCreationPayload.md) - [TokenListResponse](https://github.com/apivideo/api.video-java-client/blob/main/docs/TokenListResponse.md) - [TooManyRequests](https://github.com/apivideo/api.video-java-client/blob/main/docs/TooManyRequests.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 7ee5ebc..7b26f10 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -1166,6 +1166,494 @@ paths: x-group-parameters: true x-client-paginated: true x-accepts: application/json + /summaries: + get: + description: List all summarries for your videos in a project. + operationId: GET_summaries + parameters: + - description: Use this parameter to filter for a summary that belongs to a + specific video. + example: vilkR8K3N7yrRcxcMt91234 + explode: true + in: query + name: videoId + required: false + schema: + type: string + style: form + - description: 'Use this parameter to filter for summaries based on the way + they were created: automatically or manually via the API.' + example: auto + explode: true + in: query + name: origin + required: false + schema: + enum: + - auto + - api + type: string + style: form + - description: | + Use this parameter to filter for summaries based on the current status of the summary source. + + These are the available statuses: + + `missing`: the input for a summary is not present. + `waiting` : the input video is being processed and a summary will be generated. + `failed`: a technical issue prevented summary generation. + `completed`: the summary is generated. + `unprocessable`: the API rules the source video to be unsuitable for summary generation. An example for this is an input video that has no audio. + example: auto + explode: true + in: query + name: sourceStatus + required: false + schema: + enum: + - missing + - waiting + - failed + - completed + - unprocessable + type: string + style: form + - description: | + Use this parameter to choose which field the API will use to sort the response data. The default is `value`. + + These are the available fields to sort by: + + - `createdAt`: Sorts the results based on date and timestamps when summaries were created. + - `updatedAt`: Sorts the results based on date and timestamps when summaries were last updated. + - `videoId`: Sorts the results based on video IDs. + example: createdAt + explode: true + in: query + name: sortBy + required: false + schema: + enum: + - createdAt + - updatedAt + - videoId + type: string + style: form + - description: Use this parameter to sort results. `asc` is ascending and sorts + from A to Z. `desc` is descending and sorts from Z to A. + example: asc + explode: true + in: query + name: sortOrder + required: false + schema: + enum: + - asc + - desc + type: string + style: form + - description: 'Choose the number of search results to return per page. Minimum + value: 1' + example: 2 + explode: true + in: query + name: currentPage + required: false + schema: + default: 1 + type: integer + style: form + - description: Results per page. Allowed values 1-100, default is 25. + example: 30 + explode: true + in: query + name: pageSize + required: false + schema: + default: 25 + type: integer + style: form + responses: + "200": + content: + application/json: + examples: + List all summaries: + value: + data: + - summaryId: summary_1CGHWuXjhxmeH4WiZ51234 + createdAt: 2024-07-14T23:36:07+00:00 + updatedAt: 2024-07-14T23:36:07+00:00 + videoId: vilkR8K3N7yrRcxcMt91234 + origin: auto + sourceStatus: completed + - summaryId: summary_123HWuXjhxmeH4WiZ55678 + createdAt: 2024-07-15T23:36:07+00:00 + updatedAt: 2024-07-15T23:36:07+00:00 + videoId: vibaBXK3N7yrRcxcMt95678 + origin: auto + sourceStatus: waiting + pagination: + currentPage: 1 + pageSize: 25 + pagesTotal: 1 + itemsTotal: 11 + currentPageItems: 11 + links: + - rel: self + uri: https://ws.api.video/summaries?currentPage=1 + - rel: first + uri: https://ws.api.video/summaries?currentPage=1 + - rel: last + uri: https://ws.api.video/summaries?currentPage=1 + schema: + $ref: '#/components/schemas/summaries-list-response' + description: Created + headers: + X-RateLimit-Limit: + description: The request limit per minute. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Remaining: + description: The number of available requests left for the current time + window. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Retry-After: + description: The number of seconds left until the current rate limit + window resets. + explode: false + schema: + type: integer + style: simple + summary: List summaries + tags: + - Summaries + x-client-action: list + x-client-description: + default: List all summarries for your videos in a project. + x-group-parameters: true + x-client-paginated: true + x-accepts: application/json + post: + description: Generate a title, abstract, and key takeaways for a video. + operationId: POST_summaries + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/summary-creation-payload' + required: true + responses: + "201": + content: + application/json: + examples: + Summary created: + value: + summaryId: summary_1CGHWuXjhxmeH4WiZ51234 + createdAt: 2024-07-14T23:36:07+00:00 + updatedAt: 2024-07-14T23:36:07+00:00 + videoId: vilkR8K3N7yrRcxcMt91234 + origin: auto + sourceStatus: completed + schema: + $ref: '#/components/schemas/summary' + description: Created + headers: + X-RateLimit-Limit: + description: The request limit per minute. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Remaining: + description: The number of available requests left for the current time + window. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Retry-After: + description: The number of seconds left until the current rate limit + window resets. + explode: false + schema: + type: integer + style: simple + "409": + content: + application/json: + examples: + Summary already exists: + value: + type: https://docs.api.video/reference/summary-already-exists + title: A summary already exists or is being created on this video. + status: 409 + detail: You can delete the existing summary and generate a new + one. + name: videoId + schema: + $ref: '#/components/schemas/conflict-error' + description: Conflict + headers: + X-RateLimit-Limit: + description: The request limit per minute. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Remaining: + description: The number of available requests left for the current time + window. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Retry-After: + description: The number of seconds left until the current rate limit + window resets. + explode: false + schema: + type: integer + style: simple + security: + - apiKey: [] + summary: Generate video summary + tags: + - Summaries + x-client-action: create + x-client-description: + default: Generate a title, abstract, and key takeaways for a video. + x-contentType: application/json + x-accepts: application/json + /summaries/{summaryId}: + delete: + description: Delete a summary tied to a video. + operationId: DELETE_summaries-summaryId + parameters: + - description: The unique identifier of the summary you want to delete. + example: summary_1CGHWuXjhxmeH4WiZ51234 + explode: false + in: path + name: summaryId + required: true + schema: + type: string + style: simple + responses: + "204": + description: No Content + headers: + X-RateLimit-Limit: + description: The request limit per minute. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Remaining: + description: The number of available requests left for the current time + window. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Retry-After: + description: The number of seconds left until the current rate limit + window resets. + explode: false + schema: + type: integer + style: simple + security: + - apiKey: [] + summary: Delete video summary + tags: + - Summaries + x-client-action: delete + x-client-description: + default: Delete a summary tied to a video. + x-accepts: application/json + /summaries/{summaryId}/source: + get: + description: Get all details for a summary + operationId: GET_summaries-summaryId-source + parameters: + - description: The unique identifier of the summary source you want to retrieve. + example: summary_1CGHWuXjhxmeH4WiZ51234 + explode: false + in: path + name: summaryId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/summary-source' + description: Success + headers: + X-RateLimit-Limit: + description: The request limit per minute. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Remaining: + description: The number of available requests left for the current time + window. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Retry-After: + description: The number of seconds left until the current rate limit + window resets. + explode: false + schema: + type: integer + style: simple + "404": + content: + application/json: + examples: + response: + value: + type: https://docs.api.video/reference/resource-not-found + title: The requested resource was not found. + name: summaryId + status: 404 + schema: + $ref: '#/components/schemas/not-found' + description: Not Found + headers: + X-RateLimit-Limit: + description: The request limit per minute. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Remaining: + description: The number of available requests left for the current time + window. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Retry-After: + description: The number of seconds left until the current rate limit + window resets. + explode: false + schema: + type: integer + style: simple + security: + - apiKey: [] + summary: Get summary details + tags: + - Summaries + x-client-action: getSummarySource + x-client-description: + default: Get all details for a summary. + x-accepts: application/json + patch: + description: Update details for a summary. Note that this operation is only + allowed for summary objects where `sourceStatus` is `missing`. + operationId: PATCH_summaries-summaryId-source + parameters: + - description: The unique identifier of the summary source you want to update. + example: summary_1CGHWuXjhxmeH4WiZ51234 + explode: false + in: path + name: summaryId + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/summary-update-payload' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/summary-source' + description: Created + headers: + X-RateLimit-Limit: + description: The request limit per minute. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Remaining: + description: The number of available requests left for the current time + window. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Retry-After: + description: The number of seconds left until the current rate limit + window resets. + explode: false + schema: + type: integer + style: simple + "409": + content: + application/json: + examples: + Summary already exists: + value: + type: https://docs.api.video/reference/summary-already-exists + title: A summary already exists or is being created on this video. + status: 409 + detail: You can delete the existing summary and generate a new + one. + schema: + $ref: '#/components/schemas/conflict-error' + description: Conflict + headers: + X-RateLimit-Limit: + description: The request limit per minute. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Remaining: + description: The number of available requests left for the current time + window. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Retry-After: + description: The number of seconds left until the current rate limit + window resets. + explode: false + schema: + type: integer + style: simple + summary: Update summary details + tags: + - Summaries + x-client-action: update + x-client-description: + default: Update details for a summary. Note that this operation is only allowed + for summary objects where `sourceStatus` is `missing`. + x-contentType: application/json + x-accepts: application/json /videos/{videoId}/source: post: description: Ingest a video from a source or file. @@ -3410,6 +3898,42 @@ paths: schema: type: integer style: simple + "409": + content: + application/json: + examples: + Summary already exists: + value: + type: https://docs.api.video/reference/summary-already-exists + title: A summary already exists or is being created on this video. + status: 409 + detail: You can delete the existing summary and generate a new + one. + name: transcriptSummary + schema: + $ref: '#/components/schemas/conflict-error' + description: Conflict + headers: + X-RateLimit-Limit: + description: The request limit per minute. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Remaining: + description: The number of available requests left for the current time + window. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Retry-After: + description: The number of seconds left until the current rate limit + window resets. + explode: false + schema: + type: integer + style: simple "429": content: application/json: @@ -14893,12 +15417,16 @@ components: not-found: properties: type: + description: A link to the error documentation. type: string title: + description: A description of the error that occurred. type: string name: + description: The name of the parameter that caused the error. type: string status: + description: The HTTP status code. type: integer title: NotFound type: object @@ -15972,10 +16500,217 @@ components: \ a language, the API detects it based on the video. \n- When the API\ \ generates a transcript, it will be available as a caption for the video." type: boolean + transcriptSummary: + description: |- + Use this parameter to enable summarization. We recommend using this parameter together with `transcript: true`. + + - When `true`, the API generates a summary for the video, based on the transcription. + - The default value is `false`. + - If you define a video language using the `language` parameter, the API uses that language to summarize the video. If you do not define a language, the API detects it based on the video. + type: boolean required: - title title: VideoCreationPayload type: object + summary-creation-payload: + properties: + videoId: + description: Create a summary of a video using the video ID. + example: vi4k0jvEUuaTdRAEjQ4Jfrgz + type: string + origin: + description: |- + Use this parameter to define how the API generates the summary. The only allowed value is `auto`, which means that the API generates a summary automatically. + + If you do not set this parameter, **the API will not generate a summary automatically**. + + In this case, `sourceStatus` will return `missing`, and you have to manually add a summary using the `PATCH /summaries/{summaryId}/source` endpoint operation. + enum: + - auto + example: auto + type: string + required: + - videoId + type: object + summary-update-payload: + properties: + title: + description: A video title, based on the contents of the video. + example: A short lecture on quantum theory + type: string + abstract: + description: A short outline of the contents of the video. + example: In this lecture, we discuss how complicated quantum theory is, + using the famous example of Schrödingers cat. We also discuss practical + applications like quantum computing. + type: string + takeaways: + description: A list of 3 key points from the video, in chronological order. + example: + - Quantum theory is complicated. + - Schrödinger's cat is neither dead, nor alive. + - Quantum computers are super cool. + items: + type: string + maxItems: 3 + type: array + type: object + conflict-error: + properties: + type: + description: A link to the error documentation. + type: string + title: + description: A description of the error that occurred. + type: string + name: + description: The name of the parameter that caused the error. + type: string + status: + description: The HTTP status code. + type: integer + detail: + description: A solution for the error. + type: string + type: object + summary-source: + example: + takeaways: + - Quantum theory is complicated. + - Schrödinger's cat is neither dead, nor alive. + - Quantum computers are super cool. + abstract: In this lecture, we discuss how complicated quantum theory is, using + the famous example of Schrödingers cat. We also discuss practical applications + like quantum computing. + title: A short lecture on quantum theory + properties: + title: + description: A video title, based on the contents of the video. + example: A short lecture on quantum theory + type: string + abstract: + description: A short outline of the contents of the video. The length of + an `abstract` depends on the amount of content in a video that can be + transcribed. The API condenses the contents into minimum 20, maximum 300 + words. + example: In this lecture, we discuss how complicated quantum theory is, + using the famous example of Schrödingers cat. We also discuss practical + applications like quantum computing. + type: string + takeaways: + description: A list of 3 key points from the video, in chronological order. + example: + - Quantum theory is complicated. + - Schrödinger's cat is neither dead, nor alive. + - Quantum computers are super cool. + items: + type: string + maxItems: 3 + type: array + type: object + summaries-list-response: + example: + pagination: + itemsTotal: 123 + pagesTotal: 7 + pageSize: 20 + currentPage: 3 + currentPageItems: 20 + links: + first: + rel: first + uri: /videos/search?currentPage=1&pageSize=20 + previous: + rel: previous + uri: /videos/search?currentPage=2&pageSize=20 + next: + rel: next + uri: /videos/search?currentPage=4&pageSize=20 + last: + rel: last + uri: /videos/search?currentPage=6&pageSize=20 + data: + - sourceStatus: missing + createdAt: 2024-05-28T11:15:07Z + origin: api + summaryId: summary_1CGHWuXjhxmeH4WiZ51234 + videoId: vi4k0jvEUuaTdRAEjQ4Prklg + updatedAt: 2024-05-28T11:15:07Z + - sourceStatus: missing + createdAt: 2024-05-28T11:15:07Z + origin: api + summaryId: summary_1CGHWuXjhxmeH4WiZ51234 + videoId: vi4k0jvEUuaTdRAEjQ4Prklg + updatedAt: 2024-05-28T11:15:07Z + properties: + data: + description: An array of summary objects. + items: + $ref: '#/components/schemas/summary' + type: array + pagination: + $ref: '#/components/schemas/pagination' + required: + - data + - pagination + title: Summaries + type: object + summary: + example: + sourceStatus: missing + createdAt: 2024-05-28T11:15:07Z + origin: api + summaryId: summary_1CGHWuXjhxmeH4WiZ51234 + videoId: vi4k0jvEUuaTdRAEjQ4Prklg + updatedAt: 2024-05-28T11:15:07Z + properties: + summaryId: + description: The unique identifier of the summary object. + example: summary_1CGHWuXjhxmeH4WiZ51234 + type: string + createdAt: + description: Returns the date and time when the summary was created in ATOM + date-time format. + example: 2024-05-28T11:15:07Z + format: date-time + type: string + updatedAt: + description: Returns the date and time when the summary was last updated + in ATOM date-time format. + example: 2024-05-28T11:15:07Z + format: date-time + type: string + videoId: + description: The unique identifier of the video object. + example: vi4k0jvEUuaTdRAEjQ4Prklg + type: string + origin: + description: |- + Returns the origin of how the summary was created. + + - `api` means that no summary was generated automatically. You can add summary manually using the `PATCH /summaries/{summaryId}/source` endpoint operation. Until this happens, `sourceStatus` returns `missing`. + - `auto` means that the API generated the summary automatically. + enum: + - api + - auto + type: string + sourceStatus: + description: |- + Returns the current status of summary generation. + + `missing`: the input for a summary is not present. + `waiting` : the input video is being processed and a summary will be generated. + `failed`: a technical issue prevented summary generation. + `completed`: the summary is generated. + `unprocessable`: the API rules the source video to be unsuitable for summary generation. An example for this is an input video that has no audio. + enum: + - missing + - waiting + - failed + - completed + - unprocessable + type: string + type: object video-upload-payload: properties: file: @@ -16024,6 +16759,7 @@ components: public: false language: en transcript: true + transcriptSummary: true panoramic: false mp4Support: true tags: @@ -16128,6 +16864,14 @@ components: \ a language, the API detects it based on the video. \n- When the API\ \ generates a transcript, it will be available as a caption for the video." type: boolean + transcriptSummary: + description: "Use this parameter to enable summarization. \n\n- When `true`,\ + \ the API generates a summary for the video, based on the transcription.\n\ + - The default value is `false`.\n- If you define a video language using\ + \ the `language` parameter, the API uses that language to summarize the\ + \ video. If you do not define a language, the API detects it based on\ + \ the video." + type: boolean title: VideoUpdatePayload type: object discarded-video-update-payload: diff --git a/build.gradle b/build.gradle index f6e1ddd..5fa96d3 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ apply plugin: 'com.diffplug.spotless' apply plugin: 'maven-publish' group = 'video.api' -version = '1.4.4' +version = '1.4.5' buildscript { repositories { diff --git a/docs/ConflictError.md b/docs/ConflictError.md new file mode 100644 index 0000000..dccc3f6 --- /dev/null +++ b/docs/ConflictError.md @@ -0,0 +1,21 @@ + + +# ConflictError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | A link to the error documentation. | [optional] +**title** | **String** | A description of the error that occurred. | [optional] +**name** | **String** | The name of the parameter that caused the error. | [optional] +**status** | **Integer** | The HTTP status code. | [optional] +**detail** | **String** | A solution for the error. | [optional] + + +## Implemented Interfaces + +* Serializable +* DeepObject + + diff --git a/docs/NotFound.md b/docs/NotFound.md index f9862fd..d7b583c 100644 --- a/docs/NotFound.md +++ b/docs/NotFound.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **String** | | [optional] -**title** | **String** | | [optional] -**name** | **String** | | [optional] -**status** | **Integer** | | [optional] +**type** | **String** | A link to the error documentation. | [optional] +**title** | **String** | A description of the error that occurred. | [optional] +**name** | **String** | The name of the parameter that caused the error. | [optional] +**status** | **Integer** | The HTTP status code. | [optional] ## Implemented Interfaces diff --git a/docs/SummariesApi.md b/docs/SummariesApi.md new file mode 100644 index 0000000..2a8c671 --- /dev/null +++ b/docs/SummariesApi.md @@ -0,0 +1,388 @@ +# SummariesApi + +All URIs are relative to *https://ws.api.video* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create**](SummariesApi.md#create) | **POST** /summaries | Generate video summary +[**update**](SummariesApi.md#update) | **PATCH** /summaries/{summaryId}/source | Update summary details +[**delete**](SummariesApi.md#delete) | **DELETE** /summaries/{summaryId} | Delete video summary +[**list**](SummariesApi.md#list) | **GET** /summaries | List summaries +[**getSummarySource**](SummariesApi.md#getSummarySource) | **GET** /summaries/{summaryId}/source | Get summary details + + + +# **create** +> Summary create(summaryCreationPayload) +> okhttp3.Call createAsync(summaryCreationPayload, callback) +> ApiResponse createWithHttpInfo(summaryCreationPayload) + +Generate video summary + +Generate a title, abstract, and key takeaways for a video. + +### Example +```java +// Import classes: +import video.api.client.ApiVideoClient; +import video.api.client.api.ApiException; +import video.api.client.api.models.*; +import video.api.client.api.clients.SummariesApi; +import java.util.*; + +public class Example { + public static void main(String[] args) { + ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY"); + // if you rather like to use the sandbox environment: + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); + + SummariesApi apiInstance = client.summaries(); + + SummaryCreationPayload summaryCreationPayload = new SummaryCreationPayload(); // + summaryCreationPayload.setVideoId("vi4k0jvEUuaTdRAEjQ4Jfrgz"); // Create a summary of a video using the video ID. + summaryCreationPayload.setOrigin("auto"); // Use this parameter to define how the API generates the summary. The only allowed value is `auto`, which means that the API generates a summary automatically. + +If you do not set this parameter, **the API will not generate a summary automatically**. + +In this case, `sourceStatus` will return `missing`, and you have to manually add a summary using the `PATCH /summaries/{summaryId}/source` endpoint operation. + + + try { + Summary result = apiInstance.create(summaryCreationPayload); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SummariesApi#create"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getMessage()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **summaryCreationPayload** | [**SummaryCreationPayload**](SummaryCreationPayload.md)| | + +### Return type + + +[**Summary**](Summary.md) + +### Authorization + +[API key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +**409** | Conflict | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| + + +# **update** +> SummarySource update(summaryId, summaryUpdatePayload) +> okhttp3.Call updateAsync(summaryId, summaryUpdatePayload, callback) +> ApiResponse updateWithHttpInfo(summaryId, summaryUpdatePayload) + +Update summary details + +Update details for a summary. Note that this operation is only allowed for summary objects where `sourceStatus` is `missing`. + +### Example +```java +// Import classes: +import video.api.client.ApiVideoClient; +import video.api.client.api.ApiException; +import video.api.client.api.models.*; +import video.api.client.api.clients.SummariesApi; +import java.util.*; + +public class Example { + public static void main(String[] args) { + ApiVideoClient client = new ApiVideoClient(); + // if you rather like to use the sandbox environment: + // ApiVideoClient client = new ApiVideoClient(Environment.SANDBOX); + + SummariesApi apiInstance = client.summaries(); + + String summaryId = "summary_1CGHWuXjhxmeH4WiZ51234"; // The unique identifier of the summary source you want to update. + SummaryUpdatePayload summaryUpdatePayload = new SummaryUpdatePayload(); // + summaryUpdatePayload.setTitle("A short lecture on quantum theory"); // A video title, based on the contents of the video. + summaryUpdatePayload.setAbstract("In this lecture, we discuss how complicated quantum theory is, using the famous example of Schrödingers cat. We also discuss practical applications like quantum computing."); // A short outline of the contents of the video. + summaryUpdatePayload.setTakeaways(Arrays.asList("Quantum theory is complicated.","Schrödinger's cat is neither dead, nor alive.","Quantum computers are super cool.")); // A list of 3 key points from the video, in chronological order. + + + try { + SummarySource result = apiInstance.update(summaryId, summaryUpdatePayload); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SummariesApi#update"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getMessage()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **summaryId** | **String**| The unique identifier of the summary source you want to update. | + **summaryUpdatePayload** | [**SummaryUpdatePayload**](SummaryUpdatePayload.md)| | + +### Return type + + +[**SummarySource**](SummarySource.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +**409** | Conflict | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| + + +# **delete** +> delete(summaryId) +> okhttp3.Call deleteAsync(summaryId, callback) +> ApiResponse deleteWithHttpInfo(summaryId) + +Delete video summary + +Delete a summary tied to a video. + +### Example +```java +// Import classes: +import video.api.client.ApiVideoClient; +import video.api.client.api.ApiException; +import video.api.client.api.models.*; +import video.api.client.api.clients.SummariesApi; +import java.util.*; + +public class Example { + public static void main(String[] args) { + ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY"); + // if you rather like to use the sandbox environment: + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); + + SummariesApi apiInstance = client.summaries(); + + String summaryId = "summary_1CGHWuXjhxmeH4WiZ51234"; // The unique identifier of the summary you want to delete. + + try { + apiInstance.delete(summaryId); + } catch (ApiException e) { + System.err.println("Exception when calling SummariesApi#delete"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getMessage()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **summaryId** | **String**| The unique identifier of the summary you want to delete. | + +### Return type + + +null (empty response body) + +### Authorization + +[API key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| + + +# **list** +> SummariesListResponse list().videoId(videoId).origin(origin).sourceStatus(sourceStatus).sortBy(sortBy).sortOrder(sortOrder).currentPage(currentPage).pageSize(pageSize).execute() +> okhttp3.Call executeAsync(callback) +> ApiResponse executeWithHttpInfo() + +List summaries + +List all summarries for your videos in a project. + +### Example +```java +// Import classes: +import video.api.client.ApiVideoClient; +import video.api.client.api.ApiException; +import video.api.client.api.models.*; +import video.api.client.api.clients.SummariesApi; +import java.util.*; + +public class Example { + public static void main(String[] args) { + ApiVideoClient client = new ApiVideoClient(); + // if you rather like to use the sandbox environment: + // ApiVideoClient client = new ApiVideoClient(Environment.SANDBOX); + + SummariesApi apiInstance = client.summaries(); + + String videoId = "vilkR8K3N7yrRcxcMt91234"; // Use this parameter to filter for a summary that belongs to a specific video. + String origin = "auto"; // Use this parameter to filter for summaries based on the way they were created: automatically or manually via the API. + String sourceStatus = "missing"; // Use this parameter to filter for summaries based on the current status of the summary source. These are the available statuses: `missing`: the input for a summary is not present. `waiting` : the input video is being processed and a summary will be generated. `failed`: a technical issue prevented summary generation. `completed`: the summary is generated. `unprocessable`: the API rules the source video to be unsuitable for summary generation. An example for this is an input video that has no audio. + String sortBy = "createdAt"; // Use this parameter to choose which field the API will use to sort the response data. The default is `value`. These are the available fields to sort by: - `createdAt`: Sorts the results based on date and timestamps when summaries were created. - `updatedAt`: Sorts the results based on date and timestamps when summaries were last updated. - `videoId`: Sorts the results based on video IDs. + String sortOrder = "asc"; // Use this parameter to sort results. `asc` is ascending and sorts from A to Z. `desc` is descending and sorts from Z to A. + Integer currentPage = 1; // Choose the number of search results to return per page. Minimum value: 1 + Integer pageSize = 25; // Results per page. Allowed values 1-100, default is 25. + + try { + Page result = apiInstance.list() + .videoId(videoId) + .origin(origin) + .sourceStatus(sourceStatus) + .sortBy(sortBy) + .sortOrder(sortOrder) + .currentPage(currentPage) + .pageSize(pageSize) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SummariesApi#list"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getMessage()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **videoId** | **String**| Use this parameter to filter for a summary that belongs to a specific video. | [optional] + **origin** | **String**| Use this parameter to filter for summaries based on the way they were created: automatically or manually via the API. | [optional] [enum: auto, api] + **sourceStatus** | **String**| Use this parameter to filter for summaries based on the current status of the summary source. These are the available statuses: `missing`: the input for a summary is not present. `waiting` : the input video is being processed and a summary will be generated. `failed`: a technical issue prevented summary generation. `completed`: the summary is generated. `unprocessable`: the API rules the source video to be unsuitable for summary generation. An example for this is an input video that has no audio. | [optional] [enum: missing, waiting, failed, completed, unprocessable] + **sortBy** | **String**| Use this parameter to choose which field the API will use to sort the response data. The default is `value`. These are the available fields to sort by: - `createdAt`: Sorts the results based on date and timestamps when summaries were created. - `updatedAt`: Sorts the results based on date and timestamps when summaries were last updated. - `videoId`: Sorts the results based on video IDs. | [optional] [enum: createdAt, updatedAt, videoId] + **sortOrder** | **String**| Use this parameter to sort results. `asc` is ascending and sorts from A to Z. `desc` is descending and sorts from Z to A. | [optional] [enum: asc, desc] + **currentPage** | **Integer**| Choose the number of search results to return per page. Minimum value: 1 | [optional] [default to 1] + **pageSize** | **Integer**| Results per page. Allowed values 1-100, default is 25. | [optional] [default to 25] + +### Return type + +[**Page**](pagination.md)<[**Summary**](Summary.md)> + + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Created | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| + + +# **getSummarySource** +> SummarySource getSummarySource(summaryId) +> okhttp3.Call getSummarySourceAsync(summaryId, callback) +> ApiResponse getSummarySourceWithHttpInfo(summaryId) + +Get summary details + +Get all details for a summary. + +### Example +```java +// Import classes: +import video.api.client.ApiVideoClient; +import video.api.client.api.ApiException; +import video.api.client.api.models.*; +import video.api.client.api.clients.SummariesApi; +import java.util.*; + +public class Example { + public static void main(String[] args) { + ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY"); + // if you rather like to use the sandbox environment: + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); + + SummariesApi apiInstance = client.summaries(); + + String summaryId = "summary_1CGHWuXjhxmeH4WiZ51234"; // The unique identifier of the summary source you want to retrieve. + + try { + SummarySource result = apiInstance.getSummarySource(summaryId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SummariesApi#getSummarySource"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getMessage()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **summaryId** | **String**| The unique identifier of the summary source you want to retrieve. | + +### Return type + + +[**SummarySource**](SummarySource.md) + +### Authorization + +[API key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +**404** | Not Found | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| + diff --git a/docs/SummariesListResponse.md b/docs/SummariesListResponse.md new file mode 100644 index 0000000..bb476fe --- /dev/null +++ b/docs/SummariesListResponse.md @@ -0,0 +1,18 @@ + + +# SummariesListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List<Summary>**](Summary.md) | An array of summary objects. | +**pagination** | [**Pagination**](Pagination.md) | | + + +## Implemented Interfaces + +* Serializable +* DeepObject + + diff --git a/docs/Summary.md b/docs/Summary.md new file mode 100644 index 0000000..65eae63 --- /dev/null +++ b/docs/Summary.md @@ -0,0 +1,43 @@ + + +# Summary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**summaryId** | **String** | The unique identifier of the summary object. | [optional] +**createdAt** | **OffsetDateTime** | Returns the date and time when the summary was created in ATOM date-time format. | [optional] +**updatedAt** | **OffsetDateTime** | Returns the date and time when the summary was last updated in ATOM date-time format. | [optional] +**videoId** | **String** | The unique identifier of the video object. | [optional] +**origin** | [**OriginEnum**](#OriginEnum) | Returns the origin of how the summary was created. - `api` means that no summary was generated automatically. You can add summary manually using the `PATCH /summaries/{summaryId}/source` endpoint operation. Until this happens, `sourceStatus` returns `missing`. - `auto` means that the API generated the summary automatically. | [optional] +**sourceStatus** | [**SourceStatusEnum**](#SourceStatusEnum) | Returns the current status of summary generation. `missing`: the input for a summary is not present. `waiting` : the input video is being processed and a summary will be generated. `failed`: a technical issue prevented summary generation. `completed`: the summary is generated. `unprocessable`: the API rules the source video to be unsuitable for summary generation. An example for this is an input video that has no audio. | [optional] + + + +## Enum: OriginEnum + +Name | Value +---- | ----- +API | "api" +AUTO | "auto" + + + +## Enum: SourceStatusEnum + +Name | Value +---- | ----- +MISSING | "missing" +WAITING | "waiting" +FAILED | "failed" +COMPLETED | "completed" +UNPROCESSABLE | "unprocessable" + + +## Implemented Interfaces + +* Serializable +* DeepObject + + diff --git a/docs/SummaryCreationPayload.md b/docs/SummaryCreationPayload.md new file mode 100644 index 0000000..67a2388 --- /dev/null +++ b/docs/SummaryCreationPayload.md @@ -0,0 +1,26 @@ + + +# SummaryCreationPayload + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**videoId** | **String** | Create a summary of a video using the video ID. | +**origin** | [**OriginEnum**](#OriginEnum) | Use this parameter to define how the API generates the summary. The only allowed value is `auto`, which means that the API generates a summary automatically. If you do not set this parameter, **the API will not generate a summary automatically**. In this case, `sourceStatus` will return `missing`, and you have to manually add a summary using the `PATCH /summaries/{summaryId}/source` endpoint operation. | [optional] + + + +## Enum: OriginEnum + +Name | Value +---- | ----- +AUTO | "auto" + + +## Implemented Interfaces + +* Serializable +* DeepObject + + diff --git a/docs/SummarySource.md b/docs/SummarySource.md new file mode 100644 index 0000000..1163faa --- /dev/null +++ b/docs/SummarySource.md @@ -0,0 +1,19 @@ + + +# SummarySource + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **String** | A video title, based on the contents of the video. | [optional] +**_abstract** | **String** | A short outline of the contents of the video. The length of an `abstract` depends on the amount of content in a video that can be transcribed. The API condenses the contents into minimum 20, maximum 300 words. | [optional] +**takeaways** | **List<String>** | A list of 3 key points from the video, in chronological order. | [optional] + + +## Implemented Interfaces + +* Serializable +* DeepObject + + diff --git a/docs/SummaryUpdatePayload.md b/docs/SummaryUpdatePayload.md new file mode 100644 index 0000000..859dc29 --- /dev/null +++ b/docs/SummaryUpdatePayload.md @@ -0,0 +1,19 @@ + + +# SummaryUpdatePayload + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **String** | A video title, based on the contents of the video. | [optional] +**_abstract** | **String** | A short outline of the contents of the video. | [optional] +**takeaways** | **List<String>** | A list of 3 key points from the video, in chronological order. | [optional] + + +## Implemented Interfaces + +* Serializable +* DeepObject + + diff --git a/docs/VideoCreationPayload.md b/docs/VideoCreationPayload.md index 5af38d6..24d8f07 100644 --- a/docs/VideoCreationPayload.md +++ b/docs/VideoCreationPayload.md @@ -19,6 +19,7 @@ Name | Type | Description | Notes **watermark** | [**VideoWatermark**](VideoWatermark.md) | | [optional] **language** | [**LanguageEnum**](#LanguageEnum) | Use this parameter to set the language of the video. When this parameter is set, the API creates a transcript of the video using the language you specify. You must use the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. `language` is a permanent attribute of the video. You can update it to another language using the [`PATCH /videos/{videoId}`](https://docs.api.video/reference/api/Videos#update-a-video-object) operation. This triggers the API to generate a new transcript using a different language. | [optional] **transcript** | **Boolean** | Use this parameter to enable transcription. - When `true`, the API generates a transcript for the video. - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to transcribe the video. If you do not define a language, the API detects it based on the video. - When the API generates a transcript, it will be available as a caption for the video. | [optional] +**transcriptSummary** | **Boolean** | Use this parameter to enable summarization. We recommend using this parameter together with `transcript: true`. - When `true`, the API generates a summary for the video, based on the transcription. - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to summarize the video. If you do not define a language, the API detects it based on the video. | [optional] diff --git a/docs/VideoUpdatePayload.md b/docs/VideoUpdatePayload.md index d8a1eed..3ed276d 100644 --- a/docs/VideoUpdatePayload.md +++ b/docs/VideoUpdatePayload.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **metadata** | [**List<Metadata>**](Metadata.md) | A list (array) of dictionaries where each dictionary contains a key value pair that describes the video. As with tags, you must send the complete list of metadata you want as whatever you send here will overwrite the existing metadata for the video. | [optional] **language** | [**LanguageEnum**](#LanguageEnum) | Use this parameter to set the language of the video. When this parameter is set, the API creates a transcript of the video using the language you specify. You must use the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. `language` is a permanent attribute of the video. You can update it to another language using the [`PATCH /videos/{videoId}`](https://docs.api.video/reference/api/Videos#update-a-video-object) operation. This triggers the API to generate a new transcript using a different language. | [optional] **transcript** | **Boolean** | Use this parameter to enable transcription. - When `true`, the API generates a transcript for the video. - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to transcribe the video. If you do not define a language, the API detects it based on the video. - When the API generates a transcript, it will be available as a caption for the video. | [optional] +**transcriptSummary** | **Boolean** | Use this parameter to enable summarization. - When `true`, the API generates a summary for the video, based on the transcription. - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to summarize the video. If you do not define a language, the API detects it based on the video. | [optional] diff --git a/docs/VideosApi.md b/docs/VideosApi.md index ca6650d..b238fdf 100644 --- a/docs/VideosApi.md +++ b/docs/VideosApi.md @@ -67,6 +67,11 @@ public class Example { - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to transcribe the video. If you do not define a language, the API detects it based on the video. - When the API generates a transcript, it will be available as a caption for the video. + videoCreationPayload.setTranscriptSummary(); // Use this parameter to enable summarization. We recommend using this parameter together with `transcript: true`. + +- When `true`, the API generates a summary for the video, based on the transcription. +- The default value is `false`. +- If you define a video language using the `language` parameter, the API uses that language to summarize the video. If you do not define a language, the API detects it based on the video. try { @@ -448,6 +453,11 @@ public class Example { - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to transcribe the video. If you do not define a language, the API detects it based on the video. - When the API generates a transcript, it will be available as a caption for the video. + videoUpdatePayload.setTranscriptSummary(); // Use this parameter to enable summarization. + +- When `true`, the API generates a summary for the video, based on the transcription. +- The default value is `false`. +- If you define a video language using the `language` parameter, the API uses that language to summarize the video. If you do not define a language, the API detects it based on the video. try { @@ -491,6 +501,7 @@ Name | Type | Description | Notes **200** | Success | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| **400** | Bad Request | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| **404** | Not Found | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +**409** | Conflict | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| **429** | Too Many Requests | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| diff --git a/pom.xml b/pom.xml index cfe95a7..95c2014 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ java-api-client jar ${project.groupId}:${project.artifactId} - 1.4.4 + 1.4.5 https://github.com/apivideo/api.video-java-client api.video Java API client diff --git a/src/main/java/video/api/client/ApiVideoClient.java b/src/main/java/video/api/client/ApiVideoClient.java index 29db65b..33dc4da 100644 --- a/src/main/java/video/api/client/ApiVideoClient.java +++ b/src/main/java/video/api/client/ApiVideoClient.java @@ -13,6 +13,7 @@ public class ApiVideoClient { private final ChaptersApi chapters; private final LiveStreamsApi liveStreams; private final PlayerThemesApi playerThemes; + private final SummariesApi summaries; private final TagsApi tags; private final UploadTokensApi uploadTokens; private final VideosApi videos; @@ -88,6 +89,7 @@ public ApiVideoClient(ApiClient apiClient) { this.chapters = new ChaptersApi(this.apiClient); this.liveStreams = new LiveStreamsApi(this.apiClient); this.playerThemes = new PlayerThemesApi(this.apiClient); + this.summaries = new SummariesApi(this.apiClient); this.tags = new TagsApi(this.apiClient); this.uploadTokens = new UploadTokensApi(this.apiClient); this.videos = new VideosApi(this.apiClient); @@ -140,6 +142,15 @@ public PlayerThemesApi playerThemes() { return this.playerThemes; } + /** + * Get an SummariesApi instance + * + * @return SummariesApi + */ + public SummariesApi summaries() { + return this.summaries; + } + /** * Get an TagsApi instance * diff --git a/src/main/java/video/api/client/api/ApiClient.java b/src/main/java/video/api/client/api/ApiClient.java index 6ecf58e..538f969 100644 --- a/src/main/java/video/api/client/api/ApiClient.java +++ b/src/main/java/video/api/client/api/ApiClient.java @@ -120,7 +120,7 @@ private OkHttpClient initHttpClient(List interceptors) { private void init() { verifyingSsl = true; json = new JSON(); - addDefaultHeader("AV-Origin-Client", "java:1.4.4"); + addDefaultHeader("AV-Origin-Client", "java:1.4.5"); } private boolean isValid(String regex, String field) { diff --git a/src/main/java/video/api/client/api/clients/SummariesApi.java b/src/main/java/video/api/client/api/clients/SummariesApi.java new file mode 100644 index 0000000..ae8c1b1 --- /dev/null +++ b/src/main/java/video/api/client/api/clients/SummariesApi.java @@ -0,0 +1,1408 @@ +/* + * api.video Java API client + * api.video is an API that encodes on the go to facilitate immediate playback, enhancing viewer streaming experiences across multiple devices and platforms. You can stream live or on-demand online videos within minutes. + * + * The version of the OpenAPI document: 1 + * Contact: ecosystem@api.video + * + * NOTE: This class is auto generated. + * Do not edit the class manually. + */ + +package video.api.client.api.clients; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + +import video.api.client.api.models.ConflictError; +import video.api.client.api.models.NotFound; +import video.api.client.api.models.SummariesListResponse; +import video.api.client.api.models.Summary; +import video.api.client.api.models.SummaryCreationPayload; +import video.api.client.api.models.SummarySource; +import video.api.client.api.models.SummaryUpdatePayload; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import video.api.client.api.models.*; +import video.api.client.api.upload.*; +import video.api.client.api.*; + +public class SummariesApi { + private ApiClient localVarApiClient; + + public SummariesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + /** + * Constructor for SummariesApi production environment where API key is not required. + */ + public SummariesApi() { + this.localVarApiClient = new ApiClient(Environment.PRODUCTION.basePath); + } + + /** + * Constructor for SummariesApi with custom API base path where API key is not required. + * + * @param basePath + * the api base path. Expected Environment.PRODUCTION.basePath (default) or Environment.SANDBOX.basePath. + */ + public SummariesApi(String basePath) { + this.localVarApiClient = new ApiClient(basePath); + } + + /** + * Constructor for SummariesApi with custom API base path where API key is not required. + * + * @param environment + * the target environment. Expected Environment.PRODUCTION (default) or Environment.SANDBOX. + */ + public SummariesApi(Environment environment) { + this.localVarApiClient = new ApiClient(environment.basePath); + } + + /** + * Constructor for SummariesApi with custom API base path + * + * @param apiKey + * the api key to use to authenticate to the API + * @param basePath + * the api base path. Expected Environment.PRODUCTION.basePath (default) or Environment.SANDBOX.basePath. + */ + public SummariesApi(String apiKey, String basePath) { + this.localVarApiClient = new ApiClient(apiKey, basePath); + } + + /** + * Constructor for SummariesApi with custom API base path + * + * @param apiKey + * the api key to use to authenticate to the API + * @param environment + * the target environment. Expected Environment.PRODUCTION (default) or Environment.SANDBOX. + */ + public SummariesApi(String apiKey, Environment environment) { + this.localVarApiClient = new ApiClient(apiKey, environment.basePath); + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + /** + * Build call for create + * + * @param summaryCreationPayload + * (required) + * @param _callback + * Callback for upload/download progress + * + * @return Call to execute + * + * @throws ApiException + * If fail to serialize the request body object + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
201Created* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
409Conflict* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
+ */ + private okhttp3.Call createCall(SummaryCreationPayload summaryCreationPayload, final ApiCallback _callback) + throws ApiException { + Object localVarPostBody = summaryCreationPayload; + + // create path and map variables + String localVarPath = "/summaries"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { "application/json" }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, + localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createValidateBeforeCall(SummaryCreationPayload summaryCreationPayload, + final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'summaryCreationPayload' is set + if (summaryCreationPayload == null) { + throw new ApiException("Missing the required parameter 'summaryCreationPayload' when calling create"); + } + + if (summaryCreationPayload.getVideoId() == null) { + throw new ApiException( + "Missing the required parameter 'summaryCreationPayload.videoId' when calling create"); + } + + okhttp3.Call localVarCall = createCall(summaryCreationPayload, _callback); + return localVarCall; + } + + /** + * Generate video summary + * + * Generate a title, abstract, and key takeaways for a video. + * + * @param summaryCreationPayload + * (required) + * + * @return Summary + * + * @throws ApiException + * If fail to call the API, e.g. server error or cannot deserialize the response body + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
201Created* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
409Conflict* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
+ */ + public Summary create(SummaryCreationPayload summaryCreationPayload) throws ApiException { + ApiResponse localVarResp = createWithHttpInfo(summaryCreationPayload); + return localVarResp.getData(); + } + + /** + * Generate video summary + * + * Generate a title, abstract, and key takeaways for a video. + * + * @param summaryCreationPayload + * (required) + * + * @return ApiResponse<Summary> + * + * @throws ApiException + * If fail to call the API, e.g. server error or cannot deserialize the response body + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
201Created* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
409Conflict* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
+ */ + public ApiResponse createWithHttpInfo(SummaryCreationPayload summaryCreationPayload) throws ApiException { + okhttp3.Call localVarCall = createValidateBeforeCall(summaryCreationPayload, null); + Type localVarReturnType = new TypeToken() { + }.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Generate video summary (asynchronously) Generate a title, abstract, and key takeaways for a video. + * + * @param summaryCreationPayload + * (required) + * @param _callback + * The callback to be executed when the API call finishes + * + * @return The request call + * + * @throws ApiException + * If fail to process the API call, e.g. serializing the request body object + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
201Created* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
409Conflict* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
+ */ + public okhttp3.Call createAsync(SummaryCreationPayload summaryCreationPayload, final ApiCallback _callback) + throws ApiException { + okhttp3.Call localVarCall = createValidateBeforeCall(summaryCreationPayload, _callback); + Type localVarReturnType = new TypeToken() { + }.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for update + * + * @param summaryId + * The unique identifier of the summary source you want to update. (required) + * @param summaryUpdatePayload + * (required) + * @param _callback + * Callback for upload/download progress + * + * @return Call to execute + * + * @throws ApiException + * If fail to serialize the request body object + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
201Created* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
409Conflict* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
+ */ + private okhttp3.Call updateCall(String summaryId, SummaryUpdatePayload summaryUpdatePayload, + final ApiCallback _callback) throws ApiException { + Object localVarPostBody = summaryUpdatePayload; + + // create path and map variables + String localVarPath = "/summaries/{summaryId}/source".replaceAll("\\{" + "summaryId" + "\\}", + localVarApiClient.escapeString(summaryId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { "application/json" }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, + localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateValidateBeforeCall(String summaryId, SummaryUpdatePayload summaryUpdatePayload, + final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'summaryId' is set + if (summaryId == null) { + throw new ApiException("Missing the required parameter 'summaryId' when calling update"); + } + + // verify the required parameter 'summaryUpdatePayload' is set + if (summaryUpdatePayload == null) { + throw new ApiException("Missing the required parameter 'summaryUpdatePayload' when calling update"); + } + + okhttp3.Call localVarCall = updateCall(summaryId, summaryUpdatePayload, _callback); + return localVarCall; + } + + /** + * Update summary details + * + * Update details for a summary. Note that this operation is only allowed for summary objects where + * `sourceStatus` is `missing`. + * + * @param summaryId + * The unique identifier of the summary source you want to update. (required) + * @param summaryUpdatePayload + * (required) + * + * @return SummarySource + * + * @throws ApiException + * If fail to call the API, e.g. server error or cannot deserialize the response body + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
201Created* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
409Conflict* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
+ */ + public SummarySource update(String summaryId, SummaryUpdatePayload summaryUpdatePayload) throws ApiException { + ApiResponse localVarResp = updateWithHttpInfo(summaryId, summaryUpdatePayload); + return localVarResp.getData(); + } + + /** + * Update summary details + * + * Update details for a summary. Note that this operation is only allowed for summary objects where + * `sourceStatus` is `missing`. + * + * @param summaryId + * The unique identifier of the summary source you want to update. (required) + * @param summaryUpdatePayload + * (required) + * + * @return ApiResponse<SummarySource> + * + * @throws ApiException + * If fail to call the API, e.g. server error or cannot deserialize the response body + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
201Created* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
409Conflict* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
+ */ + public ApiResponse updateWithHttpInfo(String summaryId, SummaryUpdatePayload summaryUpdatePayload) + throws ApiException { + okhttp3.Call localVarCall = updateValidateBeforeCall(summaryId, summaryUpdatePayload, null); + Type localVarReturnType = new TypeToken() { + }.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update summary details (asynchronously) Update details for a summary. Note that this operation is only allowed + * for summary objects where `sourceStatus` is `missing`. + * + * @param summaryId + * The unique identifier of the summary source you want to update. (required) + * @param summaryUpdatePayload + * (required) + * @param _callback + * The callback to be executed when the API call finishes + * + * @return The request call + * + * @throws ApiException + * If fail to process the API call, e.g. serializing the request body object + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
201Created* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
409Conflict* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
+ */ + public okhttp3.Call updateAsync(String summaryId, SummaryUpdatePayload summaryUpdatePayload, + final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = updateValidateBeforeCall(summaryId, summaryUpdatePayload, _callback); + Type localVarReturnType = new TypeToken() { + }.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for delete + * + * @param summaryId + * The unique identifier of the summary you want to delete. (required) + * @param _callback + * Callback for upload/download progress + * + * @return Call to execute + * + * @throws ApiException + * If fail to serialize the request body object + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
204No Content* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
+ */ + private okhttp3.Call deleteCall(String summaryId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/summaries/{summaryId}".replaceAll("\\{" + "summaryId" + "\\}", + localVarApiClient.escapeString(summaryId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, + localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteValidateBeforeCall(String summaryId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'summaryId' is set + if (summaryId == null) { + throw new ApiException("Missing the required parameter 'summaryId' when calling delete"); + } + + okhttp3.Call localVarCall = deleteCall(summaryId, _callback); + return localVarCall; + } + + /** + * Delete video summary + * + * Delete a summary tied to a video. + * + * @param summaryId + * The unique identifier of the summary you want to delete. (required) + * + * @throws ApiException + * If fail to call the API, e.g. server error or cannot deserialize the response body + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
204No Content* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
+ */ + public void delete(String summaryId) throws ApiException { + deleteWithHttpInfo(summaryId); + } + + /** + * Delete video summary + * + * Delete a summary tied to a video. + * + * @param summaryId + * The unique identifier of the summary you want to delete. (required) + * + * @return ApiResponse<Void> + * + * @throws ApiException + * If fail to call the API, e.g. server error or cannot deserialize the response body + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
204No Content* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
+ */ + public ApiResponse deleteWithHttpInfo(String summaryId) throws ApiException { + okhttp3.Call localVarCall = deleteValidateBeforeCall(summaryId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete video summary (asynchronously) Delete a summary tied to a video. + * + * @param summaryId + * The unique identifier of the summary you want to delete. (required) + * @param _callback + * The callback to be executed when the API call finishes + * + * @return The request call + * + * @throws ApiException + * If fail to process the API call, e.g. serializing the request body object + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
204No Content* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
+ */ + public okhttp3.Call deleteAsync(String summaryId, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = deleteValidateBeforeCall(summaryId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + private okhttp3.Call listCall(String videoId, String origin, String sourceStatus, String sortBy, String sortOrder, + Integer currentPage, Integer pageSize, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/summaries"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (videoId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("videoId", videoId)); + } + + if (origin != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("origin", origin)); + } + + if (sourceStatus != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sourceStatus", sourceStatus)); + } + + if (sortBy != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sortBy", sortBy)); + } + + if (sortOrder != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sortOrder", sortOrder)); + } + + if (currentPage != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currentPage", currentPage)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, + localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listValidateBeforeCall(String videoId, String origin, String sourceStatus, String sortBy, + String sortOrder, Integer currentPage, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listCall(videoId, origin, sourceStatus, sortBy, sortOrder, currentPage, pageSize, + _callback); + return localVarCall; + } + + private ApiResponse listWithHttpInfo(String videoId, String origin, String sourceStatus, + String sortBy, String sortOrder, Integer currentPage, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = listValidateBeforeCall(videoId, origin, sourceStatus, sortBy, sortOrder, + currentPage, pageSize, null); + Type localVarReturnType = new TypeToken() { + }.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listAsync(String videoId, String origin, String sourceStatus, String sortBy, String sortOrder, + Integer currentPage, Integer pageSize, final ApiCallback _callback) + throws ApiException { + okhttp3.Call localVarCall = listValidateBeforeCall(videoId, origin, sourceStatus, sortBy, sortOrder, + currentPage, pageSize, _callback); + Type localVarReturnType = new TypeToken() { + }.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistRequest { + private String videoId; + private String origin; + private String sourceStatus; + private String sortBy; + private String sortOrder; + private Integer currentPage; + private Integer pageSize; + + private APIlistRequest() { + } + + /** + * Set videoId + * + * @param videoId + * Use this parameter to filter for a summary that belongs to a specific video. (optional) + * + * @return APIlistRequest + */ + public APIlistRequest videoId(String videoId) { + this.videoId = videoId; + return this; + } + + /** + * Set origin + * + * @param origin + * Use this parameter to filter for summaries based on the way they were created: automatically or + * manually via the API. (optional) + * + * @return APIlistRequest + */ + public APIlistRequest origin(String origin) { + this.origin = origin; + return this; + } + + /** + * Set sourceStatus + * + * @param sourceStatus + * Use this parameter to filter for summaries based on the current status of the summary source. + * These are the available statuses: `missing`: the input for a summary is not present. + * `waiting` : the input video is being processed and a summary will be generated. + * `failed`: a technical issue prevented summary generation. `completed`: the + * summary is generated. `unprocessable`: the API rules the source video to be unsuitable + * for summary generation. An example for this is an input video that has no audio. (optional) + * + * @return APIlistRequest + */ + public APIlistRequest sourceStatus(String sourceStatus) { + this.sourceStatus = sourceStatus; + return this; + } + + /** + * Set sortBy + * + * @param sortBy + * Use this parameter to choose which field the API will use to sort the response data. The default + * is `value`. These are the available fields to sort by: - `createdAt`: Sorts + * the results based on date and timestamps when summaries were created. - `updatedAt`: + * Sorts the results based on date and timestamps when summaries were last updated. - + * `videoId`: Sorts the results based on video IDs. (optional) + * + * @return APIlistRequest + */ + public APIlistRequest sortBy(String sortBy) { + this.sortBy = sortBy; + return this; + } + + /** + * Set sortOrder + * + * @param sortOrder + * Use this parameter to sort results. `asc` is ascending and sorts from A to Z. + * `desc` is descending and sorts from Z to A. (optional) + * + * @return APIlistRequest + */ + public APIlistRequest sortOrder(String sortOrder) { + this.sortOrder = sortOrder; + return this; + } + + /** + * Set currentPage + * + * @param currentPage + * Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1) + * + * @return APIlistRequest + */ + public APIlistRequest currentPage(Integer currentPage) { + this.currentPage = currentPage; + return this; + } + + /** + * Set pageSize + * + * @param pageSize + * Results per page. Allowed values 1-100, default is 25. (optional, default to 25) + * + * @return APIlistRequest + */ + public APIlistRequest pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Build call for list + * + * @param _callback + * ApiCallback API callback + * + * @return Call to execute + * + * @throws ApiException + * If fail to serialize the request body object + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
200Created* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit + * window resets.
+ *
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listCall(videoId, origin, sourceStatus, sortBy, sortOrder, currentPage, pageSize, _callback); + } + + /** + * Execute list request + * + * @return SummariesListResponse + * + * @throws ApiException + * If fail to call the API, e.g. server error or cannot deserialize the response body + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
200Created* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit + * window resets.
+ *
+ */ + public Page execute() throws ApiException { + ApiResponse localVarResp = listWithHttpInfo(videoId, origin, sourceStatus, sortBy, + sortOrder, currentPage, pageSize); + return new Page<>(localVarResp.getData().getData(), localVarResp.getData().getPagination(), () -> { + try { + return copy().currentPage((currentPage == null ? 1 : currentPage) + 1).execute(); + } catch (ApiException e) { + throw new RuntimeException(e); + } + }); // + } + + private APIlistRequest copy() { + APIlistRequest copy = new APIlistRequest(); + copy.videoId(videoId); + copy.origin(origin); + copy.sourceStatus(sourceStatus); + copy.sortBy(sortBy); + copy.sortOrder(sortOrder); + copy.currentPage(currentPage); + copy.pageSize(pageSize); + return copy; + } + + /** + * Execute list request with HTTP info returned + * + * @return ApiResponse<SummariesListResponse> + * + * @throws ApiException + * If fail to call the API, e.g. server error or cannot deserialize the response body + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
200Created* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit + * window resets.
+ *
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listWithHttpInfo(videoId, origin, sourceStatus, sortBy, sortOrder, currentPage, pageSize); + } + + /** + * Execute list request (asynchronously) + * + * @param _callback + * The callback to be executed when the API call finishes + * + * @return The request call + * + * @throws ApiException + * If fail to process the API call, e.g. serializing the request body object + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
200Created* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit + * window resets.
+ *
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + ApiCallback apiCallback = new ApiCallback() { + + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + _callback.onFailure(e, statusCode, responseHeaders); + } + + @Override + public void onSuccess(SummariesListResponse result, int statusCode, + Map> responseHeaders) { + _callback.onSuccess(new Page<>(result.getData(), result.getPagination(), () -> { + try { + return copy().currentPage((currentPage == null ? 1 : currentPage) + 1).execute(); + } catch (ApiException e) { + throw new RuntimeException(e); + } + }), statusCode, responseHeaders); + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + _callback.onUploadProgress(bytesWritten, contentLength, done); + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + _callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + return listAsync(videoId, origin, sourceStatus, sortBy, sortOrder, currentPage, pageSize, apiCallback); + } + } + + /** + * List summaries + * + * List all summarries for your videos in a project. + * + * @return APIlistRequest + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
200Created* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
+ */ + public APIlistRequest list() { + return new APIlistRequest(); + } + + /** + * Build call for getSummarySource + * + * @param summaryId + * The unique identifier of the summary source you want to retrieve. (required) + * @param _callback + * Callback for upload/download progress + * + * @return Call to execute + * + * @throws ApiException + * If fail to serialize the request body object + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
200Success* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
404Not Found* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
+ */ + private okhttp3.Call getSummarySourceCall(String summaryId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/summaries/{summaryId}/source".replaceAll("\\{" + "summaryId" + "\\}", + localVarApiClient.escapeString(summaryId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, + localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSummarySourceValidateBeforeCall(String summaryId, final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'summaryId' is set + if (summaryId == null) { + throw new ApiException("Missing the required parameter 'summaryId' when calling getSummarySource"); + } + + okhttp3.Call localVarCall = getSummarySourceCall(summaryId, _callback); + return localVarCall; + } + + /** + * Get summary details + * + * Get all details for a summary. + * + * @param summaryId + * The unique identifier of the summary source you want to retrieve. (required) + * + * @return SummarySource + * + * @throws ApiException + * If fail to call the API, e.g. server error or cannot deserialize the response body + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
200Success* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
404Not Found* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
+ */ + public SummarySource getSummarySource(String summaryId) throws ApiException { + ApiResponse localVarResp = getSummarySourceWithHttpInfo(summaryId); + return localVarResp.getData(); + } + + /** + * Get summary details + * + * Get all details for a summary. + * + * @param summaryId + * The unique identifier of the summary source you want to retrieve. (required) + * + * @return ApiResponse<SummarySource> + * + * @throws ApiException + * If fail to call the API, e.g. server error or cannot deserialize the response body + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
200Success* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
404Not Found* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
+ */ + public ApiResponse getSummarySourceWithHttpInfo(String summaryId) throws ApiException { + okhttp3.Call localVarCall = getSummarySourceValidateBeforeCall(summaryId, null); + Type localVarReturnType = new TypeToken() { + }.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get summary details (asynchronously) Get all details for a summary. + * + * @param summaryId + * The unique identifier of the summary source you want to retrieve. (required) + * @param _callback + * The callback to be executed when the API call finishes + * + * @return The request call + * + * @throws ApiException + * If fail to process the API call, e.g. serializing the request body object + * + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Status CodeDescriptionResponse Headers
200Success* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
404Not Found* X-RateLimit-Limit - The request limit per minute.
+ * * X-RateLimit-Remaining - The number of available requests left for the current time + * window.
+ * * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window + * resets.
+ *
+ */ + public okhttp3.Call getSummarySourceAsync(String summaryId, final ApiCallback _callback) + throws ApiException { + okhttp3.Call localVarCall = getSummarySourceValidateBeforeCall(summaryId, _callback); + Type localVarReturnType = new TypeToken() { + }.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + +} diff --git a/src/main/java/video/api/client/api/clients/VideosApi.java b/src/main/java/video/api/client/api/clients/VideosApi.java index f778f96..cae6969 100644 --- a/src/main/java/video/api/client/api/clients/VideosApi.java +++ b/src/main/java/video/api/client/api/clients/VideosApi.java @@ -16,6 +16,7 @@ import java.io.IOException; import video.api.client.api.models.BadRequest; +import video.api.client.api.models.ConflictError; import video.api.client.api.models.DiscardedVideoUpdatePayload; import java.io.File; import video.api.client.api.models.NotFound; @@ -2083,6 +2084,16 @@ public okhttp3.Call getAsync(String videoId, final ApiCallback