diff --git a/src/libs/Phoenix/Generated/Phoenix.AnyOf.2.g.cs b/src/libs/Phoenix/Generated/Phoenix.AnyOf.2.g.cs index 189de05..4c56c42 100644 --- a/src/libs/Phoenix/Generated/Phoenix.AnyOf.2.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.AnyOf.2.g.cs @@ -25,6 +25,19 @@ namespace Phoenix #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 Phoenix [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/Phoenix/Generated/Phoenix.AnyOf.21.g.cs b/src/libs/Phoenix/Generated/Phoenix.AnyOf.21.g.cs index 85466c8..b2e5c7c 100644 --- a/src/libs/Phoenix/Generated/Phoenix.AnyOf.21.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.AnyOf.21.g.cs @@ -25,6 +25,19 @@ namespace Phoenix #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 Phoenix #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 Phoenix #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 Phoenix #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; + } + /// /// /// @@ -93,6 +145,19 @@ namespace Phoenix #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; + } + /// /// /// @@ -110,6 +175,19 @@ namespace Phoenix #endif public bool IsValue6 => Value6 != null; + /// + /// + /// + public bool TryPickValue6( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T6? value) + { + value = Value6; + return IsValue6; + } + /// /// /// @@ -127,6 +205,19 @@ namespace Phoenix #endif public bool IsValue7 => Value7 != null; + /// + /// + /// + public bool TryPickValue7( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T7? value) + { + value = Value7; + return IsValue7; + } + /// /// /// @@ -144,6 +235,19 @@ namespace Phoenix #endif public bool IsValue8 => Value8 != null; + /// + /// + /// + public bool TryPickValue8( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T8? value) + { + value = Value8; + return IsValue8; + } + /// /// /// @@ -161,6 +265,19 @@ namespace Phoenix #endif public bool IsValue9 => Value9 != null; + /// + /// + /// + public bool TryPickValue9( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T9? value) + { + value = Value9; + return IsValue9; + } + /// /// /// @@ -178,6 +295,19 @@ namespace Phoenix #endif public bool IsValue10 => Value10 != null; + /// + /// + /// + public bool TryPickValue10( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T10? value) + { + value = Value10; + return IsValue10; + } + /// /// /// @@ -195,6 +325,19 @@ namespace Phoenix #endif public bool IsValue11 => Value11 != null; + /// + /// + /// + public bool TryPickValue11( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T11? value) + { + value = Value11; + return IsValue11; + } + /// /// /// @@ -212,6 +355,19 @@ namespace Phoenix #endif public bool IsValue12 => Value12 != null; + /// + /// + /// + public bool TryPickValue12( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T12? value) + { + value = Value12; + return IsValue12; + } + /// /// /// @@ -229,6 +385,19 @@ namespace Phoenix #endif public bool IsValue13 => Value13 != null; + /// + /// + /// + public bool TryPickValue13( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T13? value) + { + value = Value13; + return IsValue13; + } + /// /// /// @@ -246,6 +415,19 @@ namespace Phoenix #endif public bool IsValue14 => Value14 != null; + /// + /// + /// + public bool TryPickValue14( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T14? value) + { + value = Value14; + return IsValue14; + } + /// /// /// @@ -263,6 +445,19 @@ namespace Phoenix #endif public bool IsValue15 => Value15 != null; + /// + /// + /// + public bool TryPickValue15( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T15? value) + { + value = Value15; + return IsValue15; + } + /// /// /// @@ -280,6 +475,19 @@ namespace Phoenix #endif public bool IsValue16 => Value16 != null; + /// + /// + /// + public bool TryPickValue16( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T16? value) + { + value = Value16; + return IsValue16; + } + /// /// /// @@ -297,6 +505,19 @@ namespace Phoenix #endif public bool IsValue17 => Value17 != null; + /// + /// + /// + public bool TryPickValue17( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T17? value) + { + value = Value17; + return IsValue17; + } + /// /// /// @@ -314,6 +535,19 @@ namespace Phoenix #endif public bool IsValue18 => Value18 != null; + /// + /// + /// + public bool TryPickValue18( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T18? value) + { + value = Value18; + return IsValue18; + } + /// /// /// @@ -331,6 +565,19 @@ namespace Phoenix #endif public bool IsValue19 => Value19 != null; + /// + /// + /// + public bool TryPickValue19( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T19? value) + { + value = Value19; + return IsValue19; + } + /// /// /// @@ -348,6 +595,19 @@ namespace Phoenix #endif public bool IsValue20 => Value20 != null; + /// + /// + /// + public bool TryPickValue20( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T20? value) + { + value = Value20; + return IsValue20; + } + /// /// /// @@ -364,6 +624,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value21))] #endif public bool IsValue21 => Value21 != null; + + /// + /// + /// + public bool TryPickValue21( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T21? value) + { + value = Value21; + return IsValue21; + } /// /// /// @@ -979,6 +1252,144 @@ 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, + + global::System.Action? value6 = null, + + global::System.Action? value7 = null, + + global::System.Action? value8 = null, + + global::System.Action? value9 = null, + + global::System.Action? value10 = null, + + global::System.Action? value11 = null, + + global::System.Action? value12 = null, + + global::System.Action? value13 = null, + + global::System.Action? value14 = null, + + global::System.Action? value15 = null, + + global::System.Action? value16 = null, + + global::System.Action? value17 = null, + + global::System.Action? value18 = null, + + global::System.Action? value19 = null, + + global::System.Action? value20 = null, + + global::System.Action? value21 = 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!); + } + else if (IsValue6) + { + value6?.Invoke(Value6!); + } + else if (IsValue7) + { + value7?.Invoke(Value7!); + } + else if (IsValue8) + { + value8?.Invoke(Value8!); + } + else if (IsValue9) + { + value9?.Invoke(Value9!); + } + else if (IsValue10) + { + value10?.Invoke(Value10!); + } + else if (IsValue11) + { + value11?.Invoke(Value11!); + } + else if (IsValue12) + { + value12?.Invoke(Value12!); + } + else if (IsValue13) + { + value13?.Invoke(Value13!); + } + else if (IsValue14) + { + value14?.Invoke(Value14!); + } + else if (IsValue15) + { + value15?.Invoke(Value15!); + } + else if (IsValue16) + { + value16?.Invoke(Value16!); + } + else if (IsValue17) + { + value17?.Invoke(Value17!); + } + else if (IsValue18) + { + value18?.Invoke(Value18!); + } + else if (IsValue19) + { + value19?.Invoke(Value19!); + } + else if (IsValue20) + { + value20?.Invoke(Value20!); + } + else if (IsValue21) + { + value21?.Invoke(Value21!); + } + } + + /// + /// + /// + 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/Phoenix/Generated/Phoenix.AnyOf.3.g.cs b/src/libs/Phoenix/Generated/Phoenix.AnyOf.3.g.cs index e0d38ff..0542c8f 100644 --- a/src/libs/Phoenix/Generated/Phoenix.AnyOf.3.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.AnyOf.3.g.cs @@ -25,6 +25,19 @@ namespace Phoenix #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 Phoenix #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 Phoenix [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/Phoenix/Generated/Phoenix.AnyOf.4.g.cs b/src/libs/Phoenix/Generated/Phoenix.AnyOf.4.g.cs index 045bbc7..ab27eeb 100644 --- a/src/libs/Phoenix/Generated/Phoenix.AnyOf.4.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.AnyOf.4.g.cs @@ -25,6 +25,19 @@ namespace Phoenix #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 Phoenix #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 Phoenix #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 Phoenix [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/Phoenix/Generated/Phoenix.AnyOf.7.g.cs b/src/libs/Phoenix/Generated/Phoenix.AnyOf.7.g.cs index 13196f0..5025c1f 100644 --- a/src/libs/Phoenix/Generated/Phoenix.AnyOf.7.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.AnyOf.7.g.cs @@ -25,6 +25,19 @@ namespace Phoenix #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 Phoenix #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 Phoenix #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 Phoenix #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; + } + /// /// /// @@ -93,6 +145,19 @@ namespace Phoenix #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; + } + /// /// /// @@ -110,6 +175,19 @@ namespace Phoenix #endif public bool IsValue6 => Value6 != null; + /// + /// + /// + public bool TryPickValue6( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T6? value) + { + value = Value6; + return IsValue6; + } + /// /// /// @@ -126,6 +204,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value7))] #endif public bool IsValue7 => Value7 != null; + + /// + /// + /// + public bool TryPickValue7( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T7? value) + { + value = Value7; + return IsValue7; + } /// /// /// @@ -363,6 +454,60 @@ 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, + + global::System.Action? value6 = null, + + global::System.Action? value7 = 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!); + } + else if (IsValue6) + { + value6?.Invoke(Value6!); + } + else if (IsValue7) + { + value7?.Invoke(Value7!); + } + } + + /// + /// + /// + 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/Phoenix/Generated/Phoenix.Models.ChatChatPostRoot.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.ChatChatPostRoot.g.cs index f6f19e1..ed0572f 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.ChatChatPostRoot.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.ChatChatPostRoot.g.cs @@ -35,6 +35,19 @@ namespace Phoenix #endif public bool IsCustom => Custom != null; + /// + /// + /// + public bool TryPickCustom( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.CustomProviderChatSearchParams? value) + { + value = Custom; + return IsCustom; + } + /// /// Chat against a Phoenix built-in provider.
/// Credentials and connection details (base URL, Azure endpoint, AWS
@@ -55,6 +68,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Builtin))] #endif public bool IsBuiltin => Builtin != null; + + /// + /// + /// + public bool TryPickBuiltin( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.BuiltInProviderChatSearchParams? value) + { + value = Builtin; + return IsBuiltin; + } /// /// /// @@ -134,8 +160,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? custom = null, - global::System.Func? builtin = null, + global::System.Func? custom = null, + global::System.Func? builtin = null, bool validate = true) { if (validate) @@ -159,8 +185,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? custom = null, - global::System.Action? builtin = null, + global::System.Action? custom = null, + + global::System.Action? builtin = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsCustom) + { + custom?.Invoke(Custom!); + } + else if (IsBuiltin) + { + builtin?.Invoke(Builtin!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? custom = null, + global::System.Action? builtin = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.ChatV2ChatV2PostRequest.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.ChatV2ChatV2PostRequest.g.cs index c2ba8b2..c0b9d23 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.ChatV2ChatV2PostRequest.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.ChatV2ChatV2PostRequest.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsSubmitMessage => SubmitMessage != null; + /// + /// + /// + public bool TryPickSubmitMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.SubmitMessage? value) + { + value = SubmitMessage; + return IsSubmitMessage; + } + /// /// Regenerate message extended with Phoenix-specific fields. /// @@ -47,6 +60,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(RegenerateMessage))] #endif public bool IsRegenerateMessage => RegenerateMessage != null; + + /// + /// + /// + public bool TryPickRegenerateMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.RegenerateMessage? value) + { + value = RegenerateMessage; + return IsRegenerateMessage; + } /// /// /// @@ -126,8 +152,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? submitMessage = null, - global::System.Func? regenerateMessage = null, + global::System.Func? submitMessage = null, + global::System.Func? regenerateMessage = null, bool validate = true) { if (validate) @@ -151,8 +177,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? submitMessage = null, - global::System.Action? regenerateMessage = null, + global::System.Action? submitMessage = null, + + global::System.Action? regenerateMessage = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSubmitMessage) + { + submitMessage?.Invoke(SubmitMessage!); + } + else if (IsRegenerateMessage) + { + regenerateMessage?.Invoke(RegenerateMessage!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? submitMessage = null, + global::System.Action? regenerateMessage = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.ChatV2ChatV2PostRoot.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.ChatV2ChatV2PostRoot.g.cs index 3d3a9aa..4feb6e1 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.ChatV2ChatV2PostRoot.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.ChatV2ChatV2PostRoot.g.cs @@ -35,6 +35,19 @@ namespace Phoenix #endif public bool IsCustom => Custom != null; + /// + /// + /// + public bool TryPickCustom( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.CustomProviderChatSearchParams? value) + { + value = Custom; + return IsCustom; + } + /// /// Chat against a Phoenix built-in provider.
/// Credentials and connection details (base URL, Azure endpoint, AWS
@@ -55,6 +68,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Builtin))] #endif public bool IsBuiltin => Builtin != null; + + /// + /// + /// + public bool TryPickBuiltin( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.BuiltInProviderChatSearchParams? value) + { + value = Builtin; + return IsBuiltin; + } /// /// /// @@ -134,8 +160,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? custom = null, - global::System.Func? builtin = null, + global::System.Func? custom = null, + global::System.Func? builtin = null, bool validate = true) { if (validate) @@ -159,8 +185,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? custom = null, - global::System.Action? builtin = null, + global::System.Action? custom = null, + + global::System.Action? builtin = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsCustom) + { + custom?.Invoke(Custom!); + } + else if (IsBuiltin) + { + builtin?.Invoke(Builtin!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? custom = null, + global::System.Action? builtin = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.ContentVariant2Item.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.ContentVariant2Item.g.cs index 6b62031..3739d34 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.ContentVariant2Item.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.ContentVariant2Item.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.TextContentPart? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Phoenix #endif public bool IsToolCall => ToolCall != null; + /// + /// + /// + public bool TryPickToolCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.ToolCallContentPart? value) + { + value = ToolCall; + return IsToolCall; + } + /// /// /// @@ -64,6 +90,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ToolResult))] #endif public bool IsToolResult => ToolResult != null; + + /// + /// + /// + public bool TryPickToolResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.ToolResultContentPart? value) + { + value = ToolResult; + return IsToolResult; + } /// /// /// @@ -165,9 +204,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? toolCall = null, - global::System.Func? toolResult = null, + global::System.Func? text = null, + global::System.Func? toolCall = null, + global::System.Func? toolResult = null, bool validate = true) { if (validate) @@ -195,9 +234,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? toolCall = null, - global::System.Action? toolResult = null, + global::System.Action? text = null, + + global::System.Action? toolCall = null, + + global::System.Action? toolResult = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsToolCall) + { + toolCall?.Invoke(ToolCall!); + } + else if (IsToolResult) + { + toolResult?.Invoke(ToolResult!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? toolCall = null, + global::System.Action? toolResult = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.ContextsItem.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.ContextsItem.g.cs index a87213d..4ddee6b 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.ContextsItem.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.ContextsItem.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsApp => App != null; + /// + /// + /// + public bool TryPickApp( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.AppContext? value) + { + value = App; + return IsApp; + } + /// /// Project the user is currently viewing.
/// ``span_filter`` carries the project-scoped span filter expression when the
@@ -55,6 +68,19 @@ namespace Phoenix #endif public bool IsProject => Project != null; + /// + /// + /// + public bool TryPickProject( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.ProjectContext? value) + { + value = Project; + return IsProject; + } + /// /// /// @@ -72,6 +98,19 @@ namespace Phoenix #endif public bool IsTrace => Trace != null; + /// + /// + /// + public bool TryPickTrace( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.TraceContext? value) + { + value = Trace; + return IsTrace; + } + /// /// Span the user has selected.
/// Exactly one of ``span_node_id`` (relay) or ``otel_span_id`` (OpenTelemetry
@@ -91,6 +130,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Span))] #endif public bool IsSpan => Span != null; + + /// + /// + /// + public bool TryPickSpan( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.AgentSpanContext? value) + { + value = Span; + return IsSpan; + } /// /// /// @@ -214,10 +266,10 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? app = null, - global::System.Func? project = null, - global::System.Func? trace = null, - global::System.Func? span = null, + global::System.Func? app = null, + global::System.Func? project = null, + global::System.Func? trace = null, + global::System.Func? span = null, bool validate = true) { if (validate) @@ -249,10 +301,46 @@ public bool Validate() /// ///
public void Match( - global::System.Action? app = null, - global::System.Action? project = null, - global::System.Action? trace = null, - global::System.Action? span = null, + global::System.Action? app = null, + + global::System.Action? project = null, + + global::System.Action? trace = null, + + global::System.Action? span = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsApp) + { + app?.Invoke(App!); + } + else if (IsProject) + { + project?.Invoke(Project!); + } + else if (IsTrace) + { + trace?.Invoke(Trace!); + } + else if (IsSpan) + { + span?.Invoke(Span!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? app = null, + global::System.Action? project = null, + global::System.Action? trace = null, + global::System.Action? span = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.ContextsItem2.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.ContextsItem2.g.cs index ba82fcd..14e0979 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.ContextsItem2.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.ContextsItem2.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsApp => App != null; + /// + /// + /// + public bool TryPickApp( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.AppContext? value) + { + value = App; + return IsApp; + } + /// /// Project the user is currently viewing.
/// ``span_filter`` carries the project-scoped span filter expression when the
@@ -55,6 +68,19 @@ namespace Phoenix #endif public bool IsProject => Project != null; + /// + /// + /// + public bool TryPickProject( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.ProjectContext? value) + { + value = Project; + return IsProject; + } + /// /// /// @@ -72,6 +98,19 @@ namespace Phoenix #endif public bool IsTrace => Trace != null; + /// + /// + /// + public bool TryPickTrace( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.TraceContext? value) + { + value = Trace; + return IsTrace; + } + /// /// Span the user has selected.
/// Exactly one of ``span_node_id`` (relay) or ``otel_span_id`` (OpenTelemetry
@@ -91,6 +130,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Span))] #endif public bool IsSpan => Span != null; + + /// + /// + /// + public bool TryPickSpan( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.AgentSpanContext? value) + { + value = Span; + return IsSpan; + } /// /// /// @@ -214,10 +266,10 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? app = null, - global::System.Func? project = null, - global::System.Func? trace = null, - global::System.Func? span = null, + global::System.Func? app = null, + global::System.Func? project = null, + global::System.Func? trace = null, + global::System.Func? span = null, bool validate = true) { if (validate) @@ -249,10 +301,46 @@ public bool Validate() /// ///
public void Match( - global::System.Action? app = null, - global::System.Action? project = null, - global::System.Action? trace = null, - global::System.Action? span = null, + global::System.Action? app = null, + + global::System.Action? project = null, + + global::System.Action? trace = null, + + global::System.Action? span = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsApp) + { + app?.Invoke(App!); + } + else if (IsProject) + { + project?.Invoke(Project!); + } + else if (IsTrace) + { + trace?.Invoke(Trace!); + } + else if (IsSpan) + { + span?.Invoke(Span!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? app = null, + global::System.Action? project = null, + global::System.Action? trace = null, + global::System.Action? span = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.CreateAnnotationConfigData.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.CreateAnnotationConfigData.g.cs index 0b23662..f32f6f6 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.CreateAnnotationConfigData.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.CreateAnnotationConfigData.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsCategorical => Categorical != null; + /// + /// + /// + public bool TryPickCategorical( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.CategoricalAnnotationConfigData? value) + { + value = Categorical; + return IsCategorical; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Phoenix #endif public bool IsContinuous => Continuous != null; + /// + /// + /// + public bool TryPickContinuous( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.ContinuousAnnotationConfigData? value) + { + value = Continuous; + return IsContinuous; + } + /// /// /// @@ -64,6 +90,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Freeform))] #endif public bool IsFreeform => Freeform != null; + + /// + /// + /// + public bool TryPickFreeform( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.FreeformAnnotationConfigData? value) + { + value = Freeform; + return IsFreeform; + } /// /// /// @@ -165,9 +204,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? categorical = null, - global::System.Func? continuous = null, - global::System.Func? freeform = null, + global::System.Func? categorical = null, + global::System.Func? continuous = null, + global::System.Func? freeform = null, bool validate = true) { if (validate) @@ -195,9 +234,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? categorical = null, - global::System.Action? continuous = null, - global::System.Action? freeform = null, + global::System.Action? categorical = null, + + global::System.Action? continuous = null, + + global::System.Action? freeform = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsCategorical) + { + categorical?.Invoke(Categorical!); + } + else if (IsContinuous) + { + continuous?.Invoke(Continuous!); + } + else if (IsFreeform) + { + freeform?.Invoke(Freeform!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? categorical = null, + global::System.Action? continuous = null, + global::System.Action? freeform = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.Data.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.Data.g.cs index d733b0b..5329906 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.Data.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.Data.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsCategorical => Categorical != null; + /// + /// + /// + public bool TryPickCategorical( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.CategoricalAnnotationConfig? value) + { + value = Categorical; + return IsCategorical; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Phoenix #endif public bool IsContinuous => Continuous != null; + /// + /// + /// + public bool TryPickContinuous( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.ContinuousAnnotationConfig? value) + { + value = Continuous; + return IsContinuous; + } + /// /// /// @@ -64,6 +90,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Freeform))] #endif public bool IsFreeform => Freeform != null; + + /// + /// + /// + public bool TryPickFreeform( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.FreeformAnnotationConfig? value) + { + value = Freeform; + return IsFreeform; + } /// /// /// @@ -165,9 +204,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? categorical = null, - global::System.Func? continuous = null, - global::System.Func? freeform = null, + global::System.Func? categorical = null, + global::System.Func? continuous = null, + global::System.Func? freeform = null, bool validate = true) { if (validate) @@ -195,9 +234,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? categorical = null, - global::System.Action? continuous = null, - global::System.Action? freeform = null, + global::System.Action? categorical = null, + + global::System.Action? continuous = null, + + global::System.Action? freeform = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsCategorical) + { + categorical?.Invoke(Categorical!); + } + else if (IsContinuous) + { + continuous?.Invoke(Continuous!); + } + else if (IsFreeform) + { + freeform?.Invoke(Freeform!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? categorical = null, + global::System.Action? continuous = null, + global::System.Action? freeform = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.Data2.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.Data2.g.cs index 96ddc4b..64e4086 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.Data2.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.Data2.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsLocal => Local != null; + /// + /// + /// + public bool TryPickLocal( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.LocalUser? value) + { + value = Local; + return IsLocal; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Phoenix #endif public bool IsOauth2 => Oauth2 != null; + /// + /// + /// + public bool TryPickOauth2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.OAuth2User? value) + { + value = Oauth2; + return IsOauth2; + } + /// /// /// @@ -64,6 +90,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Ldap))] #endif public bool IsLdap => Ldap != null; + + /// + /// + /// + public bool TryPickLdap( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.LDAPUser? value) + { + value = Ldap; + return IsLdap; + } /// /// /// @@ -165,9 +204,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? local = null, - global::System.Func? oauth2 = null, - global::System.Func? ldap = null, + global::System.Func? local = null, + global::System.Func? oauth2 = null, + global::System.Func? ldap = null, bool validate = true) { if (validate) @@ -195,9 +234,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? local = null, - global::System.Action? oauth2 = null, - global::System.Action? ldap = null, + global::System.Action? local = null, + + global::System.Action? oauth2 = null, + + global::System.Action? ldap = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsLocal) + { + local?.Invoke(Local!); + } + else if (IsOauth2) + { + oauth2?.Invoke(Oauth2!); + } + else if (IsLdap) + { + ldap?.Invoke(Ldap!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? local = null, + global::System.Action? oauth2 = null, + global::System.Action? ldap = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.Data3.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.Data3.g.cs index d520ffb..6803bee 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.Data3.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.Data3.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsCategorical => Categorical != null; + /// + /// + /// + public bool TryPickCategorical( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.CategoricalAnnotationConfig? value) + { + value = Categorical; + return IsCategorical; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Phoenix #endif public bool IsContinuous => Continuous != null; + /// + /// + /// + public bool TryPickContinuous( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.ContinuousAnnotationConfig? value) + { + value = Continuous; + return IsContinuous; + } + /// /// /// @@ -64,6 +90,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Freeform))] #endif public bool IsFreeform => Freeform != null; + + /// + /// + /// + public bool TryPickFreeform( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.FreeformAnnotationConfig? value) + { + value = Freeform; + return IsFreeform; + } /// /// /// @@ -165,9 +204,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? categorical = null, - global::System.Func? continuous = null, - global::System.Func? freeform = null, + global::System.Func? categorical = null, + global::System.Func? continuous = null, + global::System.Func? freeform = null, bool validate = true) { if (validate) @@ -195,9 +234,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? categorical = null, - global::System.Action? continuous = null, - global::System.Action? freeform = null, + global::System.Action? categorical = null, + + global::System.Action? continuous = null, + + global::System.Action? freeform = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsCategorical) + { + categorical?.Invoke(Categorical!); + } + else if (IsContinuous) + { + continuous?.Invoke(Continuous!); + } + else if (IsFreeform) + { + freeform?.Invoke(Freeform!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? categorical = null, + global::System.Action? continuous = null, + global::System.Action? freeform = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.Data4.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.Data4.g.cs index 7ce0162..ac1045b 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.Data4.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.Data4.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsCategorical => Categorical != null; + /// + /// + /// + public bool TryPickCategorical( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.CategoricalAnnotationConfig? value) + { + value = Categorical; + return IsCategorical; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Phoenix #endif public bool IsContinuous => Continuous != null; + /// + /// + /// + public bool TryPickContinuous( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.ContinuousAnnotationConfig? value) + { + value = Continuous; + return IsContinuous; + } + /// /// /// @@ -64,6 +90,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Freeform))] #endif public bool IsFreeform => Freeform != null; + + /// + /// + /// + public bool TryPickFreeform( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.FreeformAnnotationConfig? value) + { + value = Freeform; + return IsFreeform; + } /// /// /// @@ -165,9 +204,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? categorical = null, - global::System.Func? continuous = null, - global::System.Func? freeform = null, + global::System.Func? categorical = null, + global::System.Func? continuous = null, + global::System.Func? freeform = null, bool validate = true) { if (validate) @@ -195,9 +234,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? categorical = null, - global::System.Action? continuous = null, - global::System.Action? freeform = null, + global::System.Action? categorical = null, + + global::System.Action? continuous = null, + + global::System.Action? freeform = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsCategorical) + { + categorical?.Invoke(Categorical!); + } + else if (IsContinuous) + { + continuous?.Invoke(Continuous!); + } + else if (IsFreeform) + { + freeform?.Invoke(Freeform!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? categorical = null, + global::System.Action? continuous = null, + global::System.Action? freeform = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.Data5.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.Data5.g.cs index 2640b73..dd8ab4e 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.Data5.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.Data5.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsLocal => Local != null; + /// + /// + /// + public bool TryPickLocal( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.LocalUser? value) + { + value = Local; + return IsLocal; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Phoenix #endif public bool IsOauth2 => Oauth2 != null; + /// + /// + /// + public bool TryPickOauth2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.OAuth2User? value) + { + value = Oauth2; + return IsOauth2; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Phoenix #endif public bool IsLdap => Ldap != null; + /// + /// + /// + public bool TryPickLdap( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.LDAPUser? value) + { + value = Ldap; + return IsLdap; + } + /// /// /// @@ -81,6 +120,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Anonymous))] #endif public bool IsAnonymous => Anonymous != null; + + /// + /// + /// + public bool TryPickAnonymous( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.AnonymousUser? value) + { + value = Anonymous; + return IsAnonymous; + } /// /// /// @@ -204,10 +256,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? local = null, - global::System.Func? oauth2 = null, - global::System.Func? ldap = null, - global::System.Func? anonymous = null, + global::System.Func? local = null, + global::System.Func? oauth2 = null, + global::System.Func? ldap = null, + global::System.Func? anonymous = null, bool validate = true) { if (validate) @@ -239,10 +291,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? local = null, - global::System.Action? oauth2 = null, - global::System.Action? ldap = null, - global::System.Action? anonymous = null, + global::System.Action? local = null, + + global::System.Action? oauth2 = null, + + global::System.Action? ldap = null, + + global::System.Action? anonymous = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsLocal) + { + local?.Invoke(Local!); + } + else if (IsOauth2) + { + oauth2?.Invoke(Oauth2!); + } + else if (IsLdap) + { + ldap?.Invoke(Ldap!); + } + else if (IsAnonymous) + { + anonymous?.Invoke(Anonymous!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? local = null, + global::System.Action? oauth2 = null, + global::System.Action? ldap = null, + global::System.Action? anonymous = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.Data6.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.Data6.g.cs index 8f7ffe9..425d792 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.Data6.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.Data6.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsCategorical => Categorical != null; + /// + /// + /// + public bool TryPickCategorical( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.CategoricalAnnotationConfig? value) + { + value = Categorical; + return IsCategorical; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Phoenix #endif public bool IsContinuous => Continuous != null; + /// + /// + /// + public bool TryPickContinuous( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.ContinuousAnnotationConfig? value) + { + value = Continuous; + return IsContinuous; + } + /// /// /// @@ -64,6 +90,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Freeform))] #endif public bool IsFreeform => Freeform != null; + + /// + /// + /// + public bool TryPickFreeform( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.FreeformAnnotationConfig? value) + { + value = Freeform; + return IsFreeform; + } /// /// /// @@ -165,9 +204,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? categorical = null, - global::System.Func? continuous = null, - global::System.Func? freeform = null, + global::System.Func? categorical = null, + global::System.Func? continuous = null, + global::System.Func? freeform = null, bool validate = true) { if (validate) @@ -195,9 +234,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? categorical = null, - global::System.Action? continuous = null, - global::System.Action? freeform = null, + global::System.Action? categorical = null, + + global::System.Action? continuous = null, + + global::System.Action? freeform = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsCategorical) + { + categorical?.Invoke(Categorical!); + } + else if (IsContinuous) + { + continuous?.Invoke(Continuous!); + } + else if (IsFreeform) + { + freeform?.Invoke(Freeform!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? categorical = null, + global::System.Action? continuous = null, + global::System.Action? freeform = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.DataItem.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.DataItem.g.cs index f4c43eb..121011a 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.DataItem.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.DataItem.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsCategorical => Categorical != null; + /// + /// + /// + public bool TryPickCategorical( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.CategoricalAnnotationConfig? value) + { + value = Categorical; + return IsCategorical; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Phoenix #endif public bool IsContinuous => Continuous != null; + /// + /// + /// + public bool TryPickContinuous( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.ContinuousAnnotationConfig? value) + { + value = Continuous; + return IsContinuous; + } + /// /// /// @@ -64,6 +90,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Freeform))] #endif public bool IsFreeform => Freeform != null; + + /// + /// + /// + public bool TryPickFreeform( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.FreeformAnnotationConfig? value) + { + value = Freeform; + return IsFreeform; + } /// /// /// @@ -165,9 +204,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? categorical = null, - global::System.Func? continuous = null, - global::System.Func? freeform = null, + global::System.Func? categorical = null, + global::System.Func? continuous = null, + global::System.Func? freeform = null, bool validate = true) { if (validate) @@ -195,9 +234,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? categorical = null, - global::System.Action? continuous = null, - global::System.Action? freeform = null, + global::System.Action? categorical = null, + + global::System.Action? continuous = null, + + global::System.Action? freeform = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsCategorical) + { + categorical?.Invoke(Categorical!); + } + else if (IsContinuous) + { + continuous?.Invoke(Continuous!); + } + else if (IsFreeform) + { + freeform?.Invoke(Freeform!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? categorical = null, + global::System.Action? continuous = null, + global::System.Action? freeform = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.DataItem2.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.DataItem2.g.cs index b38f6c8..821afa6 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.DataItem2.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.DataItem2.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsLocal => Local != null; + /// + /// + /// + public bool TryPickLocal( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.LocalUser? value) + { + value = Local; + return IsLocal; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Phoenix #endif public bool IsOauth2 => Oauth2 != null; + /// + /// + /// + public bool TryPickOauth2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.OAuth2User? value) + { + value = Oauth2; + return IsOauth2; + } + /// /// /// @@ -64,6 +90,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Ldap))] #endif public bool IsLdap => Ldap != null; + + /// + /// + /// + public bool TryPickLdap( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.LDAPUser? value) + { + value = Ldap; + return IsLdap; + } /// /// /// @@ -165,9 +204,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? local = null, - global::System.Func? oauth2 = null, - global::System.Func? ldap = null, + global::System.Func? local = null, + global::System.Func? oauth2 = null, + global::System.Func? ldap = null, bool validate = true) { if (validate) @@ -195,9 +234,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? local = null, - global::System.Action? oauth2 = null, - global::System.Action? ldap = null, + global::System.Action? local = null, + + global::System.Action? oauth2 = null, + + global::System.Action? ldap = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsLocal) + { + local?.Invoke(Local!); + } + else if (IsOauth2) + { + oauth2?.Invoke(Oauth2!); + } + else if (IsLdap) + { + ldap?.Invoke(Ldap!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? local = null, + global::System.Action? oauth2 = null, + global::System.Action? ldap = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.InvocationParameters.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.InvocationParameters.g.cs index affbdee..47b4581 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.InvocationParameters.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.InvocationParameters.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsOpenai => Openai != null; + /// + /// + /// + public bool TryPickOpenai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptOpenAIInvocationParameters? value) + { + value = Openai; + return IsOpenai; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Phoenix #endif public bool IsAzureOpenai => AzureOpenai != null; + /// + /// + /// + public bool TryPickAzureOpenai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptAzureOpenAIInvocationParameters? value) + { + value = AzureOpenai; + return IsAzureOpenai; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Phoenix #endif public bool IsAnthropic => Anthropic != null; + /// + /// + /// + public bool TryPickAnthropic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptAnthropicInvocationParameters? value) + { + value = Anthropic; + return IsAnthropic; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Phoenix #endif public bool IsGoogle => Google != null; + /// + /// + /// + public bool TryPickGoogle( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptGoogleInvocationParameters? value) + { + value = Google; + return IsGoogle; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Phoenix #endif public bool IsDeepseek => Deepseek != null; + /// + /// + /// + public bool TryPickDeepseek( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptDeepSeekInvocationParameters? value) + { + value = Deepseek; + return IsDeepseek; + } + /// /// /// @@ -116,6 +181,19 @@ namespace Phoenix #endif public bool IsXai => Xai != null; + /// + /// + /// + public bool TryPickXai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptXAIInvocationParameters? value) + { + value = Xai; + return IsXai; + } + /// /// /// @@ -133,6 +211,19 @@ namespace Phoenix #endif public bool IsOllama => Ollama != null; + /// + /// + /// + public bool TryPickOllama( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptOllamaInvocationParameters? value) + { + value = Ollama; + return IsOllama; + } + /// /// /// @@ -150,6 +241,19 @@ namespace Phoenix #endif public bool IsAws => Aws != null; + /// + /// + /// + public bool TryPickAws( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptAwsInvocationParameters? value) + { + value = Aws; + return IsAws; + } + /// /// /// @@ -167,6 +271,19 @@ namespace Phoenix #endif public bool IsCerebras => Cerebras != null; + /// + /// + /// + public bool TryPickCerebras( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptCerebrasInvocationParameters? value) + { + value = Cerebras; + return IsCerebras; + } + /// /// /// @@ -184,6 +301,19 @@ namespace Phoenix #endif public bool IsFireworks => Fireworks != null; + /// + /// + /// + public bool TryPickFireworks( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptFireworksInvocationParameters? value) + { + value = Fireworks; + return IsFireworks; + } + /// /// /// @@ -201,6 +331,19 @@ namespace Phoenix #endif public bool IsGroq => Groq != null; + /// + /// + /// + public bool TryPickGroq( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptGroqInvocationParameters? value) + { + value = Groq; + return IsGroq; + } + /// /// /// @@ -218,6 +361,19 @@ namespace Phoenix #endif public bool IsMoonshot => Moonshot != null; + /// + /// + /// + public bool TryPickMoonshot( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptMoonshotInvocationParameters? value) + { + value = Moonshot; + return IsMoonshot; + } + /// /// /// @@ -235,6 +391,19 @@ namespace Phoenix #endif public bool IsPerplexity => Perplexity != null; + /// + /// + /// + public bool TryPickPerplexity( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptPerplexityInvocationParameters? value) + { + value = Perplexity; + return IsPerplexity; + } + /// /// /// @@ -251,6 +420,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Together))] #endif public bool IsTogether => Together != null; + + /// + /// + /// + public bool TryPickTogether( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptTogetherInvocationParameters? value) + { + value = Together; + return IsTogether; + } /// /// /// @@ -594,20 +776,20 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? openai = null, - global::System.Func? azureOpenai = null, - global::System.Func? anthropic = null, - global::System.Func? google = null, - global::System.Func? deepseek = null, - global::System.Func? xai = null, - global::System.Func? ollama = null, - global::System.Func? aws = null, - global::System.Func? cerebras = null, - global::System.Func? fireworks = null, - global::System.Func? groq = null, - global::System.Func? moonshot = null, - global::System.Func? perplexity = null, - global::System.Func? together = null, + global::System.Func? openai = null, + global::System.Func? azureOpenai = null, + global::System.Func? anthropic = null, + global::System.Func? google = null, + global::System.Func? deepseek = null, + global::System.Func? xai = null, + global::System.Func? ollama = null, + global::System.Func? aws = null, + global::System.Func? cerebras = null, + global::System.Func? fireworks = null, + global::System.Func? groq = null, + global::System.Func? moonshot = null, + global::System.Func? perplexity = null, + global::System.Func? together = null, bool validate = true) { if (validate) @@ -679,20 +861,116 @@ public bool Validate() /// /// public void Match( - global::System.Action? openai = null, - global::System.Action? azureOpenai = null, - global::System.Action? anthropic = null, - global::System.Action? google = null, - global::System.Action? deepseek = null, - global::System.Action? xai = null, - global::System.Action? ollama = null, - global::System.Action? aws = null, - global::System.Action? cerebras = null, - global::System.Action? fireworks = null, - global::System.Action? groq = null, - global::System.Action? moonshot = null, - global::System.Action? perplexity = null, - global::System.Action? together = null, + global::System.Action? openai = null, + + global::System.Action? azureOpenai = null, + + global::System.Action? anthropic = null, + + global::System.Action? google = null, + + global::System.Action? deepseek = null, + + global::System.Action? xai = null, + + global::System.Action? ollama = null, + + global::System.Action? aws = null, + + global::System.Action? cerebras = null, + + global::System.Action? fireworks = null, + + global::System.Action? groq = null, + + global::System.Action? moonshot = null, + + global::System.Action? perplexity = null, + + global::System.Action? together = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOpenai) + { + openai?.Invoke(Openai!); + } + else if (IsAzureOpenai) + { + azureOpenai?.Invoke(AzureOpenai!); + } + else if (IsAnthropic) + { + anthropic?.Invoke(Anthropic!); + } + else if (IsGoogle) + { + google?.Invoke(Google!); + } + else if (IsDeepseek) + { + deepseek?.Invoke(Deepseek!); + } + else if (IsXai) + { + xai?.Invoke(Xai!); + } + else if (IsOllama) + { + ollama?.Invoke(Ollama!); + } + else if (IsAws) + { + aws?.Invoke(Aws!); + } + else if (IsCerebras) + { + cerebras?.Invoke(Cerebras!); + } + else if (IsFireworks) + { + fireworks?.Invoke(Fireworks!); + } + else if (IsGroq) + { + groq?.Invoke(Groq!); + } + else if (IsMoonshot) + { + moonshot?.Invoke(Moonshot!); + } + else if (IsPerplexity) + { + perplexity?.Invoke(Perplexity!); + } + else if (IsTogether) + { + together?.Invoke(Together!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? openai = null, + global::System.Action? azureOpenai = null, + global::System.Action? anthropic = null, + global::System.Action? google = null, + global::System.Action? deepseek = null, + global::System.Action? xai = null, + global::System.Action? ollama = null, + global::System.Action? aws = null, + global::System.Action? cerebras = null, + global::System.Action? fireworks = null, + global::System.Action? groq = null, + global::System.Action? moonshot = null, + global::System.Action? perplexity = null, + global::System.Action? together = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.InvocationParameters2.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.InvocationParameters2.g.cs index c6c1b71..b9e4c5a 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.InvocationParameters2.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.InvocationParameters2.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsOpenai => Openai != null; + /// + /// + /// + public bool TryPickOpenai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptOpenAIInvocationParameters? value) + { + value = Openai; + return IsOpenai; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Phoenix #endif public bool IsAzureOpenai => AzureOpenai != null; + /// + /// + /// + public bool TryPickAzureOpenai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptAzureOpenAIInvocationParameters? value) + { + value = AzureOpenai; + return IsAzureOpenai; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Phoenix #endif public bool IsAnthropic => Anthropic != null; + /// + /// + /// + public bool TryPickAnthropic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptAnthropicInvocationParameters? value) + { + value = Anthropic; + return IsAnthropic; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Phoenix #endif public bool IsGoogle => Google != null; + /// + /// + /// + public bool TryPickGoogle( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptGoogleInvocationParameters? value) + { + value = Google; + return IsGoogle; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Phoenix #endif public bool IsDeepseek => Deepseek != null; + /// + /// + /// + public bool TryPickDeepseek( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptDeepSeekInvocationParameters? value) + { + value = Deepseek; + return IsDeepseek; + } + /// /// /// @@ -116,6 +181,19 @@ namespace Phoenix #endif public bool IsXai => Xai != null; + /// + /// + /// + public bool TryPickXai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptXAIInvocationParameters? value) + { + value = Xai; + return IsXai; + } + /// /// /// @@ -133,6 +211,19 @@ namespace Phoenix #endif public bool IsOllama => Ollama != null; + /// + /// + /// + public bool TryPickOllama( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptOllamaInvocationParameters? value) + { + value = Ollama; + return IsOllama; + } + /// /// /// @@ -150,6 +241,19 @@ namespace Phoenix #endif public bool IsAws => Aws != null; + /// + /// + /// + public bool TryPickAws( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptAwsInvocationParameters? value) + { + value = Aws; + return IsAws; + } + /// /// /// @@ -167,6 +271,19 @@ namespace Phoenix #endif public bool IsCerebras => Cerebras != null; + /// + /// + /// + public bool TryPickCerebras( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptCerebrasInvocationParameters? value) + { + value = Cerebras; + return IsCerebras; + } + /// /// /// @@ -184,6 +301,19 @@ namespace Phoenix #endif public bool IsFireworks => Fireworks != null; + /// + /// + /// + public bool TryPickFireworks( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptFireworksInvocationParameters? value) + { + value = Fireworks; + return IsFireworks; + } + /// /// /// @@ -201,6 +331,19 @@ namespace Phoenix #endif public bool IsGroq => Groq != null; + /// + /// + /// + public bool TryPickGroq( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptGroqInvocationParameters? value) + { + value = Groq; + return IsGroq; + } + /// /// /// @@ -218,6 +361,19 @@ namespace Phoenix #endif public bool IsMoonshot => Moonshot != null; + /// + /// + /// + public bool TryPickMoonshot( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptMoonshotInvocationParameters? value) + { + value = Moonshot; + return IsMoonshot; + } + /// /// /// @@ -235,6 +391,19 @@ namespace Phoenix #endif public bool IsPerplexity => Perplexity != null; + /// + /// + /// + public bool TryPickPerplexity( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptPerplexityInvocationParameters? value) + { + value = Perplexity; + return IsPerplexity; + } + /// /// /// @@ -251,6 +420,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Together))] #endif public bool IsTogether => Together != null; + + /// + /// + /// + public bool TryPickTogether( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptTogetherInvocationParameters? value) + { + value = Together; + return IsTogether; + } /// /// /// @@ -594,20 +776,20 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? openai = null, - global::System.Func? azureOpenai = null, - global::System.Func? anthropic = null, - global::System.Func? google = null, - global::System.Func? deepseek = null, - global::System.Func? xai = null, - global::System.Func? ollama = null, - global::System.Func? aws = null, - global::System.Func? cerebras = null, - global::System.Func? fireworks = null, - global::System.Func? groq = null, - global::System.Func? moonshot = null, - global::System.Func? perplexity = null, - global::System.Func? together = null, + global::System.Func? openai = null, + global::System.Func? azureOpenai = null, + global::System.Func? anthropic = null, + global::System.Func? google = null, + global::System.Func? deepseek = null, + global::System.Func? xai = null, + global::System.Func? ollama = null, + global::System.Func? aws = null, + global::System.Func? cerebras = null, + global::System.Func? fireworks = null, + global::System.Func? groq = null, + global::System.Func? moonshot = null, + global::System.Func? perplexity = null, + global::System.Func? together = null, bool validate = true) { if (validate) @@ -679,20 +861,116 @@ public bool Validate() /// /// public void Match( - global::System.Action? openai = null, - global::System.Action? azureOpenai = null, - global::System.Action? anthropic = null, - global::System.Action? google = null, - global::System.Action? deepseek = null, - global::System.Action? xai = null, - global::System.Action? ollama = null, - global::System.Action? aws = null, - global::System.Action? cerebras = null, - global::System.Action? fireworks = null, - global::System.Action? groq = null, - global::System.Action? moonshot = null, - global::System.Action? perplexity = null, - global::System.Action? together = null, + global::System.Action? openai = null, + + global::System.Action? azureOpenai = null, + + global::System.Action? anthropic = null, + + global::System.Action? google = null, + + global::System.Action? deepseek = null, + + global::System.Action? xai = null, + + global::System.Action? ollama = null, + + global::System.Action? aws = null, + + global::System.Action? cerebras = null, + + global::System.Action? fireworks = null, + + global::System.Action? groq = null, + + global::System.Action? moonshot = null, + + global::System.Action? perplexity = null, + + global::System.Action? together = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOpenai) + { + openai?.Invoke(Openai!); + } + else if (IsAzureOpenai) + { + azureOpenai?.Invoke(AzureOpenai!); + } + else if (IsAnthropic) + { + anthropic?.Invoke(Anthropic!); + } + else if (IsGoogle) + { + google?.Invoke(Google!); + } + else if (IsDeepseek) + { + deepseek?.Invoke(Deepseek!); + } + else if (IsXai) + { + xai?.Invoke(Xai!); + } + else if (IsOllama) + { + ollama?.Invoke(Ollama!); + } + else if (IsAws) + { + aws?.Invoke(Aws!); + } + else if (IsCerebras) + { + cerebras?.Invoke(Cerebras!); + } + else if (IsFireworks) + { + fireworks?.Invoke(Fireworks!); + } + else if (IsGroq) + { + groq?.Invoke(Groq!); + } + else if (IsMoonshot) + { + moonshot?.Invoke(Moonshot!); + } + else if (IsPerplexity) + { + perplexity?.Invoke(Perplexity!); + } + else if (IsTogether) + { + together?.Invoke(Together!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? openai = null, + global::System.Action? azureOpenai = null, + global::System.Action? anthropic = null, + global::System.Action? google = null, + global::System.Action? deepseek = null, + global::System.Action? xai = null, + global::System.Action? ollama = null, + global::System.Action? aws = null, + global::System.Action? cerebras = null, + global::System.Action? fireworks = null, + global::System.Action? groq = null, + global::System.Action? moonshot = null, + global::System.Action? perplexity = null, + global::System.Action? together = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.ResponseFormatVariant1.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.ResponseFormatVariant1.g.cs index 121c658..22cfaef 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.ResponseFormatVariant1.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.ResponseFormatVariant1.g.cs @@ -30,6 +30,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(JsonSchema))] #endif public bool IsJsonSchema => JsonSchema != null; + + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptResponseFormatJSONSchema? value) + { + value = JsonSchema; + return IsJsonSchema; + } /// /// /// @@ -87,7 +100,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? jsonSchema = null, + global::System.Func? jsonSchema = null, bool validate = true) { if (validate) @@ -107,7 +120,25 @@ public bool Validate() /// /// public void Match( - global::System.Action? jsonSchema = null, + global::System.Action? jsonSchema = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsJsonSchema) + { + jsonSchema?.Invoke(JsonSchema!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? jsonSchema = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.ResponseFormatVariant12.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.ResponseFormatVariant12.g.cs index fd30ea1..b7131e0 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.ResponseFormatVariant12.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.ResponseFormatVariant12.g.cs @@ -30,6 +30,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(JsonSchema))] #endif public bool IsJsonSchema => JsonSchema != null; + + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptResponseFormatJSONSchema? value) + { + value = JsonSchema; + return IsJsonSchema; + } /// /// /// @@ -87,7 +100,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? jsonSchema = null, + global::System.Func? jsonSchema = null, bool validate = true) { if (validate) @@ -107,7 +120,25 @@ public bool Validate() /// /// public void Match( - global::System.Action? jsonSchema = null, + global::System.Action? jsonSchema = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsJsonSchema) + { + jsonSchema?.Invoke(JsonSchema!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? jsonSchema = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.Template.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.Template.g.cs index 2e6746b..a24e9fb 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.Template.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.Template.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsChat => Chat != null; + /// + /// + /// + public bool TryPickChat( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptChatTemplate? value) + { + value = Chat; + return IsChat; + } + /// /// /// @@ -47,6 +60,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(String))] #endif public bool IsString => String != null; + + /// + /// + /// + public bool TryPickString( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptStringTemplate? value) + { + value = String; + return IsString; + } /// /// /// @@ -126,8 +152,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? chat = null, - global::System.Func? @string = null, + global::System.Func? chat = null, + global::System.Func? @string = null, bool validate = true) { if (validate) @@ -151,8 +177,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? chat = null, - global::System.Action? @string = null, + global::System.Action? chat = null, + + global::System.Action? @string = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsChat) + { + chat?.Invoke(Chat!); + } + else if (IsString) + { + @string?.Invoke(String!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? chat = null, + global::System.Action? @string = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.Template2.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.Template2.g.cs index aba519b..fc537ae 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.Template2.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.Template2.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsChat => Chat != null; + /// + /// + /// + public bool TryPickChat( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptChatTemplate? value) + { + value = Chat; + return IsChat; + } + /// /// /// @@ -47,6 +60,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(String))] #endif public bool IsString => String != null; + + /// + /// + /// + public bool TryPickString( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptStringTemplate? value) + { + value = String; + return IsString; + } /// /// /// @@ -126,8 +152,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? chat = null, - global::System.Func? @string = null, + global::System.Func? chat = null, + global::System.Func? @string = null, bool validate = true) { if (validate) @@ -151,8 +177,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? chat = null, - global::System.Action? @string = null, + global::System.Action? chat = null, + + global::System.Action? @string = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsChat) + { + chat?.Invoke(Chat!); + } + else if (IsString) + { + @string?.Invoke(String!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? chat = null, + global::System.Action? @string = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.Thinking.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.Thinking.g.cs index 769a7d4..185bdec 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.Thinking.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.Thinking.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsDisabled => Disabled != null; + /// + /// + /// + public bool TryPickDisabled( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptAnthropicThinkingConfigDisabled? value) + { + value = Disabled; + return IsDisabled; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Phoenix #endif public bool IsEnabled => Enabled != null; + /// + /// + /// + public bool TryPickEnabled( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptAnthropicThinkingConfigEnabled? value) + { + value = Enabled; + return IsEnabled; + } + /// /// /// @@ -64,6 +90,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Adaptive))] #endif public bool IsAdaptive => Adaptive != null; + + /// + /// + /// + public bool TryPickAdaptive( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptAnthropicThinkingConfigAdaptive? value) + { + value = Adaptive; + return IsAdaptive; + } /// /// /// @@ -165,9 +204,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? disabled = null, - global::System.Func? enabled = null, - global::System.Func? adaptive = null, + global::System.Func? disabled = null, + global::System.Func? enabled = null, + global::System.Func? adaptive = null, bool validate = true) { if (validate) @@ -195,9 +234,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? disabled = null, - global::System.Action? enabled = null, - global::System.Action? adaptive = null, + global::System.Action? disabled = null, + + global::System.Action? enabled = null, + + global::System.Action? adaptive = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsDisabled) + { + disabled?.Invoke(Disabled!); + } + else if (IsEnabled) + { + enabled?.Invoke(Enabled!); + } + else if (IsAdaptive) + { + adaptive?.Invoke(Adaptive!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? disabled = null, + global::System.Action? enabled = null, + global::System.Action? adaptive = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.ToolChoice.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.ToolChoice.g.cs index 6ccb135..93350ed 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.ToolChoice.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.ToolChoice.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsNone => None != null; + /// + /// + /// + public bool TryPickNone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptToolChoiceNone? value) + { + value = None; + return IsNone; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Phoenix #endif public bool IsZeroOrMore => ZeroOrMore != null; + /// + /// + /// + public bool TryPickZeroOrMore( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptToolChoiceZeroOrMore? value) + { + value = ZeroOrMore; + return IsZeroOrMore; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Phoenix #endif public bool IsOneOrMore => OneOrMore != null; + /// + /// + /// + public bool TryPickOneOrMore( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptToolChoiceOneOrMore? value) + { + value = OneOrMore; + return IsOneOrMore; + } + /// /// /// @@ -81,6 +120,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SpecificFunction))] #endif public bool IsSpecificFunction => SpecificFunction != null; + + /// + /// + /// + public bool TryPickSpecificFunction( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptToolChoiceSpecificFunctionTool? value) + { + value = SpecificFunction; + return IsSpecificFunction; + } /// /// /// @@ -204,10 +256,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? none = null, - global::System.Func? zeroOrMore = null, - global::System.Func? oneOrMore = null, - global::System.Func? specificFunction = null, + global::System.Func? none = null, + global::System.Func? zeroOrMore = null, + global::System.Func? oneOrMore = null, + global::System.Func? specificFunction = null, bool validate = true) { if (validate) @@ -239,10 +291,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? none = null, - global::System.Action? zeroOrMore = null, - global::System.Action? oneOrMore = null, - global::System.Action? specificFunction = null, + global::System.Action? none = null, + + global::System.Action? zeroOrMore = null, + + global::System.Action? oneOrMore = null, + + global::System.Action? specificFunction = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsNone) + { + none?.Invoke(None!); + } + else if (IsZeroOrMore) + { + zeroOrMore?.Invoke(ZeroOrMore!); + } + else if (IsOneOrMore) + { + oneOrMore?.Invoke(OneOrMore!); + } + else if (IsSpecificFunction) + { + specificFunction?.Invoke(SpecificFunction!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? none = null, + global::System.Action? zeroOrMore = null, + global::System.Action? oneOrMore = null, + global::System.Action? specificFunction = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.ToolsItem.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.ToolsItem.g.cs index 2e22625..4419166 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.ToolsItem.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.ToolsItem.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsFunction => Function != null; + /// + /// + /// + public bool TryPickFunction( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptToolFunction? value) + { + value = Function; + return IsFunction; + } + /// /// /// @@ -47,6 +60,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Raw))] #endif public bool IsRaw => Raw != null; + + /// + /// + /// + public bool TryPickRaw( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.PromptToolRaw? value) + { + value = Raw; + return IsRaw; + } /// /// /// @@ -126,8 +152,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? function = null, - global::System.Func? raw = null, + global::System.Func? function = null, + global::System.Func? raw = null, bool validate = true) { if (validate) @@ -151,8 +177,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? function = null, - global::System.Action? raw = null, + global::System.Action? function = null, + + global::System.Action? raw = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsFunction) + { + function?.Invoke(Function!); + } + else if (IsRaw) + { + raw?.Invoke(Raw!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? function = null, + global::System.Action? raw = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.User.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.User.g.cs index 0c61630..6c0114f 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.User.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.User.g.cs @@ -31,6 +31,19 @@ namespace Phoenix #endif public bool IsLocal => Local != null; + /// + /// + /// + public bool TryPickLocal( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.LocalUserData? value) + { + value = Local; + return IsLocal; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Phoenix #endif public bool IsOauth2 => Oauth2 != null; + /// + /// + /// + public bool TryPickOauth2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.OAuth2UserData? value) + { + value = Oauth2; + return IsOauth2; + } + /// /// /// @@ -64,6 +90,19 @@ namespace Phoenix [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Ldap))] #endif public bool IsLdap => Ldap != null; + + /// + /// + /// + public bool TryPickLdap( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.LDAPUserData? value) + { + value = Ldap; + return IsLdap; + } /// /// /// @@ -165,9 +204,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? local = null, - global::System.Func? oauth2 = null, - global::System.Func? ldap = null, + global::System.Func? local = null, + global::System.Func? oauth2 = null, + global::System.Func? ldap = null, bool validate = true) { if (validate) @@ -195,9 +234,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? local = null, - global::System.Action? oauth2 = null, - global::System.Action? ldap = null, + global::System.Action? local = null, + + global::System.Action? oauth2 = null, + + global::System.Action? ldap = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsLocal) + { + local?.Invoke(Local!); + } + else if (IsOauth2) + { + oauth2?.Invoke(Oauth2!); + } + else if (IsLdap) + { + ldap?.Invoke(Ldap!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? local = null, + global::System.Action? oauth2 = null, + global::System.Action? ldap = null, bool validate = true) { if (validate) diff --git a/src/libs/Phoenix/Generated/Phoenix.OneOf.2.g.cs b/src/libs/Phoenix/Generated/Phoenix.OneOf.2.g.cs index 1c0c8f1..dad0229 100644 --- a/src/libs/Phoenix/Generated/Phoenix.OneOf.2.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.OneOf.2.g.cs @@ -25,6 +25,19 @@ namespace Phoenix #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 Phoenix [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/Phoenix/Generated/Phoenix.OneOf.3.g.cs b/src/libs/Phoenix/Generated/Phoenix.OneOf.3.g.cs index e504d72..5be3f67 100644 --- a/src/libs/Phoenix/Generated/Phoenix.OneOf.3.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.OneOf.3.g.cs @@ -25,6 +25,19 @@ namespace Phoenix #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 Phoenix #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 Phoenix [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/Phoenix/Generated/Phoenix.PhoenixClient.Constructors.Bearer.g.cs b/src/libs/Phoenix/Generated/Phoenix.PhoenixClient.Constructors.Bearer.g.cs index 7a88d0b..ff21b17 100644 --- a/src/libs/Phoenix/Generated/Phoenix.PhoenixClient.Constructors.Bearer.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.PhoenixClient.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