diff --git a/src/cli/Murf.CLI/CliRuntime.cs b/src/cli/Murf.CLI/CliRuntime.cs index 8b63e50..26fa3a8 100644 --- a/src/cli/Murf.CLI/CliRuntime.cs +++ b/src/cli/Murf.CLI/CliRuntime.cs @@ -355,9 +355,10 @@ public static TimeSpan ParseDuration(string value, string optionName) public static T DeserializeJsonValue(string json, JsonSerializerContext context) { - _ = context; - return JsonSerializer.Deserialize(json) ?? - throw new CliException($"Unable to deserialize generated CLI value as {typeof(T).Name}."); + var value = JsonSerializer.Deserialize(json, typeof(T), context); + return value is T typed + ? typed + : throw new CliException($"Unable to deserialize generated CLI value as {typeof(T).Name}."); } public static string SerializeKeyValuePairs(IEnumerable pairs) diff --git a/src/libs/Murf/Generated/Murf.JsonSerializerContext.g.cs b/src/libs/Murf/Generated/Murf.JsonSerializerContext.g.cs index 8f3db8f..38365dc 100644 --- a/src/libs/Murf/Generated/Murf.JsonSerializerContext.g.cs +++ b/src/libs/Murf/Generated/Murf.JsonSerializerContext.g.cs @@ -1,14 +1,12 @@ #nullable enable -#pragma warning disable CS0618 // Type or member is obsolete -#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant - namespace Murf { /// /// /// + #pragma warning disable CS3016 // Converter type array in this attribute is not CLS-compliant. [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, Converters = new global::System.Type[] @@ -55,6 +53,7 @@ namespace Murf typeof(global::Murf.JsonConverters.UnixTimestampJsonConverter), })] + #pragma warning restore CS3016 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Murf.JsonSerializerContextTypes))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Murf.PronunciationDetailType), TypeInfoPropertyName = "PronunciationDetailType2")] diff --git a/src/libs/Murf/Generated/Murf.OptionsSupport.g.cs b/src/libs/Murf/Generated/Murf.OptionsSupport.g.cs index 83540b2..44de0d3 100644 --- a/src/libs/Murf/Generated/Murf.OptionsSupport.g.cs +++ b/src/libs/Murf/Generated/Murf.OptionsSupport.g.cs @@ -241,7 +241,8 @@ public sealed class AutoSDKAuthorizationProviderHook : global::Murf.AutoSDKHook { context = context ?? throw new global::System.ArgumentNullException(nameof(context)); - if (context.Request == null) + var request = context.Request; + if (request == null) { return; } @@ -251,10 +252,10 @@ public sealed class AutoSDKAuthorizationProviderHook : global::Murf.AutoSDKHook { for (var index = 0; index < perRequest.Count; index++) { - ApplyAuthorization(context.Request, perRequest[index]); + ApplyAuthorization(request, perRequest[index]); } - global::Murf.AutoSDKHttpRequestOptions.StampAuthorizationOverride(context.Request); + global::Murf.AutoSDKHttpRequestOptions.StampAuthorizationOverride(request); return; } @@ -272,10 +273,10 @@ public sealed class AutoSDKAuthorizationProviderHook : global::Murf.AutoSDKHook for (var index = 0; index < resolved.Count; index++) { - ApplyAuthorization(context.Request, resolved[index]); + ApplyAuthorization(request, resolved[index]); } - global::Murf.AutoSDKHttpRequestOptions.StampAuthorizationOverride(context.Request); + global::Murf.AutoSDKHttpRequestOptions.StampAuthorizationOverride(request); } private static void ApplyAuthorization( @@ -486,7 +487,7 @@ public sealed class AutoSDKHookContext /// /// The outgoing HTTP request for the current attempt. /// - public global::System.Net.Http.HttpRequestMessage Request { get; set; } = null!; + public global::System.Net.Http.HttpRequestMessage? Request { get; set; } /// /// The HTTP response when one was received. @@ -501,7 +502,7 @@ public sealed class AutoSDKHookContext /// /// The client-wide runtime options. /// - public global::Murf.AutoSDKClientOptions ClientOptions { get; set; } = null!; + public global::Murf.AutoSDKClientOptions? ClientOptions { get; set; } /// /// The per-request runtime options. diff --git a/src/libs/Murf/Generated/Murf.SubpackageAuth.JsonSerializerContext.g.cs b/src/libs/Murf/Generated/Murf.SubpackageAuth.JsonSerializerContext.g.cs index 547859f..109ad65 100644 --- a/src/libs/Murf/Generated/Murf.SubpackageAuth.JsonSerializerContext.g.cs +++ b/src/libs/Murf/Generated/Murf.SubpackageAuth.JsonSerializerContext.g.cs @@ -1,19 +1,14 @@ #nullable enable -#pragma warning disable CS0618 // Type or member is obsolete -#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant - namespace Murf { /// /// /// [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - Converters = new global::System.Type[] - { - })] + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull + )] [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")] diff --git a/src/libs/Murf/Generated/Murf.SubpackageDubbingSubpackageDubbingJobs.JsonSerializerContext.g.cs b/src/libs/Murf/Generated/Murf.SubpackageDubbingSubpackageDubbingJobs.JsonSerializerContext.g.cs index 6d88c3c..597328a 100644 --- a/src/libs/Murf/Generated/Murf.SubpackageDubbingSubpackageDubbingJobs.JsonSerializerContext.g.cs +++ b/src/libs/Murf/Generated/Murf.SubpackageDubbingSubpackageDubbingJobs.JsonSerializerContext.g.cs @@ -1,19 +1,14 @@ #nullable enable -#pragma warning disable CS0618 // Type or member is obsolete -#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant - namespace Murf { /// /// /// [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - Converters = new global::System.Type[] - { - })] + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull + )] [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")] diff --git a/src/libs/Murf/Generated/Murf.SubpackageDubbingSubpackageDubbingLanguages.JsonSerializerContext.g.cs b/src/libs/Murf/Generated/Murf.SubpackageDubbingSubpackageDubbingLanguages.JsonSerializerContext.g.cs index eac8fdb..30fa6e5 100644 --- a/src/libs/Murf/Generated/Murf.SubpackageDubbingSubpackageDubbingLanguages.JsonSerializerContext.g.cs +++ b/src/libs/Murf/Generated/Murf.SubpackageDubbingSubpackageDubbingLanguages.JsonSerializerContext.g.cs @@ -1,19 +1,14 @@ #nullable enable -#pragma warning disable CS0618 // Type or member is obsolete -#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant - namespace Murf { /// /// /// [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - Converters = new global::System.Type[] - { - })] + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull + )] [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")] diff --git a/src/libs/Murf/Generated/Murf.SubpackageDubbingSubpackageDubbingProjects.JsonSerializerContext.g.cs b/src/libs/Murf/Generated/Murf.SubpackageDubbingSubpackageDubbingProjects.JsonSerializerContext.g.cs index 67691c2..ee101d0 100644 --- a/src/libs/Murf/Generated/Murf.SubpackageDubbingSubpackageDubbingProjects.JsonSerializerContext.g.cs +++ b/src/libs/Murf/Generated/Murf.SubpackageDubbingSubpackageDubbingProjects.JsonSerializerContext.g.cs @@ -1,19 +1,14 @@ #nullable enable -#pragma warning disable CS0618 // Type or member is obsolete -#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant - namespace Murf { /// /// /// [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - Converters = new global::System.Type[] - { - })] + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull + )] [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")] diff --git a/src/libs/Murf/Generated/Murf.SubpackageText.JsonSerializerContext.g.cs b/src/libs/Murf/Generated/Murf.SubpackageText.JsonSerializerContext.g.cs index c37eb52..e3595c5 100644 --- a/src/libs/Murf/Generated/Murf.SubpackageText.JsonSerializerContext.g.cs +++ b/src/libs/Murf/Generated/Murf.SubpackageText.JsonSerializerContext.g.cs @@ -1,19 +1,14 @@ #nullable enable -#pragma warning disable CS0618 // Type or member is obsolete -#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant - namespace Murf { /// /// /// [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - Converters = new global::System.Type[] - { - })] + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull + )] [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")] diff --git a/src/libs/Murf/Generated/Murf.SubpackageTextToSpeech.JsonSerializerContext.g.cs b/src/libs/Murf/Generated/Murf.SubpackageTextToSpeech.JsonSerializerContext.g.cs index d920fd6..478e24d 100644 --- a/src/libs/Murf/Generated/Murf.SubpackageTextToSpeech.JsonSerializerContext.g.cs +++ b/src/libs/Murf/Generated/Murf.SubpackageTextToSpeech.JsonSerializerContext.g.cs @@ -1,19 +1,14 @@ #nullable enable -#pragma warning disable CS0618 // Type or member is obsolete -#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant - namespace Murf { /// /// /// [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - Converters = new global::System.Type[] - { - })] + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull + )] [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")] diff --git a/src/libs/Murf/Generated/Murf.SubpackageVoiceChanger.JsonSerializerContext.g.cs b/src/libs/Murf/Generated/Murf.SubpackageVoiceChanger.JsonSerializerContext.g.cs index d8f71fd..ee89dc6 100644 --- a/src/libs/Murf/Generated/Murf.SubpackageVoiceChanger.JsonSerializerContext.g.cs +++ b/src/libs/Murf/Generated/Murf.SubpackageVoiceChanger.JsonSerializerContext.g.cs @@ -1,19 +1,14 @@ #nullable enable -#pragma warning disable CS0618 // Type or member is obsolete -#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant - namespace Murf { /// /// /// [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - Converters = new global::System.Type[] - { - })] + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull + )] [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")]