From 0c55a8c95251a29dcb2b48d01fabc975aab17ba9 Mon Sep 17 00:00:00 2001 From: szekelyzol Date: Fri, 18 Oct 2024 14:50:48 +0000 Subject: [PATCH] Add summary feature --- .openapi-generator/FILES | 21 + .../oas_apivideo.yaml-defaut-cli.sha256 | 2 +- README.md | 27 + docs/ConflictError.md | 14 + docs/GetSummaries.md | 10 + docs/InlineObject.md | 11 + docs/NotFound.md | 8 +- docs/SummariesApi.md | 343 ++++++++ docs/SummaryObject.md | 15 + docs/SummarySource.md | 12 + docs/UpdateSummaryRequest.md | 12 + docs/VideoCreationPayload.md | 1 + docs/VideoUpdatePayload.md | 1 + docs/VideosApi.md | 1 + src/Api/SummariesApi.cs | 800 ++++++++++++++++++ src/Api/VideosApi.cs | 12 +- src/ApiVideo.cs | 10 + src/Model/ConflictError.cs | 77 ++ src/Model/GetSummaries.cs | 45 + src/Model/InlineObject.cs | 53 ++ src/Model/NotFound.cs | 12 +- src/Model/SummaryObject.cs | 85 ++ src/Model/SummarySource.cs | 61 ++ src/Model/UpdateSummaryRequest.cs | 61 ++ src/Model/VideoCreationPayload.cs | 8 + src/Model/VideoUpdatePayload.cs | 8 + .../summaries/create/responses/201.json | 8 + .../summaries/create/responses/409.json | 7 + .../payloads/summaries/get/responses/404.json | 6 + .../summaries/list/responses/200.json | 17 + .../summaries/update/responses/409.json | 6 + .../payloads/videos/update/responses/409.json | 7 + 32 files changed, 1746 insertions(+), 15 deletions(-) create mode 100644 docs/ConflictError.md create mode 100644 docs/GetSummaries.md create mode 100644 docs/InlineObject.md create mode 100644 docs/SummariesApi.md create mode 100644 docs/SummaryObject.md create mode 100644 docs/SummarySource.md create mode 100644 docs/UpdateSummaryRequest.md create mode 100644 src/Api/SummariesApi.cs create mode 100644 src/Model/ConflictError.cs create mode 100644 src/Model/GetSummaries.cs create mode 100644 src/Model/InlineObject.cs create mode 100644 src/Model/SummaryObject.cs create mode 100644 src/Model/SummarySource.cs create mode 100644 src/Model/UpdateSummaryRequest.cs create mode 100644 tests/resources/payloads/summaries/create/responses/201.json create mode 100644 tests/resources/payloads/summaries/create/responses/409.json create mode 100644 tests/resources/payloads/summaries/get/responses/404.json create mode 100644 tests/resources/payloads/summaries/list/responses/200.json create mode 100644 tests/resources/payloads/summaries/update/responses/409.json create mode 100644 tests/resources/payloads/videos/update/responses/409.json diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 6516e6f..820cf2d 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -30,10 +30,13 @@ docs/CaptionsUpdatePayload.md docs/Chapter.md docs/ChaptersApi.md docs/ChaptersListResponse.md +docs/ConflictError.md docs/DiscardedVideoUpdatePayload.md docs/FilterBy.md docs/FilterBy1.md docs/FilterBy2.md +docs/GetSummaries.md +docs/InlineObject.md docs/Link.md docs/ListTagsResponse.md docs/ListTagsResponseData.md @@ -60,11 +63,15 @@ docs/Quality.md docs/RefreshTokenPayload.md docs/RestreamsRequestObject.md docs/RestreamsResponseObject.md +docs/SummariesApi.md +docs/SummaryObject.md +docs/SummarySource.md docs/TagsApi.md docs/TokenCreationPayload.md docs/TokenListResponse.md docs/TooManyRequests.md docs/UnrecognizedRequestUrl.md +docs/UpdateSummaryRequest.md docs/UploadToken.md docs/UploadTokensApi.md docs/Video.md @@ -100,6 +107,7 @@ src/ApiVideo.Test/Api/CaptionsApiTests.cs src/ApiVideo.Test/Api/ChaptersApiTests.cs src/ApiVideo.Test/Api/LiveStreamsApiTests.cs src/ApiVideo.Test/Api/PlayerThemesApiTests.cs +src/ApiVideo.Test/Api/SummariesApiTests.cs src/ApiVideo.Test/Api/TagsApiTests.cs src/ApiVideo.Test/Api/UploadTokensApiTests.cs src/ApiVideo.Test/Api/VideosApiTests.cs @@ -128,10 +136,13 @@ src/ApiVideo.Test/Model/CaptionsListResponseTests.cs src/ApiVideo.Test/Model/CaptionsUpdatePayloadTests.cs src/ApiVideo.Test/Model/ChapterTests.cs src/ApiVideo.Test/Model/ChaptersListResponseTests.cs +src/ApiVideo.Test/Model/ConflictErrorTests.cs src/ApiVideo.Test/Model/DiscardedVideoUpdatePayloadTests.cs src/ApiVideo.Test/Model/FilterBy1Tests.cs src/ApiVideo.Test/Model/FilterBy2Tests.cs src/ApiVideo.Test/Model/FilterByTests.cs +src/ApiVideo.Test/Model/GetSummariesTests.cs +src/ApiVideo.Test/Model/InlineObjectTests.cs src/ApiVideo.Test/Model/LinkTests.cs src/ApiVideo.Test/Model/ListTagsResponseDataTests.cs src/ApiVideo.Test/Model/ListTagsResponseTests.cs @@ -155,10 +166,13 @@ src/ApiVideo.Test/Model/QualityTests.cs src/ApiVideo.Test/Model/RefreshTokenPayloadTests.cs src/ApiVideo.Test/Model/RestreamsRequestObjectTests.cs src/ApiVideo.Test/Model/RestreamsResponseObjectTests.cs +src/ApiVideo.Test/Model/SummaryObjectTests.cs +src/ApiVideo.Test/Model/SummarySourceTests.cs src/ApiVideo.Test/Model/TokenCreationPayloadTests.cs src/ApiVideo.Test/Model/TokenListResponseTests.cs src/ApiVideo.Test/Model/TooManyRequestsTests.cs src/ApiVideo.Test/Model/UnrecognizedRequestUrlTests.cs +src/ApiVideo.Test/Model/UpdateSummaryRequestTests.cs src/ApiVideo.Test/Model/UploadTokenTests.cs src/ApiVideo.Test/Model/VideoAssetsTests.cs src/ApiVideo.Test/Model/VideoClipTests.cs @@ -188,6 +202,7 @@ src/ApiVideo/Api/CaptionsApi.cs src/ApiVideo/Api/ChaptersApi.cs src/ApiVideo/Api/LiveStreamsApi.cs src/ApiVideo/Api/PlayerThemesApi.cs +src/ApiVideo/Api/SummariesApi.cs src/ApiVideo/Api/TagsApi.cs src/ApiVideo/Api/UploadTokensApi.cs src/ApiVideo/Api/VideosApi.cs @@ -224,12 +239,15 @@ src/ApiVideo/Model/CaptionsListResponse.cs src/ApiVideo/Model/CaptionsUpdatePayload.cs src/ApiVideo/Model/Chapter.cs src/ApiVideo/Model/ChaptersListResponse.cs +src/ApiVideo/Model/ConflictError.cs src/ApiVideo/Model/DiscardedVideoUpdatePayload.cs src/ApiVideo/Model/FilterBy.cs src/ApiVideo/Model/FilterBy1.cs src/ApiVideo/Model/FilterBy2.cs +src/ApiVideo/Model/GetSummaries.cs src/ApiVideo/Model/IUploadPartProgressListener.cs src/ApiVideo/Model/IUploadProgressListener.cs +src/ApiVideo/Model/InlineObject.cs src/ApiVideo/Model/Link.cs src/ApiVideo/Model/ListTagsResponse.cs src/ApiVideo/Model/ListTagsResponseData.cs @@ -255,10 +273,13 @@ src/ApiVideo/Model/Quality.cs src/ApiVideo/Model/RefreshTokenPayload.cs src/ApiVideo/Model/RestreamsRequestObject.cs src/ApiVideo/Model/RestreamsResponseObject.cs +src/ApiVideo/Model/SummaryObject.cs +src/ApiVideo/Model/SummarySource.cs src/ApiVideo/Model/TokenCreationPayload.cs src/ApiVideo/Model/TokenListResponse.cs src/ApiVideo/Model/TooManyRequests.cs src/ApiVideo/Model/UnrecognizedRequestUrl.cs +src/ApiVideo/Model/UpdateSummaryRequest.cs src/ApiVideo/Model/UploadToken.cs src/ApiVideo/Model/Video.cs src/ApiVideo/Model/VideoAssets.cs diff --git a/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 b/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 index ccf8a5a..b930c86 100644 --- a/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 +++ b/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 @@ -1 +1 @@ -9d05425d4fb2c3a73804ed5a27232eda6751260b0947f6b4c736cc96df300103 \ No newline at end of file +92f534e12eeb57fda284e0323fdf986652b4cc901acefd85b8c0fdfa9d64fca3 \ No newline at end of file diff --git a/README.md b/README.md index c0dc2d4..7a1b014 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ - [ChaptersApi](#chaptersapi) - [LiveStreamsApi](#livestreamsapi) - [PlayerThemesApi](#playerthemesapi) + - [SummariesApi](#summariesapi) - [TagsApi](#tagsapi) - [UploadTokensApi](#uploadtokensapi) - [VideosApi](#videosapi) @@ -259,6 +260,26 @@ Method | HTTP request | Description [**deleteLogo**](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/PlayerThemesApi.md#deleteLogo) | **DELETE** `/players/{playerId}/logo` | Delete logo +#### SummariesApi + + +##### Retrieve an instance of SummariesApi: +```java +ApiVideoClient apiVideoClient = new ApiVideoClient("YOUR_API_KEY"); +SummariesApi summaries = client.Summaries() +``` + +##### Endpoints + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create**](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/SummariesApi.md#create) | **POST** `/summaries` | Generate video summary +[**get**](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/SummariesApi.md#get) | **GET** `/summaries/{summaryId}/source` | Get summary details +[**update**](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/SummariesApi.md#update) | **PATCH** `/summaries/{summaryId}/source` | Update summary details +[**delete**](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/SummariesApi.md#delete) | **DELETE** `/summaries/{summaryId}` | Delete video summary +[**list**](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/SummariesApi.md#list) | **GET** `/summaries` | List summaries + + #### TagsApi @@ -384,10 +405,13 @@ Method | HTTP request | Description - [CaptionsUpdatePayload](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/CaptionsUpdatePayload.md) - [Chapter](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/Chapter.md) - [ChaptersListResponse](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/ChaptersListResponse.md) + - [ConflictError](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/ConflictError.md) - [DiscardedVideoUpdatePayload](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/DiscardedVideoUpdatePayload.md) - [FilterBy](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/FilterBy.md) - [FilterBy1](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/FilterBy1.md) - [FilterBy2](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/FilterBy2.md) + - [GetSummaries](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/GetSummaries.md) + - [InlineObject](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/InlineObject.md) - [Link](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/Link.md) - [ListTagsResponse](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/ListTagsResponse.md) - [ListTagsResponseData](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/ListTagsResponseData.md) @@ -411,10 +435,13 @@ Method | HTTP request | Description - [RefreshTokenPayload](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/RefreshTokenPayload.md) - [RestreamsRequestObject](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/RestreamsRequestObject.md) - [RestreamsResponseObject](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/RestreamsResponseObject.md) + - [SummaryObject](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/SummaryObject.md) + - [SummarySource](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/SummarySource.md) - [TokenCreationPayload](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/TokenCreationPayload.md) - [TokenListResponse](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/TokenListResponse.md) - [TooManyRequests](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/TooManyRequests.md) - [UnrecognizedRequestUrl](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/UnrecognizedRequestUrl.md) + - [UpdateSummaryRequest](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/UpdateSummaryRequest.md) - [UploadToken](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/UploadToken.md) - [Video](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/Video.md) - [VideoAssets](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/VideoAssets.md) diff --git a/docs/ConflictError.md b/docs/ConflictError.md new file mode 100644 index 0000000..f339e5b --- /dev/null +++ b/docs/ConflictError.md @@ -0,0 +1,14 @@ +# ApiVideo.Model.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** | **int** | The HTTP status code. | [optional] +**Detail** | **string** | A solution for the error. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/GetSummaries.md b/docs/GetSummaries.md new file mode 100644 index 0000000..d1d8778 --- /dev/null +++ b/docs/GetSummaries.md @@ -0,0 +1,10 @@ +# ApiVideo.Model.GetSummaries + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**List<SummaryObject>**](SummaryObject.md) | An array of summary objects. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/InlineObject.md b/docs/InlineObject.md new file mode 100644 index 0000000..83c5261 --- /dev/null +++ b/docs/InlineObject.md @@ -0,0 +1,11 @@ +# ApiVideo.Model.InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VideoId** | **string** | Create a summary of a video using the video ID. | [optional] +**Origin** | **string** | 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] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/NotFound.md b/docs/NotFound.md index c5135ec..3d434a9 100644 --- a/docs/NotFound.md +++ b/docs/NotFound.md @@ -4,10 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **string** | | [optional] -**Title** | **string** | | [optional] -**Name** | **string** | | [optional] -**Status** | **int** | | [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** | **int** | The HTTP status code. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SummariesApi.md b/docs/SummariesApi.md new file mode 100644 index 0000000..77441af --- /dev/null +++ b/docs/SummariesApi.md @@ -0,0 +1,343 @@ +# ApiVideo.Api.SummariesApi + +All URIs are relative to *https://ws.api.video* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create**](SummariesApi.md#postsummaries) | **POST** /summaries | Generate video summary +[**get**](SummariesApi.md#getsummariessummaryidsource) | **GET** /summaries/{summaryId}/source | Get summary details +[**update**](SummariesApi.md#patchsummariessummaryidsource) | **PATCH** /summaries/{summaryId}/source | Update summary details +[**delete**](SummariesApi.md#deletesummariessummaryid) | **DELETE** /summaries/{summaryId} | Delete video summary +[**list**](SummariesApi.md#getsummaries) | **GET** /summaries | List summaries + + + +# **create** +> SummaryObject create (InlineObject inlineObject) + +Generate video summary + +Generate a title, abstract, and key takeaways for a video. + +### Example +```csharp +using System.Diagnostics; +using ApiVideo.Client; + +namespace Example +{ + public class createExample + { + public static void Main() + { + var basePath = ApiVideoClient.Client.Environment.SANDBOX; + var apiKey = "YOUR_API_KEY"; + + var apiInstance = new ApiVideoClient(apiKey,basePath); + + var inlineObject = new InlineObject(); // InlineObject | + var apiSummariesInstance = apiInstance.Summaries(); + try + { + // Generate video summary + SummaryObject result = apiSummariesInstance.create(inlineObject); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SummariesApi.create: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inlineObject** | [**InlineObject**](InlineObject.md)| | + +### Return type + +[**SummaryObject**](SummaryObject.md) + +### HTTP request headers + + - **Content-Type**: applictaion/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.
| + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **get** +> SummarySource get (string summaryId) + +Get summary details + +Get all details for a summary. + +### Example +```csharp +using System.Diagnostics; +using ApiVideo.Client; + +namespace Example +{ + public class getExample + { + public static void Main() + { + var basePath = ApiVideoClient.Client.Environment.SANDBOX; + var apiKey = "YOUR_API_KEY"; + + var apiInstance = new ApiVideoClient(apiKey,basePath); + + var summaryId = summary_1CGHWuXjhxmeH4WiZ51234; // string | The unique identifier of the summary source you want to retrieve. + var apiSummariesInstance = apiInstance.Summaries(); + try + { + // Get summary details + SummarySource result = apiSummariesInstance.get(summaryId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SummariesApi.get: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **summaryId** | **string**| The unique identifier of the summary source you want to retrieve. | + +### Return type + +[**SummarySource**](SummarySource.md) + +### 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.
| + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **update** +> SummarySource update (string summaryId, UpdateSummaryRequest updateSummaryRequest) + +Update summary details + +Update details for a summary. Note that this operation is only allowed for summary objects where `sourceStatus` is `missing`. + +### Example +```csharp +using System.Diagnostics; +using ApiVideo.Client; + +namespace Example +{ + public class updateExample + { + public static void Main() + { + var basePath = ApiVideoClient.Client.Environment.SANDBOX; + var apiKey = "YOUR_API_KEY"; + + var apiInstance = new ApiVideoClient(apiKey,basePath); + + var summaryId = summary_1CGHWuXjhxmeH4WiZ51234; // string | The unique identifier of the summary source you want to update. + var updateSummaryRequest = new UpdateSummaryRequest(); // UpdateSummaryRequest | + var apiSummariesInstance = apiInstance.Summaries(); + try + { + // Update summary details + SummarySource result = apiSummariesInstance.update(summaryId, updateSummaryRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SummariesApi.update: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **summaryId** | **string**| The unique identifier of the summary source you want to update. | + **updateSummaryRequest** | [**UpdateSummaryRequest**](UpdateSummaryRequest.md)| | + +### Return type + +[**SummarySource**](SummarySource.md) + +### 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.
| + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **delete** +> void delete (string summaryId) + +Delete video summary + +Delete a summary tied to a video. + +### Example +```csharp +using System.Diagnostics; +using ApiVideo.Client; + +namespace Example +{ + public class deleteExample + { + public static void Main() + { + var basePath = ApiVideoClient.Client.Environment.SANDBOX; + var apiKey = "YOUR_API_KEY"; + + var apiInstance = new ApiVideoClient(apiKey,basePath); + + var summaryId = summary_1CGHWuXjhxmeH4WiZ51234; // string | The unique identifier of the summary you want to delete. + var apiSummariesInstance = apiInstance.Summaries(); + try + { + // Delete video summary + apiSummariesInstance.delete(summaryId); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SummariesApi.delete: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **summaryId** | **string**| The unique identifier of the summary you want to delete. | + +### Return type + +void (empty response body) + +### 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.
| + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **list** +> GetSummaries list () + +List summaries + +List all summarries for your videos in a project. + +### Example +```csharp +using System.Diagnostics; +using ApiVideo.Client; + +namespace Example +{ + public class listExample + { + public static void Main() + { + var basePath = ApiVideoClient.Client.Environment.SANDBOX; + var apiKey = "YOUR_API_KEY"; + + var apiInstance = new ApiVideoClient(apiKey,basePath); + + var apiSummariesInstance = apiInstance.Summaries(); + try + { + // List summaries + GetSummaries result = apiSummariesInstance.list(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SummariesApi.list: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**GetSummaries**](GetSummaries.md) + +### 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.
| + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/SummaryObject.md b/docs/SummaryObject.md new file mode 100644 index 0000000..b48ad05 --- /dev/null +++ b/docs/SummaryObject.md @@ -0,0 +1,15 @@ +# ApiVideo.Model.SummaryObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SummaryId** | **string** | The unique identifier of the summary object. | [optional] +**CreatedAt** | **DateTime** | Returns the date and time when the summary was created in ATOM date-time format. | [optional] +**UpdatedAt** | **DateTime** | 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** | **Object** | 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** | **string** | 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] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SummarySource.md b/docs/SummarySource.md new file mode 100644 index 0000000..8124e9e --- /dev/null +++ b/docs/SummarySource.md @@ -0,0 +1,12 @@ +# ApiVideo.Model.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] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/UpdateSummaryRequest.md b/docs/UpdateSummaryRequest.md new file mode 100644 index 0000000..91f42b3 --- /dev/null +++ b/docs/UpdateSummaryRequest.md @@ -0,0 +1,12 @@ +# ApiVideo.Model.UpdateSummaryRequest + +## 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] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/VideoCreationPayload.md b/docs/VideoCreationPayload.md index 88cc92e..27465e3 100644 --- a/docs/VideoCreationPayload.md +++ b/docs/VideoCreationPayload.md @@ -17,6 +17,7 @@ Name | Type | Description | Notes **Watermark** | [**VideoWatermark**](VideoWatermark.md) | | [optional] **Language** | **string** | 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** | **bool** | 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** | **bool** | 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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/VideoUpdatePayload.md b/docs/VideoUpdatePayload.md index be4b7fb..5923d5b 100644 --- a/docs/VideoUpdatePayload.md +++ b/docs/VideoUpdatePayload.md @@ -14,6 +14,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** | **string** | 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** | **bool** | 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** | **bool** | 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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/VideosApi.md b/docs/VideosApi.md index 9ee7b4f..d3ff148 100644 --- a/docs/VideosApi.md +++ b/docs/VideosApi.md @@ -388,6 +388,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.
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/src/Api/SummariesApi.cs b/src/Api/SummariesApi.cs new file mode 100644 index 0000000..a2872df --- /dev/null +++ b/src/Api/SummariesApi.cs @@ -0,0 +1,800 @@ +/* + * api.video + * + * 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 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using System.IO; +using ApiVideo.Upload; +using RestSharp; +using ApiVideo.Client; +using ApiVideo.Model; + +namespace ApiVideo.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class SummariesApi + { + /// + /// Api Client Instance + /// + public ApiClient ApiClient {get; set;} + + /// + /// Initializes a new instance of the class. + /// + /// + public SummariesApi(ApiClient apiClient) + { + this.ApiClient = apiClient; + } + + /// + /// Generate video summary Generate a title, abstract, and key takeaways for a video. + /// + /// Thrown when fails to make API call + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. (optional) + /// + + /// SummaryObject + public Task createAsync(InlineObject inlineObject, CancellationToken cancellationToken = default) + { + Task> localVarResponse = createWithHttpInfoAsync(inlineObject, cancellationToken); + return localVarResponse.ContinueWith((Task> task) => task.Result.Data ); + + } + + /// + /// Generate video summary Generate a title, abstract, and key takeaways for a video. + /// + /// Thrown when fails to make API call + /// + + /// SummaryObject + public SummaryObject create(InlineObject inlineObject) + { + ApiResponse localVarResponse = createWithHttpInfo(inlineObject); + return localVarResponse.Data; + } + + + /// + /// Generate video summary Generate a title, abstract, and key takeaways for a video. + /// + /// Thrown when fails to make API call + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. (optional) + /// + + /// ApiResponse of SummaryObject + public Task> createWithHttpInfoAsync(InlineObject inlineObject, CancellationToken cancellationToken = default) + { + if (inlineObject == null) + throw new ApiException(400,"Missing required parameter 'inlineObject' when calling SummariesApi->create"); + + + // verify the required parameter 'inlineObject' is set + if (inlineObject == null) + throw new ApiException(400, "Missing required parameter 'inlineObject' when calling SummariesApi->create"); + + + var localVarPath = "/summaries"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarContentTypes = new string[] { + "applictaion/json" + }; + string localVarContentType = ApiClient.SelectHeaderContentType(localVarContentTypes); + localVarHeaderParams.Add("Content-Type", localVarContentType); + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { + "application/json" + }; + string localVarHttpHeaderAccept = ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (inlineObject != null && inlineObject.GetType() != typeof(byte[]) && inlineObject.GetType() != typeof(string)) + { + localVarPostBody = this.ApiClient.Serialize(inlineObject); // http body (model) parameter + } + else + { + localVarPostBody = inlineObject; // byte array + } + + + + + // make the HTTP request + Task localVarResponse = (Task) this.ApiClient.CallApiAsync(localVarPath, + Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarContentType, cancellationToken); + + + return localVarResponse.ContinueWith((Task task) => + { + int localVarStatusCode = (int) task.Result.StatusCode; + return new ApiResponse(localVarStatusCode, + task.Result.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (SummaryObject) this.ApiClient.Deserialize(task.Result, typeof(SummaryObject))); + }); + + } + + + /// + /// Generate video summary Generate a title, abstract, and key takeaways for a video. + /// + /// Thrown when fails to make API call + /// + + /// ApiResponse of SummaryObject + public ApiResponse createWithHttpInfo(InlineObject inlineObject) + { + if (inlineObject == null) + throw new ApiException(400,"Missing required parameter 'inlineObject' when calling SummariesApi->create"); + + + // verify the required parameter 'inlineObject' is set + if (inlineObject == null) + throw new ApiException(400, "Missing required parameter 'inlineObject' when calling SummariesApi->create"); + + + var localVarPath = "/summaries"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarContentTypes = new string[] { + "applictaion/json" + }; + string localVarContentType = ApiClient.SelectHeaderContentType(localVarContentTypes); + localVarHeaderParams.Add("Content-Type", localVarContentType); + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { + "application/json" + }; + string localVarHttpHeaderAccept = ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (inlineObject != null && inlineObject.GetType() != typeof(byte[]) && inlineObject.GetType() != typeof(string)) + { + localVarPostBody = this.ApiClient.Serialize(inlineObject); // http body (model) parameter + } + else + { + localVarPostBody = inlineObject; // byte array + } + + + + + // make the HTTP request + RestResponse localVarResponse = (RestResponse) this.ApiClient.CallApi(localVarPath, + Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (SummaryObject) this.ApiClient.Deserialize(localVarResponse, typeof(SummaryObject))); + + } + + + /// + /// Get summary details Get all details for a summary. + /// + /// Thrown when fails to make API call + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. (optional) + /// The unique identifier of the summary source you want to retrieve. + + /// SummarySource + public Task getAsync(string summaryId, CancellationToken cancellationToken = default) + { + Task> localVarResponse = getWithHttpInfoAsync(summaryId, cancellationToken); + return localVarResponse.ContinueWith((Task> task) => task.Result.Data ); + + } + + /// + /// Get summary details Get all details for a summary. + /// + /// Thrown when fails to make API call + /// The unique identifier of the summary source you want to retrieve. + + /// SummarySource + public SummarySource get(string summaryId) + { + ApiResponse localVarResponse = getWithHttpInfo(summaryId); + return localVarResponse.Data; + } + + + /// + /// Get summary details Get all details for a summary. + /// + /// Thrown when fails to make API call + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. (optional) + /// The unique identifier of the summary source you want to retrieve. + + /// ApiResponse of SummarySource + public Task> getWithHttpInfoAsync(string summaryId, CancellationToken cancellationToken = default) + { + + // verify the required parameter 'summaryId' is set + if (summaryId == null) + throw new ApiException(400, "Missing required parameter 'summaryId' when calling SummariesApi->get"); + + + var localVarPath = "/summaries/{summaryId}/source"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarContentTypes = new string[] { + }; + string localVarContentType = ApiClient.SelectHeaderContentType(localVarContentTypes); + localVarHeaderParams.Add("Content-Type", localVarContentType); + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { + "application/json" + }; + string localVarHttpHeaderAccept = ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (summaryId != null) localVarPathParams.Add("summaryId", this.ApiClient.ParameterToString(summaryId)); // path parameter + + + + + // make the HTTP request + Task localVarResponse = (Task) this.ApiClient.CallApiAsync(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarContentType, cancellationToken); + + + return localVarResponse.ContinueWith((Task task) => + { + int localVarStatusCode = (int) task.Result.StatusCode; + return new ApiResponse(localVarStatusCode, + task.Result.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (SummarySource) this.ApiClient.Deserialize(task.Result, typeof(SummarySource))); + }); + + } + + + /// + /// Get summary details Get all details for a summary. + /// + /// Thrown when fails to make API call + /// The unique identifier of the summary source you want to retrieve. + + /// ApiResponse of SummarySource + public ApiResponse getWithHttpInfo(string summaryId) + { + + // verify the required parameter 'summaryId' is set + if (summaryId == null) + throw new ApiException(400, "Missing required parameter 'summaryId' when calling SummariesApi->get"); + + + var localVarPath = "/summaries/{summaryId}/source"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarContentTypes = new string[] { + }; + string localVarContentType = ApiClient.SelectHeaderContentType(localVarContentTypes); + localVarHeaderParams.Add("Content-Type", localVarContentType); + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { + "application/json" + }; + string localVarHttpHeaderAccept = ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (summaryId != null) localVarPathParams.Add("summaryId", this.ApiClient.ParameterToString(summaryId)); // path parameter + + + + + // make the HTTP request + RestResponse localVarResponse = (RestResponse) this.ApiClient.CallApi(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (SummarySource) this.ApiClient.Deserialize(localVarResponse, typeof(SummarySource))); + + } + + + /// + /// Update summary details Update details for a summary. Note that this operation is only allowed for summary objects where `sourceStatus` is `missing`. + /// + /// Thrown when fails to make API call + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. (optional) + /// The unique identifier of the summary source you want to update. +/// + + /// SummarySource + public Task updateAsync(string summaryId, UpdateSummaryRequest updateSummaryRequest, CancellationToken cancellationToken = default) + { + Task> localVarResponse = updateWithHttpInfoAsync(summaryId, updateSummaryRequest, cancellationToken); + return localVarResponse.ContinueWith((Task> task) => task.Result.Data ); + + } + + /// + /// Update summary details Update details for a summary. Note that this operation is only allowed for summary objects where `sourceStatus` is `missing`. + /// + /// Thrown when fails to make API call + /// The unique identifier of the summary source you want to update. +/// + + /// SummarySource + public SummarySource update(string summaryId, UpdateSummaryRequest updateSummaryRequest) + { + ApiResponse localVarResponse = updateWithHttpInfo(summaryId, updateSummaryRequest); + return localVarResponse.Data; + } + + + /// + /// Update summary details Update details for a summary. Note that this operation is only allowed for summary objects where `sourceStatus` is `missing`. + /// + /// Thrown when fails to make API call + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. (optional) + /// The unique identifier of the summary source you want to update. +/// + + /// ApiResponse of SummarySource + public Task> updateWithHttpInfoAsync(string summaryId, UpdateSummaryRequest updateSummaryRequest, CancellationToken cancellationToken = default) + { + if (updateSummaryRequest == null) + throw new ApiException(400,"Missing required parameter 'updateSummaryRequest' when calling SummariesApi->update"); + + + if (updateSummaryRequest == null) + throw new ApiException(400,"Missing required parameter 'updateSummaryRequest' when calling SummariesApi->update"); + + + // verify the required parameter 'summaryId' is set + if (summaryId == null) + throw new ApiException(400, "Missing required parameter 'summaryId' when calling SummariesApi->update"); + // verify the required parameter 'updateSummaryRequest' is set + if (updateSummaryRequest == null) + throw new ApiException(400, "Missing required parameter 'updateSummaryRequest' when calling SummariesApi->update"); + + + var localVarPath = "/summaries/{summaryId}/source"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarContentTypes = new string[] { + "application/json" + }; + string localVarContentType = ApiClient.SelectHeaderContentType(localVarContentTypes); + localVarHeaderParams.Add("Content-Type", localVarContentType); + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { + "application/json" + }; + string localVarHttpHeaderAccept = ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (summaryId != null) localVarPathParams.Add("summaryId", this.ApiClient.ParameterToString(summaryId)); // path parameter + if (updateSummaryRequest != null && updateSummaryRequest.GetType() != typeof(byte[]) && updateSummaryRequest.GetType() != typeof(string)) + { + localVarPostBody = this.ApiClient.Serialize(updateSummaryRequest); // http body (model) parameter + } + else + { + localVarPostBody = updateSummaryRequest; // byte array + } + + + + + // make the HTTP request + Task localVarResponse = (Task) this.ApiClient.CallApiAsync(localVarPath, + Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarContentType, cancellationToken); + + + return localVarResponse.ContinueWith((Task task) => + { + int localVarStatusCode = (int) task.Result.StatusCode; + return new ApiResponse(localVarStatusCode, + task.Result.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (SummarySource) this.ApiClient.Deserialize(task.Result, typeof(SummarySource))); + }); + + } + + + /// + /// Update summary details Update details for a summary. Note that this operation is only allowed for summary objects where `sourceStatus` is `missing`. + /// + /// Thrown when fails to make API call + /// The unique identifier of the summary source you want to update. +/// + + /// ApiResponse of SummarySource + public ApiResponse updateWithHttpInfo(string summaryId, UpdateSummaryRequest updateSummaryRequest) + { + if (updateSummaryRequest == null) + throw new ApiException(400,"Missing required parameter 'updateSummaryRequest' when calling SummariesApi->update"); + + + if (updateSummaryRequest == null) + throw new ApiException(400,"Missing required parameter 'updateSummaryRequest' when calling SummariesApi->update"); + + + // verify the required parameter 'summaryId' is set + if (summaryId == null) + throw new ApiException(400, "Missing required parameter 'summaryId' when calling SummariesApi->update"); + // verify the required parameter 'updateSummaryRequest' is set + if (updateSummaryRequest == null) + throw new ApiException(400, "Missing required parameter 'updateSummaryRequest' when calling SummariesApi->update"); + + + var localVarPath = "/summaries/{summaryId}/source"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarContentTypes = new string[] { + "application/json" + }; + string localVarContentType = ApiClient.SelectHeaderContentType(localVarContentTypes); + localVarHeaderParams.Add("Content-Type", localVarContentType); + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { + "application/json" + }; + string localVarHttpHeaderAccept = ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (summaryId != null) localVarPathParams.Add("summaryId", this.ApiClient.ParameterToString(summaryId)); // path parameter + if (updateSummaryRequest != null && updateSummaryRequest.GetType() != typeof(byte[]) && updateSummaryRequest.GetType() != typeof(string)) + { + localVarPostBody = this.ApiClient.Serialize(updateSummaryRequest); // http body (model) parameter + } + else + { + localVarPostBody = updateSummaryRequest; // byte array + } + + + + + // make the HTTP request + RestResponse localVarResponse = (RestResponse) this.ApiClient.CallApi(localVarPath, + Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (SummarySource) this.ApiClient.Deserialize(localVarResponse, typeof(SummarySource))); + + } + + + /// + /// Delete video summary Delete a summary tied to a video. + /// + /// Thrown when fails to make API call + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. (optional) + /// The unique identifier of the summary you want to delete. + + /// + public Task> deleteAsync(string summaryId, CancellationToken cancellationToken = default) + { + return deleteWithHttpInfoAsync(summaryId, cancellationToken); + } + + /// + /// Delete video summary Delete a summary tied to a video. + /// + /// Thrown when fails to make API call + /// The unique identifier of the summary you want to delete. + + /// + public void delete(string summaryId) + { + deleteWithHttpInfo(summaryId); + } + + + /// + /// Delete video summary Delete a summary tied to a video. + /// + /// Thrown when fails to make API call + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. (optional) + /// The unique identifier of the summary you want to delete. + + /// ApiResponse of Object(void) + public Task> deleteWithHttpInfoAsync(string summaryId, CancellationToken cancellationToken = default) + { + + // verify the required parameter 'summaryId' is set + if (summaryId == null) + throw new ApiException(400, "Missing required parameter 'summaryId' when calling SummariesApi->delete"); + + + var localVarPath = "/summaries/{summaryId}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarContentTypes = new string[] { + }; + string localVarContentType = ApiClient.SelectHeaderContentType(localVarContentTypes); + localVarHeaderParams.Add("Content-Type", localVarContentType); + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { + }; + string localVarHttpHeaderAccept = ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (summaryId != null) localVarPathParams.Add("summaryId", this.ApiClient.ParameterToString(summaryId)); // path parameter + + + + + // make the HTTP request + Task localVarResponse = (Task) this.ApiClient.CallApiAsync(localVarPath, + Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarContentType, cancellationToken); + + return localVarResponse.ContinueWith((Task task) => + { + int localVarStatusCode = (int) task.Result.StatusCode; + return new ApiResponse(localVarStatusCode, + task.Result.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + }); + + } + + + /// + /// Delete video summary Delete a summary tied to a video. + /// + /// Thrown when fails to make API call + /// The unique identifier of the summary you want to delete. + + /// ApiResponse of Object(void) + public ApiResponse deleteWithHttpInfo(string summaryId) + { + + // verify the required parameter 'summaryId' is set + if (summaryId == null) + throw new ApiException(400, "Missing required parameter 'summaryId' when calling SummariesApi->delete"); + + + var localVarPath = "/summaries/{summaryId}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarContentTypes = new string[] { + }; + string localVarContentType = ApiClient.SelectHeaderContentType(localVarContentTypes); + localVarHeaderParams.Add("Content-Type", localVarContentType); + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { + }; + string localVarHttpHeaderAccept = ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (summaryId != null) localVarPathParams.Add("summaryId", this.ApiClient.ParameterToString(summaryId)); // path parameter + + + + + // make the HTTP request + RestResponse localVarResponse = (RestResponse) this.ApiClient.CallApi(localVarPath, + Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + + } + + + /// + /// List summaries List all summarries for your videos in a project. + /// + /// Thrown when fails to make API call + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. (optional) + + /// GetSummaries + public Task listAsync(, CancellationToken cancellationToken = default) + { + Task> localVarResponse = listWithHttpInfoAsync(, cancellationToken); + return localVarResponse.ContinueWith((Task> task) => task.Result.Data ); + + } + + /// + /// List summaries List all summarries for your videos in a project. + /// + /// Thrown when fails to make API call + + /// GetSummaries + public GetSummaries list() + { + ApiResponse localVarResponse = listWithHttpInfo(); + return localVarResponse.Data; + } + + + /// + /// List summaries List all summarries for your videos in a project. + /// + /// Thrown when fails to make API call + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. (optional) + + /// ApiResponse of GetSummaries + public Task> listWithHttpInfoAsync(, CancellationToken cancellationToken = default) + { + + + var localVarPath = "/summaries"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarContentTypes = new string[] { + }; + string localVarContentType = ApiClient.SelectHeaderContentType(localVarContentTypes); + localVarHeaderParams.Add("Content-Type", localVarContentType); + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { + "application/json" + }; + string localVarHttpHeaderAccept = ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + + + + + // make the HTTP request + Task localVarResponse = (Task) this.ApiClient.CallApiAsync(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarContentType, cancellationToken); + + + return localVarResponse.ContinueWith((Task task) => + { + int localVarStatusCode = (int) task.Result.StatusCode; + return new ApiResponse(localVarStatusCode, + task.Result.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (GetSummaries) this.ApiClient.Deserialize(task.Result, typeof(GetSummaries))); + }); + + } + + + /// + /// List summaries List all summarries for your videos in a project. + /// + /// Thrown when fails to make API call + + /// ApiResponse of GetSummaries + public ApiResponse listWithHttpInfo() + { + + + var localVarPath = "/summaries"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarContentTypes = new string[] { + }; + string localVarContentType = ApiClient.SelectHeaderContentType(localVarContentTypes); + localVarHeaderParams.Add("Content-Type", localVarContentType); + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { + "application/json" + }; + string localVarHttpHeaderAccept = ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + + + + + // make the HTTP request + RestResponse localVarResponse = (RestResponse) this.ApiClient.CallApi(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (GetSummaries) this.ApiClient.Deserialize(localVarResponse, typeof(GetSummaries))); + + } + + + + } + +} diff --git a/src/Api/VideosApi.cs b/src/Api/VideosApi.cs index a5a2b25..11662d0 100644 --- a/src/Api/VideosApi.cs +++ b/src/Api/VideosApi.cs @@ -85,7 +85,7 @@ public Task> createWithHttpInfoAsync(VideoCreationPayload vid if (videoCreationPayload != null && videoCreationPayload.title == null) { throw new ApiException(400,"Missing required parameter 'videoCreationPayload.Title' when calling VideosApi->create"); } - + // verify the required parameter 'videoCreationPayload' is set if (videoCreationPayload == null) throw new ApiException(400, "Missing required parameter 'videoCreationPayload' when calling VideosApi->create"); @@ -157,7 +157,7 @@ public ApiResponse