From b133c23e1e0ebd63bf9b7dea916bd72a4864e664 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 29 Sep 2026 03:51:37 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Shotstack.EditClient.GetGenerate.g.cs | 37 + .../Shotstack.EditClient.GetModel.g.cs | 9 +- .../Shotstack.EditClient.PostGenerate.g.cs | 252 +++++ .../Generated/Shotstack.EditClient.g.cs | 4 + .../Shotstack.IEditClient.PostGenerate.g.cs | 17 + .../Generated/Shotstack.IEditClient.g.cs | 4 + .../Generated/Shotstack.IIngestClient.g.cs | 4 + .../Generated/Shotstack.IServeClient.g.cs | 4 + .../Generated/Shotstack.IShotstackClient.g.cs | 4 + ...hotstack.Ingest.JsonSerializerContext.g.cs | 2 +- .../Generated/Shotstack.IngestClient.g.cs | 4 + ...GenerationModelErrorResponseErrorName.g.cs | 53 ++ ...onModelErrorResponseErrorNameNullable.g.cs | 60 ++ .../Shotstack.JsonSerializerContext.g.cs | 79 +- .../Shotstack.JsonSerializerContextTypes.g.cs | 162 ++-- ...k.Models.GenerationErrorResponse.Json.g.cs | 141 +++ ...tstack.Models.GenerationErrorResponse.g.cs | 78 ++ ...els.GenerationModelErrorResponse.Json.g.cs | 141 +++ ...k.Models.GenerationModelErrorResponse.g.cs | 45 + ...enerationModelErrorResponseError.Json.g.cs | 141 +++ ...els.GenerationModelErrorResponseError.g.cs | 66 ++ ...GenerationModelErrorResponseErrorName.g.cs | 52 ++ ...otstack.Models.GenerationModelPricing.g.cs | 6 +- .../Shotstack.Models.PostGenerateRequest.g.cs | 16 +- ...Shotstack.Serve.JsonSerializerContext.g.cs | 2 +- .../Generated/Shotstack.ServeClient.g.cs | 4 + .../Generated/Shotstack.ShotstackClient.g.cs | 7 + src/libs/Shotstack/openapi.json | 867 +++++++++++------- 28 files changed, 1798 insertions(+), 463 deletions(-) create mode 100644 src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationModelErrorResponseErrorName.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationModelErrorResponseErrorNameNullable.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.GenerationErrorResponse.Json.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.GenerationErrorResponse.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponse.Json.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponse.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponseError.Json.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponseError.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponseErrorName.g.cs diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.GetGenerate.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.GetGenerate.g.cs index bc9f61a..b3bcd57 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.GetGenerate.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.GetGenerate.g.cs @@ -315,6 +315,43 @@ partial void ProcessGetGenerateResponseContent( retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } + // No generation job with this id exists for the calling account. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::Shotstack.GenerationErrorResponse? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::Shotstack.GenerationErrorResponse.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::Shotstack.GenerationErrorResponse.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.GetModel.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.GetModel.g.cs index af34841..7c16a26 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.GetModel.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.GetModel.g.cs @@ -315,20 +315,24 @@ partial void ProcessGetModelResponseContent( retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - // + // No listed model has that identifier. `error.name` tells an unknown model from one that has been withdrawn. if ((int)__response.StatusCode == 404) { string? __content_404 = null; global::System.Exception? __exception_404 = null; + global::Shotstack.GenerationModelErrorResponse? __value_404 = null; try { if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::Shotstack.GenerationModelErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::Shotstack.GenerationModelErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -337,11 +341,12 @@ partial void ProcessGetModelResponseContent( } - throw global::Shotstack.ApiException.Create( + throw global::Shotstack.ApiException.Create( statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, + responseObject: __value_404, responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.PostGenerate.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.PostGenerate.g.cs index 98a6752..4578e93 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.PostGenerate.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.PostGenerate.g.cs @@ -27,10 +27,12 @@ public partial class EditClient }; partial void PreparePostGenerateArguments( global::System.Net.Http.HttpClient httpClient, + ref string? idempotencyKey, global::Shotstack.PostGenerateRequest request); partial void PreparePostGenerateRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? idempotencyKey, global::Shotstack.PostGenerateRequest request); partial void ProcessPostGenerateResponse( global::System.Net.Http.HttpClient httpClient, @@ -52,6 +54,9 @@ partial void ProcessPostGenerateResponseContent( /// resolve from the cache at no charge.
/// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> /// + /// + /// Optional idempotency key. When omitted, the SDK generates one for this request. + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with @@ -59,12 +64,14 @@ partial void ProcessPostGenerateResponseContent( public async global::System.Threading.Tasks.Task PostGenerateAsync( global::Shotstack.PostGenerateRequest request, + string? idempotencyKey = default, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __response = await PostGenerateAsResponseAsync( request: request, + idempotencyKey: idempotencyKey, requestOptions: requestOptions, cancellationToken: cancellationToken ).ConfigureAwait(false); @@ -82,6 +89,9 @@ partial void ProcessPostGenerateResponseContent( /// resolve from the cache at no charge.
/// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> /// + /// + /// Optional idempotency key. When omitted, the SDK generates one for this request. + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with @@ -89,6 +99,7 @@ partial void ProcessPostGenerateResponseContent( public async global::System.Threading.Tasks.Task> PostGenerateAsResponseAsync( global::Shotstack.PostGenerateRequest request, + string? idempotencyKey = default, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -98,6 +109,7 @@ partial void ProcessPostGenerateResponseContent( client: HttpClient); PreparePostGenerateArguments( httpClient: HttpClient, + idempotencyKey: ref idempotencyKey, request: request); @@ -138,6 +150,12 @@ partial void ProcessPostGenerateResponseContent( __httpRequest.Version = global::System.Net.HttpVersion.Version11; __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif + + var __idempotencyKey = global::System.String.IsNullOrWhiteSpace(idempotencyKey) + ? CreateIdempotencyKey() + : idempotencyKey; + __httpRequest.Headers.TryAddWithoutValidation("Idempotency-Key", __idempotencyKey); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, @@ -155,6 +173,7 @@ partial void ProcessPostGenerateResponseContent( PreparePostGenerateRequest( httpClient: HttpClient, httpRequestMessage: __httpRequest, + idempotencyKey: idempotencyKey, request: request); global::Shotstack.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); @@ -336,6 +355,228 @@ partial void ProcessPostGenerateResponseContent( retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } + // The request is invalid, for example a missing asset or prompt, a disallowed URL or a `length` that is not positive. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Shotstack.GenerationErrorResponse? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Shotstack.GenerationErrorResponse.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Shotstack.GenerationErrorResponse.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The account has too few credits for this generation. `available` holds how many it has. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Shotstack.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Shotstack.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Shotstack.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The account cannot use this generation. `code` says why. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Shotstack.GenerationErrorResponse? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Shotstack.GenerationErrorResponse.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Shotstack.GenerationErrorResponse.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The `Idempotency-Key` was already used for a different asset. + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::Shotstack.GenerationErrorResponse? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::Shotstack.GenerationErrorResponse.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::Shotstack.GenerationErrorResponse.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The account has reached its generation quota. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Shotstack.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Shotstack.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Shotstack.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A service the request depends on is temporarily unavailable. `code` is `AiAccessUnavailable` when access to AI generation could not be confirmed. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Shotstack.GenerationErrorResponse? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Shotstack.GenerationErrorResponse.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Shotstack.GenerationErrorResponse.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { @@ -443,21 +684,32 @@ partial void ProcessPostGenerateResponseContent( /// resolve from the cache at no charge.
/// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> /// + /// + /// Optional idempotency key. When omitted, the SDK generates one for this request. + /// /// + /// + /// The length, in seconds, of the clip the asset fills. A model that generates to a duration takes it from this value in place of its own duration option. Other models ignore it.
+ /// Example: 5 + /// /// 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 PostGenerateAsync( global::Shotstack.OneOf asset, + string? idempotencyKey = default, + double? length = default, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Shotstack.PostGenerateRequest { Asset = asset, + Length = length, }; return await PostGenerateAsync( + idempotencyKey: idempotencyKey, request: __request, requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.g.cs index 1d79fe7..29cffd5 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.g.cs @@ -35,6 +35,10 @@ public sealed partial class EditClient : global::Shotstack.IEditClient, global:: /// public global::Shotstack.AutoSDKClientOptions Options { get; } + + /// + public global::System.Func CreateIdempotencyKey { get; set; } = () => global::System.Guid.NewGuid().ToString("D"); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Shotstack.SourceGenerationContext.Default); /// diff --git a/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostGenerate.g.cs b/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostGenerate.g.cs index 96e966f..154a676 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostGenerate.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostGenerate.g.cs @@ -15,6 +15,9 @@ public partial interface IEditClient /// resolve from the cache at no charge.
/// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> ///
+ /// + /// Optional idempotency key. When omitted, the SDK generates one for this request. + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with @@ -22,6 +25,7 @@ public partial interface IEditClient global::System.Threading.Tasks.Task PostGenerateAsync( global::Shotstack.PostGenerateRequest request, + string? idempotencyKey = default, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// @@ -35,6 +39,9 @@ public partial interface IEditClient /// resolve from the cache at no charge.
/// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> ///
+ /// + /// Optional idempotency key. When omitted, the SDK generates one for this request. + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with @@ -42,6 +49,7 @@ public partial interface IEditClient global::System.Threading.Tasks.Task> PostGenerateAsResponseAsync( global::Shotstack.PostGenerateRequest request, + string? idempotencyKey = default, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// @@ -55,12 +63,21 @@ public partial interface IEditClient /// resolve from the cache at no charge.
/// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> ///
+ /// + /// Optional idempotency key. When omitted, the SDK generates one for this request. + /// /// + /// + /// The length, in seconds, of the clip the asset fills. A model that generates to a duration takes it from this value in place of its own duration option. Other models ignore it.
+ /// Example: 5 + /// /// 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 PostGenerateAsync( global::Shotstack.OneOf asset, + string? idempotencyKey = default, + double? length = default, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Shotstack/Generated/Shotstack.IEditClient.g.cs b/src/libs/Shotstack/Generated/Shotstack.IEditClient.g.cs index c67d6db..129ec55 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IEditClient.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IEditClient.g.cs @@ -38,6 +38,10 @@ public partial interface IEditClient : global::System.IDisposable /// public global::Shotstack.AutoSDKClientOptions Options { get; } + /// + /// Creates idempotency keys for generated idempotent requests when the caller does not provide one. + /// + public global::System.Func CreateIdempotencyKey { get; set; } /// /// diff --git a/src/libs/Shotstack/Generated/Shotstack.IIngestClient.g.cs b/src/libs/Shotstack/Generated/Shotstack.IIngestClient.g.cs index c465f40..fa5a0b7 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IIngestClient.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IIngestClient.g.cs @@ -38,6 +38,10 @@ public partial interface IIngestClient : global::System.IDisposable /// public global::Shotstack.AutoSDKClientOptions Options { get; } + /// + /// Creates idempotency keys for generated idempotent requests when the caller does not provide one. + /// + public global::System.Func CreateIdempotencyKey { get; set; } /// /// diff --git a/src/libs/Shotstack/Generated/Shotstack.IServeClient.g.cs b/src/libs/Shotstack/Generated/Shotstack.IServeClient.g.cs index 548c2b7..9bc2ade 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IServeClient.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IServeClient.g.cs @@ -38,6 +38,10 @@ public partial interface IServeClient : global::System.IDisposable /// public global::Shotstack.AutoSDKClientOptions Options { get; } + /// + /// Creates idempotency keys for generated idempotent requests when the caller does not provide one. + /// + public global::System.Func CreateIdempotencyKey { get; set; } /// /// diff --git a/src/libs/Shotstack/Generated/Shotstack.IShotstackClient.g.cs b/src/libs/Shotstack/Generated/Shotstack.IShotstackClient.g.cs index 9bb9e29..b547ac0 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IShotstackClient.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IShotstackClient.g.cs @@ -48,6 +48,10 @@ public partial interface IShotstackClient : global::System.IDisposable /// public global::Shotstack.AutoSDKClientOptions Options { get; } + /// + /// Creates idempotency keys for generated idempotent requests when the caller does not provide one. + /// + public global::System.Func CreateIdempotencyKey { get; set; } /// /// diff --git a/src/libs/Shotstack/Generated/Shotstack.Ingest.JsonSerializerContext.g.cs b/src/libs/Shotstack/Generated/Shotstack.Ingest.JsonSerializerContext.g.cs index cd7d2de..fd7f613 100644 --- a/src/libs/Shotstack/Generated/Shotstack.Ingest.JsonSerializerContext.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.Ingest.JsonSerializerContext.g.cs @@ -153,7 +153,7 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options.Converters.Add(new global::Shotstack.JsonConverters.AudioEnhancementJsonConverter()); options.Converters.Add(new global::Shotstack.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Shotstack.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Shotstack.JsonConverters.OneOfJsonConverter()); + options.Converters.Add(new global::Shotstack.JsonConverters.OneOfJsonConverter>()); options.Converters.Add(new global::Shotstack.JsonConverters.UnixTimestampJsonConverter()); options.Converters.Add(new LazyEnumJsonConverterFactory()); } diff --git a/src/libs/Shotstack/Generated/Shotstack.IngestClient.g.cs b/src/libs/Shotstack/Generated/Shotstack.IngestClient.g.cs index 0110147..06979f7 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IngestClient.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IngestClient.g.cs @@ -35,6 +35,10 @@ public sealed partial class IngestClient : global::Shotstack.IIngestClient, glob /// public global::Shotstack.AutoSDKClientOptions Options { get; } + + /// + public global::System.Func CreateIdempotencyKey { get; set; } = () => global::System.Guid.NewGuid().ToString("D"); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Shotstack.IngestSourceGenerationContext.Default); /// diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationModelErrorResponseErrorName.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationModelErrorResponseErrorName.g.cs new file mode 100644 index 0000000..9fe2ac7 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationModelErrorResponseErrorName.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Shotstack.JsonConverters +{ + /// + public sealed class GenerationModelErrorResponseErrorNameJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Shotstack.GenerationModelErrorResponseErrorName Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Shotstack.GenerationModelErrorResponseErrorNameExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Shotstack.GenerationModelErrorResponseErrorName)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Shotstack.GenerationModelErrorResponseErrorName); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Shotstack.GenerationModelErrorResponseErrorName value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Shotstack.GenerationModelErrorResponseErrorNameExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationModelErrorResponseErrorNameNullable.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationModelErrorResponseErrorNameNullable.g.cs new file mode 100644 index 0000000..c0a558d --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationModelErrorResponseErrorNameNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Shotstack.JsonConverters +{ + /// + public sealed class GenerationModelErrorResponseErrorNameNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Shotstack.GenerationModelErrorResponseErrorName? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Shotstack.GenerationModelErrorResponseErrorNameExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Shotstack.GenerationModelErrorResponseErrorName)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Shotstack.GenerationModelErrorResponseErrorName?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Shotstack.GenerationModelErrorResponseErrorName? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Shotstack.GenerationModelErrorResponseErrorNameExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContext.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContext.g.cs index ce083b6..876a338 100644 --- a/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContext.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContext.g.cs @@ -279,6 +279,30 @@ namespace Shotstack typeof(global::Shotstack.JsonConverters.DolbyEnhancementOptionsPresetNullableJsonConverter), + typeof(global::Shotstack.JsonConverters.GenerationModelTypeJsonConverter), + + typeof(global::Shotstack.JsonConverters.GenerationModelTypeNullableJsonConverter), + + typeof(global::Shotstack.JsonConverters.GenerationModelUnavailableReasonJsonConverter), + + typeof(global::Shotstack.JsonConverters.GenerationModelUnavailableReasonNullableJsonConverter), + + typeof(global::Shotstack.JsonConverters.GenerationModelPricingQuantityMeasureJsonConverter), + + typeof(global::Shotstack.JsonConverters.GenerationModelPricingQuantityMeasureNullableJsonConverter), + + typeof(global::Shotstack.JsonConverters.GenerationModelPricingQuantityRoundJsonConverter), + + typeof(global::Shotstack.JsonConverters.GenerationModelPricingQuantityRoundNullableJsonConverter), + + typeof(global::Shotstack.JsonConverters.GenerationResponseStatusJsonConverter), + + typeof(global::Shotstack.JsonConverters.GenerationResponseStatusNullableJsonConverter), + + typeof(global::Shotstack.JsonConverters.GenerationModelErrorResponseErrorNameJsonConverter), + + typeof(global::Shotstack.JsonConverters.GenerationModelErrorResponseErrorNameNullableJsonConverter), + typeof(global::Shotstack.JsonConverters.RenderResponseDataStatusJsonConverter), typeof(global::Shotstack.JsonConverters.RenderResponseDataStatusNullableJsonConverter), @@ -319,26 +343,6 @@ namespace Shotstack typeof(global::Shotstack.JsonConverters.TiktokDestinationOptionsPrivacyLevelNullableJsonConverter), - typeof(global::Shotstack.JsonConverters.GenerationResponseStatusJsonConverter), - - typeof(global::Shotstack.JsonConverters.GenerationResponseStatusNullableJsonConverter), - - typeof(global::Shotstack.JsonConverters.GenerationModelPricingQuantityMeasureJsonConverter), - - typeof(global::Shotstack.JsonConverters.GenerationModelPricingQuantityMeasureNullableJsonConverter), - - typeof(global::Shotstack.JsonConverters.GenerationModelPricingQuantityRoundJsonConverter), - - typeof(global::Shotstack.JsonConverters.GenerationModelPricingQuantityRoundNullableJsonConverter), - - typeof(global::Shotstack.JsonConverters.GenerationModelTypeJsonConverter), - - typeof(global::Shotstack.JsonConverters.GenerationModelTypeNullableJsonConverter), - - typeof(global::Shotstack.JsonConverters.GenerationModelUnavailableReasonJsonConverter), - - typeof(global::Shotstack.JsonConverters.GenerationModelUnavailableReasonNullableJsonConverter), - typeof(global::Shotstack.JsonConverters.AssetJsonConverter), typeof(global::Shotstack.JsonConverters.DestinationsJsonConverter), @@ -379,7 +383,7 @@ namespace Shotstack typeof(global::Shotstack.JsonConverters.OneOfJsonConverter>), - typeof(global::Shotstack.JsonConverters.OneOfJsonConverter), + typeof(global::Shotstack.JsonConverters.OneOfJsonConverter>), typeof(global::Shotstack.JsonConverters.OneOfJsonConverter), @@ -620,6 +624,24 @@ namespace Shotstack [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.DolbyEnhancementOptions))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.DolbyEnhancementOptionsPreset), TypeInfoPropertyName = "DolbyEnhancementOptionsPreset2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.Transfer))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModel))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelType), TypeInfoPropertyName = "GenerationModelType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelPricing))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelUnavailableReason), TypeInfoPropertyName = "GenerationModelUnavailableReason2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.OneOf>), TypeInfoPropertyName = "OneOfDoubleDictionaryStringDouble2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelPricingTieredBy))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelPricingQuantity))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelPricingQuantityMeasure), TypeInfoPropertyName = "GenerationModelPricingQuantityMeasure2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelPricingQuantityRound), TypeInfoPropertyName = "GenerationModelPricingQuantityRound2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationResponseStatus), TypeInfoPropertyName = "GenerationResponseStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelErrorResponseError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelErrorResponseErrorName), TypeInfoPropertyName = "GenerationModelErrorResponseErrorName2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.QueuedResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.QueuedResponseData))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.RenderResponse))] @@ -670,19 +692,6 @@ namespace Shotstack [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.TiktokDestinationOptionsPrivacyLevel), TypeInfoPropertyName = "TiktokDestinationOptionsPrivacyLevel2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.AkamaiNetStorageDestinationOptions))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.AzureBlobStorageDestinationOptions))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationResponseStatus), TypeInfoPropertyName = "GenerationResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelPricing))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.OneOf), TypeInfoPropertyName = "OneOfDoubleObject2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelPricingTieredBy))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelPricingQuantity))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelPricingQuantityMeasure), TypeInfoPropertyName = "GenerationModelPricingQuantityMeasure2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelPricingQuantityRound), TypeInfoPropertyName = "GenerationModelPricingQuantityRound2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModel))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelType), TypeInfoPropertyName = "GenerationModelType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelUnavailableReason), TypeInfoPropertyName = "GenerationModelUnavailableReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelListResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.PostGenerateRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.OneOf), TypeInfoPropertyName = "OneOfImageAssetVideoAssetAudioAsset2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] @@ -696,12 +705,12 @@ namespace Shotstack [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] public sealed partial class SourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext { } diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContextTypes.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContextTypes.g.cs index 9a14544..5feeefb 100644 --- a/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContextTypes.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContextTypes.g.cs @@ -777,263 +777,283 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Shotstack.QueuedResponse? Type186 { get; set; } + public global::Shotstack.GenerationModel? Type186 { get; set; } /// /// /// - public global::Shotstack.QueuedResponseData? Type187 { get; set; } + public global::Shotstack.GenerationModelType? Type187 { get; set; } /// /// /// - public global::Shotstack.RenderResponse? Type188 { get; set; } + public global::Shotstack.GenerationModelPricing? Type188 { get; set; } /// /// /// - public global::Shotstack.RenderResponseData? Type189 { get; set; } + public global::Shotstack.GenerationModelUnavailableReason? Type189 { get; set; } /// /// /// - public global::Shotstack.RenderResponseDataStatus? Type190 { get; set; } + public global::Shotstack.OneOf>? Type190 { get; set; } /// /// /// - public global::Shotstack.TemplateResponse? Type191 { get; set; } + public global::System.Collections.Generic.Dictionary? Type191 { get; set; } /// /// /// - public global::Shotstack.TemplateResponseData? Type192 { get; set; } + public global::Shotstack.GenerationModelPricingTieredBy? Type192 { get; set; } /// /// /// - public global::Shotstack.TemplateDataResponse? Type193 { get; set; } + public global::Shotstack.GenerationModelPricingQuantity? Type193 { get; set; } /// /// /// - public global::Shotstack.TemplateDataResponseData? Type194 { get; set; } + public global::Shotstack.GenerationModelPricingQuantityMeasure? Type194 { get; set; } /// /// /// - public global::Shotstack.TemplateListResponse? Type195 { get; set; } + public global::Shotstack.GenerationModelPricingQuantityRound? Type195 { get; set; } /// /// /// - public global::Shotstack.TemplateListResponseData? Type196 { get; set; } + public global::Shotstack.GenerationModelListResponse? Type196 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type197 { get; set; } + public global::System.Collections.Generic.IList? Type197 { get; set; } /// /// /// - public global::Shotstack.TemplateListResponseItem? Type198 { get; set; } + public global::Shotstack.GenerationResponse? Type198 { get; set; } /// /// /// - public global::Shotstack.ProbeResponse? Type199 { get; set; } + public global::Shotstack.GenerationResponseStatus? Type199 { get; set; } /// /// /// - public global::Shotstack.AssetResponse? Type200 { get; set; } + public global::Shotstack.GenerationErrorResponse? Type200 { get; set; } /// /// /// - public global::Shotstack.AssetResponseData? Type201 { get; set; } + public global::Shotstack.GenerationModelErrorResponse? Type201 { get; set; } /// /// /// - public global::Shotstack.AssetRenderResponse? Type202 { get; set; } + public global::Shotstack.GenerationModelErrorResponseError? Type202 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type203 { get; set; } + public global::Shotstack.GenerationModelErrorResponseErrorName? Type203 { get; set; } /// /// /// - public global::Shotstack.AssetResponseAttributes? Type204 { get; set; } + public global::Shotstack.QueuedResponse? Type204 { get; set; } /// /// /// - public global::Shotstack.AssetResponseAttributesStatus? Type205 { get; set; } + public global::Shotstack.QueuedResponseData? Type205 { get; set; } /// /// /// - public global::Shotstack.TransferResponse? Type206 { get; set; } + public global::Shotstack.RenderResponse? Type206 { get; set; } /// /// /// - public global::Shotstack.TransferResponseData? Type207 { get; set; } + public global::Shotstack.RenderResponseData? Type207 { get; set; } /// /// /// - public global::Shotstack.TransferResponseAttributes? Type208 { get; set; } + public global::Shotstack.RenderResponseDataStatus? Type208 { get; set; } /// /// /// - public global::Shotstack.TransferResponseAttributesStatus? Type209 { get; set; } + public global::Shotstack.TemplateResponse? Type209 { get; set; } /// /// /// - public global::Shotstack.QueuedSourceResponse? Type210 { get; set; } + public global::Shotstack.TemplateResponseData? Type210 { get; set; } /// /// /// - public global::Shotstack.QueuedSourceResponseData? Type211 { get; set; } + public global::Shotstack.TemplateDataResponse? Type211 { get; set; } /// /// /// - public global::Shotstack.SourceListResponse? Type212 { get; set; } + public global::Shotstack.TemplateDataResponseData? Type212 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type213 { get; set; } + public global::Shotstack.TemplateListResponse? Type213 { get; set; } /// /// /// - public global::Shotstack.SourceResponseData? Type214 { get; set; } + public global::Shotstack.TemplateListResponseData? Type214 { get; set; } /// /// /// - public global::Shotstack.SourceResponse? Type215 { get; set; } + public global::System.Collections.Generic.IList? Type215 { get; set; } /// /// /// - public global::Shotstack.SourceResponseAttributes? Type216 { get; set; } + public global::Shotstack.TemplateListResponseItem? Type216 { get; set; } /// /// /// - public global::Shotstack.SourceResponseAttributesStatus? Type217 { get; set; } + public global::Shotstack.ProbeResponse? Type217 { get; set; } /// /// /// - public global::Shotstack.OutputsResponse? Type218 { get; set; } + public global::Shotstack.AssetResponse? Type218 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type219 { get; set; } + public global::Shotstack.AssetResponseData? Type219 { get; set; } /// /// /// - public global::Shotstack.RenditionResponseAttributes? Type220 { get; set; } + public global::Shotstack.AssetRenderResponse? Type220 { get; set; } /// /// /// - public global::Shotstack.RenditionResponseAttributesStatus? Type221 { get; set; } + public global::System.Collections.Generic.IList? Type221 { get; set; } /// /// /// - public global::Shotstack.UploadResponse? Type222 { get; set; } + public global::Shotstack.AssetResponseAttributes? Type222 { get; set; } /// /// /// - public global::Shotstack.UploadResponseData? Type223 { get; set; } + public global::Shotstack.AssetResponseAttributesStatus? Type223 { get; set; } /// /// /// - public global::Shotstack.UploadResponseAttributes? Type224 { get; set; } + public global::Shotstack.TransferResponse? Type224 { get; set; } /// /// /// - public global::Shotstack.IngestErrorResponse? Type225 { get; set; } + public global::Shotstack.TransferResponseData? Type225 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type226 { get; set; } + public global::Shotstack.TransferResponseAttributes? Type226 { get; set; } /// /// /// - public global::Shotstack.IngestErrorResponseData? Type227 { get; set; } + public global::Shotstack.TransferResponseAttributesStatus? Type227 { get; set; } /// /// /// - public global::Shotstack.TextAnimationPreset? Type228 { get; set; } + public global::Shotstack.QueuedSourceResponse? Type228 { get; set; } /// /// /// - public global::Shotstack.RichCaptionFontStyle? Type229 { get; set; } + public global::Shotstack.QueuedSourceResponseData? Type229 { get; set; } /// /// /// - public global::Shotstack.RichCaptionStyleTextTransform? Type230 { get; set; } + public global::Shotstack.SourceListResponse? Type230 { get; set; } /// /// /// - public global::Shotstack.RichCaptionStyleTextDecoration? Type231 { get; set; } + public global::System.Collections.Generic.IList? Type231 { get; set; } /// /// /// - public global::Shotstack.TiktokDestinationOptions? Type232 { get; set; } + public global::Shotstack.SourceResponseData? Type232 { get; set; } /// /// /// - public global::Shotstack.TiktokDestinationOptionsPrivacyLevel? Type233 { get; set; } + public global::Shotstack.SourceResponse? Type233 { get; set; } /// /// /// - public global::Shotstack.AkamaiNetStorageDestinationOptions? Type234 { get; set; } + public global::Shotstack.SourceResponseAttributes? Type234 { get; set; } /// /// /// - public global::Shotstack.AzureBlobStorageDestinationOptions? Type235 { get; set; } + public global::Shotstack.SourceResponseAttributesStatus? Type235 { get; set; } /// /// /// - public global::Shotstack.GenerationResponse? Type236 { get; set; } + public global::Shotstack.OutputsResponse? Type236 { get; set; } /// /// /// - public global::Shotstack.GenerationResponseStatus? Type237 { get; set; } + public global::System.Collections.Generic.IList? Type237 { get; set; } /// /// /// - public global::Shotstack.GenerationModelPricing? Type238 { get; set; } + public global::Shotstack.RenditionResponseAttributes? Type238 { get; set; } /// /// /// - public global::Shotstack.OneOf? Type239 { get; set; } + public global::Shotstack.RenditionResponseAttributesStatus? Type239 { get; set; } /// /// /// - public global::Shotstack.GenerationModelPricingTieredBy? Type240 { get; set; } + public global::Shotstack.UploadResponse? Type240 { get; set; } /// /// /// - public global::Shotstack.GenerationModelPricingQuantity? Type241 { get; set; } + public global::Shotstack.UploadResponseData? Type241 { get; set; } /// /// /// - public global::Shotstack.GenerationModelPricingQuantityMeasure? Type242 { get; set; } + public global::Shotstack.UploadResponseAttributes? Type242 { get; set; } /// /// /// - public global::Shotstack.GenerationModelPricingQuantityRound? Type243 { get; set; } + public global::Shotstack.IngestErrorResponse? Type243 { get; set; } /// /// /// - public global::Shotstack.GenerationModel? Type244 { get; set; } + public global::System.Collections.Generic.IList? Type244 { get; set; } /// /// /// - public global::Shotstack.GenerationModelType? Type245 { get; set; } + public global::Shotstack.IngestErrorResponseData? Type245 { get; set; } /// /// /// - public global::Shotstack.GenerationModelUnavailableReason? Type246 { get; set; } + public global::Shotstack.TextAnimationPreset? Type246 { get; set; } /// /// /// - public global::Shotstack.GenerationModelListResponse? Type247 { get; set; } + public global::Shotstack.RichCaptionFontStyle? Type247 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type248 { get; set; } + public global::Shotstack.RichCaptionStyleTextTransform? Type248 { get; set; } /// /// /// - public global::Shotstack.PostGenerateRequest? Type249 { get; set; } + public global::Shotstack.RichCaptionStyleTextDecoration? Type249 { get; set; } /// /// /// - public global::Shotstack.OneOf? Type250 { get; set; } + public global::Shotstack.TiktokDestinationOptions? Type250 { get; set; } + /// + /// + /// + public global::Shotstack.TiktokDestinationOptionsPrivacyLevel? Type251 { get; set; } + /// + /// + /// + public global::Shotstack.AkamaiNetStorageDestinationOptions? Type252 { get; set; } + /// + /// + /// + public global::Shotstack.AzureBlobStorageDestinationOptions? Type253 { get; set; } + /// + /// + /// + public global::Shotstack.PostGenerateRequest? Type254 { get; set; } + /// + /// + /// + public global::Shotstack.OneOf? Type255 { get; set; } /// /// @@ -1082,26 +1102,26 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.List? ListType11 { get; set; } + public global::System.Collections.Generic.List? ListType11 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType12 { get; set; } + public global::System.Collections.Generic.List? ListType12 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType13 { get; set; } + public global::System.Collections.Generic.List? ListType13 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType14 { get; set; } + public global::System.Collections.Generic.List? ListType14 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType15 { get; set; } + public global::System.Collections.Generic.List? ListType15 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType16 { get; set; } + public global::System.Collections.Generic.List? ListType16 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.GenerationErrorResponse.Json.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationErrorResponse.Json.g.cs new file mode 100644 index 0000000..cee0ed7 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationErrorResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Shotstack +{ + public sealed partial class GenerationErrorResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Shotstack.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Shotstack.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Shotstack.GenerationErrorResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Shotstack.GenerationErrorResponse), + jsonSerializerContext) as global::Shotstack.GenerationErrorResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Shotstack.GenerationErrorResponse? FromJson( + string json) + { + return FromJson( + json, + global::Shotstack.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Shotstack.GenerationErrorResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Shotstack.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Shotstack.GenerationErrorResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Shotstack.GenerationErrorResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Shotstack.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Shotstack.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.GenerationErrorResponse.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationErrorResponse.g.cs new file mode 100644 index 0000000..cdfa984 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationErrorResponse.g.cs @@ -0,0 +1,78 @@ + +#nullable enable + +namespace Shotstack +{ + /// + /// Why a generation request was not accepted or a job could not be found. + /// + public sealed partial class GenerationErrorResponse + { + /// + /// A human readable error message.
+ /// Example: Insufficient generation credits. + ///
+ /// Insufficient generation credits. + [global::System.Text.Json.Serialization.JsonPropertyName("error")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Error { get; set; } + + /// + /// Why access to AI generation was refused. `AiCapabilityNotIncluded`: the account's plan does not include this kind of generation. `FeatureNotIncluded`: the plan does not include a feature the asset uses. `AiDisabled`: AI generation is turned off for the account. `AiAccessUnavailable`: access could not be confirmed; try again later.
+ /// Example: AiCapabilityNotIncluded + ///
+ /// AiCapabilityNotIncluded + [global::System.Text.Json.Serialization.JsonPropertyName("code")] + public string? Code { get; set; } + + /// + /// The credits the account has available. Present when it has too few.
+ /// Example: 1.5F + ///
+ /// 1.5F + [global::System.Text.Json.Serialization.JsonPropertyName("available")] + public double? Available { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// A human readable error message.
+ /// Example: Insufficient generation credits. + /// + /// + /// Why access to AI generation was refused. `AiCapabilityNotIncluded`: the account's plan does not include this kind of generation. `FeatureNotIncluded`: the plan does not include a feature the asset uses. `AiDisabled`: AI generation is turned off for the account. `AiAccessUnavailable`: access could not be confirmed; try again later.
+ /// Example: AiCapabilityNotIncluded + /// + /// + /// The credits the account has available. Present when it has too few.
+ /// Example: 1.5F + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GenerationErrorResponse( + string error, + string? code, + double? available) + { + this.Error = error ?? throw new global::System.ArgumentNullException(nameof(error)); + this.Code = code; + this.Available = available; + } + + /// + /// Initializes a new instance of the class. + /// + public GenerationErrorResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponse.Json.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponse.Json.g.cs new file mode 100644 index 0000000..06c96c0 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Shotstack +{ + public sealed partial class GenerationModelErrorResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Shotstack.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Shotstack.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Shotstack.GenerationModelErrorResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Shotstack.GenerationModelErrorResponse), + jsonSerializerContext) as global::Shotstack.GenerationModelErrorResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Shotstack.GenerationModelErrorResponse? FromJson( + string json) + { + return FromJson( + json, + global::Shotstack.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Shotstack.GenerationModelErrorResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Shotstack.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Shotstack.GenerationModelErrorResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Shotstack.GenerationModelErrorResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Shotstack.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Shotstack.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponse.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponse.g.cs new file mode 100644 index 0000000..2955e64 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponse.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Shotstack +{ + /// + /// Why a generation model could not be returned. + /// + public sealed partial class GenerationModelErrorResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("error")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Shotstack.GenerationModelErrorResponseError Error { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GenerationModelErrorResponse( + global::Shotstack.GenerationModelErrorResponseError error) + { + this.Error = error ?? throw new global::System.ArgumentNullException(nameof(error)); + } + + /// + /// Initializes a new instance of the class. + /// + public GenerationModelErrorResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponseError.Json.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponseError.Json.g.cs new file mode 100644 index 0000000..85f6d45 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponseError.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Shotstack +{ + public sealed partial class GenerationModelErrorResponseError + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Shotstack.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Shotstack.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Shotstack.GenerationModelErrorResponseError? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Shotstack.GenerationModelErrorResponseError), + jsonSerializerContext) as global::Shotstack.GenerationModelErrorResponseError; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Shotstack.GenerationModelErrorResponseError? FromJson( + string json) + { + return FromJson( + json, + global::Shotstack.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Shotstack.GenerationModelErrorResponseError? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Shotstack.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Shotstack.GenerationModelErrorResponseError), + jsonSerializerContext).ConfigureAwait(false)) as global::Shotstack.GenerationModelErrorResponseError; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Shotstack.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Shotstack.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponseError.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponseError.g.cs new file mode 100644 index 0000000..7b3cc09 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponseError.g.cs @@ -0,0 +1,66 @@ + +#nullable enable + +namespace Shotstack +{ + /// + /// + /// + public sealed partial class GenerationModelErrorResponseError + { + /// + /// `UnknownGenerationModel`: no model has this identifier. `WithdrawnGenerationModel`: the model is no longer listed, but edits that already use it still validate, bill and render.
+ /// Example: UnknownGenerationModel + ///
+ /// UnknownGenerationModel + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Shotstack.JsonConverters.GenerationModelErrorResponseErrorNameJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Shotstack.GenerationModelErrorResponseErrorName Name { get; set; } + + /// + /// A human readable error message.
+ /// Example: Unknown generation model "seedance-9". + ///
+ /// Unknown generation model "seedance-9". + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Message { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// `UnknownGenerationModel`: no model has this identifier. `WithdrawnGenerationModel`: the model is no longer listed, but edits that already use it still validate, bill and render.
+ /// Example: UnknownGenerationModel + /// + /// + /// A human readable error message.
+ /// Example: Unknown generation model "seedance-9". + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GenerationModelErrorResponseError( + global::Shotstack.GenerationModelErrorResponseErrorName name, + string message) + { + this.Name = name; + this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); + } + + /// + /// Initializes a new instance of the class. + /// + public GenerationModelErrorResponseError() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponseErrorName.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponseErrorName.g.cs new file mode 100644 index 0000000..d69416a --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelErrorResponseErrorName.g.cs @@ -0,0 +1,52 @@ + +#nullable enable + +namespace Shotstack +{ + /// + /// `UnknownGenerationModel`: no model has this identifier. `WithdrawnGenerationModel`: the model is no longer listed, but edits that already use it still validate, bill and render.
+ /// Example: UnknownGenerationModel + ///
+ public enum GenerationModelErrorResponseErrorName + { + /// + /// no model has this identifier. `WithdrawnGenerationModel`: the model is no longer listed, but edits that already use it still validate, bill and render. + /// + UnknownGenerationModel, + /// + /// no model has this identifier. `WithdrawnGenerationModel`: the model is no longer listed, but edits that already use it still validate, bill and render. + /// + WithdrawnGenerationModel, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class GenerationModelErrorResponseErrorNameExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this GenerationModelErrorResponseErrorName value) + { + return value switch + { + GenerationModelErrorResponseErrorName.UnknownGenerationModel => "UnknownGenerationModel", + GenerationModelErrorResponseErrorName.WithdrawnGenerationModel => "WithdrawnGenerationModel", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static GenerationModelErrorResponseErrorName? ToEnum(string value) + { + return value switch + { + "UnknownGenerationModel" => GenerationModelErrorResponseErrorName.UnknownGenerationModel, + "WithdrawnGenerationModel" => GenerationModelErrorResponseErrorName.WithdrawnGenerationModel, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelPricing.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelPricing.g.cs index 58aed32..5fe619f 100644 --- a/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelPricing.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationModelPricing.g.cs @@ -14,9 +14,9 @@ public sealed partial class GenerationModelPricing ///
/// {"480p":0.9375,"720p":1.8962,"1080p":4.2625} [global::System.Text.Json.Serialization.JsonPropertyName("credits")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Shotstack.JsonConverters.OneOfJsonConverter))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Shotstack.JsonConverters.OneOfJsonConverter>))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::Shotstack.OneOf Credits { get; set; } + public required global::Shotstack.OneOf> Credits { get; set; } /// /// The option whose value selects the rate, and the value assumed when the option is absent. Present only when `credits` is keyed. @@ -66,7 +66,7 @@ public sealed partial class GenerationModelPricing [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public GenerationModelPricing( - global::Shotstack.OneOf credits, + global::Shotstack.OneOf> credits, string effectiveFrom, global::Shotstack.GenerationModelPricingTieredBy? tieredBy, global::Shotstack.GenerationModelPricingQuantity? quantity) diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.PostGenerateRequest.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.PostGenerateRequest.g.cs index 85ef953..5cb9e97 100644 --- a/src/libs/Shotstack/Generated/Shotstack.Models.PostGenerateRequest.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.Models.PostGenerateRequest.g.cs @@ -16,6 +16,14 @@ public sealed partial class PostGenerateRequest [global::System.Text.Json.Serialization.JsonRequired] public required global::Shotstack.OneOf Asset { get; set; } + /// + /// The length, in seconds, of the clip the asset fills. A model that generates to a duration takes it from this value in place of its own duration option. Other models ignore it.
+ /// Example: 5 + ///
+ /// 5 + [global::System.Text.Json.Serialization.JsonPropertyName("length")] + public double? Length { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -26,13 +34,19 @@ public sealed partial class PostGenerateRequest /// Initializes a new instance of the class. ///
/// + /// + /// The length, in seconds, of the clip the asset fills. A model that generates to a duration takes it from this value in place of its own duration option. Other models ignore it.
+ /// Example: 5 + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public PostGenerateRequest( - global::Shotstack.OneOf asset) + global::Shotstack.OneOf asset, + double? length) { this.Asset = asset; + this.Length = length; } /// diff --git a/src/libs/Shotstack/Generated/Shotstack.Serve.JsonSerializerContext.g.cs b/src/libs/Shotstack/Generated/Shotstack.Serve.JsonSerializerContext.g.cs index ccc6bdf..33751c1 100644 --- a/src/libs/Shotstack/Generated/Shotstack.Serve.JsonSerializerContext.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.Serve.JsonSerializerContext.g.cs @@ -115,7 +115,7 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options.Converters.Add(new global::Shotstack.JsonConverters.DestinationsJsonConverter()); options.Converters.Add(new global::Shotstack.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Shotstack.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Shotstack.JsonConverters.OneOfJsonConverter()); + options.Converters.Add(new global::Shotstack.JsonConverters.OneOfJsonConverter>()); options.Converters.Add(new global::Shotstack.JsonConverters.UnixTimestampJsonConverter()); options.Converters.Add(new LazyEnumJsonConverterFactory()); } diff --git a/src/libs/Shotstack/Generated/Shotstack.ServeClient.g.cs b/src/libs/Shotstack/Generated/Shotstack.ServeClient.g.cs index 2f8b98e..559eed1 100644 --- a/src/libs/Shotstack/Generated/Shotstack.ServeClient.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.ServeClient.g.cs @@ -35,6 +35,10 @@ public sealed partial class ServeClient : global::Shotstack.IServeClient, global /// public global::Shotstack.AutoSDKClientOptions Options { get; } + + /// + public global::System.Func CreateIdempotencyKey { get; set; } = () => global::System.Guid.NewGuid().ToString("D"); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Shotstack.ServeSourceGenerationContext.Default); /// diff --git a/src/libs/Shotstack/Generated/Shotstack.ShotstackClient.g.cs b/src/libs/Shotstack/Generated/Shotstack.ShotstackClient.g.cs index 9d4296b..07f7056 100644 --- a/src/libs/Shotstack/Generated/Shotstack.ShotstackClient.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.ShotstackClient.g.cs @@ -45,6 +45,10 @@ public sealed partial class ShotstackClient : global::Shotstack.IShotstackClient /// public global::Shotstack.AutoSDKClientOptions Options { get; } + + /// + public global::System.Func CreateIdempotencyKey { get; set; } = () => global::System.Guid.NewGuid().ToString("D"); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Shotstack.SourceGenerationContext.Default); /// @@ -63,6 +67,7 @@ public sealed partial class ShotstackClient : global::Shotstack.IShotstackClient public EditClient Edit => new EditClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, + CreateIdempotencyKey = CreateIdempotencyKey, JsonSerializerContextProvider = JsonSerializerContextProvider, }; @@ -72,6 +77,7 @@ public sealed partial class ShotstackClient : global::Shotstack.IShotstackClient public IngestClient Ingest => new IngestClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, + CreateIdempotencyKey = CreateIdempotencyKey, JsonSerializerContextProvider = JsonSerializerContextProvider, }; @@ -81,6 +87,7 @@ public sealed partial class ShotstackClient : global::Shotstack.IShotstackClient public ServeClient Serve => new ServeClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, + CreateIdempotencyKey = CreateIdempotencyKey, JsonSerializerContextProvider = JsonSerializerContextProvider, }; diff --git a/src/libs/Shotstack/openapi.json b/src/libs/Shotstack/openapi.json index 338c30a..9b31b28 100644 --- a/src/libs/Shotstack/openapi.json +++ b/src/libs/Shotstack/openapi.json @@ -446,7 +446,7 @@ "post": { "responses": { "200": { - "description": "The generated asset was already cached and is immediately available.", + "description": "The asset was generated before: `done` with its URL, or `failed` with the error that ended it.", "content": { "application/json": { "schema": { @@ -478,11 +478,90 @@ } } } + }, + "400": { + "description": "The request is invalid, for example a missing asset or prompt, a disallowed URL or a `length` that is not positive.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } + }, + "402": { + "description": "The account has too few credits for this generation. `available` holds how many it has.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } + }, + "403": { + "description": "The account cannot use this generation. `code` says why.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } + }, + "409": { + "description": "The `Idempotency-Key` was already used for a different asset.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } + }, + "429": { + "description": "The account has reached its generation quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } + }, + "503": { + "description": "A service the request depends on is temporarily unavailable. `code` is `AiAccessUnavailable` when access to AI generation could not be confirmed.", + "headers": { + "Retry-After": { + "description": "Suggested seconds to wait before retrying.", + "schema": { + "type": "integer" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } } }, "description": "Generate a single image, video or audio asset from a text prompt without\nrendering a full edit. Submit a prompt-bearing asset; the response is\nimmediate when an identical asset has been generated before (results are\ncached by prompt, model and options), otherwise the job is queued and can\nbe polled via the status endpoint.\n\nGeneration is billed in credits per asset. Identical repeat requests\nresolve from the cache at no charge.\n\n**Base URL:** https://api.shotstack.io/edit/{version}\n", "summary": "Generate Asset", "operationId": "postGenerate", + "parameters": [ + { + "in": "header", + "name": "Idempotency-Key", + "required": false, + "description": "A key that makes this request its own generation. Retrying with the same key returns the job it first created instead of generating and billing again, and a new key generates afresh even when the asset matches an earlier one. Without a key, identical assets share one cached result. For 24 hours a key reused for a different asset is rejected; after that it returns its first result.", + "schema": { + "type": "string" + } + } + ], "requestBody": { "description": "A prompt-bearing image, video or audio asset to generate.", "content": { @@ -502,6 +581,13 @@ "$ref": "#/components/schemas/AudioAsset" } ] + }, + "length": { + "description": "The length, in seconds, of the clip the asset fills. A model that generates to a duration takes it from this value in place of its own duration option. Other models ignore it.", + "type": "number", + "minimum": 0, + "exclusiveMinimum": true, + "example": 5 } }, "required": [ @@ -536,6 +622,14 @@ }, "202": { "description": "The generation job is still processing.", + "headers": { + "Retry-After": { + "description": "Suggested seconds to wait before polling again.", + "schema": { + "type": "integer" + } + } + }, "content": { "application/json": { "schema": { @@ -543,6 +637,16 @@ } } } + }, + "404": { + "description": "No generation job with this id exists for the calling account.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } } }, "description": "Get the status of an on-demand asset generation job created with the\ngenerate endpoint. Jobs are owner-scoped.\n\n**Base URL:** https://api.shotstack.io/edit/{version}\n", @@ -628,7 +732,14 @@ } }, "404": { - "description": "No model exists with that identifier." + "description": "No listed model has that identifier. `error.name` tells an unknown model from one that has been withdrawn.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationModelErrorResponse" + } + } + } } }, "security": [ @@ -4382,168 +4493,433 @@ ], "type": "object" }, - "QueuedResponse": { - "description": "The response received after a [render request](#render-asset) or [template render](#render-template) is submitted. The render task is queued for rendering and a unique render id is returned.", - "properties": { - "success": { - "description": "`true` if successfully queued, else `false`.", - "type": "boolean", - "example": true - }, - "message": { - "description": "`Created`, `Bad Request` or an error message.", - "type": "string", - "example": "Created" - }, - "response": { - "description": "`QueuedResponseData` or an error message.", - "$ref": "#/components/schemas/QueuedResponseData" - } - }, - "required": [ - "success", - "message", - "response" - ], - "type": "object" - }, - "QueuedResponseData": { - "description": "The response data returned with the [QueuedResponse](#tocs_queuedresponse).", - "properties": { - "message": { - "description": "Success response message or error details.", - "type": "string", - "example": "Render Successfully Queued" - }, - "id": { - "description": "The id of the render task in UUID format.", - "type": "string", - "example": "2abd5c11-0f3d-4c6d-ba20-235fc9b8e8b7" - } - }, - "required": [ - "message", - "id" - ], - "type": "object" - }, - "RenderResponse": { - "description": "The response received after a [render status request](#get-render-status) is submitted. The response includes details about status of a render and the output URL.", - "properties": { - "success": { - "description": "`true` if status available, else `false`.", - "type": "boolean", - "example": true - }, - "message": { - "description": "`OK` or an error message.", - "type": "string", - "example": "OK" - }, - "response": { - "description": "`RenderResponse` or an error message.", - "$ref": "#/components/schemas/RenderResponseData" - } - }, - "required": [ - "success", - "message", - "response" - ], - "type": "object" - }, - "RenderResponseData": { - "description": "The response data returned with the [RenderResponse](#tocs_renderresponse) including status and URL.", + "GenerationModel": { + "description": "A generation model available to `prompt`-bearing image, video and audio assets, with the options it accepts and what it costs. Render a model picker and its option fields from this rather than hard coding a model list, so a newly launched model is available without a client release.", "properties": { - "id": { - "description": "The id of the render task in UUID format.", - "type": "string", - "example": "2abd5c11-0f3d-4c6d-ba20-235fc9b8e8b7" - }, - "owner": { - "description": "The owner id of the render task.", + "model": { + "description": "The identifier to set as the asset `model`. Carries no provider name, so routing can change without a public rename.", "type": "string", - "example": "5ca6hu7s9k" + "example": "seedance-2.0-text-to-video" }, - "plan": { - "description": "The customer subscription plan.", + "type": { + "description": "The asset type this model generates.", "type": "string", - "example": "basic" - }, - "status": { - "description": "The status of the render task.
    \n
  • `queued` - render is queued waiting to be rendered
  • \n
  • `fetching` - assets are being fetched
  • \n
  • `preprocessing` - video assets are being processed for compatibility
  • \n
  • `rendering` - the asset is being rendered
  • \n
  • `generating` - AI/media generation is in progress
  • \n
  • `saving` - the final asset is being saved to storage
  • \n
  • `done` - the asset is ready to be downloaded
  • \n
  • `failed` - there was an error rendering the asset
  • \n
", "enum": [ - "queued", - "fetching", - "preprocessing", - "rendering", - "generating", - "saving", - "done", - "failed" + "image", + "video", + "audio" ], - "type": "string", - "example": "done" - }, - "error": { - "description": "An error message, only displayed if an error occurred.", - "type": "string", - "example": "" - }, - "duration": { - "description": "The output video or audio length in seconds.", - "type": "number", - "example": 8.5 - }, - "renderTime": { - "description": "The time taken to render the asset in milliseconds.", - "type": "number", - "example": 9433.44 + "example": "video" }, - "url": { - "description": "The URL of the final asset. This will only be available if status is done. This is a temporary URL and will be deleted after 24 hours. By default all assets are copied to the Shotstack hosting and CDN destination.", + "name": { + "description": "The model's display name, for a model picker.", "type": "string", - "example": "https://shotstack-api-v1-output.s3-ap-southeast-2.amazonaws.com/5ca6hu7s9k/2abd5c11-0f3d-4c6d-ba20-235fc9b8e8b7.mp4" + "example": "Seedance 2.0 \u00b7 Text to video" }, - "poster": { - "description": "The URL of the poster image if requested. This will only be available if status is done.", + "description": { + "description": "What the model is suited to, in a sentence or two.", "type": "string", - "nullable": true, - "example": "https://shotstack-api-v1-output.s3-ap-southeast-2.amazonaws.com/5ca6hu7s9k/2abd5c11-0f3d-4c6d-ba20-235fc9b8e8b7-poster.jpg" + "example": "Generate cinematic video with realistic motion, prompt-directed camera movement and optional synchronised audio." }, - "thumbnail": { - "description": "The URL of the thumbnail image if requested. This will only be available if status is done.", - "type": "string", - "nullable": true, - "example": "https://shotstack-api-v1-output.s3-ap-southeast-2.amazonaws.com/5ca6hu7s9k/2abd5c11-0f3d-4c6d-ba20-235fc9b8e8b7-thumb.jpg" + "pricing": { + "description": "What one generation with this model costs.", + "$ref": "#/components/schemas/GenerationModelPricing" }, - "data": { - "description": "The timeline and output data to be rendered.", - "$ref": "#/components/schemas/Edit" + "options": { + "description": "JSON Schema for the model's `options` object. Only returned for a single model, or for a list requested with `expand=options`. Values outside this schema are rejected.", + "type": "object", + "additionalProperties": true }, - "created": { - "description": "The time the render task was initially queued.", - "type": "string", - "example": "2020-10-30T09:42:29.446Z" + "available": { + "description": "Whether the account behind the calling API key can generate with this model. Omitted when that cannot be determined; treat a missing value as unknown, not as available. Generation requests are checked either way.", + "type": "boolean", + "example": false }, - "updated": { - "description": "The time the render status was last updated.", + "unavailableReason": { + "description": "Why `available` is false. `AiCapabilityNotIncluded`: the account's plan does not include this kind of generation. `AiDisabled`: AI generation is turned off for the account. `AiAccessUnavailable`: access could not be confirmed; try again later.", "type": "string", - "example": "2020-10-30T09:42:39.168Z" + "enum": [ + "AiCapabilityNotIncluded", + "AiDisabled", + "AiAccessUnavailable" + ], + "example": "AiCapabilityNotIncluded" } }, "required": [ - "status", - "id", - "owner" + "model", + "type" ], "type": "object" }, - "TemplateResponse": { - "description": "The response received after a [template](#create-template) is submitted. The template is saved and a unique template id is returned.", + "GenerationModelPricing": { + "description": "What one generation costs, in credits: the rate multiplied by the units consumed. `quantity` says how to count the units, and is absent when one generation is one unit. Where a model charges differently per option value, `credits` is an object keyed by that value and `tieredBy` names the option that selects it.", "properties": { - "success": { - "description": "`true` if successfully created, else `false`.", + "credits": { + "description": "Credits per unit. A number when the rate is flat, or an object keyed by the values of the option named in `tieredBy`.", + "oneOf": [ + { + "type": "number" + }, + { + "type": "object", + "additionalProperties": { + "type": "number" + } + } + ], + "example": { + "480p": 0.9375, + "720p": 1.8962, + "1080p": 4.2625 + } + }, + "tieredBy": { + "description": "The option whose value selects the rate, and the value assumed when the option is absent. Present only when `credits` is keyed.", + "type": "object", + "properties": { + "option": { + "type": "string", + "example": "resolution" + }, + "default": { + "type": "string", + "example": "720p" + } + }, + "required": [ + "option", + "default" + ] + }, + "quantity": { + "description": "How many units a generation consumes. Take the value `measure` names, or `default` when the request carries none, hold it within `min` and `max`, divide by `per`, and round up when `round` is `up`. Absent when one generation is one unit.", + "type": "object", + "properties": { + "measure": { + "description": "What the count is taken from, and the scale it is measured in.", + "type": "string", + "enum": [ + "clipSeconds", + "promptCharacters" + ], + "example": "clipSeconds" + }, + "per": { + "description": "How many of `measure` make one billable unit.", + "type": "number", + "example": 60 + }, + "min": { + "description": "Fewest accepted. A smaller request is charged at this.", + "type": "number", + "example": 3 + }, + "max": { + "description": "Most accepted. A larger request is charged at this.", + "type": "number", + "example": 600 + }, + "default": { + "description": "Assumed when the request carries no value.", + "type": "number", + "example": 30 + }, + "round": { + "description": "Present when a partial unit is charged as a whole one. A 61 second track on a per-minute rate is charged as two minutes.", + "type": "string", + "enum": [ + "up" + ], + "example": "up" + } + }, + "required": [ + "measure", + "per" + ] + }, + "effectiveFrom": { + "description": "The date this rate took effect, or `legacy` for a rate that predates dated pricing.", + "type": "string", + "example": "2026-08-13" + } + }, + "required": [ + "credits", + "effectiveFrom" + ], + "type": "object" + }, + "GenerationModelListResponse": { + "description": "The generation models available to this account.", + "properties": { + "models": { + "description": "The available models.", + "type": "array", + "items": { + "$ref": "#/components/schemas/GenerationModel" + } + } + }, + "required": [ + "models" + ], + "type": "object" + }, + "GenerationResponse": { + "description": "The status of an on-demand asset generation job. Completed jobs include the public URL of the generated asset.", + "type": "object", + "properties": { + "id": { + "description": "The generation job id. Deterministic for a given owner and asset payload (or idempotency key), so identical requests return the same job and cached result.", + "type": "string", + "example": "8a1f2c3d-4e5b-5a6c-9d7e-1f2a3b4c5d6e" + }, + "status": { + "description": "The status of the generation job.", + "type": "string", + "enum": [ + "queued", + "processing", + "done", + "failed" + ], + "example": "done" + }, + "url": { + "description": "The public URL of the generated asset. Present only when `status` is `done`.", + "type": "string", + "example": "https://shotstack-api-v1-output.s3-ap-southeast-2.amazonaws.com/owner/8a1f2c3d.png" + }, + "error": { + "description": "A human readable error message. Present only when `status` is `failed`.", + "type": "string" + } + }, + "required": [ + "id", + "status" + ] + }, + "GenerationErrorResponse": { + "description": "Why a generation request was not accepted or a job could not be found.", + "type": "object", + "properties": { + "error": { + "description": "A human readable error message.", + "type": "string", + "example": "Insufficient generation credits." + }, + "code": { + "description": "Why access to AI generation was refused. `AiCapabilityNotIncluded`: the account's plan does not include this kind of generation. `FeatureNotIncluded`: the plan does not include a feature the asset uses. `AiDisabled`: AI generation is turned off for the account. `AiAccessUnavailable`: access could not be confirmed; try again later.", + "type": "string", + "example": "AiCapabilityNotIncluded" + }, + "available": { + "description": "The credits the account has available. Present when it has too few.", + "type": "number", + "example": 1.5 + } + }, + "required": [ + "error" + ] + }, + "GenerationModelErrorResponse": { + "description": "Why a generation model could not be returned.", + "type": "object", + "properties": { + "error": { + "type": "object", + "properties": { + "name": { + "description": "`UnknownGenerationModel`: no model has this identifier. `WithdrawnGenerationModel`: the model is no longer listed, but edits that already use it still validate, bill and render.", + "type": "string", + "enum": [ + "UnknownGenerationModel", + "WithdrawnGenerationModel" + ], + "example": "UnknownGenerationModel" + }, + "message": { + "description": "A human readable error message.", + "type": "string", + "example": "Unknown generation model \"seedance-9\"." + } + }, + "required": [ + "name", + "message" + ] + } + }, + "required": [ + "error" + ] + }, + "QueuedResponse": { + "description": "The response received after a [render request](#render-asset) or [template render](#render-template) is submitted. The render task is queued for rendering and a unique render id is returned.", + "properties": { + "success": { + "description": "`true` if successfully queued, else `false`.", + "type": "boolean", + "example": true + }, + "message": { + "description": "`Created`, `Bad Request` or an error message.", + "type": "string", + "example": "Created" + }, + "response": { + "description": "`QueuedResponseData` or an error message.", + "$ref": "#/components/schemas/QueuedResponseData" + } + }, + "required": [ + "success", + "message", + "response" + ], + "type": "object" + }, + "QueuedResponseData": { + "description": "The response data returned with the [QueuedResponse](#tocs_queuedresponse).", + "properties": { + "message": { + "description": "Success response message or error details.", + "type": "string", + "example": "Render Successfully Queued" + }, + "id": { + "description": "The id of the render task in UUID format.", + "type": "string", + "example": "2abd5c11-0f3d-4c6d-ba20-235fc9b8e8b7" + } + }, + "required": [ + "message", + "id" + ], + "type": "object" + }, + "RenderResponse": { + "description": "The response received after a [render status request](#get-render-status) is submitted. The response includes details about status of a render and the output URL.", + "properties": { + "success": { + "description": "`true` if status available, else `false`.", + "type": "boolean", + "example": true + }, + "message": { + "description": "`OK` or an error message.", + "type": "string", + "example": "OK" + }, + "response": { + "description": "`RenderResponse` or an error message.", + "$ref": "#/components/schemas/RenderResponseData" + } + }, + "required": [ + "success", + "message", + "response" + ], + "type": "object" + }, + "RenderResponseData": { + "description": "The response data returned with the [RenderResponse](#tocs_renderresponse) including status and URL.", + "properties": { + "id": { + "description": "The id of the render task in UUID format.", + "type": "string", + "example": "2abd5c11-0f3d-4c6d-ba20-235fc9b8e8b7" + }, + "owner": { + "description": "The owner id of the render task.", + "type": "string", + "example": "5ca6hu7s9k" + }, + "plan": { + "description": "The customer subscription plan.", + "type": "string", + "example": "basic" + }, + "status": { + "description": "The status of the render task.
    \n
  • `queued` - render is queued waiting to be rendered
  • \n
  • `fetching` - assets are being fetched
  • \n
  • `preprocessing` - video assets are being processed for compatibility
  • \n
  • `rendering` - the asset is being rendered
  • \n
  • `generating` - AI/media generation is in progress
  • \n
  • `saving` - the final asset is being saved to storage
  • \n
  • `done` - the asset is ready to be downloaded
  • \n
  • `failed` - there was an error rendering the asset
  • \n
", + "enum": [ + "queued", + "fetching", + "preprocessing", + "rendering", + "generating", + "saving", + "done", + "failed" + ], + "type": "string", + "example": "done" + }, + "error": { + "description": "An error message, only displayed if an error occurred.", + "type": "string", + "example": "" + }, + "duration": { + "description": "The output video or audio length in seconds.", + "type": "number", + "example": 8.5 + }, + "renderTime": { + "description": "The time taken to render the asset in milliseconds.", + "type": "number", + "example": 9433.44 + }, + "url": { + "description": "The URL of the final asset. This will only be available if status is done. This is a temporary URL and will be deleted after 24 hours. By default all assets are copied to the Shotstack hosting and CDN destination.", + "type": "string", + "example": "https://shotstack-api-v1-output.s3-ap-southeast-2.amazonaws.com/5ca6hu7s9k/2abd5c11-0f3d-4c6d-ba20-235fc9b8e8b7.mp4" + }, + "poster": { + "description": "The URL of the poster image if requested. This will only be available if status is done.", + "type": "string", + "nullable": true, + "example": "https://shotstack-api-v1-output.s3-ap-southeast-2.amazonaws.com/5ca6hu7s9k/2abd5c11-0f3d-4c6d-ba20-235fc9b8e8b7-poster.jpg" + }, + "thumbnail": { + "description": "The URL of the thumbnail image if requested. This will only be available if status is done.", + "type": "string", + "nullable": true, + "example": "https://shotstack-api-v1-output.s3-ap-southeast-2.amazonaws.com/5ca6hu7s9k/2abd5c11-0f3d-4c6d-ba20-235fc9b8e8b7-thumb.jpg" + }, + "data": { + "description": "The timeline and output data to be rendered.", + "$ref": "#/components/schemas/Edit" + }, + "created": { + "description": "The time the render task was initially queued.", + "type": "string", + "example": "2020-10-30T09:42:29.446Z" + }, + "updated": { + "description": "The time the render status was last updated.", + "type": "string", + "example": "2020-10-30T09:42:39.168Z" + } + }, + "required": [ + "status", + "id", + "owner" + ], + "type": "object" + }, + "TemplateResponse": { + "description": "The response received after a [template](#create-template) is submitted. The template is saved and a unique template id is returned.", + "properties": { + "success": { + "description": "`true` if successfully created, else `false`.", "type": "boolean", "example": true }, @@ -5716,213 +6092,6 @@ "required": [ "provider" ] - }, - "GenerationResponse": { - "description": "The status of an on-demand asset generation job. Completed jobs include the public URL of the generated asset.", - "type": "object", - "properties": { - "id": { - "description": "The generation job id. Deterministic for a given owner and asset payload (or idempotency key), so identical requests return the same job and cached result.", - "type": "string", - "example": "8a1f2c3d-4e5b-5a6c-9d7e-1f2a3b4c5d6e" - }, - "status": { - "description": "The status of the generation job.", - "type": "string", - "enum": [ - "queued", - "processing", - "done", - "failed" - ], - "example": "done" - }, - "url": { - "description": "The public URL of the generated asset. Present only when `status` is `done`.", - "type": "string", - "example": "https://shotstack-api-v1-output.s3-ap-southeast-2.amazonaws.com/owner/8a1f2c3d.png" - }, - "error": { - "description": "A human readable error message. Present only when `status` is `failed`.", - "type": "string" - } - }, - "required": [ - "id", - "status" - ] - }, - "GenerationModelPricing": { - "description": "What one generation costs, in credits: the rate multiplied by the units consumed. `quantity` says how to count the units, and is absent when one generation is one unit. Where a model charges differently per option value, `credits` is an object keyed by that value and `tieredBy` names the option that selects it.", - "properties": { - "credits": { - "description": "Credits per unit. A number when the rate is flat, or an object keyed by the values of the option named in `tieredBy`.", - "oneOf": [ - { - "type": "number" - }, - { - "type": "object", - "additionalProperties": true - } - ], - "example": { - "480p": 0.9375, - "720p": 1.8962, - "1080p": 4.2625 - } - }, - "tieredBy": { - "description": "The option whose value selects the rate, and the value assumed when the option is absent. Present only when `credits` is keyed.", - "type": "object", - "properties": { - "option": { - "type": "string", - "example": "resolution" - }, - "default": { - "type": "string", - "example": "720p" - } - }, - "required": [ - "option", - "default" - ] - }, - "quantity": { - "description": "How many units a generation consumes. Take the value `measure` names, or `default` when the request carries none, hold it within `min` and `max`, divide by `per`, and round up when `round` is `up`. Absent when one generation is one unit.", - "type": "object", - "properties": { - "measure": { - "description": "What the count is taken from, and the scale it is measured in.", - "type": "string", - "enum": [ - "clipSeconds", - "promptCharacters" - ], - "example": "clipSeconds" - }, - "per": { - "description": "How many of `measure` make one billable unit.", - "type": "number", - "example": 60 - }, - "min": { - "description": "Fewest accepted. A smaller request is charged at this.", - "type": "number", - "example": 3 - }, - "max": { - "description": "Most accepted. A larger request is charged at this.", - "type": "number", - "example": 600 - }, - "default": { - "description": "Assumed when the request carries no value.", - "type": "number", - "example": 30 - }, - "round": { - "description": "Present when a partial unit is charged as a whole one. A 61 second track on a per-minute rate is charged as two minutes.", - "type": "string", - "enum": [ - "up" - ], - "example": "up" - } - }, - "required": [ - "measure", - "per" - ] - }, - "effectiveFrom": { - "description": "The date this rate took effect, or `legacy` for a rate that predates dated pricing.", - "type": "string", - "example": "2026-08-13" - } - }, - "required": [ - "credits", - "effectiveFrom" - ], - "type": "object" - }, - "GenerationModel": { - "description": "A generation model available to `prompt`-bearing image, video and audio assets, with the options it accepts and what it costs. Render a model picker and its option fields from this rather than hard coding a model list, so a newly launched model is available without a client release.", - "properties": { - "model": { - "description": "The identifier to set as the asset `model`. Carries no provider name, so routing can change without a public rename.", - "type": "string", - "example": "seedance-2.0-text-to-video" - }, - "type": { - "description": "The asset type this model generates.", - "type": "string", - "enum": [ - "image", - "video", - "audio" - ], - "example": "video" - }, - "name": { - "description": "The model's display name, for a model picker.", - "type": "string", - "example": "Seedance 2.0 \u00b7 Text to video" - }, - "description": { - "description": "What the model is suited to, in a sentence or two.", - "type": "string", - "example": "Generate cinematic video with realistic motion, prompt-directed camera movement and optional synchronised audio." - }, - "pricing": { - "description": "What one generation with this model costs.", - "$ref": "#/components/schemas/GenerationModelPricing" - }, - "options": { - "description": "JSON Schema for the model's `options` object. Only returned for a single model, or for a list requested with `expand=options`. Values outside this schema are rejected.", - "type": "object", - "additionalProperties": true - }, - "available": { - "description": "Whether the account behind the calling API key can generate with this model. Omitted when that cannot be determined; treat a missing value as unknown, not as available. Generation requests are checked either way.", - "type": "boolean", - "example": false - }, - "unavailableReason": { - "description": "Why `available` is false. `AiCapabilityNotIncluded`: the account's plan does not include this kind of generation. `AiDisabled`: AI generation is turned off for the account. `AiAccessUnavailable`: access could not be confirmed; try again later.", - "type": "string", - "enum": [ - "AiCapabilityNotIncluded", - "AiDisabled", - "AiAccessUnavailable" - ], - "example": "AiCapabilityNotIncluded" - } - }, - "required": [ - "model", - "type" - ], - "type": "object" - }, - "GenerationModelListResponse": { - "description": "The generation models available to this account.", - "properties": { - "models": { - "description": "The available models.", - "type": "array", - "items": { - "$ref": "#/components/schemas/GenerationModel" - } - } - }, - "required": [ - "models" - ], - "type": "object" } }, "responses": {},