From d7e37230e8d383c0fbe84ebeab18e3790978a2f1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 1 Oct 2026 03:45:18 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Shotstack.EditClient.PostGenerate.g.cs | 6 +- .../Shotstack.IEditClient.PostGenerate.g.cs | 6 +- ...ck.JsonConverters.GenerationAssetType.g.cs | 53 +++ ...onverters.GenerationAssetTypeNullable.g.cs | 60 +++ .../Shotstack.JsonConverters.OneOf3.g.cs | 216 ---------- .../Shotstack.JsonSerializerContext.g.cs | 9 +- .../Shotstack.JsonSerializerContextTypes.g.cs | 144 +++---- ...hotstack.Models.GenerationAsset.Json.g.cs} | 26 +- .../Shotstack.Models.GenerationAsset.g.cs | 94 +++++ ...ck.Models.GenerationAssetOptions.Json.g.cs | 141 +++++++ ...otstack.Models.GenerationAssetOptions.g.cs | 20 + .../Shotstack.Models.GenerationAssetType.g.cs | 58 +++ .../Shotstack.Models.PostGenerateRequest.g.cs | 13 +- .../Generated/Shotstack.OneOf.3.g.cs | 377 ------------------ src/libs/Shotstack/openapi.json | 57 ++- 15 files changed, 579 insertions(+), 701 deletions(-) create mode 100644 src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationAssetType.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationAssetTypeNullable.g.cs delete mode 100644 src/libs/Shotstack/Generated/Shotstack.JsonConverters.OneOf3.g.cs rename src/libs/Shotstack/Generated/{Shotstack.OneOf.3.Json.g.cs => Shotstack.Models.GenerationAsset.Json.g.cs} (88%) create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.GenerationAsset.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.GenerationAssetOptions.Json.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.GenerationAssetOptions.g.cs create mode 100644 src/libs/Shotstack/Generated/Shotstack.Models.GenerationAssetType.g.cs delete mode 100644 src/libs/Shotstack/Generated/Shotstack.OneOf.3.g.cs diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.PostGenerate.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.PostGenerate.g.cs index 4578e93..18e2fe7 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.PostGenerate.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.PostGenerate.g.cs @@ -687,7 +687,9 @@ partial void ProcessPostGenerateResponseContent( /// /// Optional idempotency key. When omitted, the SDK generates one for this request. /// - /// + /// + /// An image, video or audio asset to generate from a text prompt. + /// /// /// The length, in seconds, of the clip the asset fills. A model that generates to a duration takes it from this value in place of its own duration option. Other models ignore it.
/// Example: 5 @@ -696,7 +698,7 @@ partial void ProcessPostGenerateResponseContent( /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task PostGenerateAsync( - global::Shotstack.OneOf asset, + global::Shotstack.GenerationAsset asset, string? idempotencyKey = default, double? length = default, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostGenerate.g.cs b/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostGenerate.g.cs index 154a676..5d996e2 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostGenerate.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IEditClient.PostGenerate.g.cs @@ -66,7 +66,9 @@ public partial interface IEditClient /// /// Optional idempotency key. When omitted, the SDK generates one for this request. /// - /// + /// + /// An image, video or audio asset to generate from a text prompt. + /// /// /// The length, in seconds, of the clip the asset fills. A model that generates to a duration takes it from this value in place of its own duration option. Other models ignore it.
/// Example: 5 @@ -75,7 +77,7 @@ public partial interface IEditClient /// The token to cancel the operation with /// global::System.Threading.Tasks.Task PostGenerateAsync( - global::Shotstack.OneOf asset, + global::Shotstack.GenerationAsset asset, string? idempotencyKey = default, double? length = default, global::Shotstack.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationAssetType.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationAssetType.g.cs new file mode 100644 index 0000000..21a148b --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationAssetType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Shotstack.JsonConverters +{ + /// + public sealed class GenerationAssetTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Shotstack.GenerationAssetType 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.GenerationAssetTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Shotstack.GenerationAssetType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Shotstack.GenerationAssetType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Shotstack.GenerationAssetType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Shotstack.GenerationAssetTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationAssetTypeNullable.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationAssetTypeNullable.g.cs new file mode 100644 index 0000000..4c30f9d --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.JsonConverters.GenerationAssetTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Shotstack.JsonConverters +{ + /// + public sealed class GenerationAssetTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Shotstack.GenerationAssetType? 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.GenerationAssetTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Shotstack.GenerationAssetType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Shotstack.GenerationAssetType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Shotstack.GenerationAssetType? 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.GenerationAssetTypeExtensions.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 deleted file mode 100644 index 83d035b..0000000 --- a/src/libs/Shotstack/Generated/Shotstack.JsonConverters.OneOf3.g.cs +++ /dev/null @@ -1,216 +0,0 @@ -#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.PickValue1(), 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.PickValue2(), 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.PickValue3(), typeInfo); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContext.g.cs b/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContext.g.cs index 97f70cc..70f19af 100644 --- a/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContext.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContext.g.cs @@ -279,6 +279,10 @@ namespace Shotstack typeof(global::Shotstack.JsonConverters.DolbyEnhancementOptionsPresetNullableJsonConverter), + typeof(global::Shotstack.JsonConverters.GenerationAssetTypeJsonConverter), + + typeof(global::Shotstack.JsonConverters.GenerationAssetTypeNullableJsonConverter), + typeof(global::Shotstack.JsonConverters.GenerationModelTypeJsonConverter), typeof(global::Shotstack.JsonConverters.GenerationModelTypeNullableJsonConverter), @@ -385,8 +389,6 @@ namespace Shotstack typeof(global::Shotstack.JsonConverters.OneOfJsonConverter>), - typeof(global::Shotstack.JsonConverters.OneOfJsonConverter), - typeof(global::Shotstack.JsonConverters.UnixTimestampJsonConverter), })] #pragma warning restore CS3016 @@ -634,6 +636,8 @@ namespace Shotstack [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.DolbyEnhancementOptions))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.DolbyEnhancementOptionsPreset), TypeInfoPropertyName = "DolbyEnhancementOptionsPreset2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.Transfer))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationAsset))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationAssetType), TypeInfoPropertyName = "GenerationAssetType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModel))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelType), TypeInfoPropertyName = "GenerationModelType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelPricing))] @@ -707,7 +711,6 @@ namespace Shotstack [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.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 5feeefb..81f2f37 100644 --- a/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContextTypes.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.JsonSerializerContextTypes.g.cs @@ -777,283 +777,287 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Shotstack.GenerationModel? Type186 { get; set; } + public global::Shotstack.GenerationAsset? Type186 { get; set; } /// /// /// - public global::Shotstack.GenerationModelType? Type187 { get; set; } + public global::Shotstack.GenerationAssetType? Type187 { get; set; } /// /// /// - public global::Shotstack.GenerationModelPricing? Type188 { get; set; } + public global::Shotstack.GenerationModel? Type188 { get; set; } /// /// /// - public global::Shotstack.GenerationModelUnavailableReason? Type189 { get; set; } + public global::Shotstack.GenerationModelType? Type189 { get; set; } /// /// /// - public global::Shotstack.OneOf>? Type190 { get; set; } + public global::Shotstack.GenerationModelPricing? Type190 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type191 { get; set; } + public global::Shotstack.GenerationModelUnavailableReason? Type191 { get; set; } /// /// /// - public global::Shotstack.GenerationModelPricingTieredBy? Type192 { get; set; } + public global::Shotstack.OneOf>? Type192 { get; set; } /// /// /// - public global::Shotstack.GenerationModelPricingQuantity? Type193 { get; set; } + public global::System.Collections.Generic.Dictionary? Type193 { get; set; } /// /// /// - public global::Shotstack.GenerationModelPricingQuantityMeasure? Type194 { get; set; } + public global::Shotstack.GenerationModelPricingTieredBy? Type194 { get; set; } /// /// /// - public global::Shotstack.GenerationModelPricingQuantityRound? Type195 { get; set; } + public global::Shotstack.GenerationModelPricingQuantity? Type195 { get; set; } /// /// /// - public global::Shotstack.GenerationModelListResponse? Type196 { get; set; } + public global::Shotstack.GenerationModelPricingQuantityMeasure? Type196 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type197 { get; set; } + public global::Shotstack.GenerationModelPricingQuantityRound? Type197 { get; set; } /// /// /// - public global::Shotstack.GenerationResponse? Type198 { get; set; } + public global::Shotstack.GenerationModelListResponse? Type198 { get; set; } /// /// /// - public global::Shotstack.GenerationResponseStatus? Type199 { get; set; } + public global::System.Collections.Generic.IList? Type199 { get; set; } /// /// /// - public global::Shotstack.GenerationErrorResponse? Type200 { get; set; } + public global::Shotstack.GenerationResponse? Type200 { get; set; } /// /// /// - public global::Shotstack.GenerationModelErrorResponse? Type201 { get; set; } + public global::Shotstack.GenerationResponseStatus? Type201 { get; set; } /// /// /// - public global::Shotstack.GenerationModelErrorResponseError? Type202 { get; set; } + public global::Shotstack.GenerationErrorResponse? Type202 { get; set; } /// /// /// - public global::Shotstack.GenerationModelErrorResponseErrorName? Type203 { get; set; } + public global::Shotstack.GenerationModelErrorResponse? Type203 { get; set; } /// /// /// - public global::Shotstack.QueuedResponse? Type204 { get; set; } + public global::Shotstack.GenerationModelErrorResponseError? Type204 { get; set; } /// /// /// - public global::Shotstack.QueuedResponseData? Type205 { get; set; } + public global::Shotstack.GenerationModelErrorResponseErrorName? Type205 { get; set; } /// /// /// - public global::Shotstack.RenderResponse? Type206 { get; set; } + public global::Shotstack.QueuedResponse? Type206 { get; set; } /// /// /// - public global::Shotstack.RenderResponseData? Type207 { get; set; } + public global::Shotstack.QueuedResponseData? Type207 { get; set; } /// /// /// - public global::Shotstack.RenderResponseDataStatus? Type208 { get; set; } + public global::Shotstack.RenderResponse? Type208 { get; set; } /// /// /// - public global::Shotstack.TemplateResponse? Type209 { get; set; } + public global::Shotstack.RenderResponseData? Type209 { get; set; } /// /// /// - public global::Shotstack.TemplateResponseData? Type210 { get; set; } + public global::Shotstack.RenderResponseDataStatus? Type210 { get; set; } /// /// /// - public global::Shotstack.TemplateDataResponse? Type211 { get; set; } + public global::Shotstack.TemplateResponse? Type211 { get; set; } /// /// /// - public global::Shotstack.TemplateDataResponseData? Type212 { get; set; } + public global::Shotstack.TemplateResponseData? Type212 { get; set; } /// /// /// - public global::Shotstack.TemplateListResponse? Type213 { get; set; } + public global::Shotstack.TemplateDataResponse? Type213 { get; set; } /// /// /// - public global::Shotstack.TemplateListResponseData? Type214 { get; set; } + public global::Shotstack.TemplateDataResponseData? Type214 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type215 { get; set; } + public global::Shotstack.TemplateListResponse? Type215 { get; set; } /// /// /// - public global::Shotstack.TemplateListResponseItem? Type216 { get; set; } + public global::Shotstack.TemplateListResponseData? Type216 { get; set; } /// /// /// - public global::Shotstack.ProbeResponse? Type217 { get; set; } + public global::System.Collections.Generic.IList? Type217 { get; set; } /// /// /// - public global::Shotstack.AssetResponse? Type218 { get; set; } + public global::Shotstack.TemplateListResponseItem? Type218 { get; set; } /// /// /// - public global::Shotstack.AssetResponseData? Type219 { get; set; } + public global::Shotstack.ProbeResponse? Type219 { get; set; } /// /// /// - public global::Shotstack.AssetRenderResponse? Type220 { get; set; } + public global::Shotstack.AssetResponse? Type220 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type221 { get; set; } + public global::Shotstack.AssetResponseData? Type221 { get; set; } /// /// /// - public global::Shotstack.AssetResponseAttributes? Type222 { get; set; } + public global::Shotstack.AssetRenderResponse? Type222 { get; set; } /// /// /// - public global::Shotstack.AssetResponseAttributesStatus? Type223 { get; set; } + public global::System.Collections.Generic.IList? Type223 { get; set; } /// /// /// - public global::Shotstack.TransferResponse? Type224 { get; set; } + public global::Shotstack.AssetResponseAttributes? Type224 { get; set; } /// /// /// - public global::Shotstack.TransferResponseData? Type225 { get; set; } + public global::Shotstack.AssetResponseAttributesStatus? Type225 { get; set; } /// /// /// - public global::Shotstack.TransferResponseAttributes? Type226 { get; set; } + public global::Shotstack.TransferResponse? Type226 { get; set; } /// /// /// - public global::Shotstack.TransferResponseAttributesStatus? Type227 { get; set; } + public global::Shotstack.TransferResponseData? Type227 { get; set; } /// /// /// - public global::Shotstack.QueuedSourceResponse? Type228 { get; set; } + public global::Shotstack.TransferResponseAttributes? Type228 { get; set; } /// /// /// - public global::Shotstack.QueuedSourceResponseData? Type229 { get; set; } + public global::Shotstack.TransferResponseAttributesStatus? Type229 { get; set; } /// /// /// - public global::Shotstack.SourceListResponse? Type230 { get; set; } + public global::Shotstack.QueuedSourceResponse? Type230 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type231 { get; set; } + public global::Shotstack.QueuedSourceResponseData? Type231 { get; set; } /// /// /// - public global::Shotstack.SourceResponseData? Type232 { get; set; } + public global::Shotstack.SourceListResponse? Type232 { get; set; } /// /// /// - public global::Shotstack.SourceResponse? Type233 { get; set; } + public global::System.Collections.Generic.IList? Type233 { get; set; } /// /// /// - public global::Shotstack.SourceResponseAttributes? Type234 { get; set; } + public global::Shotstack.SourceResponseData? Type234 { get; set; } /// /// /// - public global::Shotstack.SourceResponseAttributesStatus? Type235 { get; set; } + public global::Shotstack.SourceResponse? Type235 { get; set; } /// /// /// - public global::Shotstack.OutputsResponse? Type236 { get; set; } + public global::Shotstack.SourceResponseAttributes? Type236 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type237 { get; set; } + public global::Shotstack.SourceResponseAttributesStatus? Type237 { get; set; } /// /// /// - public global::Shotstack.RenditionResponseAttributes? Type238 { get; set; } + public global::Shotstack.OutputsResponse? Type238 { get; set; } /// /// /// - public global::Shotstack.RenditionResponseAttributesStatus? Type239 { get; set; } + public global::System.Collections.Generic.IList? Type239 { get; set; } /// /// /// - public global::Shotstack.UploadResponse? Type240 { get; set; } + public global::Shotstack.RenditionResponseAttributes? Type240 { get; set; } /// /// /// - public global::Shotstack.UploadResponseData? Type241 { get; set; } + public global::Shotstack.RenditionResponseAttributesStatus? Type241 { get; set; } /// /// /// - public global::Shotstack.UploadResponseAttributes? Type242 { get; set; } + public global::Shotstack.UploadResponse? Type242 { get; set; } /// /// /// - public global::Shotstack.IngestErrorResponse? Type243 { get; set; } + public global::Shotstack.UploadResponseData? Type243 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type244 { get; set; } + public global::Shotstack.UploadResponseAttributes? Type244 { get; set; } /// /// /// - public global::Shotstack.IngestErrorResponseData? Type245 { get; set; } + public global::Shotstack.IngestErrorResponse? Type245 { get; set; } /// /// /// - public global::Shotstack.TextAnimationPreset? Type246 { get; set; } + public global::System.Collections.Generic.IList? Type246 { get; set; } /// /// /// - public global::Shotstack.RichCaptionFontStyle? Type247 { get; set; } + public global::Shotstack.IngestErrorResponseData? Type247 { get; set; } /// /// /// - public global::Shotstack.RichCaptionStyleTextTransform? Type248 { get; set; } + public global::Shotstack.TextAnimationPreset? Type248 { get; set; } /// /// /// - public global::Shotstack.RichCaptionStyleTextDecoration? Type249 { get; set; } + public global::Shotstack.RichCaptionFontStyle? Type249 { get; set; } /// /// /// - public global::Shotstack.TiktokDestinationOptions? Type250 { get; set; } + public global::Shotstack.RichCaptionStyleTextTransform? Type250 { get; set; } /// /// /// - public global::Shotstack.TiktokDestinationOptionsPrivacyLevel? Type251 { get; set; } + public global::Shotstack.RichCaptionStyleTextDecoration? Type251 { get; set; } /// /// /// - public global::Shotstack.AkamaiNetStorageDestinationOptions? Type252 { get; set; } + public global::Shotstack.TiktokDestinationOptions? Type252 { get; set; } /// /// /// - public global::Shotstack.AzureBlobStorageDestinationOptions? Type253 { get; set; } + public global::Shotstack.TiktokDestinationOptionsPrivacyLevel? Type253 { get; set; } /// /// /// - public global::Shotstack.PostGenerateRequest? Type254 { get; set; } + public global::Shotstack.AkamaiNetStorageDestinationOptions? Type254 { get; set; } /// /// /// - public global::Shotstack.OneOf? Type255 { get; set; } + public global::Shotstack.AzureBlobStorageDestinationOptions? Type255 { get; set; } + /// + /// + /// + public global::Shotstack.PostGenerateRequest? Type256 { get; set; } /// /// diff --git a/src/libs/Shotstack/Generated/Shotstack.OneOf.3.Json.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationAsset.Json.g.cs similarity index 88% rename from src/libs/Shotstack/Generated/Shotstack.OneOf.3.Json.g.cs rename to src/libs/Shotstack/Generated/Shotstack.Models.GenerationAsset.Json.g.cs index 4ac0ca1..19bfda1 100644 --- a/src/libs/Shotstack/Generated/Shotstack.OneOf.3.Json.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationAsset.Json.g.cs @@ -2,7 +2,7 @@ namespace Shotstack { - public readonly partial struct OneOf + public sealed partial class GenerationAsset { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Shotstack.OneOf? FromJson( + public static global::Shotstack.GenerationAsset? 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?; + typeof(global::Shotstack.GenerationAsset), + jsonSerializerContext) as global::Shotstack.GenerationAsset; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::Shotstack.OneOf? FromJson( + public static global::Shotstack.GenerationAsset? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [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( + public static global::Shotstack.GenerationAsset? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::Shotstack.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize>( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + 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?; + typeof(global::Shotstack.GenerationAsset), + jsonSerializerContext).ConfigureAwait(false)) as global::Shotstack.GenerationAsset; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [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( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::Shotstack.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.GenerationAsset.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationAsset.g.cs new file mode 100644 index 0000000..8839a89 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationAsset.g.cs @@ -0,0 +1,94 @@ + +#nullable enable + +namespace Shotstack +{ + /// + /// An image, video or audio asset to generate from a text prompt. + /// + public sealed partial class GenerationAsset + { + /// + /// The kind of asset to generate.
+ /// Example: image + ///
+ /// image + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Shotstack.JsonConverters.GenerationAssetTypeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Shotstack.GenerationAssetType Type { get; set; } + + /// + /// A description of the asset to generate. For text-to-speech models it is the text spoken.
+ /// Example: A lighthouse on a rocky coast at sunset, cinematic lighting + ///
+ /// A lighthouse on a rocky coast at sunset, cinematic lighting + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// The generation model. Defaults to `nano-banana-2` for images, `seedance-2.0-text-to-video` for video and `elevenlabs-multilingual-v2` for audio. `GET /models` lists the models for each type.
+ /// Example: nano-banana-2 + ///
+ /// nano-banana-2 + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + public string? Model { get; set; } + + /// + /// Settings for the chosen `model`. `GET /models` lists the options each model accepts; omitted options use the model's defaults and unknown or invalid options are rejected. A starting image for video goes in `startSrc` (`inputSrc` on the original image-to-video models) and a speech voice in `voice`.
+ /// Example: {"aspectRatio":"16:9"} + ///
+ /// {"aspectRatio":"16:9"} + [global::System.Text.Json.Serialization.JsonPropertyName("options")] + public object? Options { 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 kind of asset to generate.
+ /// Example: image + /// + /// + /// A description of the asset to generate. For text-to-speech models it is the text spoken.
+ /// Example: A lighthouse on a rocky coast at sunset, cinematic lighting + /// + /// + /// The generation model. Defaults to `nano-banana-2` for images, `seedance-2.0-text-to-video` for video and `elevenlabs-multilingual-v2` for audio. `GET /models` lists the models for each type.
+ /// Example: nano-banana-2 + /// + /// + /// Settings for the chosen `model`. `GET /models` lists the options each model accepts; omitted options use the model's defaults and unknown or invalid options are rejected. A starting image for video goes in `startSrc` (`inputSrc` on the original image-to-video models) and a speech voice in `voice`.
+ /// Example: {"aspectRatio":"16:9"} + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GenerationAsset( + global::Shotstack.GenerationAssetType type, + string prompt, + string? model, + object? options) + { + this.Type = type; + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Model = model; + this.Options = options; + } + + /// + /// Initializes a new instance of the class. + /// + public GenerationAsset() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.GenerationAssetOptions.Json.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationAssetOptions.Json.g.cs new file mode 100644 index 0000000..0be1f84 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationAssetOptions.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Shotstack +{ + public sealed partial class GenerationAssetOptions + { + /// + /// 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.GenerationAssetOptions? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Shotstack.GenerationAssetOptions), + jsonSerializerContext) as global::Shotstack.GenerationAssetOptions; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Shotstack.GenerationAssetOptions? 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.GenerationAssetOptions? 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.GenerationAssetOptions), + jsonSerializerContext).ConfigureAwait(false)) as global::Shotstack.GenerationAssetOptions; + } + + /// + /// 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.GenerationAssetOptions.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationAssetOptions.g.cs new file mode 100644 index 0000000..dbcd815 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationAssetOptions.g.cs @@ -0,0 +1,20 @@ + +#nullable enable + +namespace Shotstack +{ + /// + /// Settings for the chosen `model`. `GET /models` lists the options each model accepts; omitted options use the model's defaults and unknown or invalid options are rejected. A starting image for video goes in `startSrc` (`inputSrc` on the original image-to-video models) and a speech voice in `voice`.
+ /// Example: {"aspectRatio":"16:9"} + ///
+ public sealed partial class GenerationAssetOptions + { + + /// + /// 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.GenerationAssetType.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationAssetType.g.cs new file mode 100644 index 0000000..331fca9 --- /dev/null +++ b/src/libs/Shotstack/Generated/Shotstack.Models.GenerationAssetType.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Shotstack +{ + /// + /// The kind of asset to generate.
+ /// Example: image + ///
+ public enum GenerationAssetType + { + /// + /// + /// + Audio, + /// + /// + /// + Image, + /// + /// + /// + Video, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class GenerationAssetTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this GenerationAssetType value) + { + return value switch + { + GenerationAssetType.Audio => "audio", + GenerationAssetType.Image => "image", + GenerationAssetType.Video => "video", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static GenerationAssetType? ToEnum(string value) + { + return value switch + { + "audio" => GenerationAssetType.Audio, + "image" => GenerationAssetType.Image, + "video" => GenerationAssetType.Video, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.Models.PostGenerateRequest.g.cs b/src/libs/Shotstack/Generated/Shotstack.Models.PostGenerateRequest.g.cs index 5cb9e97..f76631b 100644 --- a/src/libs/Shotstack/Generated/Shotstack.Models.PostGenerateRequest.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.Models.PostGenerateRequest.g.cs @@ -9,12 +9,11 @@ namespace Shotstack public sealed partial class PostGenerateRequest { /// - /// + /// An image, video or audio asset to generate from a text prompt. /// [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; } + public required global::Shotstack.GenerationAsset Asset { get; set; } /// /// The length, in seconds, of the clip the asset fills. A model that generates to a duration takes it from this value in place of its own duration option. Other models ignore it.
@@ -33,7 +32,9 @@ public sealed partial class PostGenerateRequest /// /// Initializes a new instance of the class. /// - /// + /// + /// An image, video or audio asset to generate from a text prompt. + /// /// /// The length, in seconds, of the clip the asset fills. A model that generates to a duration takes it from this value in place of its own duration option. Other models ignore it.
/// Example: 5 @@ -42,10 +43,10 @@ public sealed partial class PostGenerateRequest [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public PostGenerateRequest( - global::Shotstack.OneOf asset, + global::Shotstack.GenerationAsset asset, double? length) { - this.Asset = asset; + this.Asset = asset ?? throw new global::System.ArgumentNullException(nameof(asset)); this.Length = length; } diff --git a/src/libs/Shotstack/Generated/Shotstack.OneOf.3.g.cs b/src/libs/Shotstack/Generated/Shotstack.OneOf.3.g.cs deleted file mode 100644 index cf69668..0000000 --- a/src/libs/Shotstack/Generated/Shotstack.OneOf.3.g.cs +++ /dev/null @@ -1,377 +0,0 @@ - -#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() => Value1 is { } value - ? value - : 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() => Value2 is { } value - ? value - : 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() => Value3 is { } value - ? value - : 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 (Value1 is { } __value0 && value1 != null) - { - return value1(__value0); - } - else if (Value2 is { } __value1 && value2 != null) - { - return value2(__value1); - } - else if (Value3 is { } __value2 && value3 != null) - { - return value3(__value2); - } - - 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 (Value1 is { } __value0) - { - value1?.Invoke(__value0); - } - else if (Value2 is { } __value1) - { - value2?.Invoke(__value1); - } - else if (Value3 is { } __value2) - { - value3?.Invoke(__value2); - } - } - - /// - /// - /// - 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 (Value1 is { } __value0) - { - value1?.Invoke(__value0); - } - else if (Value2 is { } __value1) - { - value2?.Invoke(__value1); - } - else if (Value3 is { } __value2) - { - value3?.Invoke(__value2); - } - } - - /// - /// - /// - 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 930f5fd..2d3b81c 100644 --- a/src/libs/Shotstack/openapi.json +++ b/src/libs/Shotstack/openapi.json @@ -780,7 +780,8 @@ } ], "requestBody": { - "description": "A prompt-bearing image, video or audio asset to generate.", + "required": true, + "description": "The asset to generate and, for models that generate to a duration, the length of the clip it fills.", "content": { "application/json": { "example": { @@ -794,17 +795,7 @@ "type": "object", "properties": { "asset": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageAsset" - }, - { - "$ref": "#/components/schemas/VideoAsset" - }, - { - "$ref": "#/components/schemas/AudioAsset" - } - ] + "$ref": "#/components/schemas/GenerationAsset" }, "length": { "description": "The length, in seconds, of the clip the asset fills. A model that generates to a duration takes it from this value in place of its own duration option. Other models ignore it.", @@ -4799,6 +4790,48 @@ ], "type": "object" }, + "GenerationAsset": { + "description": "An image, video or audio asset to generate from a text prompt.", + "type": "object", + "properties": { + "type": { + "description": "The kind of asset to generate.", + "type": "string", + "enum": [ + "image", + "video", + "audio" + ], + "example": "image" + }, + "prompt": { + "description": "A description of the asset to generate. For text-to-speech models it is the text spoken.", + "type": "string", + "minLength": 1, + "maxLength": 4000, + "pattern": "\\S", + "example": "A lighthouse on a rocky coast at sunset, cinematic lighting" + }, + "model": { + "description": "The generation model. Defaults to `nano-banana-2` for images, `seedance-2.0-text-to-video` for video and `elevenlabs-multilingual-v2` for audio. `GET /models` lists the models for each type.", + "type": "string", + "example": "nano-banana-2" + }, + "options": { + "description": "Settings for the chosen `model`. `GET /models` lists the options each model accepts; omitted options use the model's defaults and unknown or invalid options are rejected. A starting image for video goes in `startSrc` (`inputSrc` on the original image-to-video models) and a speech voice in `voice`.", + "type": "object", + "additionalProperties": true, + "example": { + "aspectRatio": "16:9" + } + } + }, + "additionalProperties": false, + "required": [ + "type", + "prompt" + ] + }, "GenerationModel": { "description": "A generation model available to `prompt`-bearing image, video and audio assets, with the options it accepts and what it costs. Render a model picker and its option fields from this rather than hard coding a model list, so a newly launched model is available without a client release.", "properties": {