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
@@ -0,0 +1,53 @@
#nullable enable

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

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

return default;
}

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

writer.WriteStringValue(global::Shotstack.GenerationModelPricingQuantityMeasureExtensions.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 GenerationModelPricingQuantityMeasureNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Shotstack.GenerationModelPricingQuantityMeasure?>
{
/// <inheritdoc />
public override global::Shotstack.GenerationModelPricingQuantityMeasure? 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.GenerationModelPricingQuantityMeasureExtensions.ToEnum(stringValue);
}

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

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Shotstack.GenerationModelPricingQuantityMeasure? 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.GenerationModelPricingQuantityMeasureExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace Shotstack.JsonConverters
{
/// <inheritdoc />
public sealed class GenerationModelPricingUnitJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Shotstack.GenerationModelPricingUnit>
public sealed class GenerationModelPricingQuantityRoundJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Shotstack.GenerationModelPricingQuantityRound>
{
/// <inheritdoc />
public override global::Shotstack.GenerationModelPricingUnit Read(
public override global::Shotstack.GenerationModelPricingQuantityRound Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
Expand All @@ -18,19 +18,19 @@ public sealed class GenerationModelPricingUnitJsonConverter : global::System.Tex
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Shotstack.GenerationModelPricingUnitExtensions.ToEnum(stringValue) ?? default;
return global::Shotstack.GenerationModelPricingQuantityRoundExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Shotstack.GenerationModelPricingUnit)numValue;
return (global::Shotstack.GenerationModelPricingQuantityRound)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Shotstack.GenerationModelPricingUnit);
return default(global::Shotstack.GenerationModelPricingQuantityRound);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
Expand All @@ -42,12 +42,12 @@ public sealed class GenerationModelPricingUnitJsonConverter : global::System.Tex
/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Shotstack.GenerationModelPricingUnit value,
global::Shotstack.GenerationModelPricingQuantityRound value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::Shotstack.GenerationModelPricingUnitExtensions.ToValueString(value));
writer.WriteStringValue(global::Shotstack.GenerationModelPricingQuantityRoundExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace Shotstack.JsonConverters
{
/// <inheritdoc />
public sealed class GenerationModelPricingUnitNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Shotstack.GenerationModelPricingUnit?>
public sealed class GenerationModelPricingQuantityRoundNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Shotstack.GenerationModelPricingQuantityRound?>
{
/// <inheritdoc />
public override global::Shotstack.GenerationModelPricingUnit? Read(
public override global::Shotstack.GenerationModelPricingQuantityRound? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
Expand All @@ -18,19 +18,19 @@ public sealed class GenerationModelPricingUnitNullableJsonConverter : global::Sy
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Shotstack.GenerationModelPricingUnitExtensions.ToEnum(stringValue);
return global::Shotstack.GenerationModelPricingQuantityRoundExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Shotstack.GenerationModelPricingUnit)numValue;
return (global::Shotstack.GenerationModelPricingQuantityRound)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Shotstack.GenerationModelPricingUnit?);
return default(global::Shotstack.GenerationModelPricingQuantityRound?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
Expand All @@ -42,7 +42,7 @@ public sealed class GenerationModelPricingUnitNullableJsonConverter : global::Sy
/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Shotstack.GenerationModelPricingUnit? value,
global::Shotstack.GenerationModelPricingQuantityRound? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
Expand All @@ -53,7 +53,7 @@ public override void Write(
}
else
{
writer.WriteStringValue(global::Shotstack.GenerationModelPricingUnitExtensions.ToValueString(value.Value));
writer.WriteStringValue(global::Shotstack.GenerationModelPricingQuantityRoundExtensions.ToValueString(value.Value));
}
}
}
Expand Down
15 changes: 10 additions & 5 deletions src/libs/Shotstack/Generated/Shotstack.JsonSerializerContext.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,13 @@ namespace Shotstack

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

typeof(global::Shotstack.JsonConverters.GenerationModelPricingUnitJsonConverter),
typeof(global::Shotstack.JsonConverters.GenerationModelPricingQuantityMeasureJsonConverter),

typeof(global::Shotstack.JsonConverters.GenerationModelPricingUnitNullableJsonConverter),
typeof(global::Shotstack.JsonConverters.GenerationModelPricingQuantityMeasureNullableJsonConverter),

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

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

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

Expand Down Expand Up @@ -618,9 +622,11 @@ namespace Shotstack
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationResponse))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationResponseStatus), TypeInfoPropertyName = "GenerationResponseStatus2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelPricing))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelPricingUnit), TypeInfoPropertyName = "GenerationModelPricingUnit2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.OneOf<double?, object>), TypeInfoPropertyName = "OneOfDoubleObject2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<string>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelPricingTieredBy))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelPricingQuantity))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelPricingQuantityMeasure), TypeInfoPropertyName = "GenerationModelPricingQuantityMeasure2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelPricingQuantityRound), TypeInfoPropertyName = "GenerationModelPricingQuantityRound2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModel))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelType), TypeInfoPropertyName = "GenerationModelType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Shotstack.GenerationModelListResponse))]
Expand All @@ -643,7 +649,6 @@ namespace Shotstack
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Shotstack.SourceResponseData>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Shotstack.RenditionResponseAttributes>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Shotstack.IngestErrorResponseData>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<string>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Shotstack.GenerationModel>))]
public sealed partial class SourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -989,39 +989,47 @@ public sealed partial class JsonSerializerContextTypes
/// <summary>
///
/// </summary>
public global::Shotstack.GenerationModelPricingUnit? Type239 { get; set; }
public global::Shotstack.OneOf<double?, object>? Type239 { get; set; }
/// <summary>
///
/// </summary>
public global::Shotstack.OneOf<double?, object>? Type240 { get; set; }
public global::Shotstack.GenerationModelPricingTieredBy? Type240 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<string>? Type241 { get; set; }
public global::Shotstack.GenerationModelPricingQuantity? Type241 { get; set; }
/// <summary>
///
/// </summary>
public global::Shotstack.GenerationModel? Type242 { get; set; }
public global::Shotstack.GenerationModelPricingQuantityMeasure? Type242 { get; set; }
/// <summary>
///
/// </summary>
public global::Shotstack.GenerationModelType? Type243 { get; set; }
public global::Shotstack.GenerationModelPricingQuantityRound? Type243 { get; set; }
/// <summary>
///
/// </summary>
public global::Shotstack.GenerationModelListResponse? Type244 { get; set; }
public global::Shotstack.GenerationModel? Type244 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::Shotstack.GenerationModel>? Type245 { get; set; }
public global::Shotstack.GenerationModelType? Type245 { get; set; }
/// <summary>
///
/// </summary>
public global::Shotstack.PostGenerateRequest? Type246 { get; set; }
public global::Shotstack.GenerationModelListResponse? Type246 { get; set; }
/// <summary>
///
/// </summary>
public global::Shotstack.OneOf<global::Shotstack.ImageAsset, global::Shotstack.VideoAsset, global::Shotstack.AudioAsset>? Type247 { get; set; }
public global::System.Collections.Generic.IList<global::Shotstack.GenerationModel>? Type247 { get; set; }
/// <summary>
///
/// </summary>
public global::Shotstack.PostGenerateRequest? Type248 { get; set; }
/// <summary>
///
/// </summary>
public global::Shotstack.OneOf<global::Shotstack.ImageAsset, global::Shotstack.VideoAsset, global::Shotstack.AudioAsset>? Type249 { get; set; }

/// <summary>
///
Expand Down Expand Up @@ -1090,10 +1098,6 @@ public sealed partial class JsonSerializerContextTypes
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.List<string>? ListType16 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.List<global::Shotstack.GenerationModel>? ListType17 { get; set; }
public global::System.Collections.Generic.List<global::Shotstack.GenerationModel>? ListType16 { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public sealed partial class GenerationModel
public required global::Shotstack.GenerationModelType Type { get; set; }

/// <summary>
/// What one generation costs, in credits. There is no formula to evaluate: multiply the rate by the number of units the generation consumes. Where a model charges differently per option value, `credits` is an object keyed by that value and `tieredBy` names the option that selects it.
/// 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>
[global::System.Text.Json.Serialization.JsonPropertyName("pricing")]
public global::Shotstack.GenerationModelPricing? Pricing { get; set; }
Expand Down Expand Up @@ -57,7 +57,7 @@ public sealed partial class GenerationModel
/// Example: video
/// </param>
/// <param name="pricing">
/// What one generation costs, in credits. There is no formula to evaluate: multiply the rate by the number of units the generation consumes. Where a model charges differently per option value, `credits` is an object keyed by that value and `tieredBy` names the option that selects it.
/// 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.
Expand Down
Loading