From 083626fdcd7e4c9f620ede768360a220dac3c495 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 5 May 2026 13:35:23 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Shotstack.AutoSDKHttpResponse.g.cs | 121 +++++++++ .../Shotstack.EditClient.DeleteTemplate.g.cs | 55 ++++- .../Shotstack.EditClient.GetRender.g.cs | 65 ++++- .../Shotstack.EditClient.GetTemplate.g.cs | 65 ++++- .../Shotstack.EditClient.GetTemplates.g.cs | 62 ++++- .../Shotstack.EditClient.PostRender.g.cs | 77 +++++- .../Shotstack.EditClient.PostTemplate.g.cs | 69 +++++- ...otstack.EditClient.PostTemplateRender.g.cs | 68 +++++- .../Generated/Shotstack.EditClient.Probe.g.cs | 67 ++++- .../Shotstack.EditClient.PutTemplate.g.cs | 70 +++++- .../Generated/Shotstack.EditClient.g.cs | 8 +- .../Shotstack.IEditClient.DeleteTemplate.g.cs | 13 + .../Shotstack.IEditClient.GetRender.g.cs | 13 + .../Shotstack.IEditClient.GetTemplate.g.cs | 13 + .../Shotstack.IEditClient.GetTemplates.g.cs | 11 + .../Shotstack.IEditClient.PostRender.g.cs | 24 ++ .../Shotstack.IEditClient.PostTemplate.g.cs | 16 ++ ...tstack.IEditClient.PostTemplateRender.g.cs | 15 ++ .../Shotstack.IEditClient.Probe.g.cs | 15 ++ .../Shotstack.IEditClient.PutTemplate.g.cs | 16 ++ .../Shotstack.IIngestClient.DeleteSource.g.cs | 13 + .../Shotstack.IIngestClient.GetSource.g.cs | 13 + .../Shotstack.IIngestClient.GetSources.g.cs | 11 + ...tack.IIngestClient.GetUploadSignedUrl.g.cs | 22 ++ .../Shotstack.IIngestClient.PostSource.g.cs | 15 ++ .../Shotstack.IServeClient.DeleteAsset.g.cs | 14 ++ .../Shotstack.IServeClient.GetAsset.g.cs | 15 ++ ...stack.IServeClient.GetAssetByRenderId.g.cs | 15 ++ ...Shotstack.IServeClient.PostServeAsset.g.cs | 15 ++ .../Shotstack.IngestClient.DeleteSource.g.cs | 55 ++++- .../Shotstack.IngestClient.GetSource.g.cs | 65 ++++- .../Shotstack.IngestClient.GetSources.g.cs | 62 ++++- ...stack.IngestClient.GetUploadSignedUrl.g.cs | 73 +++++- .../Shotstack.IngestClient.PostSource.g.cs | 68 +++++- .../Generated/Shotstack.IngestClient.g.cs | 8 +- .../Generated/Shotstack.OptionsSupport.g.cs | 231 +++++++++++++++++- .../Shotstack.ServeClient.DeleteAsset.g.cs | 56 ++++- .../Shotstack.ServeClient.GetAsset.g.cs | 67 ++++- ...tstack.ServeClient.GetAssetByRenderId.g.cs | 67 ++++- .../Shotstack.ServeClient.PostServeAsset.g.cs | 68 +++++- .../Generated/Shotstack.ServeClient.g.cs | 8 +- .../Generated/Shotstack.ShotstackClient.g.cs | 14 +- 42 files changed, 1681 insertions(+), 157 deletions(-) create mode 100644 src/libs/Shotstack/Generated/Shotstack.AutoSDKHttpResponse.g.cs diff --git a/src/libs/Shotstack/Generated/Shotstack.AutoSDKHttpResponse.g.cs b/src/libs/Shotstack/Generated/Shotstack.AutoSDKHttpResponse.g.cs new file mode 100644 index 0000000..2b3961f --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.AutoSDKHttpResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace Shotstack +{ + /// + /// Represents a successful HTTP response with status code and headers. + /// + public partial class AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri) + { + StatusCode = statusCode; + Headers = headers ?? throw new global::System.ArgumentNullException(nameof(headers)); + RequestUri = requestUri; + } + + /// + /// Gets the HTTP status code. + /// + public global::System.Net.HttpStatusCode StatusCode { get; } + /// + /// Gets the response headers. + /// + public global::System.Collections.Generic.Dictionary> Headers { get; } + /// + /// Gets the final request URI associated with the response. + /// + public global::System.Uri? RequestUri { get; } + + internal static global::System.Collections.Generic.Dictionary> CreateHeaders( + global::System.Net.Http.HttpResponseMessage response) + { + response = response ?? throw new global::System.ArgumentNullException(nameof(response)); + + var headers = global::System.Linq.Enumerable.ToDictionary( + response.Headers, + static header => header.Key, + static header => (global::System.Collections.Generic.IEnumerable)global::System.Linq.Enumerable.ToArray(header.Value), + global::System.StringComparer.OrdinalIgnoreCase); + + if (response.Content?.Headers == null) + { + return headers; + } + + foreach (var header in response.Content.Headers) + { + if (headers.TryGetValue(header.Key, out var existingValues)) + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray( + global::System.Linq.Enumerable.Concat(existingValues, header.Value)); + } + else + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray(header.Value); + } + } + + return headers; + } + } + + /// + /// Represents a successful HTTP response with status code, headers, and body. + /// + public partial class AutoSDKHttpResponse : AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + T body) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null, + body: body) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri, + T body) + : base(statusCode, headers, requestUri) + { + Body = body; + } + + /// + /// Gets the response body. + /// + public T Body { get; } + } +} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.DeleteTemplate.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.DeleteTemplate.g.cs index 921cc6e..5456225 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.DeleteTemplate.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.DeleteTemplate.g.cs @@ -49,6 +49,26 @@ partial void ProcessDeleteTemplateResponse( string id, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteTemplateAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete Template
+ /// Delete a template by its template id.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeleteTemplateAsResponseAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -78,6 +98,7 @@ partial void ProcessDeleteTemplateResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Shotstack.PathBuilder( path: $"/edit/v1/templates/{id}", baseUri: HttpClient.BaseAddress); @@ -134,6 +155,8 @@ partial void ProcessDeleteTemplateResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -144,6 +167,11 @@ partial void ProcessDeleteTemplateResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -161,6 +189,8 @@ partial void ProcessDeleteTemplateResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -170,8 +200,7 @@ partial void ProcessDeleteTemplateResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -180,6 +209,11 @@ partial void ProcessDeleteTemplateResponse( __attempt < __maxAttempts && global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -196,14 +230,15 @@ partial void ProcessDeleteTemplateResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -243,6 +278,8 @@ partial void ProcessDeleteTemplateResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -263,6 +300,8 @@ partial void ProcessDeleteTemplateResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -283,6 +322,10 @@ partial void ProcessDeleteTemplateResponse( { __response.EnsureSuccessStatusCode(); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -304,6 +347,10 @@ partial void ProcessDeleteTemplateResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.GetRender.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.GetRender.g.cs index f8cb50a..c0f0b50 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.GetRender.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.GetRender.g.cs @@ -54,6 +54,28 @@ partial void ProcessGetRenderResponseContent( string id, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetRenderAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Render Status
+ /// Get the rendering status, temporary asset url and details of a render by ID.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetRenderAsResponseAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -83,6 +105,7 @@ partial void ProcessGetRenderResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Shotstack.PathBuilder( path: $"/edit/v1/render/{id}", baseUri: HttpClient.BaseAddress); @@ -139,6 +162,8 @@ partial void ProcessGetRenderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -149,6 +174,11 @@ partial void ProcessGetRenderResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -166,6 +196,8 @@ partial void ProcessGetRenderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -175,8 +207,7 @@ partial void ProcessGetRenderResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -185,6 +216,11 @@ partial void ProcessGetRenderResponseContent( __attempt < __maxAttempts && global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -201,14 +237,15 @@ partial void ProcessGetRenderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -248,6 +285,8 @@ partial void ProcessGetRenderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -268,6 +307,8 @@ partial void ProcessGetRenderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -292,9 +333,13 @@ partial void ProcessGetRenderResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Shotstack.RenderResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Shotstack.RenderResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -322,9 +367,13 @@ partial void ProcessGetRenderResponseContent( #endif ).ConfigureAwait(false); - return - await global::Shotstack.RenderResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Shotstack.RenderResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.GetTemplate.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.GetTemplate.g.cs index 2017a55..9029d5e 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.GetTemplate.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.GetTemplate.g.cs @@ -54,6 +54,28 @@ partial void ProcessGetTemplateResponseContent( string id, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetTemplateAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Template
+ /// Retrieve a template by template id.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetTemplateAsResponseAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -83,6 +105,7 @@ partial void ProcessGetTemplateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Shotstack.PathBuilder( path: $"/edit/v1/templates/{id}", baseUri: HttpClient.BaseAddress); @@ -139,6 +162,8 @@ partial void ProcessGetTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -149,6 +174,11 @@ partial void ProcessGetTemplateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -166,6 +196,8 @@ partial void ProcessGetTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -175,8 +207,7 @@ partial void ProcessGetTemplateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -185,6 +216,11 @@ partial void ProcessGetTemplateResponseContent( __attempt < __maxAttempts && global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -201,14 +237,15 @@ partial void ProcessGetTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -248,6 +285,8 @@ partial void ProcessGetTemplateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -268,6 +307,8 @@ partial void ProcessGetTemplateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -292,9 +333,13 @@ partial void ProcessGetTemplateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Shotstack.TemplateDataResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Shotstack.TemplateDataResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -322,9 +367,13 @@ partial void ProcessGetTemplateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Shotstack.TemplateDataResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Shotstack.TemplateDataResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.GetTemplates.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.GetTemplates.g.cs index ab186e6..cedb16e 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.GetTemplates.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.GetTemplates.g.cs @@ -50,6 +50,25 @@ partial void ProcessGetTemplatesResponseContent( public async global::System.Threading.Tasks.Task GetTemplatesAsync( global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetTemplatesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Templates
+ /// Retrieve a list of templates stored against a users account and stage.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetTemplatesAsResponseAsync( + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -78,6 +97,7 @@ partial void ProcessGetTemplatesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Shotstack.PathBuilder( path: "/edit/v1/templates", baseUri: HttpClient.BaseAddress); @@ -133,6 +153,8 @@ partial void ProcessGetTemplatesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -143,6 +165,11 @@ partial void ProcessGetTemplatesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -160,6 +187,8 @@ partial void ProcessGetTemplatesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -169,8 +198,7 @@ partial void ProcessGetTemplatesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -179,6 +207,11 @@ partial void ProcessGetTemplatesResponseContent( __attempt < __maxAttempts && global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -195,14 +228,15 @@ partial void ProcessGetTemplatesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -242,6 +276,8 @@ partial void ProcessGetTemplatesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -262,6 +298,8 @@ partial void ProcessGetTemplatesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -286,9 +324,13 @@ partial void ProcessGetTemplatesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Shotstack.TemplateListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Shotstack.TemplateListResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -316,9 +358,13 @@ partial void ProcessGetTemplatesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Shotstack.TemplateListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Shotstack.TemplateListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.PostRender.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.PostRender.g.cs index e1733f1..3eeac1a 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.PostRender.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.PostRender.g.cs @@ -64,6 +64,40 @@ partial void ProcessPostRenderResponseContent( /// public async global::System.Threading.Tasks.Task PostRenderAsync( + global::Shotstack.Edit request, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostRenderAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Render Asset
+ /// Queue and render the contents of an [Edit](#tocs_edit) as a video, image or audio file.
+ /// **Rendering Process:**
+ /// 1. **Validation**: The edit JSON is validated
+ /// 2. **Download**: All assets are downloaded and cached
+ /// 3. **Preprocessing**: Video assets are automatically processed to fix compatibility issues
+ /// 4. **Rendering**: The timeline is rendered using the processed assets
+ /// 5. **Output**: The final media file is generated and stored
+ /// **Video Preprocessing:**
+ /// Video assets undergo automatic preprocessing to ensure compatibility. You can force
+ /// preprocessing by setting `"transcode": true` on video assets. See [Preprocessing](#preprocessing)
+ /// for more details.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PostRenderAsResponseAsync( + global::Shotstack.Edit request, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +132,7 @@ partial void ProcessPostRenderResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Shotstack.PathBuilder( path: "/edit/v1/render", baseUri: HttpClient.BaseAddress); @@ -160,6 +195,8 @@ partial void ProcessPostRenderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +207,11 @@ partial void ProcessPostRenderResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +229,8 @@ partial void ProcessPostRenderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +240,7 @@ partial void ProcessPostRenderResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +249,11 @@ partial void ProcessPostRenderResponseContent( __attempt < __maxAttempts && global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +270,15 @@ partial void ProcessPostRenderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +318,8 @@ partial void ProcessPostRenderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +340,8 @@ partial void ProcessPostRenderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +366,13 @@ partial void ProcessPostRenderResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Shotstack.QueuedResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Shotstack.QueuedResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +400,13 @@ partial void ProcessPostRenderResponseContent( #endif ).ConfigureAwait(false); - return - await global::Shotstack.QueuedResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Shotstack.QueuedResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.PostTemplate.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.PostTemplate.g.cs index eb7ed06..1ec8c2e 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.PostTemplate.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.PostTemplate.g.cs @@ -54,6 +54,32 @@ partial void ProcessPostTemplateResponseContent( /// public async global::System.Threading.Tasks.Task PostTemplateAsync( + global::Shotstack.Template request, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostTemplateAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Template
+ /// Save an [Edit](#tocs_edit) as a re-usable template. Templates can be retrieved and modified in your application
+ /// before being rendered. [Merge fields](#tocs_mergefield) can be also used to merge data in to a template and
+ /// [render](#render-template) it in a single request.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PostTemplateAsResponseAsync( + global::Shotstack.Template request, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -88,6 +114,7 @@ partial void ProcessPostTemplateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Shotstack.PathBuilder( path: "/edit/v1/templates", baseUri: HttpClient.BaseAddress); @@ -150,6 +177,8 @@ partial void ProcessPostTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -160,6 +189,11 @@ partial void ProcessPostTemplateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -177,6 +211,8 @@ partial void ProcessPostTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -186,8 +222,7 @@ partial void ProcessPostTemplateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -196,6 +231,11 @@ partial void ProcessPostTemplateResponseContent( __attempt < __maxAttempts && global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -212,14 +252,15 @@ partial void ProcessPostTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -259,6 +300,8 @@ partial void ProcessPostTemplateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -279,6 +322,8 @@ partial void ProcessPostTemplateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -303,9 +348,13 @@ partial void ProcessPostTemplateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Shotstack.TemplateResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Shotstack.TemplateResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -333,9 +382,13 @@ partial void ProcessPostTemplateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Shotstack.TemplateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Shotstack.TemplateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.PostTemplateRender.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.PostTemplateRender.g.cs index 8936f11..c54d086 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.PostTemplateRender.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.PostTemplateRender.g.cs @@ -53,6 +53,31 @@ partial void ProcessPostTemplateRenderResponseContent( /// public async global::System.Threading.Tasks.Task PostTemplateRenderAsync( + global::Shotstack.TemplateRender request, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostTemplateRenderAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Render Template
+ /// Render an asset from a template id and optional merge fields. Merge fields can be used to replace placeholder
+ /// variables within the [Edit](#tocs_edit).
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PostTemplateRenderAsResponseAsync( + global::Shotstack.TemplateRender request, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -87,6 +112,7 @@ partial void ProcessPostTemplateRenderResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Shotstack.PathBuilder( path: "/edit/v1/templates/render", baseUri: HttpClient.BaseAddress); @@ -149,6 +175,8 @@ partial void ProcessPostTemplateRenderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -159,6 +187,11 @@ partial void ProcessPostTemplateRenderResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -176,6 +209,8 @@ partial void ProcessPostTemplateRenderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -185,8 +220,7 @@ partial void ProcessPostTemplateRenderResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -195,6 +229,11 @@ partial void ProcessPostTemplateRenderResponseContent( __attempt < __maxAttempts && global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -211,14 +250,15 @@ partial void ProcessPostTemplateRenderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -258,6 +298,8 @@ partial void ProcessPostTemplateRenderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -278,6 +320,8 @@ partial void ProcessPostTemplateRenderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -302,9 +346,13 @@ partial void ProcessPostTemplateRenderResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Shotstack.QueuedResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Shotstack.QueuedResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -332,9 +380,13 @@ partial void ProcessPostTemplateRenderResponseContent( #endif ).ConfigureAwait(false); - return - await global::Shotstack.QueuedResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Shotstack.QueuedResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.Probe.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.Probe.g.cs index 0ab9fa1..0e18044 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.Probe.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.Probe.g.cs @@ -56,6 +56,30 @@ partial void ProcessProbeResponseContent( string url, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProbeAsResponseAsync( + url: url, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Inspect Media
+ /// Inspects any media asset (image, video, audio) on the internet using a hosted version
+ /// of [FFprobe](https://ffmpeg.org/ffprobe.html). The probe endpoint returns useful information
+ /// about an asset such as width, height, duration, rotation, framerate, etc...
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProbeAsResponseAsync( + string url, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -85,6 +109,7 @@ partial void ProcessProbeResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Shotstack.PathBuilder( path: $"/edit/v1/probe/{url}", baseUri: HttpClient.BaseAddress); @@ -141,6 +166,8 @@ partial void ProcessProbeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -151,6 +178,11 @@ partial void ProcessProbeResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -168,6 +200,8 @@ partial void ProcessProbeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -177,8 +211,7 @@ partial void ProcessProbeResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -187,6 +220,11 @@ partial void ProcessProbeResponseContent( __attempt < __maxAttempts && global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -203,14 +241,15 @@ partial void ProcessProbeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -250,6 +289,8 @@ partial void ProcessProbeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -270,6 +311,8 @@ partial void ProcessProbeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -294,9 +337,13 @@ partial void ProcessProbeResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Shotstack.ProbeResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Shotstack.ProbeResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -324,9 +371,13 @@ partial void ProcessProbeResponseContent( #endif ).ConfigureAwait(false); - return - await global::Shotstack.ProbeResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Shotstack.ProbeResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.PutTemplate.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.PutTemplate.g.cs index 58abf33..8c684cd 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.PutTemplate.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.PutTemplate.g.cs @@ -56,6 +56,33 @@ partial void ProcessPutTemplateResponseContent( public async global::System.Threading.Tasks.Task PutTemplateAsync( string id, + global::Shotstack.Template request, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PutTemplateAsResponseAsync( + id: id, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Template
+ /// Update an existing template by template id.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PutTemplateAsResponseAsync( + string id, + global::Shotstack.Template request, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -91,6 +118,7 @@ partial void ProcessPutTemplateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Shotstack.PathBuilder( path: $"/edit/v1/templates/{id}", baseUri: HttpClient.BaseAddress); @@ -154,6 +182,8 @@ partial void ProcessPutTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +194,11 @@ partial void ProcessPutTemplateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +216,8 @@ partial void ProcessPutTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +227,7 @@ partial void ProcessPutTemplateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +236,11 @@ partial void ProcessPutTemplateResponseContent( __attempt < __maxAttempts && global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +257,15 @@ partial void ProcessPutTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +305,8 @@ partial void ProcessPutTemplateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +327,8 @@ partial void ProcessPutTemplateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +353,13 @@ partial void ProcessPutTemplateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Shotstack.TemplateResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Shotstack.TemplateResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +387,13 @@ partial void ProcessPutTemplateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Shotstack.TemplateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Shotstack.TemplateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.g.cs index 6725dd7..b386531 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.g.cs @@ -73,10 +73,10 @@ public EditClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public EditClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Shotstack.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Shotstack.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Shotstack/Generated/Shotstack.IEditClient.DeleteTemplate.g.cs b/src/libs/Shotstack/Generated/Shotstack.IEditClient.DeleteTemplate.g.cs index 72ebfc5..cf9602b 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IEditClient.DeleteTemplate.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IEditClient.DeleteTemplate.g.cs @@ -17,5 +17,18 @@ public partial interface IEditClient string id, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Template
+ /// Delete a template by its template id.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteTemplateAsResponseAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.IEditClient.GetRender.g.cs b/src/libs/Shotstack/Generated/Shotstack.IEditClient.GetRender.g.cs index d336ca7..1eeb8ce 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IEditClient.GetRender.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IEditClient.GetRender.g.cs @@ -17,5 +17,18 @@ public partial interface IEditClient string id, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Render Status
+ /// Get the rendering status, temporary asset url and details of a render by ID.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetRenderAsResponseAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.IEditClient.GetTemplate.g.cs b/src/libs/Shotstack/Generated/Shotstack.IEditClient.GetTemplate.g.cs index 504906b..e4bb68c 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IEditClient.GetTemplate.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IEditClient.GetTemplate.g.cs @@ -17,5 +17,18 @@ public partial interface IEditClient string id, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Template
+ /// Retrieve a template by template id.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetTemplateAsResponseAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.IEditClient.GetTemplates.g.cs b/src/libs/Shotstack/Generated/Shotstack.IEditClient.GetTemplates.g.cs index 3d31bac..6720355 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IEditClient.GetTemplates.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IEditClient.GetTemplates.g.cs @@ -15,5 +15,16 @@ public partial interface IEditClient global::System.Threading.Tasks.Task GetTemplatesAsync( global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Templates
+ /// Retrieve a list of templates stored against a users account and stage.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetTemplatesAsResponseAsync( + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostRender.g.cs b/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostRender.g.cs index 263b879..4ea2443 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostRender.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostRender.g.cs @@ -45,6 +45,30 @@ public partial interface IEditClient /// for more details.
/// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PostRenderAsResponseAsync( + + global::Shotstack.Edit request, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Render Asset
+ /// Queue and render the contents of an [Edit](#tocs_edit) as a video, image or audio file.
+ /// **Rendering Process:**
+ /// 1. **Validation**: The edit JSON is validated
+ /// 2. **Download**: All assets are downloaded and cached
+ /// 3. **Preprocessing**: Video assets are automatically processed to fix compatibility issues
+ /// 4. **Rendering**: The timeline is rendered using the processed assets
+ /// 5. **Output**: The final media file is generated and stored
+ /// **Video Preprocessing:**
+ /// Video assets undergo automatic preprocessing to ensure compatibility. You can force
+ /// preprocessing by setting `"transcode": true` on video assets. See [Preprocessing](#preprocessing)
+ /// for more details.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
/// /// A timeline represents the contents of a video edit over time, an audio edit over time, in seconds, or an image layout. A timeline consists of layers called tracks. Tracks are composed of titles, images, audio, html or video segments referred to as clips which are placed along the track at specific starting point and lasting for a specific amount of time. /// diff --git a/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostTemplate.g.cs b/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostTemplate.g.cs index d10419e..b0ba74c 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostTemplate.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostTemplate.g.cs @@ -27,6 +27,22 @@ public partial interface IEditClient /// [render](#render-template) it in a single request.
/// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PostTemplateAsResponseAsync( + + global::Shotstack.Template request, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Template
+ /// Save an [Edit](#tocs_edit) as a re-usable template. Templates can be retrieved and modified in your application
+ /// before being rendered. [Merge fields](#tocs_mergefield) can be also used to merge data in to a template and
+ /// [render](#render-template) it in a single request.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
/// /// The template name
/// Example: My template diff --git a/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostTemplateRender.g.cs b/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostTemplateRender.g.cs index 1ccd72d..a7c61fd 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostTemplateRender.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostTemplateRender.g.cs @@ -25,6 +25,21 @@ public partial interface IEditClient /// variables within the [Edit](#tocs_edit).
/// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PostTemplateRenderAsResponseAsync( + + global::Shotstack.TemplateRender request, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Render Template
+ /// Render an asset from a template id and optional merge fields. Merge fields can be used to replace placeholder
+ /// variables within the [Edit](#tocs_edit).
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
/// /// The id of the template to render in UUID format.
/// Example: f5493c17-d01f-445c-bb49-535fae65f219 diff --git a/src/libs/Shotstack/Generated/Shotstack.IEditClient.Probe.g.cs b/src/libs/Shotstack/Generated/Shotstack.IEditClient.Probe.g.cs index 1d8d2e4..3ec2da3 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IEditClient.Probe.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IEditClient.Probe.g.cs @@ -19,5 +19,20 @@ public partial interface IEditClient string url, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Inspect Media
+ /// Inspects any media asset (image, video, audio) on the internet using a hosted version
+ /// of [FFprobe](https://ffmpeg.org/ffprobe.html). The probe endpoint returns useful information
+ /// about an asset such as width, height, duration, rotation, framerate, etc...
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProbeAsResponseAsync( + string url, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.IEditClient.PutTemplate.g.cs b/src/libs/Shotstack/Generated/Shotstack.IEditClient.PutTemplate.g.cs index 72cad8e..a56656c 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IEditClient.PutTemplate.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IEditClient.PutTemplate.g.cs @@ -26,6 +26,22 @@ public partial interface IEditClient /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PutTemplateAsResponseAsync( + string id, + + global::Shotstack.Template request, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Template
+ /// Update an existing template by template id.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// /// /// The template name
/// Example: My template diff --git a/src/libs/Shotstack/Generated/Shotstack.IIngestClient.DeleteSource.g.cs b/src/libs/Shotstack/Generated/Shotstack.IIngestClient.DeleteSource.g.cs index 6b7c860..b691969 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IIngestClient.DeleteSource.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IIngestClient.DeleteSource.g.cs @@ -17,5 +17,18 @@ public partial interface IIngestClient string id, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Source
+ /// Delete an ingested source file by its id.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/ingest/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteSourceAsResponseAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.IIngestClient.GetSource.g.cs b/src/libs/Shotstack/Generated/Shotstack.IIngestClient.GetSource.g.cs index e663212..79f8ea1 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IIngestClient.GetSource.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IIngestClient.GetSource.g.cs @@ -17,5 +17,18 @@ public partial interface IIngestClient string id, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Source
+ /// Fetch a source file details and status by its id.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/ingest/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetSourceAsResponseAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.IIngestClient.GetSources.g.cs b/src/libs/Shotstack/Generated/Shotstack.IIngestClient.GetSources.g.cs index b638a3e..91ed151 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IIngestClient.GetSources.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IIngestClient.GetSources.g.cs @@ -15,5 +15,16 @@ public partial interface IIngestClient global::System.Threading.Tasks.Task GetSourcesAsync( global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Sources
+ /// Retrieve a list of ingested source files stored against a users account and stage.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/ingest/{version}</a> + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetSourcesAsResponseAsync( + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.IIngestClient.GetUploadSignedUrl.g.cs b/src/libs/Shotstack/Generated/Shotstack.IIngestClient.GetUploadSignedUrl.g.cs index f1de339..57894bb 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IIngestClient.GetUploadSignedUrl.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IIngestClient.GetUploadSignedUrl.g.cs @@ -26,5 +26,27 @@ public partial interface IIngestClient global::System.Threading.Tasks.Task GetUploadSignedUrlAsync( global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Direct Upload
+ /// Request a signed URL to upload a file to. The response returns a signed URL that you use to upload the file to.
+ /// The signed URL looks similar to:
+ /// https://shotstack-ingest-api-stage-sources.s3.ap-southeast-2.amazonaws.com/5ca6hu7s9k/zzytey4v-32km-kq1z-aftr-3kcuqi0brad2/source?AWSAccessKeyId=ASIAWJV7UWDMGTZLHTXP&Expires=1677209777&Signature=PKR4dGDDdOuMTAQmDASzLGmLOeo%3D&x-amz-acl=public-read&x-amz-security-token=IQoJb3JpZ2luX2VjEGMaDmFwLX......56osBGByztm7WZdbmXzO09KR
+ /// In a separate API call, use this signed URL to send a PUT request with the binary file. Using cURL you can use
+ /// a command like:
+ ///
+ /// `curl -X PUT -T video.mp4 {data.attributes.url}`
+ ///
+ /// Where **video.mp4** is the file you want to upload and **{data.attributes.url}** is the signed URL returned in
+ /// the response. The request must be a PUT type.
+ /// The SDK does not currently support the PUT request. You can use the SDK to make the request for the signed URL
+ /// and then use cURL to make the PUT request.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/ingest/{version}</a> + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetUploadSignedUrlAsResponseAsync( + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.IIngestClient.PostSource.g.cs b/src/libs/Shotstack/Generated/Shotstack.IIngestClient.PostSource.g.cs index 48f206c..22d3ef5 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IIngestClient.PostSource.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IIngestClient.PostSource.g.cs @@ -25,6 +25,21 @@ public partial interface IIngestClient /// files and fonts. Once ingested, new [output renditions](#tocs_outputs) can be created from the source file.
/// **Base URL:** <a href="#">https://api.shotstack.io/ingest/{version}</a> /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PostSourceAsResponseAsync( + + global::Shotstack.Source request, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fetch Source
+ /// Queue a source file to be fetched from a URL and stored by Shotstack. Source files can be videos, images, audio
+ /// files and fonts. Once ingested, new [output renditions](#tocs_outputs) can be created from the source file.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/ingest/{version}</a> + ///
/// /// The URL of the file to be ingested. The URL must be publicly accessible or include credentials.
/// Example: https://github.com/shotstack/test-media/raw/main/captioning/scott-ko.mp4 diff --git a/src/libs/Shotstack/Generated/Shotstack.IServeClient.DeleteAsset.g.cs b/src/libs/Shotstack/Generated/Shotstack.IServeClient.DeleteAsset.g.cs index e09c472..6fe5c35 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IServeClient.DeleteAsset.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IServeClient.DeleteAsset.g.cs @@ -18,5 +18,19 @@ public partial interface IServeClient string id, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Asset
+ /// Delete an asset by its asset id. If a render creates multiple assets, such as thumbnail and poster images,
+ /// each asset must be deleted individually by the asset id.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/serve/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAssetAsResponseAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.IServeClient.GetAsset.g.cs b/src/libs/Shotstack/Generated/Shotstack.IServeClient.GetAsset.g.cs index 4e9f383..2bec63a 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IServeClient.GetAsset.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IServeClient.GetAsset.g.cs @@ -19,5 +19,20 @@ public partial interface IServeClient string id, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Asset
+ /// The Serve API is used to interact with, and delete hosted assets including videos, images, audio files,
+ /// thumbnails and poster images. Use this endpoint to fetch an asset by asset id. Note that an asset id is unique
+ /// for each asset and different from the render id.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/serve/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAssetAsResponseAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.IServeClient.GetAssetByRenderId.g.cs b/src/libs/Shotstack/Generated/Shotstack.IServeClient.GetAssetByRenderId.g.cs index 9eb56a0..b6db77d 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IServeClient.GetAssetByRenderId.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IServeClient.GetAssetByRenderId.g.cs @@ -19,5 +19,20 @@ public partial interface IServeClient string id, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Asset by Render ID
+ /// A render may generate more than one file, such as a video, thumbnail and poster image. When the assets are
+ /// created the only known id is the render id returned by the original [render request](#render-video), status
+ /// request or webhook. This endpoint lets you look up one or more assets by the render id.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/serve/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAssetByRenderIdAsResponseAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.IServeClient.PostServeAsset.g.cs b/src/libs/Shotstack/Generated/Shotstack.IServeClient.PostServeAsset.g.cs index 44c62a4..adb1d36 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IServeClient.PostServeAsset.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IServeClient.PostServeAsset.g.cs @@ -25,6 +25,21 @@ public partial interface IServeClient /// [destinations](#tocs_destinations).
/// **Base URL:** <a href="#">https://api.shotstack.io/serve/{version}</a> /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PostServeAssetAsResponseAsync( + + global::Shotstack.Transfer request, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Transfer Asset
+ /// Transfer a file from any publicly available URL to one or more Serve API
+ /// [destinations](#tocs_destinations).
+ /// **Base URL:** <a href="#">https://api.shotstack.io/serve/{version}</a> + ///
/// /// The file URL to fetch and transfer.
/// Example: https://s3-ap-northeast-1.amazonaws.com/my-bucket/video.mp4 diff --git a/src/libs/Shotstack/Generated/Shotstack.IngestClient.DeleteSource.g.cs b/src/libs/Shotstack/Generated/Shotstack.IngestClient.DeleteSource.g.cs index 921c4ea..15de68f 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IngestClient.DeleteSource.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IngestClient.DeleteSource.g.cs @@ -49,6 +49,26 @@ partial void ProcessDeleteSourceResponse( string id, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteSourceAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete Source
+ /// Delete an ingested source file by its id.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/ingest/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeleteSourceAsResponseAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -78,6 +98,7 @@ partial void ProcessDeleteSourceResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Shotstack.PathBuilder( path: $"/ingest/v1/sources/{id}", baseUri: HttpClient.BaseAddress); @@ -134,6 +155,8 @@ partial void ProcessDeleteSourceResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -144,6 +167,11 @@ partial void ProcessDeleteSourceResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -161,6 +189,8 @@ partial void ProcessDeleteSourceResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -170,8 +200,7 @@ partial void ProcessDeleteSourceResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -180,6 +209,11 @@ partial void ProcessDeleteSourceResponse( __attempt < __maxAttempts && global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -196,14 +230,15 @@ partial void ProcessDeleteSourceResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -243,6 +278,8 @@ partial void ProcessDeleteSourceResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -263,6 +300,8 @@ partial void ProcessDeleteSourceResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -283,6 +322,10 @@ partial void ProcessDeleteSourceResponse( { __response.EnsureSuccessStatusCode(); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -304,6 +347,10 @@ partial void ProcessDeleteSourceResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetSource.g.cs b/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetSource.g.cs index 6a8d5e7..b4433ef 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetSource.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetSource.g.cs @@ -54,6 +54,28 @@ partial void ProcessGetSourceResponseContent( string id, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetSourceAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Source
+ /// Fetch a source file details and status by its id.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/ingest/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetSourceAsResponseAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -83,6 +105,7 @@ partial void ProcessGetSourceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Shotstack.PathBuilder( path: $"/ingest/v1/sources/{id}", baseUri: HttpClient.BaseAddress); @@ -139,6 +162,8 @@ partial void ProcessGetSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -149,6 +174,11 @@ partial void ProcessGetSourceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -166,6 +196,8 @@ partial void ProcessGetSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -175,8 +207,7 @@ partial void ProcessGetSourceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -185,6 +216,11 @@ partial void ProcessGetSourceResponseContent( __attempt < __maxAttempts && global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -201,14 +237,15 @@ partial void ProcessGetSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -248,6 +285,8 @@ partial void ProcessGetSourceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -268,6 +307,8 @@ partial void ProcessGetSourceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -292,9 +333,13 @@ partial void ProcessGetSourceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Shotstack.SourceResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Shotstack.SourceResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -322,9 +367,13 @@ partial void ProcessGetSourceResponseContent( #endif ).ConfigureAwait(false); - return - await global::Shotstack.SourceResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Shotstack.SourceResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetSources.g.cs b/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetSources.g.cs index 37214f0..b1af549 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetSources.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetSources.g.cs @@ -50,6 +50,25 @@ partial void ProcessGetSourcesResponseContent( public async global::System.Threading.Tasks.Task GetSourcesAsync( global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetSourcesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Sources
+ /// Retrieve a list of ingested source files stored against a users account and stage.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/ingest/{version}</a> + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetSourcesAsResponseAsync( + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -78,6 +97,7 @@ partial void ProcessGetSourcesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Shotstack.PathBuilder( path: "/ingest/v1/sources", baseUri: HttpClient.BaseAddress); @@ -133,6 +153,8 @@ partial void ProcessGetSourcesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -143,6 +165,11 @@ partial void ProcessGetSourcesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -160,6 +187,8 @@ partial void ProcessGetSourcesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -169,8 +198,7 @@ partial void ProcessGetSourcesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -179,6 +207,11 @@ partial void ProcessGetSourcesResponseContent( __attempt < __maxAttempts && global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -195,14 +228,15 @@ partial void ProcessGetSourcesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -242,6 +276,8 @@ partial void ProcessGetSourcesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -262,6 +298,8 @@ partial void ProcessGetSourcesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -286,9 +324,13 @@ partial void ProcessGetSourcesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Shotstack.SourceListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Shotstack.SourceListResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -316,9 +358,13 @@ partial void ProcessGetSourcesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Shotstack.SourceListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Shotstack.SourceListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetUploadSignedUrl.g.cs b/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetUploadSignedUrl.g.cs index f715264..98c715f 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetUploadSignedUrl.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetUploadSignedUrl.g.cs @@ -61,6 +61,36 @@ partial void ProcessGetUploadSignedUrlResponseContent( public async global::System.Threading.Tasks.Task GetUploadSignedUrlAsync( global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetUploadSignedUrlAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Direct Upload
+ /// Request a signed URL to upload a file to. The response returns a signed URL that you use to upload the file to.
+ /// The signed URL looks similar to:
+ /// https://shotstack-ingest-api-stage-sources.s3.ap-southeast-2.amazonaws.com/5ca6hu7s9k/zzytey4v-32km-kq1z-aftr-3kcuqi0brad2/source?AWSAccessKeyId=ASIAWJV7UWDMGTZLHTXP&Expires=1677209777&Signature=PKR4dGDDdOuMTAQmDASzLGmLOeo%3D&x-amz-acl=public-read&x-amz-security-token=IQoJb3JpZ2luX2VjEGMaDmFwLX......56osBGByztm7WZdbmXzO09KR
+ /// In a separate API call, use this signed URL to send a PUT request with the binary file. Using cURL you can use
+ /// a command like:
+ ///
+ /// `curl -X PUT -T video.mp4 {data.attributes.url}`
+ ///
+ /// Where **video.mp4** is the file you want to upload and **{data.attributes.url}** is the signed URL returned in
+ /// the response. The request must be a PUT type.
+ /// The SDK does not currently support the PUT request. You can use the SDK to make the request for the signed URL
+ /// and then use cURL to make the PUT request.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/ingest/{version}</a> + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetUploadSignedUrlAsResponseAsync( + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -89,6 +119,7 @@ partial void ProcessGetUploadSignedUrlResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Shotstack.PathBuilder( path: "/ingest/v1/upload", baseUri: HttpClient.BaseAddress); @@ -144,6 +175,8 @@ partial void ProcessGetUploadSignedUrlResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -154,6 +187,11 @@ partial void ProcessGetUploadSignedUrlResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -171,6 +209,8 @@ partial void ProcessGetUploadSignedUrlResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -180,8 +220,7 @@ partial void ProcessGetUploadSignedUrlResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -190,6 +229,11 @@ partial void ProcessGetUploadSignedUrlResponseContent( __attempt < __maxAttempts && global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -206,14 +250,15 @@ partial void ProcessGetUploadSignedUrlResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -253,6 +298,8 @@ partial void ProcessGetUploadSignedUrlResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -273,6 +320,8 @@ partial void ProcessGetUploadSignedUrlResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -297,9 +346,13 @@ partial void ProcessGetUploadSignedUrlResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Shotstack.UploadResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Shotstack.UploadResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -327,9 +380,13 @@ partial void ProcessGetUploadSignedUrlResponseContent( #endif ).ConfigureAwait(false); - return - await global::Shotstack.UploadResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Shotstack.UploadResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Shotstack/Generated/Shotstack.IngestClient.PostSource.g.cs b/src/libs/Shotstack/Generated/Shotstack.IngestClient.PostSource.g.cs index 39d341a..02a2597 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IngestClient.PostSource.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IngestClient.PostSource.g.cs @@ -53,6 +53,31 @@ partial void ProcessPostSourceResponseContent( /// public async global::System.Threading.Tasks.Task PostSourceAsync( + global::Shotstack.Source request, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostSourceAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fetch Source
+ /// Queue a source file to be fetched from a URL and stored by Shotstack. Source files can be videos, images, audio
+ /// files and fonts. Once ingested, new [output renditions](#tocs_outputs) can be created from the source file.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/ingest/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PostSourceAsResponseAsync( + global::Shotstack.Source request, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -87,6 +112,7 @@ partial void ProcessPostSourceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Shotstack.PathBuilder( path: "/ingest/v1/sources", baseUri: HttpClient.BaseAddress); @@ -149,6 +175,8 @@ partial void ProcessPostSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -159,6 +187,11 @@ partial void ProcessPostSourceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -176,6 +209,8 @@ partial void ProcessPostSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -185,8 +220,7 @@ partial void ProcessPostSourceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -195,6 +229,11 @@ partial void ProcessPostSourceResponseContent( __attempt < __maxAttempts && global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -211,14 +250,15 @@ partial void ProcessPostSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -258,6 +298,8 @@ partial void ProcessPostSourceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -278,6 +320,8 @@ partial void ProcessPostSourceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // A list of validation and other errors @@ -340,9 +384,13 @@ partial void ProcessPostSourceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Shotstack.QueuedSourceResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Shotstack.QueuedSourceResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -370,9 +418,13 @@ partial void ProcessPostSourceResponseContent( #endif ).ConfigureAwait(false); - return - await global::Shotstack.QueuedSourceResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Shotstack.QueuedSourceResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Shotstack/Generated/Shotstack.IngestClient.g.cs b/src/libs/Shotstack/Generated/Shotstack.IngestClient.g.cs index a37f684..c99493a 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IngestClient.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IngestClient.g.cs @@ -73,10 +73,10 @@ public IngestClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public IngestClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Shotstack.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Shotstack.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Shotstack/Generated/Shotstack.OptionsSupport.g.cs b/src/libs/Shotstack/Generated/Shotstack.OptionsSupport.g.cs index 71bedd1..dd75f3f 100644 --- a/src/libs/Shotstack/Generated/Shotstack.OptionsSupport.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.OptionsSupport.g.cs @@ -101,9 +101,45 @@ public sealed class AutoSDKRetryOptions public int MaxAttempts { get; set; } = 1; /// - /// Optional fixed delay between retry attempts. + /// Optional fixed delay between retry attempts. When set, this takes precedence over exponential backoff. /// public global::System.TimeSpan? Delay { get; set; } + + /// + /// Initial exponential backoff delay used when is not set. + /// + public global::System.TimeSpan InitialDelay { get; set; } = global::System.TimeSpan.FromSeconds(1); + + /// + /// Maximum retry delay after applying retry headers, backoff, and jitter. + /// + public global::System.TimeSpan MaxDelay { get; set; } = global::System.TimeSpan.FromSeconds(30); + + /// + /// Multiplier applied to exponential backoff after each failed attempt. + /// Values below 1 are normalized to 1. + /// + public double BackoffMultiplier { get; set; } = 2D; + + /// + /// Randomizes computed backoff by plus or minus this ratio. Values are clamped to 0..1. + /// + public double JitterRatio { get; set; } = 0.2D; + + /// + /// Whether Retry-After response headers should control retry delay when present. + /// + public bool UseRetryAfterHeader { get; set; } = true; + + /// + /// Whether a rate-limit reset response header should control retry delay when present. + /// + public bool UseRateLimitResetHeader { get; set; } + + /// + /// Optional provider-specific rate-limit reset header name. Values may be Unix seconds or an HTTP date. + /// + public string? RateLimitResetHeaderName { get; set; } = "X-RateLimit-Reset"; } @@ -231,6 +267,16 @@ public sealed class AutoSDKHookContext /// public bool WillRetry { get; set; } + /// + /// The computed retry delay when is true. + /// + public global::System.TimeSpan? RetryDelay { get; set; } + + /// + /// A short retry reason such as exception or status:429. + /// + public string RetryReason { get; set; } = string.Empty; + /// /// The effective cancellation token for the current request attempt. /// @@ -254,6 +300,8 @@ internal static class AutoSDKRequestOptionsSupport int attempt, int maxAttempts, bool willRetry, + global::System.TimeSpan? retryDelay, + string retryReason, global::System.Threading.CancellationToken cancellationToken) { return new global::Shotstack.AutoSDKHookContext @@ -271,6 +319,8 @@ internal static class AutoSDKRequestOptionsSupport Attempt = attempt, MaxAttempts = maxAttempts, WillRetry = willRetry, + RetryDelay = retryDelay, + RetryReason = retryReason ?? string.Empty, CancellationToken = cancellationToken, }; } @@ -338,19 +388,188 @@ internal static int GetMaxAttempts( return maxAttempts < 1 ? 1 : maxAttempts; } - internal static async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + internal static global::System.TimeSpan GetRetryDelay( global::Shotstack.AutoSDKClientOptions clientOptions, global::Shotstack.AutoSDKRequestOptions? requestOptions, + global::System.Net.Http.HttpResponseMessage? response, + int attempt) + { + var retryOptions = requestOptions?.Retry ?? clientOptions.Retry ?? new global::Shotstack.AutoSDKRetryOptions(); + + if (retryOptions.UseRetryAfterHeader && + TryGetRetryAfterDelay(response, out var retryAfterDelay)) + { + return ClampRetryDelay(retryAfterDelay, retryOptions); + } + + if (retryOptions.UseRateLimitResetHeader && + TryGetRateLimitResetDelay(response, retryOptions.RateLimitResetHeaderName, out var rateLimitResetDelay)) + { + return ClampRetryDelay(rateLimitResetDelay, retryOptions); + } + + if (retryOptions.Delay.HasValue) + { + return ClampRetryDelay(retryOptions.Delay.Value, retryOptions); + } + + var initialDelay = retryOptions.InitialDelay; + if (initialDelay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var multiplier = retryOptions.BackoffMultiplier < 1D ? 1D : retryOptions.BackoffMultiplier; + var exponent = attempt <= 1 ? 0 : attempt - 1; + var delayMilliseconds = initialDelay.TotalMilliseconds * global::System.Math.Pow(multiplier, exponent); + if (double.IsNaN(delayMilliseconds) || double.IsInfinity(delayMilliseconds) || delayMilliseconds < 0D) + { + delayMilliseconds = 0D; + } + + var delay = global::System.TimeSpan.FromMilliseconds(delayMilliseconds); + delay = ApplyJitter(delay, retryOptions.JitterRatio); + return ClampRetryDelay(delay, retryOptions); + } + + internal static async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + global::System.TimeSpan retryDelay, global::System.Threading.CancellationToken cancellationToken) { - var delay = requestOptions?.Retry?.Delay ?? - clientOptions.Retry?.Delay; - if (!delay.HasValue || delay.Value <= global::System.TimeSpan.Zero) + if (retryDelay <= global::System.TimeSpan.Zero) { return; } - await global::System.Threading.Tasks.Task.Delay(delay.Value, cancellationToken).ConfigureAwait(false); + await global::System.Threading.Tasks.Task.Delay(retryDelay, cancellationToken).ConfigureAwait(false); + } + + private static bool TryGetRetryAfterDelay( + global::System.Net.Http.HttpResponseMessage? response, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + var retryAfter = response?.Headers.RetryAfter; + if (retryAfter == null) + { + return false; + } + + if (retryAfter.Delta.HasValue) + { + delay = retryAfter.Delta.Value; + return delay > global::System.TimeSpan.Zero; + } + + if (retryAfter.Date.HasValue) + { + delay = retryAfter.Date.Value - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static bool TryGetRateLimitResetDelay( + global::System.Net.Http.HttpResponseMessage? response, + string? headerName, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + if (response == null || string.IsNullOrWhiteSpace(headerName)) + { + return false; + } + + if (!response.Headers.TryGetValues(headerName, out var values) && + (response.Content?.Headers == null || !response.Content.Headers.TryGetValues(headerName, out values))) + { + return false; + } + + var value = global::System.Linq.Enumerable.FirstOrDefault(values); + if (string.IsNullOrWhiteSpace(value)) + { + return false; + } + + value = value.Trim(); + if (long.TryParse( + value, + global::System.Globalization.NumberStyles.Integer, + global::System.Globalization.CultureInfo.InvariantCulture, + out var unixSeconds)) + { + delay = global::System.DateTimeOffset.FromUnixTimeSeconds(unixSeconds) - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + if (global::System.DateTimeOffset.TryParse( + value, + global::System.Globalization.CultureInfo.InvariantCulture, + global::System.Globalization.DateTimeStyles.AssumeUniversal | global::System.Globalization.DateTimeStyles.AdjustToUniversal, + out var resetAt)) + { + delay = resetAt - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static global::System.TimeSpan ApplyJitter( + global::System.TimeSpan delay, + double jitterRatio) + { + if (delay <= global::System.TimeSpan.Zero || jitterRatio <= 0D) + { + return delay; + } + + if (jitterRatio > 1D) + { + jitterRatio = 1D; + } + + var sample = NextJitterSample(); + var multiplier = 1D - jitterRatio + (sample * jitterRatio * 2D); + var milliseconds = delay.TotalMilliseconds * multiplier; + if (double.IsNaN(milliseconds) || double.IsInfinity(milliseconds) || milliseconds < 0D) + { + milliseconds = 0D; + } + + return global::System.TimeSpan.FromMilliseconds(milliseconds); + } + + private static double NextJitterSample() + { + var bytes = new byte[8]; + using (var randomNumberGenerator = global::System.Security.Cryptography.RandomNumberGenerator.Create()) + { + randomNumberGenerator.GetBytes(bytes); + } + + var value = global::System.BitConverter.ToUInt64(bytes, 0); + return value / (double)ulong.MaxValue; + } + + private static global::System.TimeSpan ClampRetryDelay( + global::System.TimeSpan delay, + global::Shotstack.AutoSDKRetryOptions retryOptions) + { + if (delay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var maxDelay = retryOptions.MaxDelay; + if (maxDelay > global::System.TimeSpan.Zero && delay > maxDelay) + { + return maxDelay; + } + + return delay; } internal static bool ShouldRetryStatusCode( diff --git a/src/libs/Shotstack/Generated/Shotstack.ServeClient.DeleteAsset.g.cs b/src/libs/Shotstack/Generated/Shotstack.ServeClient.DeleteAsset.g.cs index c4c51c0..3d93671 100644 --- a/src/libs/Shotstack/Generated/Shotstack.ServeClient.DeleteAsset.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.ServeClient.DeleteAsset.g.cs @@ -50,6 +50,27 @@ partial void ProcessDeleteAssetResponse( string id, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAssetAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete Asset
+ /// Delete an asset by its asset id. If a render creates multiple assets, such as thumbnail and poster images,
+ /// each asset must be deleted individually by the asset id.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/serve/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeleteAssetAsResponseAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -79,6 +100,7 @@ partial void ProcessDeleteAssetResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Shotstack.PathBuilder( path: $"/serve/v1/assets/{id}", baseUri: HttpClient.BaseAddress); @@ -135,6 +157,8 @@ partial void ProcessDeleteAssetResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -145,6 +169,11 @@ partial void ProcessDeleteAssetResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -162,6 +191,8 @@ partial void ProcessDeleteAssetResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -171,8 +202,7 @@ partial void ProcessDeleteAssetResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -181,6 +211,11 @@ partial void ProcessDeleteAssetResponse( __attempt < __maxAttempts && global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -197,14 +232,15 @@ partial void ProcessDeleteAssetResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -244,6 +280,8 @@ partial void ProcessDeleteAssetResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -264,6 +302,8 @@ partial void ProcessDeleteAssetResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -284,6 +324,10 @@ partial void ProcessDeleteAssetResponse( { __response.EnsureSuccessStatusCode(); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -305,6 +349,10 @@ partial void ProcessDeleteAssetResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Shotstack/Generated/Shotstack.ServeClient.GetAsset.g.cs b/src/libs/Shotstack/Generated/Shotstack.ServeClient.GetAsset.g.cs index e1c495e..82be8f9 100644 --- a/src/libs/Shotstack/Generated/Shotstack.ServeClient.GetAsset.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.ServeClient.GetAsset.g.cs @@ -56,6 +56,30 @@ partial void ProcessGetAssetResponseContent( string id, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAssetAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Asset
+ /// The Serve API is used to interact with, and delete hosted assets including videos, images, audio files,
+ /// thumbnails and poster images. Use this endpoint to fetch an asset by asset id. Note that an asset id is unique
+ /// for each asset and different from the render id.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/serve/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetAssetAsResponseAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -85,6 +109,7 @@ partial void ProcessGetAssetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Shotstack.PathBuilder( path: $"/serve/v1/assets/{id}", baseUri: HttpClient.BaseAddress); @@ -141,6 +166,8 @@ partial void ProcessGetAssetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -151,6 +178,11 @@ partial void ProcessGetAssetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -168,6 +200,8 @@ partial void ProcessGetAssetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -177,8 +211,7 @@ partial void ProcessGetAssetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -187,6 +220,11 @@ partial void ProcessGetAssetResponseContent( __attempt < __maxAttempts && global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -203,14 +241,15 @@ partial void ProcessGetAssetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -250,6 +289,8 @@ partial void ProcessGetAssetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -270,6 +311,8 @@ partial void ProcessGetAssetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -294,9 +337,13 @@ partial void ProcessGetAssetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Shotstack.AssetResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Shotstack.AssetResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -324,9 +371,13 @@ partial void ProcessGetAssetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Shotstack.AssetResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Shotstack.AssetResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Shotstack/Generated/Shotstack.ServeClient.GetAssetByRenderId.g.cs b/src/libs/Shotstack/Generated/Shotstack.ServeClient.GetAssetByRenderId.g.cs index eda1ea0..df89492 100644 --- a/src/libs/Shotstack/Generated/Shotstack.ServeClient.GetAssetByRenderId.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.ServeClient.GetAssetByRenderId.g.cs @@ -56,6 +56,30 @@ partial void ProcessGetAssetByRenderIdResponseContent( string id, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAssetByRenderIdAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Asset by Render ID
+ /// A render may generate more than one file, such as a video, thumbnail and poster image. When the assets are
+ /// created the only known id is the render id returned by the original [render request](#render-video), status
+ /// request or webhook. This endpoint lets you look up one or more assets by the render id.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/serve/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetAssetByRenderIdAsResponseAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -85,6 +109,7 @@ partial void ProcessGetAssetByRenderIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Shotstack.PathBuilder( path: $"/serve/v1/assets/render/{id}", baseUri: HttpClient.BaseAddress); @@ -141,6 +166,8 @@ partial void ProcessGetAssetByRenderIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -151,6 +178,11 @@ partial void ProcessGetAssetByRenderIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -168,6 +200,8 @@ partial void ProcessGetAssetByRenderIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -177,8 +211,7 @@ partial void ProcessGetAssetByRenderIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -187,6 +220,11 @@ partial void ProcessGetAssetByRenderIdResponseContent( __attempt < __maxAttempts && global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -203,14 +241,15 @@ partial void ProcessGetAssetByRenderIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -250,6 +289,8 @@ partial void ProcessGetAssetByRenderIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -270,6 +311,8 @@ partial void ProcessGetAssetByRenderIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -294,9 +337,13 @@ partial void ProcessGetAssetByRenderIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Shotstack.AssetRenderResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Shotstack.AssetRenderResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -324,9 +371,13 @@ partial void ProcessGetAssetByRenderIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Shotstack.AssetRenderResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Shotstack.AssetRenderResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Shotstack/Generated/Shotstack.ServeClient.PostServeAsset.g.cs b/src/libs/Shotstack/Generated/Shotstack.ServeClient.PostServeAsset.g.cs index ae0b01e..c5fec37 100644 --- a/src/libs/Shotstack/Generated/Shotstack.ServeClient.PostServeAsset.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.ServeClient.PostServeAsset.g.cs @@ -53,6 +53,31 @@ partial void ProcessPostServeAssetResponseContent( /// public async global::System.Threading.Tasks.Task PostServeAssetAsync( + global::Shotstack.Transfer request, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostServeAssetAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Transfer Asset
+ /// Transfer a file from any publicly available URL to one or more Serve API
+ /// [destinations](#tocs_destinations).
+ /// **Base URL:** <a href="#">https://api.shotstack.io/serve/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PostServeAssetAsResponseAsync( + global::Shotstack.Transfer request, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -87,6 +112,7 @@ partial void ProcessPostServeAssetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Shotstack.PathBuilder( path: "/serve/v1/assets", baseUri: HttpClient.BaseAddress); @@ -149,6 +175,8 @@ partial void ProcessPostServeAssetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -159,6 +187,11 @@ partial void ProcessPostServeAssetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -176,6 +209,8 @@ partial void ProcessPostServeAssetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -185,8 +220,7 @@ partial void ProcessPostServeAssetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -195,6 +229,11 @@ partial void ProcessPostServeAssetResponseContent( __attempt < __maxAttempts && global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -211,14 +250,15 @@ partial void ProcessPostServeAssetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -258,6 +298,8 @@ partial void ProcessPostServeAssetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -278,6 +320,8 @@ partial void ProcessPostServeAssetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -302,9 +346,13 @@ partial void ProcessPostServeAssetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Shotstack.TransferResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Shotstack.TransferResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -332,9 +380,13 @@ partial void ProcessPostServeAssetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Shotstack.TransferResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Shotstack.TransferResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Shotstack/Generated/Shotstack.ServeClient.g.cs b/src/libs/Shotstack/Generated/Shotstack.ServeClient.g.cs index 40edc1c..65f4450 100644 --- a/src/libs/Shotstack/Generated/Shotstack.ServeClient.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.ServeClient.g.cs @@ -73,10 +73,10 @@ public ServeClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ServeClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Shotstack.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Shotstack.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Shotstack/Generated/Shotstack.ShotstackClient.g.cs b/src/libs/Shotstack/Generated/Shotstack.ShotstackClient.g.cs index bad612d..1e2a615 100644 --- a/src/libs/Shotstack/Generated/Shotstack.ShotstackClient.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.ShotstackClient.g.cs @@ -53,7 +53,7 @@ public sealed partial class ShotstackClient : global::Shotstack.IShotstackClient /// /// The Edit API is used to edit videos, images and audio files in the cloud using a simple to understand JSON schema. Compose an edit using tracks, clips and assets and add transitions, filters, overlays and text. Finally send the JSON to the Edit API to be rendered. /// - public EditClient Edit => new EditClient(HttpClient, authorizations: Authorizations, options: Options) + public EditClient Edit => new EditClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -62,7 +62,7 @@ public sealed partial class ShotstackClient : global::Shotstack.IShotstackClient /// /// The Ingest API lets you upload and store your source footage and user generated content in close proximity to the Edit API. Instead of hosting your own assets or building your own uploader you can use the Ingest API. The Ingest API provides endpoints to fetch and upload files and check their status and URLs. All ingested files are available directly from an S3 bucket URL or via CDN (Serve API). /// - public IngestClient Ingest => new IngestClient(HttpClient, authorizations: Authorizations, options: Options) + public IngestClient Ingest => new IngestClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -71,7 +71,7 @@ public sealed partial class ShotstackClient : global::Shotstack.IShotstackClient /// /// Assets generated by the Edit API or uploaded via the Ingest API are sent to the Serve API. The Serve API includes a simple hosting service with a CDN or you can send assets to third party services like AWS S3 or Mux. The Serve API includes endpoints to look up assets, where they are hosted and their status. /// - public ServeClient Serve => new ServeClient(HttpClient, authorizations: Authorizations, options: Options) + public ServeClient Serve => new ServeClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -110,10 +110,10 @@ public ShotstackClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ShotstackClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Shotstack.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Shotstack.AutoSDKClientOptions? options, bool disposeHttpClient = true) {