Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ partial void ProcessGetModelsResponseContent(
/// on your side. Each entry carries the asset type it generates, so filter the list<br/>
/// client side when a picker only needs one kind.<br/>
/// Option schemas are omitted by default. Request them with `expand=options`.<br/>
/// Each model's `available` reflects the plan of the account behind the calling API<br/>
/// key, so offer only the models it marks available.<br/>
/// **Base URL:** &lt;a href="#"&gt;https://api.shotstack.io/edit/{version}&lt;/a&gt;
/// </summary>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
Expand All @@ -73,6 +75,8 @@ partial void ProcessGetModelsResponseContent(
/// on your side. Each entry carries the asset type it generates, so filter the list<br/>
/// client side when a picker only needs one kind.<br/>
/// Option schemas are omitted by default. Request them with `expand=options`.<br/>
/// Each model's `available` reflects the plan of the account behind the calling API<br/>
/// key, so offer only the models it marks available.<br/>
/// **Base URL:** &lt;a href="#"&gt;https://api.shotstack.io/edit/{version}&lt;/a&gt;
/// </summary>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public partial interface IEditClient
/// on your side. Each entry carries the asset type it generates, so filter the list<br/>
/// client side when a picker only needs one kind.<br/>
/// Option schemas are omitted by default. Request them with `expand=options`.<br/>
/// Each model's `available` reflects the plan of the account behind the calling API<br/>
/// key, so offer only the models it marks available.<br/>
/// **Base URL:** &lt;a href="#"&gt;https://api.shotstack.io/edit/{version}&lt;/a&gt;
/// </summary>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
Expand All @@ -30,6 +32,8 @@ public partial interface IEditClient
/// on your side. Each entry carries the asset type it generates, so filter the list<br/>
/// client side when a picker only needs one kind.<br/>
/// Option schemas are omitted by default. Request them with `expand=options`.<br/>
/// Each model's `available` reflects the plan of the account behind the calling API<br/>
/// key, so offer only the models it marks available.<br/>
/// **Base URL:** &lt;a href="#"&gt;https://api.shotstack.io/edit/{version}&lt;/a&gt;
/// </summary>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace Shotstack.JsonConverters
{
/// <inheritdoc />
public sealed class GenerationModelUnavailableReasonJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Shotstack.GenerationModelUnavailableReason>
{
/// <inheritdoc />
public override global::Shotstack.GenerationModelUnavailableReason 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.GenerationModelUnavailableReasonExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Shotstack.GenerationModelUnavailableReason)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Shotstack.GenerationModelUnavailableReason);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Shotstack.GenerationModelUnavailableReason value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::Shotstack.GenerationModelUnavailableReasonExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace Shotstack.JsonConverters
{
/// <inheritdoc />
public sealed class GenerationModelUnavailableReasonNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Shotstack.GenerationModelUnavailableReason?>
{
/// <inheritdoc />
public override global::Shotstack.GenerationModelUnavailableReason? 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.GenerationModelUnavailableReasonExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Shotstack.GenerationModelUnavailableReason)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Shotstack.GenerationModelUnavailableReason?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Shotstack.GenerationModelUnavailableReason? 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.GenerationModelUnavailableReasonExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ namespace Shotstack

typeof(global::Shotstack.JsonConverters.GenerationModelTypeNullableJsonConverter),

typeof(global::Shotstack.JsonConverters.GenerationModelUnavailableReasonJsonConverter),

typeof(global::Shotstack.JsonConverters.GenerationModelUnavailableReasonNullableJsonConverter),

typeof(global::Shotstack.JsonConverters.AssetJsonConverter),

typeof(global::Shotstack.JsonConverters.DestinationsJsonConverter),
Expand Down Expand Up @@ -629,6 +633,7 @@ namespace Shotstack
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelPricingQuantityRound), TypeInfoPropertyName = "GenerationModelPricingQuantityRound2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModel))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelType), TypeInfoPropertyName = "GenerationModelType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelUnavailableReason), TypeInfoPropertyName = "GenerationModelUnavailableReason2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelListResponse))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Shotstack.GenerationModel>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.PostGenerateRequest))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1017,19 +1017,23 @@ public sealed partial class JsonSerializerContextTypes
/// <summary>
///
/// </summary>
public global::Shotstack.GenerationModelListResponse? Type246 { get; set; }
public global::Shotstack.GenerationModelUnavailableReason? Type246 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::Shotstack.GenerationModel>? Type247 { get; set; }
public global::Shotstack.GenerationModelListResponse? Type247 { get; set; }
/// <summary>
///
/// </summary>
public global::Shotstack.PostGenerateRequest? Type248 { get; set; }
public global::System.Collections.Generic.IList<global::Shotstack.GenerationModel>? Type248 { get; set; }
/// <summary>
///
/// </summary>
public global::Shotstack.OneOf<global::Shotstack.ImageAsset, global::Shotstack.VideoAsset, global::Shotstack.AudioAsset>? Type249 { get; set; }
public global::Shotstack.PostGenerateRequest? Type249 { get; set; }
/// <summary>
///
/// </summary>
public global::Shotstack.OneOf<global::Shotstack.ImageAsset, global::Shotstack.VideoAsset, global::Shotstack.AudioAsset>? Type250 { get; set; }

/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ public sealed partial class GenerationModel
[global::System.Text.Json.Serialization.JsonRequired]
public required global::Shotstack.GenerationModelType Type { get; set; }

/// <summary>
/// The model's display name, for a model picker.<br/>
/// Example: Seedance 2.0 · Text to video
/// </summary>
/// <example>Seedance 2.0 · Text to video</example>
[global::System.Text.Json.Serialization.JsonPropertyName("name")]
public string? Name { get; set; }

/// <summary>
/// What the model is suited to, in a sentence or two.<br/>
/// Example: Generate cinematic video with realistic motion, prompt-directed camera movement and optional synchronised audio.
/// </summary>
/// <example>Generate cinematic video with realistic motion, prompt-directed camera movement and optional synchronised audio.</example>
[global::System.Text.Json.Serialization.JsonPropertyName("description")]
public string? Description { get; set; }

/// <summary>
/// What one generation costs, in credits: the rate multiplied by the units consumed. `quantity` says how to count the units, and is absent when one generation is one unit. Where a model charges differently per option value, `credits` is an object keyed by that value and `tieredBy` names the option that selects it.
/// </summary>
Expand All @@ -39,6 +55,23 @@ public sealed partial class GenerationModel
[global::System.Text.Json.Serialization.JsonPropertyName("options")]
public object? Options { get; set; }

/// <summary>
/// Whether the account behind the calling API key can generate with this model. Omitted when that cannot be determined; treat a missing value as unknown, not as available. Generation requests are checked either way.<br/>
/// Example: false
/// </summary>
/// <example>false</example>
[global::System.Text.Json.Serialization.JsonPropertyName("available")]
public bool? Available { get; set; }

/// <summary>
/// Why `available` is false. `AiCapabilityNotIncluded`: the account's plan does not include this kind of generation. `AiDisabled`: AI generation is turned off for the account. `AiAccessUnavailable`: access could not be confirmed; try again later.<br/>
/// Example: AiCapabilityNotIncluded
/// </summary>
/// <example>AiCapabilityNotIncluded</example>
[global::System.Text.Json.Serialization.JsonPropertyName("unavailableReason")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Shotstack.JsonConverters.GenerationModelUnavailableReasonJsonConverter))]
public global::Shotstack.GenerationModelUnavailableReason? UnavailableReason { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
Expand All @@ -56,25 +89,49 @@ public sealed partial class GenerationModel
/// The asset type this model generates.<br/>
/// Example: video
/// </param>
/// <param name="name">
/// The model's display name, for a model picker.<br/>
/// Example: Seedance 2.0 · Text to video
/// </param>
/// <param name="description">
/// What the model is suited to, in a sentence or two.<br/>
/// Example: Generate cinematic video with realistic motion, prompt-directed camera movement and optional synchronised audio.
/// </param>
/// <param name="pricing">
/// What one generation costs, in credits: the rate multiplied by the units consumed. `quantity` says how to count the units, and is absent when one generation is one unit. Where a model charges differently per option value, `credits` is an object keyed by that value and `tieredBy` names the option that selects it.
/// </param>
/// <param name="options">
/// JSON Schema for the model's `options` object. Only returned for a single model, or for a list requested with `expand=options`. Values outside this schema are rejected.
/// </param>
/// <param name="available">
/// Whether the account behind the calling API key can generate with this model. Omitted when that cannot be determined; treat a missing value as unknown, not as available. Generation requests are checked either way.<br/>
/// Example: false
/// </param>
/// <param name="unavailableReason">
/// Why `available` is false. `AiCapabilityNotIncluded`: the account's plan does not include this kind of generation. `AiDisabled`: AI generation is turned off for the account. `AiAccessUnavailable`: access could not be confirmed; try again later.<br/>
/// Example: AiCapabilityNotIncluded
/// </param>
#if NET7_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
#endif
public GenerationModel(
string model,
global::Shotstack.GenerationModelType type,
string? name,
string? description,
global::Shotstack.GenerationModelPricing? pricing,
object? options)
object? options,
bool? available,
global::Shotstack.GenerationModelUnavailableReason? unavailableReason)
{
this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model));
this.Type = type;
this.Name = name;
this.Description = description;
this.Pricing = pricing;
this.Options = options;
this.Available = available;
this.UnavailableReason = unavailableReason;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

