From ba81c2e4b70328d5a84d6b472f9dd0df1a74d2a1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 13 Sep 2026 17:54:21 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../MiniMax.Files.JsonSerializerContext.g.cs | 186 ++++++++++++++ ...Max.FilesClient.Authorizations.Bearer.g.cs | 35 +++ ...niMax.FilesClient.Constructors.Bearer.g.cs | 31 +++ .../Generated/MiniMax.FilesClient.g.cs | 2 +- ...ax.IFilesClient.Authorizations.Bearer.g.cs | 16 ++ ...ax.IImageClient.Authorizations.Bearer.g.cs | 16 ++ ...ax.IMusicClient.Authorizations.Bearer.g.cs | 16 ++ ...x.ISpeechClient.Authorizations.Bearer.g.cs | 16 ++ ...ax.IVideoClient.Authorizations.Bearer.g.cs | 16 ++ .../MiniMax.Image.JsonSerializerContext.g.cs | 208 ++++++++++++++++ ...Max.ImageClient.Authorizations.Bearer.g.cs | 35 +++ ...niMax.ImageClient.Constructors.Bearer.g.cs | 31 +++ .../Generated/MiniMax.ImageClient.g.cs | 2 +- .../MiniMax.Music.JsonSerializerContext.g.cs | 207 ++++++++++++++++ ...Max.MusicClient.Authorizations.Bearer.g.cs | 35 +++ ...niMax.MusicClient.Constructors.Bearer.g.cs | 31 +++ .../Generated/MiniMax.MusicClient.g.cs | 2 +- ...ax.SpeechClient.Authorizations.Bearer.g.cs | 35 +++ ...iMax.SpeechClient.Constructors.Bearer.g.cs | 31 +++ .../MiniMax.Video.JsonSerializerContext.g.cs | 229 ++++++++++++++++++ ...Max.VideoClient.Authorizations.Bearer.g.cs | 35 +++ ...niMax.VideoClient.Constructors.Bearer.g.cs | 31 +++ .../Generated/MiniMax.VideoClient.g.cs | 2 +- 23 files changed, 1244 insertions(+), 4 deletions(-) create mode 100644 src/libs/MiniMax/Generated/MiniMax.Files.JsonSerializerContext.g.cs create mode 100644 src/libs/MiniMax/Generated/MiniMax.FilesClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/MiniMax/Generated/MiniMax.FilesClient.Constructors.Bearer.g.cs create mode 100644 src/libs/MiniMax/Generated/MiniMax.IFilesClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/MiniMax/Generated/MiniMax.IImageClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/MiniMax/Generated/MiniMax.IMusicClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/MiniMax/Generated/MiniMax.ISpeechClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/MiniMax/Generated/MiniMax.IVideoClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/MiniMax/Generated/MiniMax.Image.JsonSerializerContext.g.cs create mode 100644 src/libs/MiniMax/Generated/MiniMax.ImageClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/MiniMax/Generated/MiniMax.ImageClient.Constructors.Bearer.g.cs create mode 100644 src/libs/MiniMax/Generated/MiniMax.Music.JsonSerializerContext.g.cs create mode 100644 src/libs/MiniMax/Generated/MiniMax.MusicClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/MiniMax/Generated/MiniMax.MusicClient.Constructors.Bearer.g.cs create mode 100644 src/libs/MiniMax/Generated/MiniMax.SpeechClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/MiniMax/Generated/MiniMax.SpeechClient.Constructors.Bearer.g.cs create mode 100644 src/libs/MiniMax/Generated/MiniMax.Video.JsonSerializerContext.g.cs create mode 100644 src/libs/MiniMax/Generated/MiniMax.VideoClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/MiniMax/Generated/MiniMax.VideoClient.Constructors.Bearer.g.cs diff --git a/src/libs/MiniMax/Generated/MiniMax.Files.JsonSerializerContext.g.cs b/src/libs/MiniMax/Generated/MiniMax.Files.JsonSerializerContext.g.cs new file mode 100644 index 0000000..0d6f2de --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.Files.JsonSerializerContext.g.cs @@ -0,0 +1,186 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace MiniMax +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.BaseResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.FileUploadRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.FileUploadRequestPurpose), TypeInfoPropertyName = "FileUploadRequestPurpose2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.FileInfo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.FileUploadResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.FileRetrieveResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.FileListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.FileDeleteRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.FileDeleteRequestPurpose), TypeInfoPropertyName = "FileDeleteRequestPurpose2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.FileDeleteResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.FileUploadRequestPurpose?), TypeInfoPropertyName = "NullableFileUploadRequestPurpose2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.FileDeleteRequestPurpose?), TypeInfoPropertyName = "NullableFileDeleteRequestPurpose2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class FilesSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class FilesSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static FilesSourceGenerationContext Default { get; } = new(DefaultOptions); + + private FilesSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::MiniMax.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::MiniMax.FileUploadRequestPurpose) + + || typeToConvert == typeof(global::MiniMax.FileUploadRequestPurpose?) + + || typeToConvert == typeof(global::MiniMax.FileDeleteRequestPurpose) + + || typeToConvert == typeof(global::MiniMax.FileDeleteRequestPurpose?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::MiniMax.FileUploadRequestPurpose)) + { + return new global::MiniMax.JsonConverters.FileUploadRequestPurposeJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.FileUploadRequestPurpose?)) + { + return new global::MiniMax.JsonConverters.FileUploadRequestPurposeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.FileDeleteRequestPurpose)) + { + return new global::MiniMax.JsonConverters.FileDeleteRequestPurposeJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.FileDeleteRequestPurpose?)) + { + return new global::MiniMax.JsonConverters.FileDeleteRequestPurposeNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new FilesSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.FilesClient.Authorizations.Bearer.g.cs b/src/libs/MiniMax/Generated/MiniMax.FilesClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..2490eaa --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.FilesClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace MiniMax +{ + public sealed partial class FilesClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::MiniMax.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.FilesClient.Constructors.Bearer.g.cs b/src/libs/MiniMax/Generated/MiniMax.FilesClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..1ad00af --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.FilesClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace MiniMax +{ + public sealed partial class FilesClient + { + /// + + public FilesClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.FilesClient.g.cs b/src/libs/MiniMax/Generated/MiniMax.FilesClient.g.cs index 4c6c08e..f2c7b93 100644 --- a/src/libs/MiniMax/Generated/MiniMax.FilesClient.g.cs +++ b/src/libs/MiniMax/Generated/MiniMax.FilesClient.g.cs @@ -38,7 +38,7 @@ public sealed partial class FilesClient : global::MiniMax.IFilesClient, global:: internal global::MiniMax.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::MiniMax.AutoSDKServerConfiguration(); - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::MiniMax.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::MiniMax.FilesSourceGenerationContext.Default); /// /// diff --git a/src/libs/MiniMax/Generated/MiniMax.IFilesClient.Authorizations.Bearer.g.cs b/src/libs/MiniMax/Generated/MiniMax.IFilesClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..cef2383 --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.IFilesClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace MiniMax +{ + public partial interface IFilesClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.IImageClient.Authorizations.Bearer.g.cs b/src/libs/MiniMax/Generated/MiniMax.IImageClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..d788981 --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.IImageClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace MiniMax +{ + public partial interface IImageClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.IMusicClient.Authorizations.Bearer.g.cs b/src/libs/MiniMax/Generated/MiniMax.IMusicClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..8c9cd76 --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.IMusicClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace MiniMax +{ + public partial interface IMusicClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.ISpeechClient.Authorizations.Bearer.g.cs b/src/libs/MiniMax/Generated/MiniMax.ISpeechClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..4f55c3c --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.ISpeechClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace MiniMax +{ + public partial interface ISpeechClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.IVideoClient.Authorizations.Bearer.g.cs b/src/libs/MiniMax/Generated/MiniMax.IVideoClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..80af624 --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.IVideoClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace MiniMax +{ + public partial interface IVideoClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.Image.JsonSerializerContext.g.cs b/src/libs/MiniMax/Generated/MiniMax.Image.JsonSerializerContext.g.cs new file mode 100644 index 0000000..b3508a8 --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.Image.JsonSerializerContext.g.cs @@ -0,0 +1,208 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace MiniMax +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.BaseResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.ImageStyle))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(float))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.ImageSubjectReference))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.ImageSubjectReferenceType), TypeInfoPropertyName = "ImageSubjectReferenceType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.ImageGenerationData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.ImageGenerationMetadata))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.ImageGenerationRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.ImageGenerationRequestAspectRatio), TypeInfoPropertyName = "ImageGenerationRequestAspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.ImageGenerationRequestResponseFormat), TypeInfoPropertyName = "ImageGenerationRequestResponseFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.ImageGenerationResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(float?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.ImageSubjectReferenceType?), TypeInfoPropertyName = "NullableImageSubjectReferenceType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.ImageGenerationRequestAspectRatio?), TypeInfoPropertyName = "NullableImageGenerationRequestAspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.ImageGenerationRequestResponseFormat?), TypeInfoPropertyName = "NullableImageGenerationRequestResponseFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class ImageSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class ImageSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static ImageSourceGenerationContext Default { get; } = new(DefaultOptions); + + private ImageSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::MiniMax.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::MiniMax.ImageSubjectReferenceType) + + || typeToConvert == typeof(global::MiniMax.ImageSubjectReferenceType?) + + || typeToConvert == typeof(global::MiniMax.ImageGenerationRequestAspectRatio) + + || typeToConvert == typeof(global::MiniMax.ImageGenerationRequestAspectRatio?) + + || typeToConvert == typeof(global::MiniMax.ImageGenerationRequestResponseFormat) + + || typeToConvert == typeof(global::MiniMax.ImageGenerationRequestResponseFormat?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::MiniMax.ImageSubjectReferenceType)) + { + return new global::MiniMax.JsonConverters.ImageSubjectReferenceTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.ImageSubjectReferenceType?)) + { + return new global::MiniMax.JsonConverters.ImageSubjectReferenceTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.ImageGenerationRequestAspectRatio)) + { + return new global::MiniMax.JsonConverters.ImageGenerationRequestAspectRatioJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.ImageGenerationRequestAspectRatio?)) + { + return new global::MiniMax.JsonConverters.ImageGenerationRequestAspectRatioNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.ImageGenerationRequestResponseFormat)) + { + return new global::MiniMax.JsonConverters.ImageGenerationRequestResponseFormatJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.ImageGenerationRequestResponseFormat?)) + { + return new global::MiniMax.JsonConverters.ImageGenerationRequestResponseFormatNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new ImageSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.ImageClient.Authorizations.Bearer.g.cs b/src/libs/MiniMax/Generated/MiniMax.ImageClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..b45b1bc --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.ImageClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace MiniMax +{ + public sealed partial class ImageClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::MiniMax.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.ImageClient.Constructors.Bearer.g.cs b/src/libs/MiniMax/Generated/MiniMax.ImageClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..5e04aa7 --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.ImageClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace MiniMax +{ + public sealed partial class ImageClient + { + /// + + public ImageClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.ImageClient.g.cs b/src/libs/MiniMax/Generated/MiniMax.ImageClient.g.cs index bf56b5c..07bccd5 100644 --- a/src/libs/MiniMax/Generated/MiniMax.ImageClient.g.cs +++ b/src/libs/MiniMax/Generated/MiniMax.ImageClient.g.cs @@ -38,7 +38,7 @@ public sealed partial class ImageClient : global::MiniMax.IImageClient, global:: internal global::MiniMax.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::MiniMax.AutoSDKServerConfiguration(); - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::MiniMax.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::MiniMax.ImageSourceGenerationContext.Default); /// /// diff --git a/src/libs/MiniMax/Generated/MiniMax.Music.JsonSerializerContext.g.cs b/src/libs/MiniMax/Generated/MiniMax.Music.JsonSerializerContext.g.cs new file mode 100644 index 0000000..190c9a9 --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.Music.JsonSerializerContext.g.cs @@ -0,0 +1,207 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace MiniMax +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.BaseResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.MusicAudioSetting))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.MusicAudioSettingFormat), TypeInfoPropertyName = "MusicAudioSettingFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.MusicGenerationRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.MusicGenerationRequestOutputFormat), TypeInfoPropertyName = "MusicGenerationRequestOutputFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.MusicGenerationData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.MusicGenerationExtraInfo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.MusicGenerationResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.MusicCoverPreprocessRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.MusicCoverPreprocessResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.LyricsGenerationRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.LyricsGenerationRequestMode), TypeInfoPropertyName = "LyricsGenerationRequestMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.LyricsGenerationResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.MusicAudioSettingFormat?), TypeInfoPropertyName = "NullableMusicAudioSettingFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.MusicGenerationRequestOutputFormat?), TypeInfoPropertyName = "NullableMusicGenerationRequestOutputFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.LyricsGenerationRequestMode?), TypeInfoPropertyName = "NullableLyricsGenerationRequestMode2")] + internal sealed partial class MusicSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class MusicSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static MusicSourceGenerationContext Default { get; } = new(DefaultOptions); + + private MusicSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::MiniMax.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::MiniMax.MusicAudioSettingFormat) + + || typeToConvert == typeof(global::MiniMax.MusicAudioSettingFormat?) + + || typeToConvert == typeof(global::MiniMax.MusicGenerationRequestOutputFormat) + + || typeToConvert == typeof(global::MiniMax.MusicGenerationRequestOutputFormat?) + + || typeToConvert == typeof(global::MiniMax.LyricsGenerationRequestMode) + + || typeToConvert == typeof(global::MiniMax.LyricsGenerationRequestMode?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::MiniMax.MusicAudioSettingFormat)) + { + return new global::MiniMax.JsonConverters.MusicAudioSettingFormatJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.MusicAudioSettingFormat?)) + { + return new global::MiniMax.JsonConverters.MusicAudioSettingFormatNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.MusicGenerationRequestOutputFormat)) + { + return new global::MiniMax.JsonConverters.MusicGenerationRequestOutputFormatJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.MusicGenerationRequestOutputFormat?)) + { + return new global::MiniMax.JsonConverters.MusicGenerationRequestOutputFormatNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.LyricsGenerationRequestMode)) + { + return new global::MiniMax.JsonConverters.LyricsGenerationRequestModeJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.LyricsGenerationRequestMode?)) + { + return new global::MiniMax.JsonConverters.LyricsGenerationRequestModeNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new MusicSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.MusicClient.Authorizations.Bearer.g.cs b/src/libs/MiniMax/Generated/MiniMax.MusicClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..d4b5887 --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.MusicClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace MiniMax +{ + public sealed partial class MusicClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::MiniMax.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.MusicClient.Constructors.Bearer.g.cs b/src/libs/MiniMax/Generated/MiniMax.MusicClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..984be56 --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.MusicClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace MiniMax +{ + public sealed partial class MusicClient + { + /// + + public MusicClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.MusicClient.g.cs b/src/libs/MiniMax/Generated/MiniMax.MusicClient.g.cs index 81e8177..435b26b 100644 --- a/src/libs/MiniMax/Generated/MiniMax.MusicClient.g.cs +++ b/src/libs/MiniMax/Generated/MiniMax.MusicClient.g.cs @@ -38,7 +38,7 @@ public sealed partial class MusicClient : global::MiniMax.IMusicClient, global:: internal global::MiniMax.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::MiniMax.AutoSDKServerConfiguration(); - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::MiniMax.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::MiniMax.MusicSourceGenerationContext.Default); /// /// diff --git a/src/libs/MiniMax/Generated/MiniMax.SpeechClient.Authorizations.Bearer.g.cs b/src/libs/MiniMax/Generated/MiniMax.SpeechClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..47e35ff --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.SpeechClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace MiniMax +{ + public sealed partial class SpeechClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::MiniMax.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.SpeechClient.Constructors.Bearer.g.cs b/src/libs/MiniMax/Generated/MiniMax.SpeechClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..1399ca4 --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.SpeechClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace MiniMax +{ + public sealed partial class SpeechClient + { + /// + + public SpeechClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.Video.JsonSerializerContext.g.cs b/src/libs/MiniMax/Generated/MiniMax.Video.JsonSerializerContext.g.cs new file mode 100644 index 0000000..7df2470 --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.Video.JsonSerializerContext.g.cs @@ -0,0 +1,229 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace MiniMax +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.BaseResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.VideoSubjectReference))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.VideoSubjectReferenceType), TypeInfoPropertyName = "VideoSubjectReferenceType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.VideoGenerationRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.VideoGenerationRequestResolution), TypeInfoPropertyName = "VideoGenerationRequestResolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.VideoGenerationResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.VideoTaskStatus), TypeInfoPropertyName = "VideoTaskStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.VideoTaskStatusResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.VideoTemplateTextInput))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.VideoTemplateMediaInput))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.VideoTemplateGenerationRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.VideoTemplateGenerationResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.VideoTemplateTaskStatus), TypeInfoPropertyName = "VideoTemplateTaskStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.VideoTemplateTaskStatusResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.VideoSubjectReferenceType?), TypeInfoPropertyName = "NullableVideoSubjectReferenceType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.VideoGenerationRequestResolution?), TypeInfoPropertyName = "NullableVideoGenerationRequestResolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.VideoTaskStatus?), TypeInfoPropertyName = "NullableVideoTaskStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::MiniMax.VideoTemplateTaskStatus?), TypeInfoPropertyName = "NullableVideoTemplateTaskStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class VideoSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class VideoSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static VideoSourceGenerationContext Default { get; } = new(DefaultOptions); + + private VideoSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::MiniMax.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::MiniMax.VideoSubjectReferenceType) + + || typeToConvert == typeof(global::MiniMax.VideoSubjectReferenceType?) + + || typeToConvert == typeof(global::MiniMax.VideoGenerationRequestResolution) + + || typeToConvert == typeof(global::MiniMax.VideoGenerationRequestResolution?) + + || typeToConvert == typeof(global::MiniMax.VideoTaskStatus) + + || typeToConvert == typeof(global::MiniMax.VideoTaskStatus?) + + || typeToConvert == typeof(global::MiniMax.VideoTemplateTaskStatus) + + || typeToConvert == typeof(global::MiniMax.VideoTemplateTaskStatus?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::MiniMax.VideoSubjectReferenceType)) + { + return new global::MiniMax.JsonConverters.VideoSubjectReferenceTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.VideoSubjectReferenceType?)) + { + return new global::MiniMax.JsonConverters.VideoSubjectReferenceTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.VideoGenerationRequestResolution)) + { + return new global::MiniMax.JsonConverters.VideoGenerationRequestResolutionJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.VideoGenerationRequestResolution?)) + { + return new global::MiniMax.JsonConverters.VideoGenerationRequestResolutionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.VideoTaskStatus)) + { + return new global::MiniMax.JsonConverters.VideoTaskStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.VideoTaskStatus?)) + { + return new global::MiniMax.JsonConverters.VideoTaskStatusNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.VideoTemplateTaskStatus)) + { + return new global::MiniMax.JsonConverters.VideoTemplateTaskStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::MiniMax.VideoTemplateTaskStatus?)) + { + return new global::MiniMax.JsonConverters.VideoTemplateTaskStatusNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new VideoSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.VideoClient.Authorizations.Bearer.g.cs b/src/libs/MiniMax/Generated/MiniMax.VideoClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..942624d --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.VideoClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace MiniMax +{ + public sealed partial class VideoClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::MiniMax.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.VideoClient.Constructors.Bearer.g.cs b/src/libs/MiniMax/Generated/MiniMax.VideoClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..577af0b --- /dev/null +++ b/src/libs/MiniMax/Generated/MiniMax.VideoClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace MiniMax +{ + public sealed partial class VideoClient + { + /// + + public VideoClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/MiniMax/Generated/MiniMax.VideoClient.g.cs b/src/libs/MiniMax/Generated/MiniMax.VideoClient.g.cs index b970771..7e991d8 100644 --- a/src/libs/MiniMax/Generated/MiniMax.VideoClient.g.cs +++ b/src/libs/MiniMax/Generated/MiniMax.VideoClient.g.cs @@ -38,7 +38,7 @@ public sealed partial class VideoClient : global::MiniMax.IVideoClient, global:: internal global::MiniMax.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::MiniMax.AutoSDKServerConfiguration(); - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::MiniMax.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::MiniMax.VideoSourceGenerationContext.Default); /// ///