diff --git a/CHANGELOG.md b/CHANGELOG.md
index 97742cf..c47cd13 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,10 @@
# Changelog
All changes to this project will be documented in this file.
+## [1.5.0] - 2024-07-19
+- fix nuget package (closes \#131)
+- add *Async() methods (closes \#132)
+
## [1.4.0] - 2024-06-11
- .net 5.0 support
diff --git a/src/Api/AdvancedAuthenticationApi.cs b/src/Api/AdvancedAuthenticationApi.cs
index e04d5b3..60b461b 100644
--- a/src/Api/AdvancedAuthenticationApi.cs
+++ b/src/Api/AdvancedAuthenticationApi.cs
@@ -12,6 +12,7 @@
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading;
+using System.Threading.Tasks;
using System.IO;
using ApiVideo.Upload;
using RestSharp;
@@ -39,6 +40,21 @@ public AdvancedAuthenticationApi(ApiClient apiClient)
this.ApiClient = apiClient;
}
+ ///
+ /// Get Bearer Token Returns a bearer token that can be used to authenticate other endpoint. You can find the tutorial on using the disposable bearer token [here](https://docs.api.video/reference/disposable-bearer-token-authentication).
+ ///
+ /// 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)
+ ///
+
+ /// AccessToken
+ public Task authenticateAsync(AuthenticatePayload authenticatePayload, CancellationToken cancellationToken = default)
+ {
+ Task> localVarResponse = authenticateWithHttpInfoAsync(authenticatePayload, cancellationToken);
+ return localVarResponse.ContinueWith((Task> task) => task.Result.Data );
+
+ }
+
///
/// Get Bearer Token Returns a bearer token that can be used to authenticate other endpoint. You can find the tutorial on using the disposable bearer token [here](https://docs.api.video/reference/disposable-bearer-token-authentication).
///
@@ -52,6 +68,80 @@ public AccessToken authenticate(AuthenticatePayload authenticatePayload)
return localVarResponse.Data;
}
+
+ ///
+ /// Get Bearer Token Returns a bearer token that can be used to authenticate other endpoint. You can find the tutorial on using the disposable bearer token [here](https://docs.api.video/reference/disposable-bearer-token-authentication).
+ ///
+ /// 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 AccessToken
+ public Task> authenticateWithHttpInfoAsync(AuthenticatePayload authenticatePayload, CancellationToken cancellationToken = default)
+ {
+ if (authenticatePayload == null)
+ throw new ApiException(400,"Missing required parameter 'authenticatePayload' when calling AdvancedAuthenticationApi->authenticate");
+
+ if (authenticatePayload != null && authenticatePayload.apikey == null) {
+ throw new ApiException(400,"Missing required parameter 'authenticatePayload.ApiKey' when calling AdvancedAuthenticationApi->authenticate");
+ }
+
+ // verify the required parameter 'authenticatePayload' is set
+ if (authenticatePayload == null)
+ throw new ApiException(400, "Missing required parameter 'authenticatePayload' when calling AdvancedAuthenticationApi->authenticate");
+
+
+ var localVarPath = "/auth/api-key";
+ 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 (authenticatePayload != null && authenticatePayload.GetType() != typeof(byte[]) && authenticatePayload.GetType() != typeof(string))
+ {
+ localVarPostBody = this.ApiClient.Serialize(authenticatePayload); // http body (model) parameter
+ }
+ else
+ {
+ localVarPostBody = authenticatePayload; // 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)),
+ (AccessToken) this.ApiClient.Deserialize(task.Result, typeof(AccessToken)));
+ });
+
+ }
+
+
///
/// Get Bearer Token Returns a bearer token that can be used to authenticate other endpoint. You can find the tutorial on using the disposable bearer token [here](https://docs.api.video/reference/disposable-bearer-token-authentication).
///
@@ -120,6 +210,21 @@ public ApiResponse authenticateWithHttpInfo(AuthenticatePayload aut
}
+ ///
+ /// Refresh Bearer Token Accepts the old bearer token and returns a new bearer token that can be used to authenticate other endpoint. You can find the tutorial on using the disposable bearer token [here](https://docs.api.video/reference/disposable-bearer-token-authentication).
+ ///
+ /// 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)
+ ///
+
+ /// AccessToken
+ public Task refreshAsync(RefreshTokenPayload refreshTokenPayload, CancellationToken cancellationToken = default)
+ {
+ Task> localVarResponse = refreshWithHttpInfoAsync(refreshTokenPayload, cancellationToken);
+ return localVarResponse.ContinueWith((Task> task) => task.Result.Data );
+
+ }
+
///
/// Refresh Bearer Token Accepts the old bearer token and returns a new bearer token that can be used to authenticate other endpoint. You can find the tutorial on using the disposable bearer token [here](https://docs.api.video/reference/disposable-bearer-token-authentication).
///
@@ -133,6 +238,80 @@ public AccessToken refresh(RefreshTokenPayload refreshTokenPayload)
return localVarResponse.Data;
}
+
+ ///
+ /// Refresh Bearer Token Accepts the old bearer token and returns a new bearer token that can be used to authenticate other endpoint. You can find the tutorial on using the disposable bearer token [here](https://docs.api.video/reference/disposable-bearer-token-authentication).
+ ///
+ /// 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 AccessToken
+ public Task> refreshWithHttpInfoAsync(RefreshTokenPayload refreshTokenPayload, CancellationToken cancellationToken = default)
+ {
+ if (refreshTokenPayload == null)
+ throw new ApiException(400,"Missing required parameter 'refreshTokenPayload' when calling AdvancedAuthenticationApi->refresh");
+
+ if (refreshTokenPayload != null && refreshTokenPayload.refreshtoken == null) {
+ throw new ApiException(400,"Missing required parameter 'refreshTokenPayload.RefreshToken' when calling AdvancedAuthenticationApi->refresh");
+ }
+
+ // verify the required parameter 'refreshTokenPayload' is set
+ if (refreshTokenPayload == null)
+ throw new ApiException(400, "Missing required parameter 'refreshTokenPayload' when calling AdvancedAuthenticationApi->refresh");
+
+
+ var localVarPath = "/auth/refresh";
+ 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 (refreshTokenPayload != null && refreshTokenPayload.GetType() != typeof(byte[]) && refreshTokenPayload.GetType() != typeof(string))
+ {
+ localVarPostBody = this.ApiClient.Serialize(refreshTokenPayload); // http body (model) parameter
+ }
+ else
+ {
+ localVarPostBody = refreshTokenPayload; // 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)),
+ (AccessToken) this.ApiClient.Deserialize(task.Result, typeof(AccessToken)));
+ });
+
+ }
+
+
///
/// Refresh Bearer Token Accepts the old bearer token and returns a new bearer token that can be used to authenticate other endpoint. You can find the tutorial on using the disposable bearer token [here](https://docs.api.video/reference/disposable-bearer-token-authentication).
///
diff --git a/src/Api/AnalyticsApi.cs b/src/Api/AnalyticsApi.cs
index 10fc689..4f57dbd 100644
--- a/src/Api/AnalyticsApi.cs
+++ b/src/Api/AnalyticsApi.cs
@@ -12,6 +12,7 @@
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading;
+using System.Threading.Tasks;
using System.IO;
using ApiVideo.Upload;
using RestSharp;
@@ -39,6 +40,26 @@ public AnalyticsApi(ApiClient apiClient)
this.ApiClient = apiClient;
}
+ ///
+ /// Get play events for live stream Retrieve filtered analytics about the number of plays for your live streams 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)
+ /// Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format.
+/// Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`.
+/// Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. (optional)
+/// Use this query parameter to filter your results to a specific live stream in a project that you want analytics for. You must use the `liveStreamId:` prefix when specifying a live stream ID. (optional)
+/// Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1)
+/// Results per page. Allowed values 1-100, default is 25. (optional, default to 25)
+
+ /// AnalyticsPlaysResponse
+ public Task getLiveStreamsPlaysAsync(DateTime from, string dimension, DateTime? to = default, string filter = default, int? currentPage = default, int? pageSize = default, CancellationToken cancellationToken = default)
+ {
+ Task> localVarResponse = getLiveStreamsPlaysWithHttpInfoAsync(from, dimension, to, filter, currentPage, pageSize, cancellationToken);
+ return localVarResponse.ContinueWith((Task> task) => task.Result.Data );
+
+ }
+
///
/// Get play events for live stream Retrieve filtered analytics about the number of plays for your live streams in a project.
///
@@ -57,6 +78,84 @@ public AnalyticsPlaysResponse getLiveStreamsPlays(DateTime from, string dimensio
return localVarResponse.Data;
}
+
+ ///
+ /// Get play events for live stream Retrieve filtered analytics about the number of plays for your live streams 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)
+ /// Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format.
+/// Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`.
+/// Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. (optional)
+/// Use this query parameter to filter your results to a specific live stream in a project that you want analytics for. You must use the `liveStreamId:` prefix when specifying a live stream ID. (optional)
+/// Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1)
+/// Results per page. Allowed values 1-100, default is 25. (optional, default to 25)
+
+ /// ApiResponse of AnalyticsPlaysResponse
+ public Task> getLiveStreamsPlaysWithHttpInfoAsync(DateTime from, string dimension, DateTime? to = default, string filter = default, int? currentPage = default, int? pageSize = default, CancellationToken cancellationToken = default)
+ {
+
+
+
+
+
+
+ // verify the required parameter 'from' is set
+ if (from == null)
+ throw new ApiException(400, "Missing required parameter 'from' when calling AnalyticsApi->getLiveStreamsPlays");
+ // verify the required parameter 'dimension' is set
+ if (dimension == null)
+ throw new ApiException(400, "Missing required parameter 'dimension' when calling AnalyticsApi->getLiveStreamsPlays");
+
+
+ var localVarPath = "/analytics/live-streams/plays";
+ 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 (from != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "from", from)); // query parameter
+ if (to != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "to", to)); // query parameter
+ if (dimension != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "dimension", dimension)); // query parameter
+ if (filter != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "filter", filter)); // query parameter
+ if (currentPage != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "currentPage", currentPage)); // query parameter
+ if (pageSize != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "pageSize", pageSize)); // query 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)),
+ (AnalyticsPlaysResponse) this.ApiClient.Deserialize(task.Result, typeof(AnalyticsPlaysResponse)));
+ });
+
+ }
+
+
///
/// Get play events for live stream Retrieve filtered analytics about the number of plays for your live streams in a project.
///
@@ -230,6 +329,26 @@ private APIgetLiveStreamsPlaysRequest copy() {
return copy;
}
}
+ ///
+ /// Get play events for video Retrieve filtered analytics about the number of plays 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)
+ /// Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format.
+/// Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`.
+/// Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. (optional)
+/// Use this query parameter to filter your results to a specific video in a project that you want analytics for. You must use the `videoId:` prefix when specifying a video ID. (optional)
+/// Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1)
+/// Results per page. Allowed values 1-100, default is 25. (optional, default to 25)
+
+ /// AnalyticsPlaysResponse
+ public Task getVideosPlaysAsync(DateTime from, string dimension, DateTime? to = default, string filter = default, int? currentPage = default, int? pageSize = default, CancellationToken cancellationToken = default)
+ {
+ Task> localVarResponse = getVideosPlaysWithHttpInfoAsync(from, dimension, to, filter, currentPage, pageSize, cancellationToken);
+ return localVarResponse.ContinueWith((Task> task) => task.Result.Data );
+
+ }
+
///
/// Get play events for video Retrieve filtered analytics about the number of plays for your videos in a project.
///
@@ -248,6 +367,84 @@ public AnalyticsPlaysResponse getVideosPlays(DateTime from, string dimension, Da
return localVarResponse.Data;
}
+
+ ///
+ /// Get play events for video Retrieve filtered analytics about the number of plays 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)
+ /// Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format.
+/// Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`.
+/// Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. (optional)
+/// Use this query parameter to filter your results to a specific video in a project that you want analytics for. You must use the `videoId:` prefix when specifying a video ID. (optional)
+/// Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1)
+/// Results per page. Allowed values 1-100, default is 25. (optional, default to 25)
+
+ /// ApiResponse of AnalyticsPlaysResponse
+ public Task> getVideosPlaysWithHttpInfoAsync(DateTime from, string dimension, DateTime? to = default, string filter = default, int? currentPage = default, int? pageSize = default, CancellationToken cancellationToken = default)
+ {
+
+
+
+
+
+
+ // verify the required parameter 'from' is set
+ if (from == null)
+ throw new ApiException(400, "Missing required parameter 'from' when calling AnalyticsApi->getVideosPlays");
+ // verify the required parameter 'dimension' is set
+ if (dimension == null)
+ throw new ApiException(400, "Missing required parameter 'dimension' when calling AnalyticsApi->getVideosPlays");
+
+
+ var localVarPath = "/analytics/videos/plays";
+ 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 (from != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "from", from)); // query parameter
+ if (to != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "to", to)); // query parameter
+ if (dimension != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "dimension", dimension)); // query parameter
+ if (filter != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "filter", filter)); // query parameter
+ if (currentPage != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "currentPage", currentPage)); // query parameter
+ if (pageSize != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "pageSize", pageSize)); // query 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)),
+ (AnalyticsPlaysResponse) this.ApiClient.Deserialize(task.Result, typeof(AnalyticsPlaysResponse)));
+ });
+
+ }
+
+
///
/// Get play events for video Retrieve filtered analytics about the number of plays for your videos in a project.
///
diff --git a/src/Api/CaptionsApi.cs b/src/Api/CaptionsApi.cs
index 472f33e..6720ab6 100644
--- a/src/Api/CaptionsApi.cs
+++ b/src/Api/CaptionsApi.cs
@@ -12,6 +12,7 @@
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading;
+using System.Threading.Tasks;
using System.IO;
using ApiVideo.Upload;
using RestSharp;
@@ -39,6 +40,23 @@ public CaptionsApi(ApiClient apiClient)
this.ApiClient = apiClient;
}
+ ///
+ /// Upload a caption Upload a VTT file to add captions to your video. More information can be found [here](https://docs.api.video/vod/add-captions)
+ ///
+ /// 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 for the video you want to add a caption to.
+/// A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags).
+/// The video text track (VTT) you want to upload.
+
+ /// Caption
+ public Task
uploadAsync(string videoId, string language, System.IO.Stream file, CancellationToken cancellationToken = default)
+ {
+ Task> localVarResponse = uploadWithHttpInfoAsync(videoId, language, file, cancellationToken);
+ return localVarResponse.ContinueWith((Task> task) => task.Result.Data );
+
+ }
+
///
/// Upload a caption Upload a VTT file to add captions to your video. More information can be found [here](https://docs.api.video/vod/add-captions)
///
@@ -54,6 +72,82 @@ public Caption upload(string videoId, string language, System.IO.Stream file)
return localVarResponse.Data;
}
+
+ ///
+ /// Upload a caption Upload a VTT file to add captions to your video. More information can be found [here](https://docs.api.video/vod/add-captions)
+ ///
+ /// 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 for the video you want to add a caption to.
+/// A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags).
+/// The video text track (VTT) you want to upload.
+
+ /// ApiResponse of Caption
+ public Task> uploadWithHttpInfoAsync(string videoId, string language, System.IO.Stream file, CancellationToken cancellationToken = default)
+ {
+
+
+
+ // verify the required parameter 'videoId' is set
+ if (videoId == null)
+ throw new ApiException(400, "Missing required parameter 'videoId' when calling CaptionsApi->upload");
+ // verify the required parameter 'language' is set
+ if (language == null)
+ throw new ApiException(400, "Missing required parameter 'language' when calling CaptionsApi->upload");
+ // verify the required parameter 'file' is set
+ if (file == null)
+ throw new ApiException(400, "Missing required parameter 'file' when calling CaptionsApi->upload");
+
+
+ var localVarPath = "/videos/{videoId}/captions/{language}";
+ 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[] {
+ "multipart/form-data"
+ };
+ 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 (videoId != null) localVarPathParams.Add("videoId", this.ApiClient.ParameterToString(videoId)); // path parameter
+ if (language != null) localVarPathParams.Add("language", this.ApiClient.ParameterToString(language)); // path parameter
+
+
+
+
+ if (file != null)
+ localVarFileParams.Add("file", this.ApiClient.ParameterToFile("file", file));
+
+
+ // 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)),
+ (Caption) this.ApiClient.Deserialize(task.Result, typeof(Caption)));
+ });
+
+ }
+
+
///
/// Upload a caption Upload a VTT file to add captions to your video. More information can be found [here](https://docs.api.video/vod/add-captions)
///
@@ -124,6 +218,24 @@ public ApiResponse
uploadWithHttpInfo(string videoId, string language,
}
+ ///
+ /// Retrieve a caption Retrieve a caption for a video in a specific language. If the language is available, the caption is returned. Otherwise, you will get a error indicating the caption was not found.
+ ///
+ /// Tutorials that use the [captions endpoint](https://api.video/blog/endpoints/captions).
+ ///
+ /// 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 for the video you want captions for.
+/// A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags).
+
+ /// Caption
+ public Task
getAsync(string videoId, string language, CancellationToken cancellationToken = default)
+ {
+ Task> localVarResponse = getWithHttpInfoAsync(videoId, language, cancellationToken);
+ return localVarResponse.ContinueWith((Task> task) => task.Result.Data );
+
+ }
+
///
/// Retrieve a caption Retrieve a caption for a video in a specific language. If the language is available, the caption is returned. Otherwise, you will get a error indicating the caption was not found.
///
@@ -140,6 +252,74 @@ public Caption get(string videoId, string language)
return localVarResponse.Data;
}
+
+ ///
+ /// Retrieve a caption Retrieve a caption for a video in a specific language. If the language is available, the caption is returned. Otherwise, you will get a error indicating the caption was not found.
+ ///
+ /// Tutorials that use the [captions endpoint](https://api.video/blog/endpoints/captions).
+ ///
+ /// 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 for the video you want captions for.
+/// A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags).
+
+ /// ApiResponse of Caption
+ public Task> getWithHttpInfoAsync(string videoId, string language, CancellationToken cancellationToken = default)
+ {
+
+
+ // verify the required parameter 'videoId' is set
+ if (videoId == null)
+ throw new ApiException(400, "Missing required parameter 'videoId' when calling CaptionsApi->get");
+ // verify the required parameter 'language' is set
+ if (language == null)
+ throw new ApiException(400, "Missing required parameter 'language' when calling CaptionsApi->get");
+
+
+ var localVarPath = "/videos/{videoId}/captions/{language}";
+ 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 (videoId != null) localVarPathParams.Add("videoId", this.ApiClient.ParameterToString(videoId)); // path parameter
+ if (language != null) localVarPathParams.Add("language", this.ApiClient.ParameterToString(language)); // 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)),
+ (Caption) this.ApiClient.Deserialize(task.Result, typeof(Caption)));
+ });
+
+ }
+
+
///
/// Retrieve a caption Retrieve a caption for a video in a specific language. If the language is available, the caption is returned. Otherwise, you will get a error indicating the caption was not found.
///
@@ -202,6 +382,23 @@ public ApiResponse
getWithHttpInfo(string videoId, string language)
}
+ ///
+ /// Update a caption To have the captions on automatically, use this method to set default: true.
+ ///
+ /// 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 for the video you want to have automatic captions for.
+/// A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags).
+///
+
+ /// Caption
+ public Task
updateAsync(string videoId, string language, CaptionsUpdatePayload captionsUpdatePayload, CancellationToken cancellationToken = default)
+ {
+ Task> localVarResponse = updateWithHttpInfoAsync(videoId, language, captionsUpdatePayload, cancellationToken);
+ return localVarResponse.ContinueWith((Task> task) => task.Result.Data );
+
+ }
+
///
/// Update a caption To have the captions on automatically, use this method to set default: true.
///
@@ -217,6 +414,95 @@ public Caption update(string videoId, string language, CaptionsUpdatePayload cap
return localVarResponse.Data;
}
+
+ ///
+ /// Update a caption To have the captions on automatically, use this method to set default: true.
+ ///
+ /// 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 for the video you want to have automatic captions for.
+/// A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags).
+///
+
+ /// ApiResponse of Caption
+ public Task> updateWithHttpInfoAsync(string videoId, string language, CaptionsUpdatePayload captionsUpdatePayload, CancellationToken cancellationToken = default)
+ {
+ if (captionsUpdatePayload == null)
+ throw new ApiException(400,"Missing required parameter 'captionsUpdatePayload' when calling CaptionsApi->update");
+
+
+ if (captionsUpdatePayload == null)
+ throw new ApiException(400,"Missing required parameter 'captionsUpdatePayload' when calling CaptionsApi->update");
+
+
+ if (captionsUpdatePayload == null)
+ throw new ApiException(400,"Missing required parameter 'captionsUpdatePayload' when calling CaptionsApi->update");
+
+
+ // verify the required parameter 'videoId' is set
+ if (videoId == null)
+ throw new ApiException(400, "Missing required parameter 'videoId' when calling CaptionsApi->update");
+ // verify the required parameter 'language' is set
+ if (language == null)
+ throw new ApiException(400, "Missing required parameter 'language' when calling CaptionsApi->update");
+ // verify the required parameter 'captionsUpdatePayload' is set
+ if (captionsUpdatePayload == null)
+ throw new ApiException(400, "Missing required parameter 'captionsUpdatePayload' when calling CaptionsApi->update");
+
+
+ var localVarPath = "/videos/{videoId}/captions/{language}";
+ 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 (videoId != null) localVarPathParams.Add("videoId", this.ApiClient.ParameterToString(videoId)); // path parameter
+ if (language != null) localVarPathParams.Add("language", this.ApiClient.ParameterToString(language)); // path parameter
+ if (captionsUpdatePayload != null && captionsUpdatePayload.GetType() != typeof(byte[]) && captionsUpdatePayload.GetType() != typeof(string))
+ {
+ localVarPostBody = this.ApiClient.Serialize(captionsUpdatePayload); // http body (model) parameter
+ }
+ else
+ {
+ localVarPostBody = captionsUpdatePayload; // 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)),
+ (Caption) this.ApiClient.Deserialize(task.Result, typeof(Caption)));
+ });
+
+ }
+
+
///
/// Update a caption To have the captions on automatically, use this method to set default: true.
///
@@ -300,6 +586,20 @@ public ApiResponse
updateWithHttpInfo(string videoId, string language,
}
+ ///
+ /// Delete a caption Delete a caption in a specific language by by video id.
+ ///
+ /// 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 for the video you want to delete a caption from.
+/// A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags).
+
+ ///
+ public void deleteAsync(string videoId, string language, CancellationToken cancellationToken = default)
+ {
+ deleteWithHttpInfoAsync(videoId, language, cancellationToken);
+ }
+
///
/// Delete a caption Delete a caption in a specific language by by video id.
///
@@ -313,6 +613,71 @@ public void delete(string videoId, string language)
deleteWithHttpInfo(videoId, language);
}
+
+ ///
+ /// Delete a caption Delete a caption in a specific language by by video id.
+ ///
+ /// 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 for the video you want to delete a caption from.
+/// A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags).
+
+ /// ApiResponse of Object(void)
+ public Task> deleteWithHttpInfoAsync(string videoId, string language, CancellationToken cancellationToken = default)
+ {
+
+
+ // verify the required parameter 'videoId' is set
+ if (videoId == null)
+ throw new ApiException(400, "Missing required parameter 'videoId' when calling CaptionsApi->delete");
+ // verify the required parameter 'language' is set
+ if (language == null)
+ throw new ApiException(400, "Missing required parameter 'language' when calling CaptionsApi->delete");
+
+
+ var localVarPath = "/videos/{videoId}/captions/{language}";
+ 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 (videoId != null) localVarPathParams.Add("videoId", this.ApiClient.ParameterToString(videoId)); // path parameter
+ if (language != null) localVarPathParams.Add("language", this.ApiClient.ParameterToString(language)); // 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