From 0fc515dc5df1e5e484c9861f43a45a138dd9ce0c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 12 Aug 2026 12:57:12 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Shotstack.EditClient.GetGenerate.g.cs | 415 ++++++++++++++++ .../Shotstack.EditClient.PostGenerate.g.cs | 466 ++++++++++++++++++ .../Shotstack.IEditClient.GetGenerate.g.cs | 36 ++ .../Shotstack.IEditClient.PostGenerate.g.cs | 67 +++ ...nConverters.GenerationResponseStatus.g.cs} | 14 +- ...ers.GenerationResponseStatusNullable.g.cs} | 14 +- ...verters.ImageAssetAspectRatioNullable.g.cs | 60 --- ...k.JsonConverters.ImageAssetResolution.g.cs | 53 -- ...nverters.ImageAssetResolutionNullable.g.cs | 60 --- .../Shotstack.JsonConverters.OneOf3.g.cs | 216 ++++++++ ....JsonConverters.VideoAssetAspectRatio.g.cs | 53 -- ...ack.JsonConverters.VideoAssetDuration.g.cs | 53 -- ...Converters.VideoAssetDurationNullable.g.cs | 60 --- ...k.JsonConverters.VideoAssetResolution.g.cs | 53 -- ...nverters.VideoAssetResolutionNullable.g.cs | 60 --- .../Shotstack.JsonSerializerContext.g.cs | 37 +- .../Shotstack.JsonSerializerContextTypes.g.cs | 378 +++++++------- .../Generated/Shotstack.Models.Asset.g.cs | 45 +- .../Shotstack.Models.AudioAsset.g.cs | 115 +---- ...otstack.Models.AudioAssetOptions.Json.g.cs | 141 ++++++ .../Shotstack.Models.AudioAssetOptions.g.cs | 20 + ...tstack.Models.GenerationResponse.Json.g.cs | 141 ++++++ .../Shotstack.Models.GenerationResponse.g.cs | 91 ++++ ...stack.Models.GenerationResponseStatus.g.cs | 64 +++ .../Shotstack.Models.ImageAsset.g.cs | 60 +-- ...hotstack.Models.ImageAssetAspectRatio.g.cs | 82 --- ...otstack.Models.ImageAssetOptions.Json.g.cs | 141 ++++++ .../Shotstack.Models.ImageAssetOptions.g.cs | 20 + ...Shotstack.Models.ImageAssetResolution.g.cs | 58 --- ...stack.Models.PostGenerateRequest.Json.g.cs | 141 ++++++ .../Shotstack.Models.PostGenerateRequest.g.cs | 46 ++ .../Shotstack.Models.VideoAsset.g.cs | 113 ++--- ...hotstack.Models.VideoAssetAspectRatio.g.cs | 82 --- .../Shotstack.Models.VideoAssetDuration.g.cs | 119 ----- ...otstack.Models.VideoAssetOptions.Json.g.cs | 141 ++++++ .../Shotstack.Models.VideoAssetOptions.g.cs | 20 + ...Shotstack.Models.VideoAssetResolution.g.cs | 58 --- .../Generated/Shotstack.OneOf.3.Json.g.cs | 141 ++++++ .../Generated/Shotstack.OneOf.3.g.cs | 377 ++++++++++++++ src/libs/Shotstack/openapi.json | 322 +++++++----- 40 files changed, 3203 insertions(+), 1430 deletions(-) create mode 100644 src/libs/Shotstack/Generated/Shotstack.EditClient.GetGenerate.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.EditClient.PostGenerate.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.IEditClient.GetGenerate.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.IEditClient.PostGenerate.g.cs rename src/libs/Shotstack/Generated/{Shotstack.JsonConverters.ImageAssetAspectRatio.g.cs => Shotstack.JsonConverters.GenerationResponseStatus.g.cs} (67%) rename src/libs/Shotstack/Generated/{Shotstack.JsonConverters.VideoAssetAspectRatioNullable.g.cs => Shotstack.JsonConverters.GenerationResponseStatusNullable.g.cs} (68%) delete mode 100644 src/libs/Shotstack/Generated/Shotstack.JsonConverters.ImageAssetAspectRatioNullable.g.cs delete mode 100644 src/libs/Shotstack/Generated/Shotstack.JsonConverters.ImageAssetResolution.g.cs delete mode 100644 src/libs/Shotstack/Generated/Shotstack.JsonConverters.ImageAssetResolutionNullable.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.JsonConverters.OneOf3.g.cs delete mode 100644 src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetAspectRatio.g.cs delete mode 100644 src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetDuration.g.cs delete mode 100644 src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetDurationNullable.g.cs delete mode 100644 src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetResolution.g.cs delete mode 100644 src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetResolutionNullable.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.AudioAssetOptions.Json.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.AudioAssetOptions.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.GenerationResponse.Json.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.GenerationResponse.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.GenerationResponseStatus.g.cs delete mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.ImageAssetAspectRatio.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.ImageAssetOptions.Json.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.ImageAssetOptions.g.cs delete mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.ImageAssetResolution.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.PostGenerateRequest.Json.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.PostGenerateRequest.g.cs delete mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetAspectRatio.g.cs delete mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetDuration.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetOptions.Json.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetOptions.g.cs delete mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetResolution.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.OneOf.3.Json.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.OneOf.3.g.cs diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.GetGenerate.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.GetGenerate.g.cs new file mode 100644 index 0000000..9045704 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.GetGenerate.g.cs @@ -0,0 +1,415 @@ + +#nullable enable + +namespace Shotstack +{ + public partial class EditClient + { + + + private static readonly global::Shotstack.EndPointSecurityRequirement s_GetGenerateSecurityRequirement0 = + new global::Shotstack.EndPointSecurityRequirement + { + Authorizations = new global::Shotstack.EndPointAuthorizationRequirement[] + { new global::Shotstack.EndPointAuthorizationRequirement + { + Type = "", + SchemeId = "DeveloperKey", + Location = "", + Name = "", + FriendlyName = "Authorization", + }, + }, + }; + private static readonly global::Shotstack.EndPointSecurityRequirement[] s_GetGenerateSecurityRequirements = + new global::Shotstack.EndPointSecurityRequirement[] + { s_GetGenerateSecurityRequirement0, + }; + partial void PrepareGetGenerateArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id); + partial void PrepareGetGenerateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id); + partial void ProcessGetGenerateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetGenerateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Generation Status
+ /// Get the status of an on-demand asset generation job created with the
+ /// generate endpoint. Jobs are owner-scoped.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetGenerateAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetGenerateAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Generation Status
+ /// Get the status of an on-demand asset generation job created with the
+ /// generate endpoint. Jobs are owner-scoped.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetGenerateAsResponseAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetGenerateArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::Shotstack.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetGenerateSecurityRequirements, + operationName: "GetGenerateAsync"); + + using var __timeoutCancellationTokenSource = global::Shotstack.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Shotstack.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Shotstack.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Shotstack.PathBuilder( + path: $"/edit/v1/generate/{id}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Shotstack.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + global::Shotstack.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetGenerateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id!); + + global::Shotstack.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Shotstack.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetGenerate", + methodName: "GetGenerateAsync", + pathTemplate: "$\"/edit/v1/generate/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetGenerate", + methodName: "GetGenerateAsync", + pathTemplate: "$\"/edit/v1/generate/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetGenerate", + methodName: "GetGenerateAsync", + pathTemplate: "$\"/edit/v1/generate/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetGenerateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetGenerate", + methodName: "GetGenerateAsync", + pathTemplate: "$\"/edit/v1/generate/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetGenerate", + methodName: "GetGenerateAsync", + pathTemplate: "$\"/edit/v1/generate/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetGenerateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Shotstack.GenerationResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Shotstack.GenerationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.PostGenerate.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.PostGenerate.g.cs new file mode 100644 index 0000000..1586737 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.PostGenerate.g.cs @@ -0,0 +1,466 @@ + +#nullable enable + +namespace Shotstack +{ + public partial class EditClient + { + + + private static readonly global::Shotstack.EndPointSecurityRequirement s_PostGenerateSecurityRequirement0 = + new global::Shotstack.EndPointSecurityRequirement + { + Authorizations = new global::Shotstack.EndPointAuthorizationRequirement[] + { new global::Shotstack.EndPointAuthorizationRequirement + { + Type = "", + SchemeId = "DeveloperKey", + Location = "", + Name = "", + FriendlyName = "Authorization", + }, + }, + }; + private static readonly global::Shotstack.EndPointSecurityRequirement[] s_PostGenerateSecurityRequirements = + new global::Shotstack.EndPointSecurityRequirement[] + { s_PostGenerateSecurityRequirement0, + }; + partial void PreparePostGenerateArguments( + global::System.Net.Http.HttpClient httpClient, + global::Shotstack.PostGenerateRequest request); + partial void PreparePostGenerateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Shotstack.PostGenerateRequest request); + partial void ProcessPostGenerateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessPostGenerateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate Asset
+ /// Generate a single image, video or audio asset from a text prompt without
+ /// rendering a full edit. Submit a prompt-bearing asset; the response is
+ /// immediate when an identical asset has been generated before (results are
+ /// cached by prompt, model and options), otherwise the job is queued and can
+ /// be polled via the status endpoint.
+ /// Generation is billed in credits per asset. Identical repeat requests
+ /// resolve from the cache at no charge.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task PostGenerateAsync( + + global::Shotstack.PostGenerateRequest request, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostGenerateAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate Asset
+ /// Generate a single image, video or audio asset from a text prompt without
+ /// rendering a full edit. Submit a prompt-bearing asset; the response is
+ /// immediate when an identical asset has been generated before (results are
+ /// cached by prompt, model and options), otherwise the job is queued and can
+ /// be polled via the status endpoint.
+ /// Generation is billed in credits per asset. Identical repeat requests
+ /// resolve from the cache at no charge.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PostGenerateAsResponseAsync( + + global::Shotstack.PostGenerateRequest request, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PreparePostGenerateArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Shotstack.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_PostGenerateSecurityRequirements, + operationName: "PostGenerateAsync"); + + using var __timeoutCancellationTokenSource = global::Shotstack.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Shotstack.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Shotstack.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Shotstack.PathBuilder( + path: "/edit/v1/generate", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Shotstack.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Shotstack.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PreparePostGenerateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + global::Shotstack.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Shotstack.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PostGenerate", + methodName: "PostGenerateAsync", + pathTemplate: "\"/edit/v1/generate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PostGenerate", + methodName: "PostGenerateAsync", + pathTemplate: "\"/edit/v1/generate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Shotstack.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Shotstack.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PostGenerate", + methodName: "PostGenerateAsync", + pathTemplate: "\"/edit/v1/generate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Shotstack.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessPostGenerateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PostGenerate", + methodName: "PostGenerateAsync", + pathTemplate: "\"/edit/v1/generate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Shotstack.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Shotstack.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PostGenerate", + methodName: "PostGenerateAsync", + pathTemplate: "\"/edit/v1/generate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessPostGenerateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Shotstack.GenerationResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Shotstack.GenerationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Shotstack.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Shotstack.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate Asset
+ /// Generate a single image, video or audio asset from a text prompt without
+ /// rendering a full edit. Submit a prompt-bearing asset; the response is
+ /// immediate when an identical asset has been generated before (results are
+ /// cached by prompt, model and options), otherwise the job is queued and can
+ /// be polled via the status endpoint.
+ /// Generation is billed in credits per asset. Identical repeat requests
+ /// resolve from the cache at no charge.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task PostGenerateAsync( + global::Shotstack.OneOf asset, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Shotstack.PostGenerateRequest + { + Asset = asset, + }; + + return await PostGenerateAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.IEditClient.GetGenerate.g.cs b/src/libs/Shotstack/Generated/Shotstack.IEditClient.GetGenerate.g.cs new file mode 100644 index 0000000..f89429e --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.IEditClient.GetGenerate.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace Shotstack +{ + public partial interface IEditClient + { + /// + /// Get Generation Status
+ /// Get the status of an on-demand asset generation job created with the
+ /// generate endpoint. Jobs are owner-scoped.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GetGenerateAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Generation Status
+ /// Get the status of an on-demand asset generation job created with the
+ /// generate endpoint. Jobs are owner-scoped.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetGenerateAsResponseAsync( + string id, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostGenerate.g.cs b/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostGenerate.g.cs new file mode 100644 index 0000000..96e966f --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostGenerate.g.cs @@ -0,0 +1,67 @@ +#nullable enable + +namespace Shotstack +{ + public partial interface IEditClient + { + /// + /// Generate Asset
+ /// Generate a single image, video or audio asset from a text prompt without
+ /// rendering a full edit. Submit a prompt-bearing asset; the response is
+ /// immediate when an identical asset has been generated before (results are
+ /// cached by prompt, model and options), otherwise the job is queued and can
+ /// be polled via the status endpoint.
+ /// Generation is billed in credits per asset. Identical repeat requests
+ /// resolve from the cache at no charge.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task PostGenerateAsync( + + global::Shotstack.PostGenerateRequest request, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate Asset
+ /// Generate a single image, video or audio asset from a text prompt without
+ /// rendering a full edit. Submit a prompt-bearing asset; the response is
+ /// immediate when an identical asset has been generated before (results are
+ /// cached by prompt, model and options), otherwise the job is queued and can
+ /// be polled via the status endpoint.
+ /// Generation is billed in credits per asset. Identical repeat requests
+ /// resolve from the cache at no charge.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PostGenerateAsResponseAsync( + + global::Shotstack.PostGenerateRequest request, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate Asset
+ /// Generate a single image, video or audio asset from a text prompt without
+ /// rendering a full edit. Submit a prompt-bearing asset; the response is
+ /// immediate when an identical asset has been generated before (results are
+ /// cached by prompt, model and options), otherwise the job is queued and can
+ /// be polled via the status endpoint.
+ /// Generation is billed in credits per asset. Identical repeat requests
+ /// resolve from the cache at no charge.
+ /// **Base URL:** <a href="#">https://api.shotstack.io/edit/{version}</a> + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task PostGenerateAsync( + global::Shotstack.OneOf asset, + global::Shotstack.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.ImageAssetAspectRatio.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationResponseStatus.g.cs similarity index 67% rename from src/libs/Shotstack/Generated/Shotstack.JsonConverters.ImageAssetAspectRatio.g.cs rename to src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationResponseStatus.g.cs index 6bbe9d8..696d9d6 100644 --- a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.ImageAssetAspectRatio.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationResponseStatus.g.cs @@ -3,10 +3,10 @@ namespace Shotstack.JsonConverters { /// - public sealed class ImageAssetAspectRatioJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class GenerationResponseStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Shotstack.ImageAssetAspectRatio Read( + public override global::Shotstack.GenerationResponseStatus Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ImageAssetAspectRatioJsonConverter : global::System.Text.Jso var stringValue = reader.GetString(); if (stringValue != null) { - return global::Shotstack.ImageAssetAspectRatioExtensions.ToEnum(stringValue) ?? default; + return global::Shotstack.GenerationResponseStatusExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class ImageAssetAspectRatioJsonConverter : global::System.Text.Jso case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Shotstack.ImageAssetAspectRatio)numValue; + return (global::Shotstack.GenerationResponseStatus)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Shotstack.ImageAssetAspectRatio); + return default(global::Shotstack.GenerationResponseStatus); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class ImageAssetAspectRatioJsonConverter : global::System.Text.Jso /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Shotstack.ImageAssetAspectRatio value, + global::Shotstack.GenerationResponseStatus value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Shotstack.ImageAssetAspectRatioExtensions.ToValueString(value)); + writer.WriteStringValue(global::Shotstack.GenerationResponseStatusExtensions.ToValueString(value)); } } } diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetAspectRatioNullable.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationResponseStatusNullable.g.cs similarity index 68% rename from src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetAspectRatioNullable.g.cs rename to src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationResponseStatusNullable.g.cs index 9594405..c434367 100644 --- a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetAspectRatioNullable.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationResponseStatusNullable.g.cs @@ -3,10 +3,10 @@ namespace Shotstack.JsonConverters { /// - public sealed class VideoAssetAspectRatioNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class GenerationResponseStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Shotstack.VideoAssetAspectRatio? Read( + public override global::Shotstack.GenerationResponseStatus? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class VideoAssetAspectRatioNullableJsonConverter : global::System. var stringValue = reader.GetString(); if (stringValue != null) { - return global::Shotstack.VideoAssetAspectRatioExtensions.ToEnum(stringValue); + return global::Shotstack.GenerationResponseStatusExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class VideoAssetAspectRatioNullableJsonConverter : global::System. case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Shotstack.VideoAssetAspectRatio)numValue; + return (global::Shotstack.GenerationResponseStatus)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Shotstack.VideoAssetAspectRatio?); + return default(global::Shotstack.GenerationResponseStatus?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class VideoAssetAspectRatioNullableJsonConverter : global::System. /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Shotstack.VideoAssetAspectRatio? value, + global::Shotstack.GenerationResponseStatus? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Shotstack.VideoAssetAspectRatioExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Shotstack.GenerationResponseStatusExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.ImageAssetAspectRatioNullable.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.ImageAssetAspectRatioNullable.g.cs deleted file mode 100644 index 7dcda63..0000000 --- a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.ImageAssetAspectRatioNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Shotstack.JsonConverters -{ - /// - public sealed class ImageAssetAspectRatioNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Shotstack.ImageAssetAspectRatio? 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.ImageAssetAspectRatioExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Shotstack.ImageAssetAspectRatio)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Shotstack.ImageAssetAspectRatio?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Shotstack.ImageAssetAspectRatio? 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.ImageAssetAspectRatioExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.ImageAssetResolution.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.ImageAssetResolution.g.cs deleted file mode 100644 index b6c53c6..0000000 --- a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.ImageAssetResolution.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Shotstack.JsonConverters -{ - /// - public sealed class ImageAssetResolutionJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Shotstack.ImageAssetResolution 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.ImageAssetResolutionExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Shotstack.ImageAssetResolution)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Shotstack.ImageAssetResolution); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Shotstack.ImageAssetResolution value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Shotstack.ImageAssetResolutionExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.ImageAssetResolutionNullable.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.ImageAssetResolutionNullable.g.cs deleted file mode 100644 index fbf2b59..0000000 --- a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.ImageAssetResolutionNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Shotstack.JsonConverters -{ - /// - public sealed class ImageAssetResolutionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Shotstack.ImageAssetResolution? 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.ImageAssetResolutionExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Shotstack.ImageAssetResolution)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Shotstack.ImageAssetResolution?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Shotstack.ImageAssetResolution? 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.ImageAssetResolutionExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.OneOf3.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.OneOf3.g.cs new file mode 100644 index 0000000..8fc19ea --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.OneOf3.g.cs @@ -0,0 +1,216 @@ +#nullable enable + +namespace Shotstack.JsonConverters +{ + /// + public class OneOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> + { + /// + public override global::Shotstack.OneOf Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + } + } + + var __score0 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T1), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score0++; + } + } + } + var __score1 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T2), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score1++; + } + } + } + var __score2 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T3), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score2++; + } + } + } + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; } + + T1? value1 = default; + T2? value2 = default; + T3? value3 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 1) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 2) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (value1 == null && value2 == null && value3 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::Shotstack.OneOf( + value1, + + value2, + + value3 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Shotstack.OneOf value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsValue1) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1!, typeInfo); + } + else if (value.IsValue2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2!, typeInfo); + } + else if (value.IsValue3) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value3!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetAspectRatio.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetAspectRatio.g.cs deleted file mode 100644 index 6825f47..0000000 --- a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetAspectRatio.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Shotstack.JsonConverters -{ - /// - public sealed class VideoAssetAspectRatioJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Shotstack.VideoAssetAspectRatio 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.VideoAssetAspectRatioExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Shotstack.VideoAssetAspectRatio)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Shotstack.VideoAssetAspectRatio); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Shotstack.VideoAssetAspectRatio value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Shotstack.VideoAssetAspectRatioExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetDuration.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetDuration.g.cs deleted file mode 100644 index ea8fba5..0000000 --- a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetDuration.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Shotstack.JsonConverters -{ - /// - public sealed class VideoAssetDurationJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Shotstack.VideoAssetDuration 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.VideoAssetDurationExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Shotstack.VideoAssetDuration)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Shotstack.VideoAssetDuration); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Shotstack.VideoAssetDuration value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Shotstack.VideoAssetDurationExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetDurationNullable.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetDurationNullable.g.cs deleted file mode 100644 index d04851e..0000000 --- a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetDurationNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Shotstack.JsonConverters -{ - /// - public sealed class VideoAssetDurationNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Shotstack.VideoAssetDuration? 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.VideoAssetDurationExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Shotstack.VideoAssetDuration)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Shotstack.VideoAssetDuration?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Shotstack.VideoAssetDuration? 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.VideoAssetDurationExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetResolution.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetResolution.g.cs deleted file mode 100644 index 252af35..0000000 --- a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetResolution.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Shotstack.JsonConverters -{ - /// - public sealed class VideoAssetResolutionJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Shotstack.VideoAssetResolution 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.VideoAssetResolutionExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Shotstack.VideoAssetResolution)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Shotstack.VideoAssetResolution); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Shotstack.VideoAssetResolution value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Shotstack.VideoAssetResolutionExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetResolutionNullable.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetResolutionNullable.g.cs deleted file mode 100644 index 6f3edd0..0000000 --- a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.VideoAssetResolutionNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Shotstack.JsonConverters -{ - /// - public sealed class VideoAssetResolutionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Shotstack.VideoAssetResolution? 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.VideoAssetResolutionExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Shotstack.VideoAssetResolution)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Shotstack.VideoAssetResolution?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Shotstack.VideoAssetResolution? 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.VideoAssetResolutionExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContext.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContext.g.cs index 1c770be..ef333d9 100644 --- a/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContext.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContext.g.cs @@ -49,18 +49,6 @@ namespace Shotstack typeof(global::Shotstack.JsonConverters.VideoAssetTypeNullableJsonConverter), - typeof(global::Shotstack.JsonConverters.VideoAssetResolutionJsonConverter), - - typeof(global::Shotstack.JsonConverters.VideoAssetResolutionNullableJsonConverter), - - typeof(global::Shotstack.JsonConverters.VideoAssetDurationJsonConverter), - - typeof(global::Shotstack.JsonConverters.VideoAssetDurationNullableJsonConverter), - - typeof(global::Shotstack.JsonConverters.VideoAssetAspectRatioJsonConverter), - - typeof(global::Shotstack.JsonConverters.VideoAssetAspectRatioNullableJsonConverter), - typeof(global::Shotstack.JsonConverters.VideoAssetVolumeEffectJsonConverter), typeof(global::Shotstack.JsonConverters.VideoAssetVolumeEffectNullableJsonConverter), @@ -69,14 +57,6 @@ namespace Shotstack typeof(global::Shotstack.JsonConverters.ImageAssetTypeNullableJsonConverter), - typeof(global::Shotstack.JsonConverters.ImageAssetResolutionJsonConverter), - - typeof(global::Shotstack.JsonConverters.ImageAssetResolutionNullableJsonConverter), - - typeof(global::Shotstack.JsonConverters.ImageAssetAspectRatioJsonConverter), - - typeof(global::Shotstack.JsonConverters.ImageAssetAspectRatioNullableJsonConverter), - typeof(global::Shotstack.JsonConverters.TextAssetTypeJsonConverter), typeof(global::Shotstack.JsonConverters.TextAssetTypeNullableJsonConverter), @@ -333,6 +313,10 @@ namespace Shotstack typeof(global::Shotstack.JsonConverters.TiktokDestinationOptionsPrivacyLevelNullableJsonConverter), + typeof(global::Shotstack.JsonConverters.GenerationResponseStatusJsonConverter), + + typeof(global::Shotstack.JsonConverters.GenerationResponseStatusNullableJsonConverter), + typeof(global::Shotstack.JsonConverters.AssetJsonConverter), typeof(global::Shotstack.JsonConverters.DestinationsJsonConverter), @@ -371,6 +355,8 @@ namespace Shotstack typeof(global::Shotstack.JsonConverters.OneOfJsonConverter>), + typeof(global::Shotstack.JsonConverters.OneOfJsonConverter), + typeof(global::Shotstack.JsonConverters.UnixTimestampJsonConverter), })] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.JsonSerializerContextTypes))] @@ -425,15 +411,11 @@ namespace Shotstack [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.AssetDiscriminator))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.AssetDiscriminatorType), TypeInfoPropertyName = "AssetDiscriminatorType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.VideoAssetType), TypeInfoPropertyName = "VideoAssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.VideoAssetResolution), TypeInfoPropertyName = "VideoAssetResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.VideoAssetDuration), TypeInfoPropertyName = "VideoAssetDuration2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.VideoAssetAspectRatio), TypeInfoPropertyName = "VideoAssetAspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.VideoAssetVolumeEffect), TypeInfoPropertyName = "VideoAssetVolumeEffect2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.Crop))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.ChromaKey))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.ImageAssetType), TypeInfoPropertyName = "ImageAssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.ImageAssetResolution), TypeInfoPropertyName = "ImageAssetResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.ImageAssetAspectRatio), TypeInfoPropertyName = "ImageAssetAspectRatio2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.TextAssetType), TypeInfoPropertyName = "TextAssetType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.TextFont))] @@ -472,7 +454,6 @@ namespace Shotstack [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.RichCaptionActive))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.RichCaptionAnimation))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.RichCaptionActiveFont))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.RichCaptionActiveFontTextDecoration), TypeInfoPropertyName = "RichCaptionActiveFontTextDecoration2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.OneOf), TypeInfoPropertyName = "OneOfRichTextStrokeRichCaptionActiveStroke2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.RichCaptionActiveStroke), TypeInfoPropertyName = "RichCaptionActiveStroke2")] @@ -613,6 +594,10 @@ 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.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))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContextTypes.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContextTypes.g.cs index 9fe7ec9..c6a262c 100644 --- a/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContextTypes.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContextTypes.g.cs @@ -232,755 +232,751 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Shotstack.VideoAssetResolution? Type51 { get; set; } + public object? Type51 { get; set; } /// /// /// - public global::Shotstack.VideoAssetDuration? Type52 { get; set; } + public global::Shotstack.VideoAssetVolumeEffect? Type52 { get; set; } /// /// /// - public global::Shotstack.VideoAssetAspectRatio? Type53 { get; set; } + public global::Shotstack.Crop? Type53 { get; set; } /// /// /// - public global::Shotstack.VideoAssetVolumeEffect? Type54 { get; set; } + public global::Shotstack.ChromaKey? Type54 { get; set; } /// /// /// - public global::Shotstack.Crop? Type55 { get; set; } + public global::Shotstack.ImageAssetType? Type55 { get; set; } /// /// /// - public global::Shotstack.ChromaKey? Type56 { get; set; } + public global::Shotstack.TextAssetType? Type56 { get; set; } /// /// /// - public global::Shotstack.ImageAssetType? Type57 { get; set; } + public int? Type57 { get; set; } /// /// /// - public global::Shotstack.ImageAssetResolution? Type58 { get; set; } + public global::Shotstack.TextFont? Type58 { get; set; } /// /// /// - public global::Shotstack.ImageAssetAspectRatio? Type59 { get; set; } + public global::Shotstack.TextBackground? Type59 { get; set; } /// /// /// - public global::Shotstack.TextAssetType? Type60 { get; set; } + public global::Shotstack.TextAlignment? Type60 { get; set; } /// /// /// - public int? Type61 { get; set; } + public global::Shotstack.TextStroke? Type61 { get; set; } /// /// /// - public global::Shotstack.TextFont? Type62 { get; set; } + public global::Shotstack.TextAnimation? Type62 { get; set; } /// /// /// - public global::Shotstack.TextBackground? Type63 { get; set; } + public global::Shotstack.RichTextAssetType? Type63 { get; set; } /// /// /// - public global::Shotstack.TextAlignment? Type64 { get; set; } + public global::Shotstack.RichTextFont? Type64 { get; set; } /// /// /// - public global::Shotstack.TextStroke? Type65 { get; set; } + public global::Shotstack.RichTextStyle? Type65 { get; set; } /// /// /// - public global::Shotstack.TextAnimation? Type66 { get; set; } + public global::Shotstack.RichTextStroke? Type66 { get; set; } /// /// /// - public global::Shotstack.RichTextAssetType? Type67 { get; set; } + public global::Shotstack.RichTextShadow? Type67 { get; set; } /// /// /// - public global::Shotstack.RichTextFont? Type68 { get; set; } + public global::Shotstack.RichTextBackground? Type68 { get; set; } /// /// /// - public global::Shotstack.RichTextStyle? Type69 { get; set; } + public global::Shotstack.RichTextBorder? Type69 { get; set; } /// /// /// - public global::Shotstack.RichTextStroke? Type70 { get; set; } + public global::Shotstack.OneOf? Type70 { get; set; } /// /// /// - public global::Shotstack.RichTextShadow? Type71 { get; set; } + public global::Shotstack.RichTextPadding? Type71 { get; set; } /// /// /// - public global::Shotstack.RichTextBackground? Type72 { get; set; } + public global::Shotstack.RichTextAlignment? Type72 { get; set; } /// /// /// - public global::Shotstack.RichTextBorder? Type73 { get; set; } + public global::Shotstack.RichTextAnimation? Type73 { get; set; } /// /// /// - public global::Shotstack.OneOf? Type74 { get; set; } + public global::Shotstack.AudioAssetType? Type74 { get; set; } /// /// /// - public global::Shotstack.RichTextPadding? Type75 { get; set; } + public global::Shotstack.AudioAssetEffect? Type75 { get; set; } /// /// /// - public global::Shotstack.RichTextAlignment? Type76 { get; set; } + public global::Shotstack.ShapeAssetType? Type76 { get; set; } /// /// /// - public global::Shotstack.RichTextAnimation? Type77 { get; set; } + public global::Shotstack.ShapeAssetShape? Type77 { get; set; } /// /// /// - public global::Shotstack.AudioAssetType? Type78 { get; set; } + public global::Shotstack.ShapeAssetFill? Type78 { get; set; } /// /// /// - public global::Shotstack.AudioAssetEffect? Type79 { get; set; } + public global::Shotstack.ShapeAssetStroke? Type79 { get; set; } /// /// /// - public global::Shotstack.ShapeAssetType? Type80 { get; set; } + public global::Shotstack.ShapeAssetRectangle? Type80 { get; set; } /// /// /// - public global::Shotstack.ShapeAssetShape? Type81 { get; set; } + public global::Shotstack.ShapeAssetCircle? Type81 { get; set; } /// /// /// - public global::Shotstack.ShapeAssetFill? Type82 { get; set; } + public global::Shotstack.ShapeAssetLine? Type82 { get; set; } /// /// /// - public global::Shotstack.ShapeAssetStroke? Type83 { get; set; } + public global::Shotstack.LumaAssetType? Type83 { get; set; } /// /// /// - public global::Shotstack.ShapeAssetRectangle? Type84 { get; set; } + public global::Shotstack.CaptionAssetType? Type84 { get; set; } /// /// /// - public global::Shotstack.ShapeAssetCircle? Type85 { get; set; } + public global::Shotstack.CaptionFont? Type85 { get; set; } /// /// /// - public global::Shotstack.ShapeAssetLine? Type86 { get; set; } + public global::Shotstack.CaptionBackground? Type86 { get; set; } /// /// /// - public global::Shotstack.LumaAssetType? Type87 { get; set; } + public global::Shotstack.CaptionMargin? Type87 { get; set; } /// /// /// - public global::Shotstack.CaptionAssetType? Type88 { get; set; } + public global::Shotstack.RichCaptionAssetType? Type88 { get; set; } /// /// /// - public global::Shotstack.CaptionFont? Type89 { get; set; } + public global::Shotstack.RichCaptionFont? Type89 { get; set; } /// /// /// - public global::Shotstack.CaptionBackground? Type90 { get; set; } + public global::Shotstack.RichCaptionStyle? Type90 { get; set; } /// /// /// - public global::Shotstack.CaptionMargin? Type91 { get; set; } + public global::Shotstack.RichCaptionActive? Type91 { get; set; } /// /// /// - public global::Shotstack.RichCaptionAssetType? Type92 { get; set; } + public global::Shotstack.RichCaptionAnimation? Type92 { get; set; } /// /// /// - public global::Shotstack.RichCaptionFont? Type93 { get; set; } + public global::Shotstack.RichCaptionActiveFont? Type93 { get; set; } /// /// /// - public global::Shotstack.RichCaptionStyle? Type94 { get; set; } + public global::Shotstack.RichCaptionActiveFontTextDecoration? Type94 { get; set; } /// /// /// - public global::Shotstack.RichCaptionActive? Type95 { get; set; } + public global::Shotstack.OneOf? Type95 { get; set; } /// /// /// - public global::Shotstack.RichCaptionAnimation? Type96 { get; set; } + public global::Shotstack.RichCaptionActiveStroke? Type96 { get; set; } /// /// /// - public global::Shotstack.RichCaptionActiveFont? Type97 { get; set; } + public global::Shotstack.OneOf? Type97 { get; set; } /// /// /// - public object? Type98 { get; set; } + public global::Shotstack.RichCaptionActiveShadow? Type98 { get; set; } /// /// /// - public global::Shotstack.RichCaptionActiveFontTextDecoration? Type99 { get; set; } + public global::Shotstack.RichCaptionAnimationStyle? Type99 { get; set; } /// /// /// - public global::Shotstack.OneOf? Type100 { get; set; } + public global::Shotstack.RichCaptionAnimationDirection? Type100 { get; set; } /// /// /// - public global::Shotstack.RichCaptionActiveStroke? Type101 { get; set; } + public global::Shotstack.TextToImageAssetType? Type101 { get; set; } /// /// /// - public global::Shotstack.OneOf? Type102 { get; set; } + public global::Shotstack.ImageToVideoAssetType? Type102 { get; set; } /// /// /// - public global::Shotstack.RichCaptionActiveShadow? Type103 { get; set; } + public global::Shotstack.ImageToVideoAssetAspectRatio? Type103 { get; set; } /// /// /// - public global::Shotstack.RichCaptionAnimationStyle? Type104 { get; set; } + public global::Shotstack.TextToSpeechAssetType? Type104 { get; set; } /// /// /// - public global::Shotstack.RichCaptionAnimationDirection? Type105 { get; set; } + public global::Shotstack.TextToSpeechAssetEffect? Type105 { get; set; } /// /// /// - public global::Shotstack.TextToImageAssetType? Type106 { get; set; } + public global::Shotstack.HtmlAssetType? Type106 { get; set; } /// /// /// - public global::Shotstack.ImageToVideoAssetType? Type107 { get; set; } + public global::Shotstack.HtmlAssetPosition? Type107 { get; set; } /// /// /// - public global::Shotstack.ImageToVideoAssetAspectRatio? Type108 { get; set; } + public global::Shotstack.Html5AssetType? Type108 { get; set; } /// /// /// - public global::Shotstack.TextToSpeechAssetType? Type109 { get; set; } + public global::Shotstack.TitleAssetType? Type109 { get; set; } /// /// /// - public global::Shotstack.TextToSpeechAssetEffect? Type110 { get; set; } + public global::Shotstack.TitleAssetStyle? Type110 { get; set; } /// /// /// - public global::Shotstack.HtmlAssetType? Type111 { get; set; } + public global::Shotstack.TitleAssetSize? Type111 { get; set; } /// /// /// - public global::Shotstack.HtmlAssetPosition? Type112 { get; set; } + public global::Shotstack.TitleAssetPosition? Type112 { get; set; } /// /// /// - public global::Shotstack.Html5AssetType? Type113 { get; set; } + public global::Shotstack.SvgAssetType? Type113 { get; set; } /// /// /// - public global::Shotstack.TitleAssetType? Type114 { get; set; } + public global::Shotstack.TransitionIn? Type114 { get; set; } /// /// /// - public global::Shotstack.TitleAssetStyle? Type115 { get; set; } + public global::Shotstack.TransitionOut? Type115 { get; set; } /// /// /// - public global::Shotstack.TitleAssetSize? Type116 { get; set; } + public global::Shotstack.RotateTransformation? Type116 { get; set; } /// /// /// - public global::Shotstack.TitleAssetPosition? Type117 { get; set; } + public global::Shotstack.SkewTransformation? Type117 { get; set; } /// /// /// - public global::Shotstack.SvgAssetType? Type118 { get; set; } + public global::Shotstack.FlipTransformation? Type118 { get; set; } /// /// /// - public global::Shotstack.TransitionIn? Type119 { get; set; } + public global::Shotstack.TextAlignmentHorizontal? Type119 { get; set; } /// /// /// - public global::Shotstack.TransitionOut? Type120 { get; set; } + public global::Shotstack.TextAlignmentVertical? Type120 { get; set; } /// /// /// - public global::Shotstack.RotateTransformation? Type121 { get; set; } + public global::Shotstack.RichTextStyleTextTransform? Type121 { get; set; } /// /// /// - public global::Shotstack.SkewTransformation? Type122 { get; set; } + public global::Shotstack.RichTextStyleTextDecoration? Type122 { get; set; } /// /// /// - public global::Shotstack.FlipTransformation? Type123 { get; set; } + public global::Shotstack.RichTextGradient? Type123 { get; set; } /// /// /// - public global::Shotstack.TextAlignmentHorizontal? Type124 { get; set; } + public global::Shotstack.RichTextGradientType? Type124 { get; set; } /// /// /// - public global::Shotstack.TextAlignmentVertical? Type125 { get; set; } + public global::System.Collections.Generic.IList? Type125 { get; set; } /// /// /// - public global::Shotstack.RichTextStyleTextTransform? Type126 { get; set; } + public global::Shotstack.RichTextGradientStop? Type126 { get; set; } /// /// /// - public global::Shotstack.RichTextStyleTextDecoration? Type127 { get; set; } + public global::Shotstack.RichTextAlignmentHorizontal? Type127 { get; set; } /// /// /// - public global::Shotstack.RichTextGradient? Type128 { get; set; } + public global::Shotstack.RichTextAlignmentVertical? Type128 { get; set; } /// /// /// - public global::Shotstack.RichTextGradientType? Type129 { get; set; } + public global::Shotstack.RichTextAnimationPreset? Type129 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type130 { get; set; } + public global::Shotstack.RichTextAnimationStyle? Type130 { get; set; } /// /// /// - public global::Shotstack.RichTextGradientStop? Type131 { get; set; } + public global::Shotstack.RichTextAnimationDirection? Type131 { get; set; } /// /// /// - public global::Shotstack.RichTextAlignmentHorizontal? Type132 { get; set; } + public global::Shotstack.TweenInterpolation? Type132 { get; set; } /// /// /// - public global::Shotstack.RichTextAlignmentVertical? Type133 { get; set; } + public global::Shotstack.TweenEasing? Type133 { get; set; } /// /// /// - public global::Shotstack.RichTextAnimationPreset? Type134 { get; set; } + public global::Shotstack.OutputFormat? Type134 { get; set; } /// /// /// - public global::Shotstack.RichTextAnimationStyle? Type135 { get; set; } + public global::Shotstack.OutputResolution? Type135 { get; set; } /// /// /// - public global::Shotstack.RichTextAnimationDirection? Type136 { get; set; } + public global::Shotstack.OutputAspectRatio? Type136 { get; set; } /// /// /// - public global::Shotstack.TweenInterpolation? Type137 { get; set; } + public global::Shotstack.Size? Type137 { get; set; } /// /// /// - public global::Shotstack.TweenEasing? Type138 { get; set; } + public global::Shotstack.OutputScaleTo? Type138 { get; set; } /// /// /// - public global::Shotstack.OutputFormat? Type139 { get; set; } + public global::Shotstack.OutputQuality? Type139 { get; set; } /// /// /// - public global::Shotstack.OutputResolution? Type140 { get; set; } + public global::Shotstack.Range? Type140 { get; set; } /// /// /// - public global::Shotstack.OutputAspectRatio? Type141 { get; set; } + public global::Shotstack.Poster? Type141 { get; set; } /// /// /// - public global::Shotstack.Size? Type142 { get; set; } + public global::Shotstack.Thumbnail? Type142 { get; set; } /// /// /// - public global::Shotstack.OutputScaleTo? Type143 { get; set; } + public global::System.Collections.Generic.IList? Type143 { get; set; } /// /// /// - public global::Shotstack.OutputQuality? Type144 { get; set; } + public global::Shotstack.Destinations? Type144 { get; set; } /// /// /// - public global::Shotstack.Range? Type145 { get; set; } + public global::Shotstack.ShotstackDestination? Type145 { get; set; } /// /// /// - public global::Shotstack.Poster? Type146 { get; set; } + public global::Shotstack.MuxDestination? Type146 { get; set; } /// /// /// - public global::Shotstack.Thumbnail? Type147 { get; set; } + public global::Shotstack.S3Destination? Type147 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type148 { get; set; } + public global::Shotstack.GoogleCloudStorageDestination? Type148 { get; set; } /// /// /// - public global::Shotstack.Destinations? Type149 { get; set; } + public global::Shotstack.GoogleDriveDestination? Type149 { get; set; } /// /// /// - public global::Shotstack.ShotstackDestination? Type150 { get; set; } + public global::Shotstack.VimeoDestination? Type150 { get; set; } /// /// /// - public global::Shotstack.MuxDestination? Type151 { get; set; } + public global::Shotstack.TiktokDestination? Type151 { get; set; } /// /// /// - public global::Shotstack.S3Destination? Type152 { get; set; } + public global::Shotstack.AkamaiNetStorageDestination? Type152 { get; set; } /// /// /// - public global::Shotstack.GoogleCloudStorageDestination? Type153 { get; set; } + public global::Shotstack.AzureBlobStorageDestination? Type153 { get; set; } /// /// /// - public global::Shotstack.GoogleDriveDestination? Type154 { get; set; } + public global::Shotstack.DestinationsDiscriminator? Type154 { get; set; } /// /// /// - public global::Shotstack.VimeoDestination? Type155 { get; set; } + public global::Shotstack.MuxDestinationOptions? Type155 { get; set; } /// /// /// - public global::Shotstack.TiktokDestination? Type156 { get; set; } + public global::System.Collections.Generic.IList? Type156 { get; set; } /// /// /// - public global::Shotstack.AkamaiNetStorageDestination? Type157 { get; set; } + public global::Shotstack.MuxDestinationOptionsPlaybackPolicyItem? Type157 { get; set; } /// /// /// - public global::Shotstack.AzureBlobStorageDestination? Type158 { get; set; } + public global::Shotstack.S3DestinationOptions? Type158 { get; set; } /// /// /// - public global::Shotstack.DestinationsDiscriminator? Type159 { get; set; } + public global::Shotstack.GoogleCloudStorageDestinationOptions? Type159 { get; set; } /// /// /// - public global::Shotstack.MuxDestinationOptions? Type160 { get; set; } + public global::Shotstack.GoogleDriveDestinationOptions? Type160 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type161 { get; set; } + public global::Shotstack.VimeoDestinationOptions? Type161 { get; set; } /// /// /// - public global::Shotstack.MuxDestinationOptionsPlaybackPolicyItem? Type162 { get; set; } + public global::Shotstack.VimeoDestinationPrivacyOptions? Type162 { get; set; } /// /// /// - public global::Shotstack.S3DestinationOptions? Type163 { get; set; } + public global::Shotstack.VimeoDestinationPrivacyOptionsView? Type163 { get; set; } /// /// /// - public global::Shotstack.GoogleCloudStorageDestinationOptions? Type164 { get; set; } + public global::Shotstack.VimeoDestinationPrivacyOptionsEmbed? Type164 { get; set; } /// /// /// - public global::Shotstack.GoogleDriveDestinationOptions? Type165 { get; set; } + public global::Shotstack.VimeoDestinationPrivacyOptionsComments? Type165 { get; set; } /// /// /// - public global::Shotstack.VimeoDestinationOptions? Type166 { get; set; } + public global::Shotstack.Template? Type166 { get; set; } /// /// /// - public global::Shotstack.VimeoDestinationPrivacyOptions? Type167 { get; set; } + public global::Shotstack.TemplateRender? Type167 { get; set; } /// /// /// - public global::Shotstack.VimeoDestinationPrivacyOptionsView? Type168 { get; set; } + public global::Shotstack.Source? Type168 { get; set; } /// /// /// - public global::Shotstack.VimeoDestinationPrivacyOptionsEmbed? Type169 { get; set; } + public global::Shotstack.Outputs? Type169 { get; set; } /// /// /// - public global::Shotstack.VimeoDestinationPrivacyOptionsComments? Type170 { get; set; } + public global::System.Collections.Generic.IList? Type170 { get; set; } /// /// /// - public global::Shotstack.Template? Type171 { get; set; } + public global::Shotstack.Rendition? Type171 { get; set; } /// /// /// - public global::Shotstack.TemplateRender? Type172 { get; set; } + public global::Shotstack.Transcription? Type172 { get; set; } /// /// /// - public global::Shotstack.Source? Type173 { get; set; } + public global::Shotstack.RenditionFormat? Type173 { get; set; } /// /// /// - public global::Shotstack.Outputs? Type174 { get; set; } + public global::Shotstack.RenditionFit? Type174 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type175 { get; set; } + public global::Shotstack.RenditionResolution? Type175 { get; set; } /// /// /// - public global::Shotstack.Rendition? Type176 { get; set; } + public global::Shotstack.Speed? Type176 { get; set; } /// /// /// - public global::Shotstack.Transcription? Type177 { get; set; } + public global::Shotstack.Enhancements? Type177 { get; set; } /// /// /// - public global::Shotstack.RenditionFormat? Type178 { get; set; } + public global::Shotstack.TranscriptionFormat? Type178 { get; set; } /// /// /// - public global::Shotstack.RenditionFit? Type179 { get; set; } + public global::Shotstack.AudioEnhancement? Type179 { get; set; } /// /// /// - public global::Shotstack.RenditionResolution? Type180 { get; set; } + public global::Shotstack.DolbyEnhancement? Type180 { get; set; } /// /// /// - public global::Shotstack.Speed? Type181 { get; set; } + public global::Shotstack.AudioEnhancementDiscriminator? Type181 { get; set; } /// /// /// - public global::Shotstack.Enhancements? Type182 { get; set; } + public global::Shotstack.DolbyEnhancementOptions? Type182 { get; set; } /// /// /// - public global::Shotstack.TranscriptionFormat? Type183 { get; set; } + public global::Shotstack.DolbyEnhancementOptionsPreset? Type183 { get; set; } /// /// /// - public global::Shotstack.AudioEnhancement? Type184 { get; set; } + public global::Shotstack.Transfer? Type184 { get; set; } /// /// /// - public global::Shotstack.DolbyEnhancement? Type185 { get; set; } + public global::Shotstack.QueuedResponse? Type185 { get; set; } /// /// /// - public global::Shotstack.AudioEnhancementDiscriminator? Type186 { get; set; } + public global::Shotstack.QueuedResponseData? Type186 { get; set; } /// /// /// - public global::Shotstack.DolbyEnhancementOptions? Type187 { get; set; } + public global::Shotstack.RenderResponse? Type187 { get; set; } /// /// /// - public global::Shotstack.DolbyEnhancementOptionsPreset? Type188 { get; set; } + public global::Shotstack.RenderResponseData? Type188 { get; set; } /// /// /// - public global::Shotstack.Transfer? Type189 { get; set; } + public global::Shotstack.RenderResponseDataStatus? Type189 { get; set; } /// /// /// - public global::Shotstack.QueuedResponse? Type190 { get; set; } + public global::Shotstack.TemplateResponse? Type190 { get; set; } /// /// /// - public global::Shotstack.QueuedResponseData? Type191 { get; set; } + public global::Shotstack.TemplateResponseData? Type191 { get; set; } /// /// /// - public global::Shotstack.RenderResponse? Type192 { get; set; } + public global::Shotstack.TemplateDataResponse? Type192 { get; set; } /// /// /// - public global::Shotstack.RenderResponseData? Type193 { get; set; } + public global::Shotstack.TemplateDataResponseData? Type193 { get; set; } /// /// /// - public global::Shotstack.RenderResponseDataStatus? Type194 { get; set; } + public global::Shotstack.TemplateListResponse? Type194 { get; set; } /// /// /// - public global::Shotstack.TemplateResponse? Type195 { get; set; } + public global::Shotstack.TemplateListResponseData? Type195 { get; set; } /// /// /// - public global::Shotstack.TemplateResponseData? Type196 { get; set; } + public global::System.Collections.Generic.IList? Type196 { get; set; } /// /// /// - public global::Shotstack.TemplateDataResponse? Type197 { get; set; } + public global::Shotstack.TemplateListResponseItem? Type197 { get; set; } /// /// /// - public global::Shotstack.TemplateDataResponseData? Type198 { get; set; } + public global::Shotstack.ProbeResponse? Type198 { get; set; } /// /// /// - public global::Shotstack.TemplateListResponse? Type199 { get; set; } + public global::Shotstack.AssetResponse? Type199 { get; set; } /// /// /// - public global::Shotstack.TemplateListResponseData? Type200 { get; set; } + public global::Shotstack.AssetResponseData? Type200 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type201 { get; set; } + public global::Shotstack.AssetRenderResponse? Type201 { get; set; } /// /// /// - public global::Shotstack.TemplateListResponseItem? Type202 { get; set; } + public global::System.Collections.Generic.IList? Type202 { get; set; } /// /// /// - public global::Shotstack.ProbeResponse? Type203 { get; set; } + public global::Shotstack.AssetResponseAttributes? Type203 { get; set; } /// /// /// - public global::Shotstack.AssetResponse? Type204 { get; set; } + public global::Shotstack.AssetResponseAttributesStatus? Type204 { get; set; } /// /// /// - public global::Shotstack.AssetResponseData? Type205 { get; set; } + public global::Shotstack.TransferResponse? Type205 { get; set; } /// /// /// - public global::Shotstack.AssetRenderResponse? Type206 { get; set; } + public global::Shotstack.TransferResponseData? Type206 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type207 { get; set; } + public global::Shotstack.TransferResponseAttributes? Type207 { get; set; } /// /// /// - public global::Shotstack.AssetResponseAttributes? Type208 { get; set; } + public global::Shotstack.TransferResponseAttributesStatus? Type208 { get; set; } /// /// /// - public global::Shotstack.AssetResponseAttributesStatus? Type209 { get; set; } + public global::Shotstack.QueuedSourceResponse? Type209 { get; set; } /// /// /// - public global::Shotstack.TransferResponse? Type210 { get; set; } + public global::Shotstack.QueuedSourceResponseData? Type210 { get; set; } /// /// /// - public global::Shotstack.TransferResponseData? Type211 { get; set; } + public global::Shotstack.SourceListResponse? Type211 { get; set; } /// /// /// - public global::Shotstack.TransferResponseAttributes? Type212 { get; set; } + public global::System.Collections.Generic.IList? Type212 { get; set; } /// /// /// - public global::Shotstack.TransferResponseAttributesStatus? Type213 { get; set; } + public global::Shotstack.SourceResponseData? Type213 { get; set; } /// /// /// - public global::Shotstack.QueuedSourceResponse? Type214 { get; set; } + public global::Shotstack.SourceResponse? Type214 { get; set; } /// /// /// - public global::Shotstack.QueuedSourceResponseData? Type215 { get; set; } + public global::Shotstack.SourceResponseAttributes? Type215 { get; set; } /// /// /// - public global::Shotstack.SourceListResponse? Type216 { get; set; } + public global::Shotstack.SourceResponseAttributesStatus? Type216 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type217 { get; set; } + public global::Shotstack.OutputsResponse? Type217 { get; set; } /// /// /// - public global::Shotstack.SourceResponseData? Type218 { get; set; } + public global::System.Collections.Generic.IList? Type218 { get; set; } /// /// /// - public global::Shotstack.SourceResponse? Type219 { get; set; } + public global::Shotstack.RenditionResponseAttributes? Type219 { get; set; } /// /// /// - public global::Shotstack.SourceResponseAttributes? Type220 { get; set; } + public global::Shotstack.RenditionResponseAttributesStatus? Type220 { get; set; } /// /// /// - public global::Shotstack.SourceResponseAttributesStatus? Type221 { get; set; } + public global::Shotstack.UploadResponse? Type221 { get; set; } /// /// /// - public global::Shotstack.OutputsResponse? Type222 { get; set; } + public global::Shotstack.UploadResponseData? Type222 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type223 { get; set; } + public global::Shotstack.UploadResponseAttributes? Type223 { get; set; } /// /// /// - public global::Shotstack.RenditionResponseAttributes? Type224 { get; set; } + public global::Shotstack.IngestErrorResponse? Type224 { get; set; } /// /// /// - public global::Shotstack.RenditionResponseAttributesStatus? Type225 { get; set; } + public global::System.Collections.Generic.IList? Type225 { get; set; } /// /// /// - public global::Shotstack.UploadResponse? Type226 { get; set; } + public global::Shotstack.IngestErrorResponseData? Type226 { get; set; } /// /// /// - public global::Shotstack.UploadResponseData? Type227 { get; set; } + public global::Shotstack.TextAnimationPreset? Type227 { get; set; } /// /// /// - public global::Shotstack.UploadResponseAttributes? Type228 { get; set; } + public global::Shotstack.RichCaptionStyleTextTransform? Type228 { get; set; } /// /// /// - public global::Shotstack.IngestErrorResponse? Type229 { get; set; } + public global::Shotstack.RichCaptionStyleTextDecoration? Type229 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type230 { get; set; } + public global::Shotstack.TiktokDestinationOptions? Type230 { get; set; } /// /// /// - public global::Shotstack.IngestErrorResponseData? Type231 { get; set; } + public global::Shotstack.TiktokDestinationOptionsPrivacyLevel? Type231 { get; set; } /// /// /// - public global::Shotstack.TextAnimationPreset? Type232 { get; set; } + public global::Shotstack.AkamaiNetStorageDestinationOptions? Type232 { get; set; } /// /// /// - public global::Shotstack.RichCaptionStyleTextTransform? Type233 { get; set; } + public global::Shotstack.AzureBlobStorageDestinationOptions? Type233 { get; set; } /// /// /// - public global::Shotstack.RichCaptionStyleTextDecoration? Type234 { get; set; } + public global::Shotstack.GenerationResponse? Type234 { get; set; } /// /// /// - public global::Shotstack.TiktokDestinationOptions? Type235 { get; set; } + public global::Shotstack.GenerationResponseStatus? Type235 { get; set; } /// /// /// - public global::Shotstack.TiktokDestinationOptionsPrivacyLevel? Type236 { get; set; } + public global::Shotstack.PostGenerateRequest? Type236 { get; set; } /// /// /// - public global::Shotstack.AkamaiNetStorageDestinationOptions? Type237 { get; set; } - /// - /// - /// - public global::Shotstack.AzureBlobStorageDestinationOptions? Type238 { get; set; } + public global::Shotstack.OneOf? Type237 { get; set; } /// /// diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.Asset.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.Asset.g.cs index 54da7f7..ce84389 100644 --- a/src/libs/Shotstack/Generated/Shotstack.Models.Asset.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.Models.Asset.g.cs @@ -16,13 +16,16 @@ namespace Shotstack /// /// The VideoAsset adds a video to a Clip. The video can be sourced from a URL
- /// (`src`) or generated from a text prompt (`prompt`), optionally from a
- /// starting image (`inputSrc`). Exactly one of `src` or `prompt` must be provided.
+ /// (`src`), generated from a text prompt (`prompt`), or both. At least one of
+ /// `src` or `prompt` must be provided.
/// - **Source URL:** set `src` to the URL of an mp4 (or compatible) video file.
- /// - **Generated:** set `prompt` to describe the motion. Optionally set `inputSrc`
- /// to a starting image URL (image-to-video). Use `model` to choose the generator
- /// (e.g. `luma-ray-3`, `runpod-itv-mini`). The generated `src` is filled in
- /// automatically. + /// - **Generated:** set `prompt` to describe the motion. Choose a generator
+ /// with `model` and configure it with model-specific `options` (including a
+ /// starting image for image-to-video). The generated `src` is filled in
+ /// automatically.
+ /// - **Both:** `src` acts as a preview placeholder while `prompt` drives
+ /// generation — the video is regenerated from the prompt at render time.
+ /// Unchanged prompts and options resolve from the generation cache. ///
#if NET6_0_OR_GREATER public global::Shotstack.VideoAsset? Video { get; init; } @@ -60,11 +63,15 @@ public bool TryPickVideo( /// /// The ImageAsset adds an image to a Clip. The image can be sourced from a URL
- /// (`src`) or generated from a text prompt (`prompt`). Exactly one of `src` or
- /// `prompt` must be provided.
+ /// (`src`), generated from a text prompt (`prompt`), or both. At least one of
+ /// `src` or `prompt` must be provided.
/// - **Source URL:** set `src` to the publicly accessible URL of a jpg or png file.
- /// - **Generated:** set `prompt` to describe the image; the engine generates it
- /// using the provider chosen by `model` and fills `src` in automatically. + /// - **Generated:** set `prompt` to describe the image. Choose a generator with
+ /// `model` and configure it with model-specific `options`; the engine fills
+ /// `src` in automatically.
+ /// - **Both:** `src` acts as a preview placeholder while `prompt` drives
+ /// generation — the image is regenerated from the prompt at render time.
+ /// Unchanged prompts and options resolve from the generation cache. ///
#if NET6_0_OR_GREATER public global::Shotstack.ImageAsset? Image { get; init; } @@ -180,14 +187,18 @@ public bool TryPickRichText( /// /// The AudioAsset adds audio to a Clip. The audio can be sourced from a URL
- /// (`src`) or generated from a text prompt (`prompt`). Exactly one of `src` or
- /// `prompt` must be provided.
+ /// (`src`), generated from a text prompt (`prompt`), or both. At least one of
+ /// `src` or `prompt` must be provided.
/// - **Source URL:** set `src` to a publicly accessible audio URL (e.g. mp3).
- /// - **Generated speech:** set `prompt` to the spoken text and `voice` to a voice
- /// identifier (text-to-speech). Optionally set `language`/`newscaster`.
- /// - **Generated music or SFX:** set `prompt` describing the sound; omit `voice`.
- /// - Use `model` to choose the generator. The generated `src` is filled in
- /// automatically. + /// - **Generated speech:** set `prompt` to the spoken text and choose a
+ /// text-to-speech `model`; set the voice via `options`.
+ /// - **Generated music or SFX:** set `prompt` describing the sound and choose
+ /// a music generation `model`.
+ /// - **Both:** `src` acts as a preview placeholder while `prompt` drives
+ /// generation — the audio is regenerated from the prompt at render time.
+ /// Unchanged prompts and options resolve from the generation cache.
+ /// - Use `model` to choose the generator and `options` to configure it. The
+ /// generated `src` is filled in automatically. ///
#if NET6_0_OR_GREATER public global::Shotstack.AudioAsset? Audio { get; init; } diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.AudioAsset.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.AudioAsset.g.cs index 6df4ba1..7643dc7 100644 --- a/src/libs/Shotstack/Generated/Shotstack.Models.AudioAsset.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.Models.AudioAsset.g.cs @@ -5,14 +5,18 @@ namespace Shotstack { /// /// The AudioAsset adds audio to a Clip. The audio can be sourced from a URL
- /// (`src`) or generated from a text prompt (`prompt`). Exactly one of `src` or
- /// `prompt` must be provided.
+ /// (`src`), generated from a text prompt (`prompt`), or both. At least one of
+ /// `src` or `prompt` must be provided.
/// - **Source URL:** set `src` to a publicly accessible audio URL (e.g. mp3).
- /// - **Generated speech:** set `prompt` to the spoken text and `voice` to a voice
- /// identifier (text-to-speech). Optionally set `language`/`newscaster`.
- /// - **Generated music or SFX:** set `prompt` describing the sound; omit `voice`.
- /// - Use `model` to choose the generator. The generated `src` is filled in
- /// automatically. + /// - **Generated speech:** set `prompt` to the spoken text and choose a
+ /// text-to-speech `model`; set the voice via `options`.
+ /// - **Generated music or SFX:** set `prompt` describing the sound and choose
+ /// a music generation `model`.
+ /// - **Both:** `src` acts as a preview placeholder while `prompt` drives
+ /// generation — the audio is regenerated from the prompt at render time.
+ /// Unchanged prompts and options resolve from the generation cache.
+ /// - Use `model` to choose the generator and `options` to configure it. The
+ /// generated `src` is filled in automatically. ///
public sealed partial class AudioAsset { @@ -26,7 +30,7 @@ public sealed partial class AudioAsset public global::Shotstack.AudioAssetType Type { get; set; } = global::Shotstack.AudioAssetType.Audio; /// - /// The audio source URL. The URL must be publicly accessible or include credentials. Provide either `src` or `prompt`, not both.
+ /// The audio source URL. The URL must be publicly accessible or include credentials. When `prompt` is also set, `src` serves as a preview placeholder and the audio is regenerated from the prompt at render time.
/// Example: https://s3-ap-northeast-1.amazonaws.com/my-bucket/sound.mp3 ///
/// https://s3-ap-northeast-1.amazonaws.com/my-bucket/sound.mp3 @@ -34,7 +38,7 @@ public sealed partial class AudioAsset public string? Src { get; set; } /// - /// A text prompt. When `voice` is set, the prompt is the spoken text (text-to-speech). Without `voice`, the prompt describes generated music or sound effects. The generated `src` is filled in automatically.
+ /// A text prompt. For text-to-speech models the prompt is the spoken text; for music models it describes the sound to generate. The generated `src` is filled in automatically; an existing `src` is treated as a preview placeholder and replaced.
/// Example: Welcome to today's broadcast. ///
/// Welcome to today's broadcast. @@ -42,30 +46,7 @@ public sealed partial class AudioAsset public string? Prompt { get; set; } /// - /// Voice identifier for text-to-speech generation (e.g. `Matthew`, `Joanna`). Only meaningful when `prompt` is set.
- /// Example: Matthew - ///
- /// Matthew - [global::System.Text.Json.Serialization.JsonPropertyName("voice")] - public string? Voice { get; set; } - - /// - /// Optional BCP-47 language code (e.g. `en-US`) for text-to-speech. Only meaningful when `prompt` and `voice` are set.
- /// Example: en-US - ///
- /// en-US - [global::System.Text.Json.Serialization.JsonPropertyName("language")] - public string? Language { get; set; } - - /// - /// Set to `true` to use the voice's newscaster mode when supported. Only meaningful when `prompt` and `voice` are set.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("newscaster")] - public bool? Newscaster { get; set; } - - /// - /// The generation model to use when `prompt` is set (e.g. `polly-neural`, `fal/elevenlabs-tts`, `fal/minimax-speech`, `fal/elevenlabs-music`). Defaults to the platform's preferred generator if omitted.
+ /// The generation model to use when `prompt` is set (e.g. `polly-neural`, `elevenlabs-tts`, `elevenlabs-music`). Defaults to `elevenlabs-tts` (with a default voice) if omitted. Each model's available options are defined by the model registry.
/// Example: polly-neural ///
/// polly-neural @@ -73,25 +54,12 @@ public sealed partial class AudioAsset public string? Model { get; set; } /// - /// Target duration in milliseconds for generated music (3,000–600,000). Only meaningful when `prompt` is set and the model is a music generator (e.g. `fal/elevenlabs-music`).
- /// Example: 30000 - ///
- /// 30000 - [global::System.Text.Json.Serialization.JsonPropertyName("musicLengthMs")] - public double? MusicLengthMs { get; set; } - - /// - /// Set to `true` to force instrumental music (no vocals). Only meaningful for music generation models.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("forceInstrumental")] - public bool? ForceInstrumental { get; set; } - - /// - /// An optional structured composition plan for music generation. Only meaningful for music generation models (e.g. `fal/elevenlabs-music`). + /// Model-specific generation settings. Valid keys and values depend on the chosen `model` and are defined by the model registry. Omitted options use the model's defaults. Unknown or invalid options are rejected.
+ /// Example: {"voice":"Matthew","language":"en-US"} ///
- [global::System.Text.Json.Serialization.JsonPropertyName("compositionPlan")] - public string? CompositionPlan { get; set; } + /// {"voice":"Matthew","language":"en-US"} + [global::System.Text.Json.Serialization.JsonPropertyName("options")] + public object? Options { get; set; } /// /// The start trim point of the audio clip, in seconds (defaults to 0). Audio will start from the in trim point. The audio will play until the file ends or the Clip length is reached. @@ -135,39 +103,20 @@ public sealed partial class AudioAsset /// Initializes a new instance of the class. /// /// - /// The audio source URL. The URL must be publicly accessible or include credentials. Provide either `src` or `prompt`, not both.
+ /// The audio source URL. The URL must be publicly accessible or include credentials. When `prompt` is also set, `src` serves as a preview placeholder and the audio is regenerated from the prompt at render time.
/// Example: https://s3-ap-northeast-1.amazonaws.com/my-bucket/sound.mp3 /// /// - /// A text prompt. When `voice` is set, the prompt is the spoken text (text-to-speech). Without `voice`, the prompt describes generated music or sound effects. The generated `src` is filled in automatically.
+ /// A text prompt. For text-to-speech models the prompt is the spoken text; for music models it describes the sound to generate. The generated `src` is filled in automatically; an existing `src` is treated as a preview placeholder and replaced.
/// Example: Welcome to today's broadcast. /// - /// - /// Voice identifier for text-to-speech generation (e.g. `Matthew`, `Joanna`). Only meaningful when `prompt` is set.
- /// Example: Matthew - /// - /// - /// Optional BCP-47 language code (e.g. `en-US`) for text-to-speech. Only meaningful when `prompt` and `voice` are set.
- /// Example: en-US - /// - /// - /// Set to `true` to use the voice's newscaster mode when supported. Only meaningful when `prompt` and `voice` are set.
- /// Default Value: false - /// /// - /// The generation model to use when `prompt` is set (e.g. `polly-neural`, `fal/elevenlabs-tts`, `fal/minimax-speech`, `fal/elevenlabs-music`). Defaults to the platform's preferred generator if omitted.
+ /// The generation model to use when `prompt` is set (e.g. `polly-neural`, `elevenlabs-tts`, `elevenlabs-music`). Defaults to `elevenlabs-tts` (with a default voice) if omitted. Each model's available options are defined by the model registry.
/// Example: polly-neural /// - /// - /// Target duration in milliseconds for generated music (3,000–600,000). Only meaningful when `prompt` is set and the model is a music generator (e.g. `fal/elevenlabs-music`).
- /// Example: 30000 - /// - /// - /// Set to `true` to force instrumental music (no vocals). Only meaningful for music generation models.
- /// Default Value: false - /// - /// - /// An optional structured composition plan for music generation. Only meaningful for music generation models (e.g. `fal/elevenlabs-music`). + /// + /// Model-specific generation settings. Valid keys and values depend on the chosen `model` and are defined by the model registry. Omitted options use the model's defaults. Unknown or invalid options are rejected.
+ /// Example: {"voice":"Matthew","language":"en-US"} /// /// /// The start trim point of the audio clip, in seconds (defaults to 0). Audio will start from the in trim point. The audio will play until the file ends or the Clip length is reached. @@ -196,13 +145,8 @@ public sealed partial class AudioAsset public AudioAsset( string? src, string? prompt, - string? voice, - string? language, - bool? newscaster, string? model, - double? musicLengthMs, - bool? forceInstrumental, - string? compositionPlan, + object? options, double? trim, global::Shotstack.OneOf>? volume, float? speed, @@ -212,13 +156,8 @@ public AudioAsset( this.Type = type; this.Src = src; this.Prompt = prompt; - this.Voice = voice; - this.Language = language; - this.Newscaster = newscaster; this.Model = model; - this.MusicLengthMs = musicLengthMs; - this.ForceInstrumental = forceInstrumental; - this.CompositionPlan = compositionPlan; + this.Options = options; this.Trim = trim; this.Volume = volume; this.Speed = speed; diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.AudioAssetOptions.Json.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.AudioAssetOptions.Json.g.cs new file mode 100644 index 0000000..ab118ec --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.AudioAssetOptions.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Shotstack +{ + public sealed partial class AudioAssetOptions + { + /// + /// 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.AudioAssetOptions? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Shotstack.AudioAssetOptions), + jsonSerializerContext) as global::Shotstack.AudioAssetOptions; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Shotstack.AudioAssetOptions? 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.AudioAssetOptions? 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.AudioAssetOptions), + jsonSerializerContext).ConfigureAwait(false)) as global::Shotstack.AudioAssetOptions; + } + + /// + /// 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.AudioAssetOptions.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.AudioAssetOptions.g.cs new file mode 100644 index 0000000..9812a82 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.AudioAssetOptions.g.cs @@ -0,0 +1,20 @@ + +#nullable enable + +namespace Shotstack +{ + /// + /// Model-specific generation settings. Valid keys and values depend on the chosen `model` and are defined by the model registry. Omitted options use the model's defaults. Unknown or invalid options are rejected.
+ /// Example: {"voice":"Matthew","language":"en-US"} + ///
+ public sealed partial class AudioAssetOptions + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.GenerationResponse.Json.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationResponse.Json.g.cs new file mode 100644 index 0000000..47a03f5 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Shotstack +{ + public sealed partial class GenerationResponse + { + /// + /// 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.GenerationResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Shotstack.GenerationResponse), + jsonSerializerContext) as global::Shotstack.GenerationResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Shotstack.GenerationResponse? 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.GenerationResponse? 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.GenerationResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Shotstack.GenerationResponse; + } + + /// + /// 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.GenerationResponse.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationResponse.g.cs new file mode 100644 index 0000000..9a4051b --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationResponse.g.cs @@ -0,0 +1,91 @@ + +#nullable enable + +namespace Shotstack +{ + /// + /// The status of an on-demand asset generation job. Completed jobs include the public URL of the generated asset. + /// + public sealed partial class GenerationResponse + { + /// + /// 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.
+ /// Example: 8a1f2c3d-4e5b-5a6c-9d7e-1f2a3b4c5d6e + ///
+ /// 8a1f2c3d-4e5b-5a6c-9d7e-1f2a3b4c5d6e + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// The status of the generation job.
+ /// Example: done + ///
+ /// done + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Shotstack.JsonConverters.GenerationResponseStatusJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Shotstack.GenerationResponseStatus Status { get; set; } + + /// + /// The public URL of the generated asset. Present only when `status` is `done`.
+ /// Example: https://shotstack-api-v1-output.s3-ap-southeast-2.amazonaws.com/owner/8a1f2c3d.png + ///
+ /// https://shotstack-api-v1-output.s3-ap-southeast-2.amazonaws.com/owner/8a1f2c3d.png + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// A human readable error message. Present only when `status` is `failed`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("error")] + public string? 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. + /// + /// + /// 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.
+ /// Example: 8a1f2c3d-4e5b-5a6c-9d7e-1f2a3b4c5d6e + /// + /// + /// The status of the generation job.
+ /// Example: done + /// + /// + /// The public URL of the generated asset. Present only when `status` is `done`.
+ /// Example: https://shotstack-api-v1-output.s3-ap-southeast-2.amazonaws.com/owner/8a1f2c3d.png + /// + /// + /// A human readable error message. Present only when `status` is `failed`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GenerationResponse( + string id, + global::Shotstack.GenerationResponseStatus status, + string? url, + string? error) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Status = status; + this.Url = url; + this.Error = error; + } + + /// + /// Initializes a new instance of the class. + /// + public GenerationResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.GenerationResponseStatus.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationResponseStatus.g.cs new file mode 100644 index 0000000..32ec630 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationResponseStatus.g.cs @@ -0,0 +1,64 @@ + +#nullable enable + +namespace Shotstack +{ + /// + /// The status of the generation job.
+ /// Example: done + ///
+ public enum GenerationResponseStatus + { + /// + /// + /// + Done, + /// + /// + /// + Failed, + /// + /// + /// + Processing, + /// + /// + /// + Queued, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class GenerationResponseStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this GenerationResponseStatus value) + { + return value switch + { + GenerationResponseStatus.Done => "done", + GenerationResponseStatus.Failed => "failed", + GenerationResponseStatus.Processing => "processing", + GenerationResponseStatus.Queued => "queued", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static GenerationResponseStatus? ToEnum(string value) + { + return value switch + { + "done" => GenerationResponseStatus.Done, + "failed" => GenerationResponseStatus.Failed, + "processing" => GenerationResponseStatus.Processing, + "queued" => GenerationResponseStatus.Queued, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.ImageAsset.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.ImageAsset.g.cs index 3909e4c..8946c85 100644 --- a/src/libs/Shotstack/Generated/Shotstack.Models.ImageAsset.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.Models.ImageAsset.g.cs @@ -5,11 +5,15 @@ namespace Shotstack { /// /// The ImageAsset adds an image to a Clip. The image can be sourced from a URL
- /// (`src`) or generated from a text prompt (`prompt`). Exactly one of `src` or
- /// `prompt` must be provided.
+ /// (`src`), generated from a text prompt (`prompt`), or both. At least one of
+ /// `src` or `prompt` must be provided.
/// - **Source URL:** set `src` to the publicly accessible URL of a jpg or png file.
- /// - **Generated:** set `prompt` to describe the image; the engine generates it
- /// using the provider chosen by `model` and fills `src` in automatically. + /// - **Generated:** set `prompt` to describe the image. Choose a generator with
+ /// `model` and configure it with model-specific `options`; the engine fills
+ /// `src` in automatically.
+ /// - **Both:** `src` acts as a preview placeholder while `prompt` drives
+ /// generation — the image is regenerated from the prompt at render time.
+ /// Unchanged prompts and options resolve from the generation cache. ///
public sealed partial class ImageAsset { @@ -23,7 +27,7 @@ public sealed partial class ImageAsset public global::Shotstack.ImageAssetType Type { get; set; } = global::Shotstack.ImageAssetType.Image; /// - /// The image source URL. The URL must be publicly accessible or include credentials. Provide either `src` or `prompt`, not both.
+ /// The image source URL. The URL must be publicly accessible or include credentials. When `prompt` is also set, `src` serves as a preview placeholder and the image is regenerated from the prompt at render time.
/// Example: https://s3-ap-northeast-1.amazonaws.com/my-bucket/image.jpg ///
/// https://s3-ap-northeast-1.amazonaws.com/my-bucket/image.jpg @@ -31,7 +35,7 @@ public sealed partial class ImageAsset public string? Src { get; set; } /// - /// A text prompt to generate the image from. When set without `src`, the engine generates an image and fills `src` automatically. Use `model` to choose the generator.
+ /// A text prompt to generate the image from. The engine generates an image at render time and fills `src` automatically; an existing `src` is treated as a preview placeholder and replaced. Use `model` to choose the generator and `options` to configure it.
/// Example: A serene landscape with a crystal-clear mountain lake at sunrise. ///
/// A serene landscape with a crystal-clear mountain lake at sunrise. @@ -39,7 +43,7 @@ public sealed partial class ImageAsset public string? Prompt { get; set; } /// - /// The generation model to use when `prompt` is set (e.g. `flux-schnell`, `fal/flux-schnell`, `fal/nano-banana-2`). Defaults to the platform's preferred generator if omitted.
+ /// The generation model to use when `prompt` is set (e.g. `flux-schnell`, `nano-banana-2`). Defaults to `nano-banana-2` if omitted. Each model's available options are defined by the model registry.
/// Example: flux-schnell ///
/// flux-schnell @@ -47,22 +51,12 @@ public sealed partial class ImageAsset public string? Model { get; set; } /// - /// Output resolution tier for supported image generation models. `1K` (default), `2K`, or `4K`. Only meaningful when `prompt` is set.
- /// Example: 1K + /// Model-specific generation settings. Valid keys and values depend on the chosen `model` and are defined by the model registry. Omitted options use the model's defaults. Unknown or invalid options are rejected.
+ /// Example: {"resolution":"1K","aspectRatio":"16:9"} ///
- /// 1K - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Shotstack.JsonConverters.ImageAssetResolutionJsonConverter))] - public global::Shotstack.ImageAssetResolution? Resolution { get; set; } - - /// - /// Aspect ratio for the generated image. Only meaningful when `prompt` is set and the model supports it.
- /// Example: 1:1 - ///
- /// 1:1 - [global::System.Text.Json.Serialization.JsonPropertyName("aspectRatio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Shotstack.JsonConverters.ImageAssetAspectRatioJsonConverter))] - public global::Shotstack.ImageAssetAspectRatio? AspectRatio { get; set; } + /// {"resolution":"1K","aspectRatio":"16:9"} + [global::System.Text.Json.Serialization.JsonPropertyName("options")] + public object? Options { get; set; } /// /// Crop the sides of an asset by a relative amount. The size of the crop is specified using a scale between 0 and 1, relative to the screen width - i.e a left crop of 0.5 will crop half of the asset from the left, a top crop of 0.25 will crop the top by quarter of the asset. @@ -80,24 +74,20 @@ public sealed partial class ImageAsset /// Initializes a new instance of the class. /// /// - /// The image source URL. The URL must be publicly accessible or include credentials. Provide either `src` or `prompt`, not both.
+ /// The image source URL. The URL must be publicly accessible or include credentials. When `prompt` is also set, `src` serves as a preview placeholder and the image is regenerated from the prompt at render time.
/// Example: https://s3-ap-northeast-1.amazonaws.com/my-bucket/image.jpg /// /// - /// A text prompt to generate the image from. When set without `src`, the engine generates an image and fills `src` automatically. Use `model` to choose the generator.
+ /// A text prompt to generate the image from. The engine generates an image at render time and fills `src` automatically; an existing `src` is treated as a preview placeholder and replaced. Use `model` to choose the generator and `options` to configure it.
/// Example: A serene landscape with a crystal-clear mountain lake at sunrise. /// /// - /// The generation model to use when `prompt` is set (e.g. `flux-schnell`, `fal/flux-schnell`, `fal/nano-banana-2`). Defaults to the platform's preferred generator if omitted.
+ /// The generation model to use when `prompt` is set (e.g. `flux-schnell`, `nano-banana-2`). Defaults to `nano-banana-2` if omitted. Each model's available options are defined by the model registry.
/// Example: flux-schnell /// - /// - /// Output resolution tier for supported image generation models. `1K` (default), `2K`, or `4K`. Only meaningful when `prompt` is set.
- /// Example: 1K - /// - /// - /// Aspect ratio for the generated image. Only meaningful when `prompt` is set and the model supports it.
- /// Example: 1:1 + /// + /// Model-specific generation settings. Valid keys and values depend on the chosen `model` and are defined by the model registry. Omitted options use the model's defaults. Unknown or invalid options are rejected.
+ /// Example: {"resolution":"1K","aspectRatio":"16:9"} /// /// /// Crop the sides of an asset by a relative amount. The size of the crop is specified using a scale between 0 and 1, relative to the screen width - i.e a left crop of 0.5 will crop half of the asset from the left, a top crop of 0.25 will crop the top by quarter of the asset. @@ -113,8 +103,7 @@ public ImageAsset( string? src, string? prompt, string? model, - global::Shotstack.ImageAssetResolution? resolution, - global::Shotstack.ImageAssetAspectRatio? aspectRatio, + object? options, global::Shotstack.Crop? crop, global::Shotstack.ImageAssetType type = global::Shotstack.ImageAssetType.Image) { @@ -122,8 +111,7 @@ public ImageAsset( this.Src = src; this.Prompt = prompt; this.Model = model; - this.Resolution = resolution; - this.AspectRatio = aspectRatio; + this.Options = options; this.Crop = crop; } diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.ImageAssetAspectRatio.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.ImageAssetAspectRatio.g.cs deleted file mode 100644 index 462f106..0000000 --- a/src/libs/Shotstack/Generated/Shotstack.Models.ImageAssetAspectRatio.g.cs +++ /dev/null @@ -1,82 +0,0 @@ - -#nullable enable - -namespace Shotstack -{ - /// - /// Aspect ratio for the generated image. Only meaningful when `prompt` is set and the model supports it.
- /// Example: 1:1 - ///
- public enum ImageAssetAspectRatio - { - /// - /// - /// - x16_9, - /// - /// - /// - x1_1, - /// - /// - /// - x21_9, - /// - /// - /// - x3_4, - /// - /// - /// - x4_3, - /// - /// - /// - x9_16, - /// - /// - /// - x9_21, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ImageAssetAspectRatioExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ImageAssetAspectRatio value) - { - return value switch - { - ImageAssetAspectRatio.x16_9 => "16:9", - ImageAssetAspectRatio.x1_1 => "1:1", - ImageAssetAspectRatio.x21_9 => "21:9", - ImageAssetAspectRatio.x3_4 => "3:4", - ImageAssetAspectRatio.x4_3 => "4:3", - ImageAssetAspectRatio.x9_16 => "9:16", - ImageAssetAspectRatio.x9_21 => "9:21", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ImageAssetAspectRatio? ToEnum(string value) - { - return value switch - { - "16:9" => ImageAssetAspectRatio.x16_9, - "1:1" => ImageAssetAspectRatio.x1_1, - "21:9" => ImageAssetAspectRatio.x21_9, - "3:4" => ImageAssetAspectRatio.x3_4, - "4:3" => ImageAssetAspectRatio.x4_3, - "9:16" => ImageAssetAspectRatio.x9_16, - "9:21" => ImageAssetAspectRatio.x9_21, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.ImageAssetOptions.Json.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.ImageAssetOptions.Json.g.cs new file mode 100644 index 0000000..7620e66 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.ImageAssetOptions.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Shotstack +{ + public sealed partial class ImageAssetOptions + { + /// + /// 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.ImageAssetOptions? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Shotstack.ImageAssetOptions), + jsonSerializerContext) as global::Shotstack.ImageAssetOptions; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Shotstack.ImageAssetOptions? 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.ImageAssetOptions? 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.ImageAssetOptions), + jsonSerializerContext).ConfigureAwait(false)) as global::Shotstack.ImageAssetOptions; + } + + /// + /// 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.ImageAssetOptions.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.ImageAssetOptions.g.cs new file mode 100644 index 0000000..6137a48 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.ImageAssetOptions.g.cs @@ -0,0 +1,20 @@ + +#nullable enable + +namespace Shotstack +{ + /// + /// Model-specific generation settings. Valid keys and values depend on the chosen `model` and are defined by the model registry. Omitted options use the model's defaults. Unknown or invalid options are rejected.
+ /// Example: {"resolution":"1K","aspectRatio":"16:9"} + ///
+ public sealed partial class ImageAssetOptions + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.ImageAssetResolution.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.ImageAssetResolution.g.cs deleted file mode 100644 index c14209f..0000000 --- a/src/libs/Shotstack/Generated/Shotstack.Models.ImageAssetResolution.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Shotstack -{ - /// - /// Output resolution tier for supported image generation models. `1K` (default), `2K`, or `4K`. Only meaningful when `prompt` is set.
- /// Example: 1K - ///
- public enum ImageAssetResolution - { - /// - /// - /// - x1k, - /// - /// - /// - x2k, - /// - /// - /// - x4k, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ImageAssetResolutionExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ImageAssetResolution value) - { - return value switch - { - ImageAssetResolution.x1k => "1K", - ImageAssetResolution.x2k => "2K", - ImageAssetResolution.x4k => "4K", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ImageAssetResolution? ToEnum(string value) - { - return value switch - { - "1K" => ImageAssetResolution.x1k, - "2K" => ImageAssetResolution.x2k, - "4K" => ImageAssetResolution.x4k, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.PostGenerateRequest.Json.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.PostGenerateRequest.Json.g.cs new file mode 100644 index 0000000..39f319e --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.PostGenerateRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Shotstack +{ + public sealed partial class PostGenerateRequest + { + /// + /// 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.PostGenerateRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Shotstack.PostGenerateRequest), + jsonSerializerContext) as global::Shotstack.PostGenerateRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Shotstack.PostGenerateRequest? 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.PostGenerateRequest? 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.PostGenerateRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Shotstack.PostGenerateRequest; + } + + /// + /// 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.PostGenerateRequest.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.PostGenerateRequest.g.cs new file mode 100644 index 0000000..f4bc7d6 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.PostGenerateRequest.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Shotstack +{ + /// + /// + /// + public sealed partial class PostGenerateRequest + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("asset")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Shotstack.JsonConverters.OneOfJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Shotstack.OneOf Asset { 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 PostGenerateRequest( + global::Shotstack.OneOf asset) + { + this.Asset = asset; + } + + /// + /// Initializes a new instance of the class. + /// + public PostGenerateRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.VideoAsset.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.VideoAsset.g.cs index 2e8edb6..7cd7619 100644 --- a/src/libs/Shotstack/Generated/Shotstack.Models.VideoAsset.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.Models.VideoAsset.g.cs @@ -5,13 +5,16 @@ namespace Shotstack { /// /// The VideoAsset adds a video to a Clip. The video can be sourced from a URL
- /// (`src`) or generated from a text prompt (`prompt`), optionally from a
- /// starting image (`inputSrc`). Exactly one of `src` or `prompt` must be provided.
+ /// (`src`), generated from a text prompt (`prompt`), or both. At least one of
+ /// `src` or `prompt` must be provided.
/// - **Source URL:** set `src` to the URL of an mp4 (or compatible) video file.
- /// - **Generated:** set `prompt` to describe the motion. Optionally set `inputSrc`
- /// to a starting image URL (image-to-video). Use `model` to choose the generator
- /// (e.g. `luma-ray-3`, `runpod-itv-mini`). The generated `src` is filled in
- /// automatically. + /// - **Generated:** set `prompt` to describe the motion. Choose a generator
+ /// with `model` and configure it with model-specific `options` (including a
+ /// starting image for image-to-video). The generated `src` is filled in
+ /// automatically.
+ /// - **Both:** `src` acts as a preview placeholder while `prompt` drives
+ /// generation — the video is regenerated from the prompt at render time.
+ /// Unchanged prompts and options resolve from the generation cache. ///
public sealed partial class VideoAsset { @@ -25,7 +28,7 @@ public sealed partial class VideoAsset public global::Shotstack.VideoAssetType Type { get; set; } = global::Shotstack.VideoAssetType.Video; /// - /// The video source URL. The URL must be publicly accessible or include credentials. Provide either `src` or `prompt`, not both.
+ /// The video source URL. The URL must be publicly accessible or include credentials. When `prompt` is also set, `src` serves as a preview placeholder and the video is regenerated from the prompt at render time.
/// Example: https://s3-ap-northeast-1.amazonaws.com/my-bucket/video.mp4 ///
/// https://s3-ap-northeast-1.amazonaws.com/my-bucket/video.mp4 @@ -33,7 +36,7 @@ public sealed partial class VideoAsset public string? Src { get; set; } /// - /// A text prompt to generate the video from. When set without `src`, the engine generates a video and fills `src` automatically. Optionally pair with `inputSrc` for image-to-video. Use `model` to choose the generator.
+ /// A text prompt to generate the video from. The engine generates a video at render time and fills `src` automatically; an existing `src` is treated as a preview placeholder and replaced. Use `model` to choose the generator and `options` to configure it (including a starting image for image-to-video).
/// Example: Slowly zoom out and orbit left around the object. ///
/// Slowly zoom out and orbit left around the object. @@ -41,55 +44,20 @@ public sealed partial class VideoAsset public string? Prompt { get; set; } /// - /// Input image URL for image-to-video generation. The image is used as the starting frame; `prompt` describes the motion. Has no effect unless `prompt` is set.
- /// Example: https://s3-ap-northeast-1.amazonaws.com/my-bucket/input-image.jpg + /// The generation model to use when `prompt` is set (e.g. `shotstack-itv-mini`, `ray-flash-2`, `seedance-2.0`). Defaults to `seedance-2.0` if omitted. Each model's available options are defined by the model registry.
+ /// Example: seedance-2.0 ///
- /// https://s3-ap-northeast-1.amazonaws.com/my-bucket/input-image.jpg - [global::System.Text.Json.Serialization.JsonPropertyName("inputSrc")] - public string? InputSrc { get; set; } - - /// - /// The generation model to use when `prompt` is set (e.g. `luma-ray-3`, `runpod-itv-mini`, `fal/seedance-2.0`). Defaults to the platform's preferred generator if omitted.
- /// Example: luma-ray-3 - ///
- /// luma-ray-3 + /// seedance-2.0 [global::System.Text.Json.Serialization.JsonPropertyName("model")] public string? Model { get; set; } /// - /// Output resolution for video generation. Only meaningful when `prompt` is set and the model supports it (e.g. `fal/seedance-2.0`).
- /// Example: 720p - ///
- /// 720p - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Shotstack.JsonConverters.VideoAssetResolutionJsonConverter))] - public global::Shotstack.VideoAssetResolution? Resolution { get; set; } - - /// - /// Target video duration in seconds for generation models that accept it. `"auto"` lets the model decide. Only meaningful when `prompt` is set.
- /// Default Value: auto
- /// Example: 5 - ///
- /// 5 - [global::System.Text.Json.Serialization.JsonPropertyName("duration")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Shotstack.JsonConverters.VideoAssetDurationJsonConverter))] - public global::Shotstack.VideoAssetDuration? Duration { get; set; } - - /// - /// Aspect ratio for the generated video. Only meaningful when `prompt` is set and the model supports it.
- /// Example: 16:9 - ///
- /// 16:9 - [global::System.Text.Json.Serialization.JsonPropertyName("aspectRatio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Shotstack.JsonConverters.VideoAssetAspectRatioJsonConverter))] - public global::Shotstack.VideoAssetAspectRatio? AspectRatio { get; set; } - - /// - /// Set to `true` to request audio generation alongside the video. Only meaningful for video generation models that support it (e.g. `fal/seedance-2.0`).
- /// Default Value: false + /// Model-specific generation settings. Valid keys and values depend on the chosen `model` and are defined by the model registry. Omitted options use the model's defaults. Unknown or invalid options are rejected.
+ /// Example: {"resolution":"720p","duration":"8","generateAudio":true} ///
- [global::System.Text.Json.Serialization.JsonPropertyName("generateAudio")] - public bool? GenerateAudio { get; set; } + /// {"resolution":"720p","duration":"8","generateAudio":true} + [global::System.Text.Json.Serialization.JsonPropertyName("options")] + public object? Options { get; set; } /// /// Set to `true` to force re-encoding of the video during preprocessing. This can help resolve compatibility issues, fix rotation problems, synchronize audio, or convert formats. The video will be processed to ensure optimal compatibility with the rendering engine.
@@ -155,37 +123,20 @@ public sealed partial class VideoAsset /// Initializes a new instance of the class. ///
/// - /// The video source URL. The URL must be publicly accessible or include credentials. Provide either `src` or `prompt`, not both.
+ /// The video source URL. The URL must be publicly accessible or include credentials. When `prompt` is also set, `src` serves as a preview placeholder and the video is regenerated from the prompt at render time.
/// Example: https://s3-ap-northeast-1.amazonaws.com/my-bucket/video.mp4 /// /// - /// A text prompt to generate the video from. When set without `src`, the engine generates a video and fills `src` automatically. Optionally pair with `inputSrc` for image-to-video. Use `model` to choose the generator.
+ /// A text prompt to generate the video from. The engine generates a video at render time and fills `src` automatically; an existing `src` is treated as a preview placeholder and replaced. Use `model` to choose the generator and `options` to configure it (including a starting image for image-to-video).
/// Example: Slowly zoom out and orbit left around the object. /// - /// - /// Input image URL for image-to-video generation. The image is used as the starting frame; `prompt` describes the motion. Has no effect unless `prompt` is set.
- /// Example: https://s3-ap-northeast-1.amazonaws.com/my-bucket/input-image.jpg - /// /// - /// The generation model to use when `prompt` is set (e.g. `luma-ray-3`, `runpod-itv-mini`, `fal/seedance-2.0`). Defaults to the platform's preferred generator if omitted.
- /// Example: luma-ray-3 - /// - /// - /// Output resolution for video generation. Only meaningful when `prompt` is set and the model supports it (e.g. `fal/seedance-2.0`).
- /// Example: 720p - /// - /// - /// Target video duration in seconds for generation models that accept it. `"auto"` lets the model decide. Only meaningful when `prompt` is set.
- /// Default Value: auto
- /// Example: 5 - /// - /// - /// Aspect ratio for the generated video. Only meaningful when `prompt` is set and the model supports it.
- /// Example: 16:9 + /// The generation model to use when `prompt` is set (e.g. `shotstack-itv-mini`, `ray-flash-2`, `seedance-2.0`). Defaults to `seedance-2.0` if omitted. Each model's available options are defined by the model registry.
+ /// Example: seedance-2.0 /// - /// - /// Set to `true` to request audio generation alongside the video. Only meaningful for video generation models that support it (e.g. `fal/seedance-2.0`).
- /// Default Value: false + /// + /// Model-specific generation settings. Valid keys and values depend on the chosen `model` and are defined by the model registry. Omitted options use the model's defaults. Unknown or invalid options are rejected.
+ /// Example: {"resolution":"720p","duration":"8","generateAudio":true} /// /// /// Set to `true` to force re-encoding of the video during preprocessing. This can help resolve compatibility issues, fix rotation problems, synchronize audio, or convert formats. The video will be processed to ensure optimal compatibility with the rendering engine.
@@ -225,12 +176,8 @@ public sealed partial class VideoAsset public VideoAsset( string? src, string? prompt, - string? inputSrc, string? model, - global::Shotstack.VideoAssetResolution? resolution, - global::Shotstack.VideoAssetDuration? duration, - global::Shotstack.VideoAssetAspectRatio? aspectRatio, - bool? generateAudio, + object? options, bool? transcode, double? trim, global::Shotstack.OneOf>? volume, @@ -243,12 +190,8 @@ public VideoAsset( this.Type = type; this.Src = src; this.Prompt = prompt; - this.InputSrc = inputSrc; this.Model = model; - this.Resolution = resolution; - this.Duration = duration; - this.AspectRatio = aspectRatio; - this.GenerateAudio = generateAudio; + this.Options = options; this.Transcode = transcode; this.Trim = trim; this.Volume = volume; diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetAspectRatio.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetAspectRatio.g.cs deleted file mode 100644 index 7641b7b..0000000 --- a/src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetAspectRatio.g.cs +++ /dev/null @@ -1,82 +0,0 @@ - -#nullable enable - -namespace Shotstack -{ - /// - /// Aspect ratio for the generated video. Only meaningful when `prompt` is set and the model supports it.
- /// Example: 16:9 - ///
- public enum VideoAssetAspectRatio - { - /// - /// - /// - x16_9, - /// - /// - /// - x1_1, - /// - /// - /// - x21_9, - /// - /// - /// - x3_4, - /// - /// - /// - x4_3, - /// - /// - /// - x9_16, - /// - /// - /// - x9_21, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class VideoAssetAspectRatioExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this VideoAssetAspectRatio value) - { - return value switch - { - VideoAssetAspectRatio.x16_9 => "16:9", - VideoAssetAspectRatio.x1_1 => "1:1", - VideoAssetAspectRatio.x21_9 => "21:9", - VideoAssetAspectRatio.x3_4 => "3:4", - VideoAssetAspectRatio.x4_3 => "4:3", - VideoAssetAspectRatio.x9_16 => "9:16", - VideoAssetAspectRatio.x9_21 => "9:21", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static VideoAssetAspectRatio? ToEnum(string value) - { - return value switch - { - "16:9" => VideoAssetAspectRatio.x16_9, - "1:1" => VideoAssetAspectRatio.x1_1, - "21:9" => VideoAssetAspectRatio.x21_9, - "3:4" => VideoAssetAspectRatio.x3_4, - "4:3" => VideoAssetAspectRatio.x4_3, - "9:16" => VideoAssetAspectRatio.x9_16, - "9:21" => VideoAssetAspectRatio.x9_21, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetDuration.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetDuration.g.cs deleted file mode 100644 index 7f8b5a7..0000000 --- a/src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetDuration.g.cs +++ /dev/null @@ -1,119 +0,0 @@ - -#nullable enable - -namespace Shotstack -{ - /// - /// Target video duration in seconds for generation models that accept it. `"auto"` lets the model decide. Only meaningful when `prompt` is set.
- /// Default Value: auto
- /// Example: 5 - ///
- public enum VideoAssetDuration - { - /// - /// - /// - x10, - /// - /// - /// - x11, - /// - /// - /// - x12, - /// - /// - /// - x13, - /// - /// - /// - x14, - /// - /// - /// - x15, - /// - /// - /// - x4, - /// - /// - /// - x5, - /// - /// - /// - x6, - /// - /// - /// - x7, - /// - /// - /// - x8, - /// - /// - /// - x9, - /// - /// - /// - Auto, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class VideoAssetDurationExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this VideoAssetDuration value) - { - return value switch - { - VideoAssetDuration.x10 => "10", - VideoAssetDuration.x11 => "11", - VideoAssetDuration.x12 => "12", - VideoAssetDuration.x13 => "13", - VideoAssetDuration.x14 => "14", - VideoAssetDuration.x15 => "15", - VideoAssetDuration.x4 => "4", - VideoAssetDuration.x5 => "5", - VideoAssetDuration.x6 => "6", - VideoAssetDuration.x7 => "7", - VideoAssetDuration.x8 => "8", - VideoAssetDuration.x9 => "9", - VideoAssetDuration.Auto => "auto", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static VideoAssetDuration? ToEnum(string value) - { - return value switch - { - "10" => VideoAssetDuration.x10, - "11" => VideoAssetDuration.x11, - "12" => VideoAssetDuration.x12, - "13" => VideoAssetDuration.x13, - "14" => VideoAssetDuration.x14, - "15" => VideoAssetDuration.x15, - "4" => VideoAssetDuration.x4, - "5" => VideoAssetDuration.x5, - "6" => VideoAssetDuration.x6, - "7" => VideoAssetDuration.x7, - "8" => VideoAssetDuration.x8, - "9" => VideoAssetDuration.x9, - "auto" => VideoAssetDuration.Auto, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetOptions.Json.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetOptions.Json.g.cs new file mode 100644 index 0000000..f38b83c --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetOptions.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Shotstack +{ + public sealed partial class VideoAssetOptions + { + /// + /// 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.VideoAssetOptions? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Shotstack.VideoAssetOptions), + jsonSerializerContext) as global::Shotstack.VideoAssetOptions; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Shotstack.VideoAssetOptions? 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.VideoAssetOptions? 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.VideoAssetOptions), + jsonSerializerContext).ConfigureAwait(false)) as global::Shotstack.VideoAssetOptions; + } + + /// + /// 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.VideoAssetOptions.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetOptions.g.cs new file mode 100644 index 0000000..f290ed3 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetOptions.g.cs @@ -0,0 +1,20 @@ + +#nullable enable + +namespace Shotstack +{ + /// + /// Model-specific generation settings. Valid keys and values depend on the chosen `model` and are defined by the model registry. Omitted options use the model's defaults. Unknown or invalid options are rejected.
+ /// Example: {"resolution":"720p","duration":"8","generateAudio":true} + ///
+ public sealed partial class VideoAssetOptions + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetResolution.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetResolution.g.cs deleted file mode 100644 index 92c03fe..0000000 --- a/src/libs/Shotstack/Generated/Shotstack.Models.VideoAssetResolution.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Shotstack -{ - /// - /// Output resolution for video generation. Only meaningful when `prompt` is set and the model supports it (e.g. `fal/seedance-2.0`).
- /// Example: 720p - ///
- public enum VideoAssetResolution - { - /// - /// - /// - x1080p, - /// - /// - /// - x480p, - /// - /// - /// - x720p, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class VideoAssetResolutionExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this VideoAssetResolution value) - { - return value switch - { - VideoAssetResolution.x1080p => "1080p", - VideoAssetResolution.x480p => "480p", - VideoAssetResolution.x720p => "720p", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static VideoAssetResolution? ToEnum(string value) - { - return value switch - { - "1080p" => VideoAssetResolution.x1080p, - "480p" => VideoAssetResolution.x480p, - "720p" => VideoAssetResolution.x720p, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.OneOf.3.Json.g.cs b/src/libs/Shotstack/Generated/Shotstack.OneOf.3.Json.g.cs new file mode 100644 index 0000000..4ac0ca1 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.OneOf.3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Shotstack +{ + public readonly partial struct OneOf + { + /// + /// 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.OneOf? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Shotstack.OneOf), + jsonSerializerContext) as global::Shotstack.OneOf?; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Shotstack.OneOf? 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.OneOf? 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.OneOf), + jsonSerializerContext).ConfigureAwait(false)) as global::Shotstack.OneOf?; + } + + /// + /// 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.OneOf.3.g.cs b/src/libs/Shotstack/Generated/Shotstack.OneOf.3.g.cs new file mode 100644 index 0000000..258795e --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.OneOf.3.g.cs @@ -0,0 +1,377 @@ + +#nullable enable + +namespace Shotstack +{ + /// + /// + /// + public readonly partial struct OneOf : global::System.IEquatable> + { + /// + /// + /// +#if NET6_0_OR_GREATER + public T1? Value1 { get; init; } +#else + public T1? Value1 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] +#endif + public bool IsValue1 => Value1 != null; + + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T2? Value2 { get; init; } +#else + public T2? Value2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] +#endif + public bool IsValue2 => Value2 != null; + + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T3? Value3 { get; init; } +#else + public T3? Value3 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] +#endif + public bool IsValue3 => Value3 != null; + + /// + /// + /// + public bool TryPickValue3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T3? value) + { + value = Value3; + return IsValue3; + } + + /// + /// + /// + public T3 PickValue3() => IsValue3 + ? Value3! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value3' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator OneOf(T1 value) => new OneOf((T1?)value); + + /// + /// + /// + public static implicit operator T1?(OneOf @this) => @this.Value1; + + /// + /// + /// + public OneOf(T1? value) + { + Value1 = value; + } + + /// + /// + /// + public static OneOf FromValue1(T1? value) => new OneOf(value); + + /// + /// + /// + public static implicit operator OneOf(T2 value) => new OneOf((T2?)value); + + /// + /// + /// + public static implicit operator T2?(OneOf @this) => @this.Value2; + + /// + /// + /// + public OneOf(T2? value) + { + Value2 = value; + } + + /// + /// + /// + public static OneOf FromValue2(T2? value) => new OneOf(value); + + /// + /// + /// + public static implicit operator OneOf(T3 value) => new OneOf((T3?)value); + + /// + /// + /// + public static implicit operator T3?(OneOf @this) => @this.Value3; + + /// + /// + /// + public OneOf(T3? value) + { + Value3 = value; + } + + /// + /// + /// + public static OneOf FromValue3(T3? value) => new OneOf(value); + + /// + /// + /// + public OneOf( + T1? value1, + T2? value2, + T3? value3 + ) + { + Value1 = value1; + Value2 = value2; + Value3 = value3; + } + + /// + /// + /// + public object? Object => + Value3 as object ?? + Value2 as object ?? + Value1 as object + ; + + /// + /// + /// + public override string? ToString() => + Value1?.ToString() ?? + Value2?.ToString() ?? + Value3?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsValue1 && !IsValue2 && !IsValue3 || !IsValue1 && IsValue2 && !IsValue3 || !IsValue1 && !IsValue2 && IsValue3; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? value1 = null, + global::System.Func? value2 = null, + global::System.Func? value3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1 && value1 != null) + { + return value1(Value1!); + } + else if (IsValue2 && value2 != null) + { + return value2(Value2!); + } + else if (IsValue3 && value3 != null) + { + return value3(Value3!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, + global::System.Action? value2 = null, + global::System.Action? value3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Value1, + typeof(T1), + Value2, + typeof(T2), + Value3, + typeof(T3), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(OneOf other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value3, other.Value3) + ; + } + + /// + /// + /// + public static bool operator ==(OneOf obj1, OneOf obj2) + { + return global::System.Collections.Generic.EqualityComparer>.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(OneOf obj1, OneOf obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is OneOf o && Equals(o); + } + } +} diff --git a/src/libs/Shotstack/openapi.json b/src/libs/Shotstack/openapi.json index 1d63488..ee6baf9 100644 --- a/src/libs/Shotstack/openapi.json +++ b/src/libs/Shotstack/openapi.json @@ -442,6 +442,133 @@ } ] }, + "/edit/v1/generate": { + "post": { + "responses": { + "200": { + "description": "The generated asset was already cached and is immediately available.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationResponse" + } + } + } + }, + "202": { + "description": "The generation job has been queued. Poll the status endpoint.", + "headers": { + "Location": { + "description": "The relative URL to poll for job status.", + "schema": { + "type": "string" + } + }, + "Retry-After": { + "description": "Suggested seconds to wait before polling.", + "schema": { + "type": "integer" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationResponse" + } + } + } + } + }, + "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", + "requestBody": { + "description": "A prompt-bearing image, video or audio asset to generate.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "asset": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageAsset" + }, + { + "$ref": "#/components/schemas/VideoAsset" + }, + { + "$ref": "#/components/schemas/AudioAsset" + } + ] + } + }, + "required": [ + "asset" + ] + } + } + } + }, + "security": [ + { + "DeveloperKey": [] + } + ], + "tags": [ + "Edit" + ] + } + }, + "/edit/v1/generate/{id}": { + "get": { + "responses": { + "200": { + "description": "The generation job has finished (done or failed).", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationResponse" + } + } + } + }, + "202": { + "description": "The generation job is still processing.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationResponse" + } + } + } + } + }, + "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", + "summary": "Get Generation Status", + "operationId": "getGenerate", + "security": [ + { + "DeveloperKey": [] + } + ], + "tags": [ + "Edit" + ] + }, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "description": "The generation job id returned by the generate endpoint." + } + ] + }, "/serve/v1/assets/{id}": { "get": { "responses": { @@ -1153,7 +1280,7 @@ "additionalProperties": false }, "VideoAsset": { - "description": "The VideoAsset adds a video to a Clip. The video can be sourced from a URL\n(`src`) or generated from a text prompt (`prompt`), optionally from a\nstarting image (`inputSrc`). Exactly one of `src` or `prompt` must be provided.\n\n- **Source URL:** set `src` to the URL of an mp4 (or compatible) video file.\n- **Generated:** set `prompt` to describe the motion. Optionally set `inputSrc`\n to a starting image URL (image-to-video). Use `model` to choose the generator\n (e.g. `luma-ray-3`, `runpod-itv-mini`). The generated `src` is filled in\n automatically.\n", + "description": "The VideoAsset adds a video to a Clip. The video can be sourced from a URL\n(`src`), generated from a text prompt (`prompt`), or both. At least one of\n`src` or `prompt` must be provided.\n\n- **Source URL:** set `src` to the URL of an mp4 (or compatible) video file.\n- **Generated:** set `prompt` to describe the motion. Choose a generator\n with `model` and configure it with model-specific `options` (including a\n starting image for image-to-video). The generated `src` is filled in\n automatically.\n- **Both:** `src` acts as a preview placeholder while `prompt` drives\n generation \u2014 the video is regenerated from the prompt at render time.\n Unchanged prompts and options resolve from the generation cache.\n", "type": "object", "properties": { "type": { @@ -1165,78 +1292,32 @@ "type": "string" }, "src": { - "description": "The video source URL. The URL must be publicly accessible or include credentials. Provide either `src` or `prompt`, not both.", + "description": "The video source URL. The URL must be publicly accessible or include credentials. When `prompt` is also set, `src` serves as a preview placeholder and the video is regenerated from the prompt at render time.", "type": "string", "minLength": 1, "pattern": "\\S", "example": "https://s3-ap-northeast-1.amazonaws.com/my-bucket/video.mp4" }, "prompt": { - "description": "A text prompt to generate the video from. When set without `src`, the engine generates a video and fills `src` automatically. Optionally pair with `inputSrc` for image-to-video. Use `model` to choose the generator.", + "description": "A text prompt to generate the video from. The engine generates a video at render time and fills `src` automatically; an existing `src` is treated as a preview placeholder and replaced. Use `model` to choose the generator and `options` to configure it (including a starting image for image-to-video).", "type": "string", "maxLength": 4000, "example": "Slowly zoom out and orbit left around the object." }, - "inputSrc": { - "description": "Input image URL for image-to-video generation. The image is used as the starting frame; `prompt` describes the motion. Has no effect unless `prompt` is set.", - "type": "string", - "minLength": 1, - "example": "https://s3-ap-northeast-1.amazonaws.com/my-bucket/input-image.jpg" - }, "model": { - "description": "The generation model to use when `prompt` is set (e.g. `luma-ray-3`, `runpod-itv-mini`, `fal/seedance-2.0`). Defaults to the platform's preferred generator if omitted.", + "description": "The generation model to use when `prompt` is set (e.g. `shotstack-itv-mini`, `ray-flash-2`, `seedance-2.0`). Defaults to `seedance-2.0` if omitted. Each model's available options are defined by the model registry.", "type": "string", - "example": "luma-ray-3" + "example": "seedance-2.0" }, - "resolution": { - "description": "Output resolution for video generation. Only meaningful when `prompt` is set and the model supports it (e.g. `fal/seedance-2.0`).", - "enum": [ - "480p", - "720p", - "1080p" - ], - "type": "string", - "example": "720p" - }, - "duration": { - "description": "Target video duration in seconds for generation models that accept it. `\"auto\"` lets the model decide. Only meaningful when `prompt` is set.", - "enum": [ - "auto", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15" - ], - "type": "string", - "default": "auto", - "example": "5" - }, - "aspectRatio": { - "description": "Aspect ratio for the generated video. Only meaningful when `prompt` is set and the model supports it.", - "enum": [ - "1:1", - "16:9", - "9:16", - "4:3", - "3:4", - "21:9", - "9:21" - ], - "type": "string", - "example": "16:9" - }, - "generateAudio": { - "description": "Set to `true` to request audio generation alongside the video. Only meaningful for video generation models that support it (e.g. `fal/seedance-2.0`).", - "type": "boolean", - "default": false + "options": { + "description": "Model-specific generation settings. Valid keys and values depend on the chosen `model` and are defined by the model registry. Omitted options use the model's defaults. Unknown or invalid options are rejected.", + "type": "object", + "additionalProperties": true, + "example": { + "resolution": "720p", + "duration": "8", + "generateAudio": true + } }, "transcode": { "type": "boolean", @@ -1299,7 +1380,7 @@ ] }, "ImageAsset": { - "description": "The ImageAsset adds an image to a Clip. The image can be sourced from a URL\n(`src`) or generated from a text prompt (`prompt`). Exactly one of `src` or\n`prompt` must be provided.\n\n- **Source URL:** set `src` to the publicly accessible URL of a jpg or png file.\n- **Generated:** set `prompt` to describe the image; the engine generates it\n using the provider chosen by `model` and fills `src` in automatically.\n", + "description": "The ImageAsset adds an image to a Clip. The image can be sourced from a URL\n(`src`), generated from a text prompt (`prompt`), or both. At least one of\n`src` or `prompt` must be provided.\n\n- **Source URL:** set `src` to the publicly accessible URL of a jpg or png file.\n- **Generated:** set `prompt` to describe the image. Choose a generator with\n `model` and configure it with model-specific `options`; the engine fills\n `src` in automatically.\n- **Both:** `src` acts as a preview placeholder while `prompt` drives\n generation \u2014 the image is regenerated from the prompt at render time.\n Unchanged prompts and options resolve from the generation cache.\n", "type": "object", "properties": { "type": { @@ -1311,46 +1392,31 @@ "type": "string" }, "src": { - "description": "The image source URL. The URL must be publicly accessible or include credentials. Provide either `src` or `prompt`, not both.", + "description": "The image source URL. The URL must be publicly accessible or include credentials. When `prompt` is also set, `src` serves as a preview placeholder and the image is regenerated from the prompt at render time.", "type": "string", "minLength": 1, "pattern": "\\S", "example": "https://s3-ap-northeast-1.amazonaws.com/my-bucket/image.jpg" }, "prompt": { - "description": "A text prompt to generate the image from. When set without `src`, the engine generates an image and fills `src` automatically. Use `model` to choose the generator.", + "description": "A text prompt to generate the image from. The engine generates an image at render time and fills `src` automatically; an existing `src` is treated as a preview placeholder and replaced. Use `model` to choose the generator and `options` to configure it.", "type": "string", "maxLength": 4000, "example": "A serene landscape with a crystal-clear mountain lake at sunrise." }, "model": { - "description": "The generation model to use when `prompt` is set (e.g. `flux-schnell`, `fal/flux-schnell`, `fal/nano-banana-2`). Defaults to the platform's preferred generator if omitted.", + "description": "The generation model to use when `prompt` is set (e.g. `flux-schnell`, `nano-banana-2`). Defaults to `nano-banana-2` if omitted. Each model's available options are defined by the model registry.", "type": "string", "example": "flux-schnell" }, - "resolution": { - "description": "Output resolution tier for supported image generation models. `1K` (default), `2K`, or `4K`. Only meaningful when `prompt` is set.", - "enum": [ - "1K", - "2K", - "4K" - ], - "type": "string", - "example": "1K" - }, - "aspectRatio": { - "description": "Aspect ratio for the generated image. Only meaningful when `prompt` is set and the model supports it.", - "enum": [ - "1:1", - "16:9", - "9:16", - "4:3", - "3:4", - "21:9", - "9:21" - ], - "type": "string", - "example": "1:1" + "options": { + "description": "Model-specific generation settings. Valid keys and values depend on the chosen `model` and are defined by the model registry. Omitted options use the model's defaults. Unknown or invalid options are rejected.", + "type": "object", + "additionalProperties": true, + "example": { + "resolution": "1K", + "aspectRatio": "16:9" + } }, "crop": { "$ref": "#/components/schemas/Crop" @@ -1493,7 +1559,7 @@ ] }, "AudioAsset": { - "description": "The AudioAsset adds audio to a Clip. The audio can be sourced from a URL\n(`src`) or generated from a text prompt (`prompt`). Exactly one of `src` or\n`prompt` must be provided.\n\n- **Source URL:** set `src` to a publicly accessible audio URL (e.g. mp3).\n- **Generated speech:** set `prompt` to the spoken text and `voice` to a voice\n identifier (text-to-speech). Optionally set `language`/`newscaster`.\n- **Generated music or SFX:** set `prompt` describing the sound; omit `voice`.\n- Use `model` to choose the generator. The generated `src` is filled in\n automatically.\n", + "description": "The AudioAsset adds audio to a Clip. The audio can be sourced from a URL\n(`src`), generated from a text prompt (`prompt`), or both. At least one of\n`src` or `prompt` must be provided.\n\n- **Source URL:** set `src` to a publicly accessible audio URL (e.g. mp3).\n- **Generated speech:** set `prompt` to the spoken text and choose a\n text-to-speech `model`; set the voice via `options`.\n- **Generated music or SFX:** set `prompt` describing the sound and choose\n a music generation `model`.\n- **Both:** `src` acts as a preview placeholder while `prompt` drives\n generation \u2014 the audio is regenerated from the prompt at render time.\n Unchanged prompts and options resolve from the generation cache.\n- Use `model` to choose the generator and `options` to configure it. The\n generated `src` is filled in automatically.\n", "type": "object", "properties": { "type": { @@ -1505,54 +1571,31 @@ "type": "string" }, "src": { - "description": "The audio source URL. The URL must be publicly accessible or include credentials. Provide either `src` or `prompt`, not both.", + "description": "The audio source URL. The URL must be publicly accessible or include credentials. When `prompt` is also set, `src` serves as a preview placeholder and the audio is regenerated from the prompt at render time.", "type": "string", "minLength": 1, "pattern": "\\S", "example": "https://s3-ap-northeast-1.amazonaws.com/my-bucket/sound.mp3" }, "prompt": { - "description": "A text prompt. When `voice` is set, the prompt is the spoken text (text-to-speech). Without `voice`, the prompt describes generated music or sound effects. The generated `src` is filled in automatically.", + "description": "A text prompt. For text-to-speech models the prompt is the spoken text; for music models it describes the sound to generate. The generated `src` is filled in automatically; an existing `src` is treated as a preview placeholder and replaced.", "type": "string", "maxLength": 4000, "example": "Welcome to today's broadcast." }, - "voice": { - "description": "Voice identifier for text-to-speech generation (e.g. `Matthew`, `Joanna`). Only meaningful when `prompt` is set.", - "type": "string", - "example": "Matthew" - }, - "language": { - "description": "Optional BCP-47 language code (e.g. `en-US`) for text-to-speech. Only meaningful when `prompt` and `voice` are set.", - "type": "string", - "example": "en-US" - }, - "newscaster": { - "description": "Set to `true` to use the voice's newscaster mode when supported. Only meaningful when `prompt` and `voice` are set.", - "type": "boolean", - "default": false - }, "model": { - "description": "The generation model to use when `prompt` is set (e.g. `polly-neural`, `fal/elevenlabs-tts`, `fal/minimax-speech`, `fal/elevenlabs-music`). Defaults to the platform's preferred generator if omitted.", + "description": "The generation model to use when `prompt` is set (e.g. `polly-neural`, `elevenlabs-tts`, `elevenlabs-music`). Defaults to `elevenlabs-tts` (with a default voice) if omitted. Each model's available options are defined by the model registry.", "type": "string", "example": "polly-neural" }, - "musicLengthMs": { - "description": "Target duration in milliseconds for generated music (3,000\u2013600,000). Only meaningful when `prompt` is set and the model is a music generator (e.g. `fal/elevenlabs-music`).", - "type": "number", - "minimum": 3000, - "maximum": 600000, - "example": 30000 - }, - "forceInstrumental": { - "description": "Set to `true` to force instrumental music (no vocals). Only meaningful for music generation models.", - "type": "boolean", - "default": false - }, - "compositionPlan": { - "description": "An optional structured composition plan for music generation. Only meaningful for music generation models (e.g. `fal/elevenlabs-music`).", - "type": "string", - "maxLength": 4000 + "options": { + "description": "Model-specific generation settings. Valid keys and values depend on the chosen `model` and are defined by the model registry. Omitted options use the model's defaults. Unknown or invalid options are rejected.", + "type": "object", + "additionalProperties": true, + "example": { + "voice": "Matthew", + "language": "en-US" + } }, "trim": { "description": "The start trim point of the audio clip, in seconds (defaults to 0). Audio will start from the in trim point. The audio will play until the file ends or the Clip length is reached.", @@ -5555,6 +5598,41 @@ "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" + ] } }, "responses": {},