#nullable enable

namespace Shotstack
{
/// <summary>
/// Why `available` is false. `AiCapabilityNotIncluded`: the account's plan does not include this kind of generation. `AiDisabled`: AI generation is turned off for the account. `AiAccessUnavailable`: access could not be confirmed; try again later.<br/>
/// Example: AiCapabilityNotIncluded
/// </summary>
public enum GenerationModelUnavailableReason
{
/// <summary>
/// the account's plan does not include this kind of generation. `AiDisabled`: AI generation is turned off for the account. `AiAccessUnavailable`: access could not be confirmed; try again later.
/// </summary>
AiAccessUnavailable,
/// <summary>
/// the account's plan does not include this kind of generation. `AiDisabled`: AI generation is turned off for the account. `AiAccessUnavailable`: access could not be confirmed; try again later.
/// </summary>
AiCapabilityNotIncluded,
/// <summary>
/// the account's plan does not include this kind of generation. `AiDisabled`: AI generation is turned off for the account. `AiAccessUnavailable`: access could not be confirmed; try again later.
/// </summary>
AiDisabled,
}

/// <summary>
/// Enum extensions to do fast conversions without the reflection.
/// </summary>
public static class GenerationModelUnavailableReasonExtensions
{
/// <summary>
/// Converts an enum to a string.
/// </summary>
public static string ToValueString(this GenerationModelUnavailableReason value)
{
return value switch
{
GenerationModelUnavailableReason.AiAccessUnavailable => "AiAccessUnavailable",
GenerationModelUnavailableReason.AiCapabilityNotIncluded => "AiCapabilityNotIncluded",
GenerationModelUnavailableReason.AiDisabled => "AiDisabled",
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
};
}
/// <summary>
/// Converts an string to a enum.
/// </summary>
public static GenerationModelUnavailableReason? ToEnum(string value)
{
return value switch
{
"AiAccessUnavailable" => GenerationModelUnavailableReason.AiAccessUnavailable,
"AiCapabilityNotIncluded" => GenerationModelUnavailableReason.AiCapabilityNotIncluded,
"AiDisabled" => GenerationModelUnavailableReason.AiDisabled,
_ => null,
};
}
}
}
Loading
Loading