diff --git a/src/libs/ZAI/Generated/ZAI.AnyOf.3.g.cs b/src/libs/ZAI/Generated/ZAI.AnyOf.3.g.cs
index d7438e2..5107d43 100644
--- a/src/libs/ZAI/Generated/ZAI.AnyOf.3.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.AnyOf.3.g.cs
@@ -25,6 +25,19 @@ namespace ZAI
#endif
public bool IsValue1 => Value1 != null;
+ ///
+ ///
+ ///
+ public bool TryPickValue1(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out T1? value)
+ {
+ value = Value1;
+ return IsValue1;
+ }
+
///
///
///
@@ -42,6 +55,19 @@ namespace ZAI
#endif
public bool IsValue2 => Value2 != null;
+ ///
+ ///
+ ///
+ public bool TryPickValue2(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out T2? value)
+ {
+ value = Value2;
+ return IsValue2;
+ }
+
///
///
///
@@ -58,6 +84,19 @@ namespace ZAI
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))]
#endif
public bool IsValue3 => Value3 != null;
+
+ ///
+ ///
+ ///
+ public bool TryPickValue3(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out T3? value)
+ {
+ value = Value3;
+ return IsValue3;
+ }
///
///
///
@@ -187,6 +226,36 @@ public bool Validate()
///
public void Match(
global::System.Action? value1 = null,
+
+ global::System.Action? value2 = null,
+
+ global::System.Action? value3 = null,
+ bool validate = true)
+ {
+ if (validate)
+ {
+ Validate();
+ }
+
+ if (IsValue1)
+ {
+ value1?.Invoke(Value1!);
+ }
+ else if (IsValue2)
+ {
+ value2?.Invoke(Value2!);
+ }
+ else if (IsValue3)
+ {
+ value3?.Invoke(Value3!);
+ }
+ }
+
+ ///
+ ///
+ ///
+ public void Switch(
+ global::System.Action? value1 = null,
global::System.Action? value2 = null,
global::System.Action? value3 = null,
bool validate = true)
diff --git a/src/libs/ZAI/Generated/ZAI.Models.CogVideoX3Request.g.cs b/src/libs/ZAI/Generated/ZAI.Models.CogVideoX3Request.g.cs
index 9cf701b..b5061ac 100644
--- a/src/libs/ZAI/Generated/ZAI.Models.CogVideoX3Request.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.Models.CogVideoX3Request.g.cs
@@ -26,6 +26,19 @@ namespace ZAI
#endif
public bool IsCogVideoX3RequestVariant1 => CogVideoX3RequestVariant1 != null;
+ ///
+ ///
+ ///
+ public bool TryPickCogVideoX3RequestVariant1(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.CogVideoX3RequestVariant1? value)
+ {
+ value = CogVideoX3RequestVariant1;
+ return IsCogVideoX3RequestVariant1;
+ }
+
///
///
///
@@ -42,6 +55,19 @@ namespace ZAI
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Common))]
#endif
public bool IsCommon => Common != null;
+
+ ///
+ ///
+ ///
+ public bool TryPickCommon(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.VideoCommonRequest? value)
+ {
+ value = Common;
+ return IsCommon;
+ }
///
///
///
@@ -118,8 +144,8 @@ public bool Validate()
///
///
public TResult? Match(
- global::System.Func? cogVideoX3RequestVariant1 = null,
- global::System.Func? common = null,
+ global::System.Func? cogVideoX3RequestVariant1 = null,
+ global::System.Func? common = null,
bool validate = true)
{
if (validate)
@@ -143,8 +169,32 @@ public bool Validate()
///
///
public void Match(
- global::System.Action? cogVideoX3RequestVariant1 = null,
- global::System.Action? common = null,
+ global::System.Action? cogVideoX3RequestVariant1 = null,
+
+ global::System.Action? common = null,
+ bool validate = true)
+ {
+ if (validate)
+ {
+ Validate();
+ }
+
+ if (IsCogVideoX3RequestVariant1)
+ {
+ cogVideoX3RequestVariant1?.Invoke(CogVideoX3RequestVariant1!);
+ }
+ else if (IsCommon)
+ {
+ common?.Invoke(Common!);
+ }
+ }
+
+ ///
+ ///
+ ///
+ public void Switch(
+ global::System.Action? cogVideoX3RequestVariant1 = null,
+ global::System.Action? common = null,
bool validate = true)
{
if (validate)
diff --git a/src/libs/ZAI/Generated/ZAI.Models.MultimodalContentItem.g.cs b/src/libs/ZAI/Generated/ZAI.Models.MultimodalContentItem.g.cs
index 0bfa138..ff979e8 100644
--- a/src/libs/ZAI/Generated/ZAI.Models.MultimodalContentItem.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.Models.MultimodalContentItem.g.cs
@@ -26,6 +26,19 @@ namespace ZAI
#endif
public bool IsText => Text != null;
+ ///
+ ///
+ ///
+ public bool TryPickText(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.MultimodalContentItemText? value)
+ {
+ value = Text;
+ return IsText;
+ }
+
///
///
///
@@ -43,6 +56,19 @@ namespace ZAI
#endif
public bool IsImage => Image != null;
+ ///
+ ///
+ ///
+ public bool TryPickImage(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.MultimodalContentItemImage? value)
+ {
+ value = Image;
+ return IsImage;
+ }
+
///
///
///
@@ -60,6 +86,19 @@ namespace ZAI
#endif
public bool IsAudio => Audio != null;
+ ///
+ ///
+ ///
+ public bool TryPickAudio(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.MultimodalContentItemAudio? value)
+ {
+ value = Audio;
+ return IsAudio;
+ }
+
///
///
///
@@ -77,6 +116,19 @@ namespace ZAI
#endif
public bool IsVideo => Video != null;
+ ///
+ ///
+ ///
+ public bool TryPickVideo(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.MultimodalContentItemVideo? value)
+ {
+ value = Video;
+ return IsVideo;
+ }
+
///
///
///
@@ -93,6 +145,19 @@ namespace ZAI
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(File))]
#endif
public bool IsFile => File != null;
+
+ ///
+ ///
+ ///
+ public bool TryPickFile(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.MultimodalContentItemFile? value)
+ {
+ value = File;
+ return IsFile;
+ }
///
///
///
@@ -235,11 +300,11 @@ public bool Validate()
///
///
public TResult? Match(
- global::System.Func? text = null,
- global::System.Func? image = null,
- global::System.Func? audio = null,
- global::System.Func? video = null,
- global::System.Func? file = null,
+ global::System.Func? text = null,
+ global::System.Func? image = null,
+ global::System.Func? audio = null,
+ global::System.Func? video = null,
+ global::System.Func? file = null,
bool validate = true)
{
if (validate)
@@ -275,11 +340,53 @@ public bool Validate()
///
///
public void Match(
- global::System.Action? text = null,
- global::System.Action? image = null,
- global::System.Action? audio = null,
- global::System.Action? video = null,
- global::System.Action? file = null,
+ global::System.Action? text = null,
+
+ global::System.Action? image = null,
+
+ global::System.Action? audio = null,
+
+ global::System.Action? video = null,
+
+ global::System.Action? file = null,
+ bool validate = true)
+ {
+ if (validate)
+ {
+ Validate();
+ }
+
+ if (IsText)
+ {
+ text?.Invoke(Text!);
+ }
+ else if (IsImage)
+ {
+ image?.Invoke(Image!);
+ }
+ else if (IsAudio)
+ {
+ audio?.Invoke(Audio!);
+ }
+ else if (IsVideo)
+ {
+ video?.Invoke(Video!);
+ }
+ else if (IsFile)
+ {
+ file?.Invoke(File!);
+ }
+ }
+
+ ///
+ ///
+ ///
+ public void Switch(
+ global::System.Action? text = null,
+ global::System.Action? image = null,
+ global::System.Action? audio = null,
+ global::System.Action? video = null,
+ global::System.Action? file = null,
bool validate = true)
{
if (validate)
diff --git a/src/libs/ZAI/Generated/ZAI.Models.SpecialEffectsVideosAgentResponse.g.cs b/src/libs/ZAI/Generated/ZAI.Models.SpecialEffectsVideosAgentResponse.g.cs
index 2f92b50..ee9f5ad 100644
--- a/src/libs/ZAI/Generated/ZAI.Models.SpecialEffectsVideosAgentResponse.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.Models.SpecialEffectsVideosAgentResponse.g.cs
@@ -26,6 +26,19 @@ namespace ZAI
#endif
public bool IsSpecialEffectsVideosAgentResponseVariant1 => SpecialEffectsVideosAgentResponseVariant1 != null;
+ ///
+ ///
+ ///
+ public bool TryPickSpecialEffectsVideosAgentResponseVariant1(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.SpecialEffectsVideosAgentResponseVariant1? value)
+ {
+ value = SpecialEffectsVideosAgentResponseVariant1;
+ return IsSpecialEffectsVideosAgentResponseVariant1;
+ }
+
///
///
///
@@ -42,6 +55,19 @@ namespace ZAI
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Error))]
#endif
public bool IsError => Error != null;
+
+ ///
+ ///
+ ///
+ public bool TryPickError(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.SpecialEffectsVideosAgentError? value)
+ {
+ value = Error;
+ return IsError;
+ }
///
///
///
@@ -118,8 +144,8 @@ public bool Validate()
///
///
public TResult? Match(
- global::System.Func? specialEffectsVideosAgentResponseVariant1 = null,
- global::System.Func? error = null,
+ global::System.Func? specialEffectsVideosAgentResponseVariant1 = null,
+ global::System.Func? error = null,
bool validate = true)
{
if (validate)
@@ -143,8 +169,32 @@ public bool Validate()
///
///
public void Match(
- global::System.Action? specialEffectsVideosAgentResponseVariant1 = null,
- global::System.Action? error = null,
+ global::System.Action? specialEffectsVideosAgentResponseVariant1 = null,
+
+ global::System.Action? error = null,
+ bool validate = true)
+ {
+ if (validate)
+ {
+ Validate();
+ }
+
+ if (IsSpecialEffectsVideosAgentResponseVariant1)
+ {
+ specialEffectsVideosAgentResponseVariant1?.Invoke(SpecialEffectsVideosAgentResponseVariant1!);
+ }
+ else if (IsError)
+ {
+ error?.Invoke(Error!);
+ }
+ }
+
+ ///
+ ///
+ ///
+ public void Switch(
+ global::System.Action? specialEffectsVideosAgentResponseVariant1 = null,
+ global::System.Action? error = null,
bool validate = true)
{
if (validate)
diff --git a/src/libs/ZAI/Generated/ZAI.Models.ViduFrames2VideoRequest.g.cs b/src/libs/ZAI/Generated/ZAI.Models.ViduFrames2VideoRequest.g.cs
index dbf89c5..915789b 100644
--- a/src/libs/ZAI/Generated/ZAI.Models.ViduFrames2VideoRequest.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.Models.ViduFrames2VideoRequest.g.cs
@@ -26,6 +26,19 @@ namespace ZAI
#endif
public bool IsViduFrames2VideoRequestVariant1 => ViduFrames2VideoRequestVariant1 != null;
+ ///
+ ///
+ ///
+ public bool TryPickViduFrames2VideoRequestVariant1(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.ViduFrames2VideoRequestVariant1? value)
+ {
+ value = ViduFrames2VideoRequestVariant1;
+ return IsViduFrames2VideoRequestVariant1;
+ }
+
///
///
///
@@ -42,6 +55,19 @@ namespace ZAI
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Common))]
#endif
public bool IsCommon => Common != null;
+
+ ///
+ ///
+ ///
+ public bool TryPickCommon(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.VideoCommonRequest? value)
+ {
+ value = Common;
+ return IsCommon;
+ }
///
///
///
@@ -118,8 +144,8 @@ public bool Validate()
///
///
public TResult? Match(
- global::System.Func? viduFrames2VideoRequestVariant1 = null,
- global::System.Func? common = null,
+ global::System.Func? viduFrames2VideoRequestVariant1 = null,
+ global::System.Func? common = null,
bool validate = true)
{
if (validate)
@@ -143,8 +169,32 @@ public bool Validate()
///
///
public void Match(
- global::System.Action? viduFrames2VideoRequestVariant1 = null,
- global::System.Action? common = null,
+ global::System.Action? viduFrames2VideoRequestVariant1 = null,
+
+ global::System.Action? common = null,
+ bool validate = true)
+ {
+ if (validate)
+ {
+ Validate();
+ }
+
+ if (IsViduFrames2VideoRequestVariant1)
+ {
+ viduFrames2VideoRequestVariant1?.Invoke(ViduFrames2VideoRequestVariant1!);
+ }
+ else if (IsCommon)
+ {
+ common?.Invoke(Common!);
+ }
+ }
+
+ ///
+ ///
+ ///
+ public void Switch(
+ global::System.Action? viduFrames2VideoRequestVariant1 = null,
+ global::System.Action? common = null,
bool validate = true)
{
if (validate)
diff --git a/src/libs/ZAI/Generated/ZAI.Models.ViduImage2VideoRequest.g.cs b/src/libs/ZAI/Generated/ZAI.Models.ViduImage2VideoRequest.g.cs
index 15100f0..cb81c09 100644
--- a/src/libs/ZAI/Generated/ZAI.Models.ViduImage2VideoRequest.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.Models.ViduImage2VideoRequest.g.cs
@@ -26,6 +26,19 @@ namespace ZAI
#endif
public bool IsViduImage2VideoRequestVariant1 => ViduImage2VideoRequestVariant1 != null;
+ ///
+ ///
+ ///
+ public bool TryPickViduImage2VideoRequestVariant1(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.ViduImage2VideoRequestVariant1? value)
+ {
+ value = ViduImage2VideoRequestVariant1;
+ return IsViduImage2VideoRequestVariant1;
+ }
+
///
///
///
@@ -42,6 +55,19 @@ namespace ZAI
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Common))]
#endif
public bool IsCommon => Common != null;
+
+ ///
+ ///
+ ///
+ public bool TryPickCommon(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.VideoCommonRequest? value)
+ {
+ value = Common;
+ return IsCommon;
+ }
///
///
///
@@ -118,8 +144,8 @@ public bool Validate()
///
///
public TResult? Match(
- global::System.Func? viduImage2VideoRequestVariant1 = null,
- global::System.Func? common = null,
+ global::System.Func? viduImage2VideoRequestVariant1 = null,
+ global::System.Func? common = null,
bool validate = true)
{
if (validate)
@@ -143,8 +169,32 @@ public bool Validate()
///
///
public void Match(
- global::System.Action? viduImage2VideoRequestVariant1 = null,
- global::System.Action? common = null,
+ global::System.Action? viduImage2VideoRequestVariant1 = null,
+
+ global::System.Action? common = null,
+ bool validate = true)
+ {
+ if (validate)
+ {
+ Validate();
+ }
+
+ if (IsViduImage2VideoRequestVariant1)
+ {
+ viduImage2VideoRequestVariant1?.Invoke(ViduImage2VideoRequestVariant1!);
+ }
+ else if (IsCommon)
+ {
+ common?.Invoke(Common!);
+ }
+ }
+
+ ///
+ ///
+ ///
+ public void Switch(
+ global::System.Action? viduImage2VideoRequestVariant1 = null,
+ global::System.Action? common = null,
bool validate = true)
{
if (validate)
diff --git a/src/libs/ZAI/Generated/ZAI.Models.ViduReference2VideoRequest.g.cs b/src/libs/ZAI/Generated/ZAI.Models.ViduReference2VideoRequest.g.cs
index addb040..0affd27 100644
--- a/src/libs/ZAI/Generated/ZAI.Models.ViduReference2VideoRequest.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.Models.ViduReference2VideoRequest.g.cs
@@ -26,6 +26,19 @@ namespace ZAI
#endif
public bool IsViduReference2VideoRequestVariant1 => ViduReference2VideoRequestVariant1 != null;
+ ///
+ ///
+ ///
+ public bool TryPickViduReference2VideoRequestVariant1(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.ViduReference2VideoRequestVariant1? value)
+ {
+ value = ViduReference2VideoRequestVariant1;
+ return IsViduReference2VideoRequestVariant1;
+ }
+
///
///
///
@@ -42,6 +55,19 @@ namespace ZAI
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Common))]
#endif
public bool IsCommon => Common != null;
+
+ ///
+ ///
+ ///
+ public bool TryPickCommon(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.VideoCommonRequest? value)
+ {
+ value = Common;
+ return IsCommon;
+ }
///
///
///
@@ -118,8 +144,8 @@ public bool Validate()
///
///
public TResult? Match(
- global::System.Func? viduReference2VideoRequestVariant1 = null,
- global::System.Func? common = null,
+ global::System.Func? viduReference2VideoRequestVariant1 = null,
+ global::System.Func? common = null,
bool validate = true)
{
if (validate)
@@ -143,8 +169,32 @@ public bool Validate()
///
///
public void Match(
- global::System.Action? viduReference2VideoRequestVariant1 = null,
- global::System.Action? common = null,
+ global::System.Action? viduReference2VideoRequestVariant1 = null,
+
+ global::System.Action? common = null,
+ bool validate = true)
+ {
+ if (validate)
+ {
+ Validate();
+ }
+
+ if (IsViduReference2VideoRequestVariant1)
+ {
+ viduReference2VideoRequestVariant1?.Invoke(ViduReference2VideoRequestVariant1!);
+ }
+ else if (IsCommon)
+ {
+ common?.Invoke(Common!);
+ }
+ }
+
+ ///
+ ///
+ ///
+ public void Switch(
+ global::System.Action? viduReference2VideoRequestVariant1 = null,
+ global::System.Action? common = null,
bool validate = true)
{
if (validate)
diff --git a/src/libs/ZAI/Generated/ZAI.Models.ViduText2VideoRequest.g.cs b/src/libs/ZAI/Generated/ZAI.Models.ViduText2VideoRequest.g.cs
index 20ccf13..502e42e 100644
--- a/src/libs/ZAI/Generated/ZAI.Models.ViduText2VideoRequest.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.Models.ViduText2VideoRequest.g.cs
@@ -26,6 +26,19 @@ namespace ZAI
#endif
public bool IsViduText2VideoRequestVariant1 => ViduText2VideoRequestVariant1 != null;
+ ///
+ ///
+ ///
+ public bool TryPickViduText2VideoRequestVariant1(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.ViduText2VideoRequestVariant1? value)
+ {
+ value = ViduText2VideoRequestVariant1;
+ return IsViduText2VideoRequestVariant1;
+ }
+
///
///
///
@@ -42,6 +55,19 @@ namespace ZAI
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Common))]
#endif
public bool IsCommon => Common != null;
+
+ ///
+ ///
+ ///
+ public bool TryPickCommon(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.VideoCommonRequest? value)
+ {
+ value = Common;
+ return IsCommon;
+ }
///
///
///
@@ -118,8 +144,8 @@ public bool Validate()
///
///
public TResult? Match(
- global::System.Func? viduText2VideoRequestVariant1 = null,
- global::System.Func? common = null,
+ global::System.Func? viduText2VideoRequestVariant1 = null,
+ global::System.Func? common = null,
bool validate = true)
{
if (validate)
@@ -143,8 +169,32 @@ public bool Validate()
///
///
public void Match(
- global::System.Action? viduText2VideoRequestVariant1 = null,
- global::System.Action? common = null,
+ global::System.Action? viduText2VideoRequestVariant1 = null,
+
+ global::System.Action? common = null,
+ bool validate = true)
+ {
+ if (validate)
+ {
+ Validate();
+ }
+
+ if (IsViduText2VideoRequestVariant1)
+ {
+ viduText2VideoRequestVariant1?.Invoke(ViduText2VideoRequestVariant1!);
+ }
+ else if (IsCommon)
+ {
+ common?.Invoke(Common!);
+ }
+ }
+
+ ///
+ ///
+ ///
+ public void Switch(
+ global::System.Action? viduText2VideoRequestVariant1 = null,
+ global::System.Action? common = null,
bool validate = true)
{
if (validate)
diff --git a/src/libs/ZAI/Generated/ZAI.Models.VisionMultimodalContentItem.g.cs b/src/libs/ZAI/Generated/ZAI.Models.VisionMultimodalContentItem.g.cs
index 36c433e..f75607e 100644
--- a/src/libs/ZAI/Generated/ZAI.Models.VisionMultimodalContentItem.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.Models.VisionMultimodalContentItem.g.cs
@@ -26,6 +26,19 @@ namespace ZAI
#endif
public bool IsText => Text != null;
+ ///
+ ///
+ ///
+ public bool TryPickText(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.VisionMultimodalContentItemText? value)
+ {
+ value = Text;
+ return IsText;
+ }
+
///
///
///
@@ -43,6 +56,19 @@ namespace ZAI
#endif
public bool IsImage => Image != null;
+ ///
+ ///
+ ///
+ public bool TryPickImage(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.VisionMultimodalContentItemImage? value)
+ {
+ value = Image;
+ return IsImage;
+ }
+
///
///
///
@@ -60,6 +86,19 @@ namespace ZAI
#endif
public bool IsVideo => Video != null;
+ ///
+ ///
+ ///
+ public bool TryPickVideo(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.VisionMultimodalContentItemVideo? value)
+ {
+ value = Video;
+ return IsVideo;
+ }
+
///
///
///
@@ -76,6 +115,19 @@ namespace ZAI
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(File))]
#endif
public bool IsFile => File != null;
+
+ ///
+ ///
+ ///
+ public bool TryPickFile(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out global::ZAI.VisionMultimodalContentItemFile? value)
+ {
+ value = File;
+ return IsFile;
+ }
///
///
///
@@ -196,10 +248,10 @@ public bool Validate()
///
///
public TResult? Match(
- global::System.Func? text = null,
- global::System.Func? image = null,
- global::System.Func? video = null,
- global::System.Func? file = null,
+ global::System.Func? text = null,
+ global::System.Func? image = null,
+ global::System.Func? video = null,
+ global::System.Func? file = null,
bool validate = true)
{
if (validate)
@@ -231,10 +283,46 @@ public bool Validate()
///
///
public void Match(
- global::System.Action? text = null,
- global::System.Action? image = null,
- global::System.Action? video = null,
- global::System.Action? file = null,
+ global::System.Action? text = null,
+
+ global::System.Action? image = null,
+
+ global::System.Action? video = null,
+
+ global::System.Action? file = null,
+ bool validate = true)
+ {
+ if (validate)
+ {
+ Validate();
+ }
+
+ if (IsText)
+ {
+ text?.Invoke(Text!);
+ }
+ else if (IsImage)
+ {
+ image?.Invoke(Image!);
+ }
+ else if (IsVideo)
+ {
+ video?.Invoke(Video!);
+ }
+ else if (IsFile)
+ {
+ file?.Invoke(File!);
+ }
+ }
+
+ ///
+ ///
+ ///
+ public void Switch(
+ global::System.Action? text = null,
+ global::System.Action? image = null,
+ global::System.Action? video = null,
+ global::System.Action? file = null,
bool validate = true)
{
if (validate)
diff --git a/src/libs/ZAI/Generated/ZAI.OneOf.2.g.cs b/src/libs/ZAI/Generated/ZAI.OneOf.2.g.cs
index dfcbfa8..a4b8c78 100644
--- a/src/libs/ZAI/Generated/ZAI.OneOf.2.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.OneOf.2.g.cs
@@ -25,6 +25,19 @@ namespace ZAI
#endif
public bool IsValue1 => Value1 != null;
+ ///
+ ///
+ ///
+ public bool TryPickValue1(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out T1? value)
+ {
+ value = Value1;
+ return IsValue1;
+ }
+
///
///
///
@@ -41,6 +54,19 @@ namespace ZAI
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))]
#endif
public bool IsValue2 => Value2 != null;
+
+ ///
+ ///
+ ///
+ public bool TryPickValue2(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out T2? value)
+ {
+ value = Value2;
+ return IsValue2;
+ }
///
///
///
@@ -143,6 +169,30 @@ public bool Validate()
///
public void Match(
global::System.Action? value1 = null,
+
+ global::System.Action? value2 = null,
+ bool validate = true)
+ {
+ if (validate)
+ {
+ Validate();
+ }
+
+ if (IsValue1)
+ {
+ value1?.Invoke(Value1!);
+ }
+ else if (IsValue2)
+ {
+ value2?.Invoke(Value2!);
+ }
+ }
+
+ ///
+ ///
+ ///
+ public void Switch(
+ global::System.Action? value1 = null,
global::System.Action? value2 = null,
bool validate = true)
{
diff --git a/src/libs/ZAI/Generated/ZAI.OneOf.3.g.cs b/src/libs/ZAI/Generated/ZAI.OneOf.3.g.cs
index 5d6d9e1..2753e9d 100644
--- a/src/libs/ZAI/Generated/ZAI.OneOf.3.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.OneOf.3.g.cs
@@ -25,6 +25,19 @@ namespace ZAI
#endif
public bool IsValue1 => Value1 != null;
+ ///
+ ///
+ ///
+ public bool TryPickValue1(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out T1? value)
+ {
+ value = Value1;
+ return IsValue1;
+ }
+
///
///
///
@@ -42,6 +55,19 @@ namespace ZAI
#endif
public bool IsValue2 => Value2 != null;
+ ///
+ ///
+ ///
+ public bool TryPickValue2(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out T2? value)
+ {
+ value = Value2;
+ return IsValue2;
+ }
+
///
///
///
@@ -58,6 +84,19 @@ namespace ZAI
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))]
#endif
public bool IsValue3 => Value3 != null;
+
+ ///
+ ///
+ ///
+ public bool TryPickValue3(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out T3? value)
+ {
+ value = Value3;
+ return IsValue3;
+ }
///
///
///
@@ -187,6 +226,36 @@ public bool Validate()
///
public void Match(
global::System.Action? value1 = null,
+
+ global::System.Action? value2 = null,
+
+ global::System.Action? value3 = null,
+ bool validate = true)
+ {
+ if (validate)
+ {
+ Validate();
+ }
+
+ if (IsValue1)
+ {
+ value1?.Invoke(Value1!);
+ }
+ else if (IsValue2)
+ {
+ value2?.Invoke(Value2!);
+ }
+ else if (IsValue3)
+ {
+ value3?.Invoke(Value3!);
+ }
+ }
+
+ ///
+ ///
+ ///
+ public void Switch(
+ global::System.Action? value1 = null,
global::System.Action? value2 = null,
global::System.Action? value3 = null,
bool validate = true)
diff --git a/src/libs/ZAI/Generated/ZAI.OneOf.4.g.cs b/src/libs/ZAI/Generated/ZAI.OneOf.4.g.cs
index d9289b7..1fe0cf0 100644
--- a/src/libs/ZAI/Generated/ZAI.OneOf.4.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.OneOf.4.g.cs
@@ -25,6 +25,19 @@ namespace ZAI
#endif
public bool IsValue1 => Value1 != null;
+ ///
+ ///
+ ///
+ public bool TryPickValue1(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out T1? value)
+ {
+ value = Value1;
+ return IsValue1;
+ }
+
///
///
///
@@ -42,6 +55,19 @@ namespace ZAI
#endif
public bool IsValue2 => Value2 != null;
+ ///
+ ///
+ ///
+ public bool TryPickValue2(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out T2? value)
+ {
+ value = Value2;
+ return IsValue2;
+ }
+
///
///
///
@@ -59,6 +85,19 @@ namespace ZAI
#endif
public bool IsValue3 => Value3 != null;
+ ///
+ ///
+ ///
+ public bool TryPickValue3(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out T3? value)
+ {
+ value = Value3;
+ return IsValue3;
+ }
+
///
///
///
@@ -75,6 +114,19 @@ namespace ZAI
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))]
#endif
public bool IsValue4 => Value4 != null;
+
+ ///
+ ///
+ ///
+ public bool TryPickValue4(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out T4? value)
+ {
+ value = Value4;
+ return IsValue4;
+ }
///
///
///
@@ -231,6 +283,42 @@ public bool Validate()
///
public void Match(
global::System.Action? value1 = null,
+
+ global::System.Action? value2 = null,
+
+ global::System.Action? value3 = null,
+
+ global::System.Action? value4 = null,
+ bool validate = true)
+ {
+ if (validate)
+ {
+ Validate();
+ }
+
+ if (IsValue1)
+ {
+ value1?.Invoke(Value1!);
+ }
+ else if (IsValue2)
+ {
+ value2?.Invoke(Value2!);
+ }
+ else if (IsValue3)
+ {
+ value3?.Invoke(Value3!);
+ }
+ else if (IsValue4)
+ {
+ value4?.Invoke(Value4!);
+ }
+ }
+
+ ///
+ ///
+ ///
+ public void Switch(
+ global::System.Action? value1 = null,
global::System.Action? value2 = null,
global::System.Action? value3 = null,
global::System.Action? value4 = null,
diff --git a/src/libs/ZAI/Generated/ZAI.OneOf.5.g.cs b/src/libs/ZAI/Generated/ZAI.OneOf.5.g.cs
index 2e06f5e..144e31b 100644
--- a/src/libs/ZAI/Generated/ZAI.OneOf.5.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.OneOf.5.g.cs
@@ -25,6 +25,19 @@ namespace ZAI
#endif
public bool IsValue1 => Value1 != null;
+ ///
+ ///
+ ///
+ public bool TryPickValue1(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out T1? value)
+ {
+ value = Value1;
+ return IsValue1;
+ }
+
///
///
///
@@ -42,6 +55,19 @@ namespace ZAI
#endif
public bool IsValue2 => Value2 != null;
+ ///
+ ///
+ ///
+ public bool TryPickValue2(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out T2? value)
+ {
+ value = Value2;
+ return IsValue2;
+ }
+
///
///
///
@@ -59,6 +85,19 @@ namespace ZAI
#endif
public bool IsValue3 => Value3 != null;
+ ///
+ ///
+ ///
+ public bool TryPickValue3(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out T3? value)
+ {
+ value = Value3;
+ return IsValue3;
+ }
+
///
///
///
@@ -76,6 +115,19 @@ namespace ZAI
#endif
public bool IsValue4 => Value4 != null;
+ ///
+ ///
+ ///
+ public bool TryPickValue4(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out T4? value)
+ {
+ value = Value4;
+ return IsValue4;
+ }
+
///
///
///
@@ -92,6 +144,19 @@ namespace ZAI
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value5))]
#endif
public bool IsValue5 => Value5 != null;
+
+ ///
+ ///
+ ///
+ public bool TryPickValue5(
+#if NET6_0_OR_GREATER
+ [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
+#endif
+ out T5? value)
+ {
+ value = Value5;
+ return IsValue5;
+ }
///
///
///
@@ -275,6 +340,48 @@ public bool Validate()
///
public void Match(
global::System.Action? value1 = null,
+
+ global::System.Action? value2 = null,
+
+ global::System.Action? value3 = null,
+
+ global::System.Action? value4 = null,
+
+ global::System.Action? value5 = null,
+ bool validate = true)
+ {
+ if (validate)
+ {
+ Validate();
+ }
+
+ if (IsValue1)
+ {
+ value1?.Invoke(Value1!);
+ }
+ else if (IsValue2)
+ {
+ value2?.Invoke(Value2!);
+ }
+ else if (IsValue3)
+ {
+ value3?.Invoke(Value3!);
+ }
+ else if (IsValue4)
+ {
+ value4?.Invoke(Value4!);
+ }
+ else if (IsValue5)
+ {
+ value5?.Invoke(Value5!);
+ }
+ }
+
+ ///
+ ///
+ ///
+ public void Switch(
+ global::System.Action? value1 = null,
global::System.Action? value2 = null,
global::System.Action? value3 = null,
global::System.Action? value4 = null,
diff --git a/src/libs/ZAI/Generated/ZAI.ZaiClient.Constructors.Bearer.g.cs b/src/libs/ZAI/Generated/ZAI.ZaiClient.Constructors.Bearer.g.cs
index 4627acd..1a72285 100644
--- a/src/libs/ZAI/Generated/ZAI.ZaiClient.Constructors.Bearer.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.ZaiClient.Constructors.Bearer.g.cs
@@ -26,5 +26,6 @@ partial void Authorizing(
ref string apiKey);
partial void Authorized(
global::System.Net.Http.HttpClient client);
+
}
}
\ No newline at end of file