From ee90719f83a197103784a7f3069c8c3e6b62c23b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 8 May 2026 02:09:12 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Generated/Braintrust.AllOf.2.g.cs | 50 ++++ .../Generated/Braintrust.AnyOf.2.g.cs | 50 ++++ .../Generated/Braintrust.AnyOf.3.g.cs | 69 +++++ .../Generated/Braintrust.AnyOf.4.g.cs | 88 +++++++ ....BraintrustClient.Constructors.Bearer.g.cs | 1 + .../Braintrust.Models.AISecretType.g.cs | 58 ++++- ...rust.Models.ChatCompletionContentPart.g.cs | 81 +++++- ...ust.Models.ChatCompletionMessageParam.g.cs | 173 +++++++++++-- .../Braintrust.Models.FunctionData.g.cs | 215 ++++++++++++++-- ...Braintrust.Models.FunctionDataNullish.g.cs | 238 ++++++++++++++++-- .../Braintrust.Models.FunctionId.g.cs | 173 +++++++++++-- .../Braintrust.Models.GraphNode.g.cs | 196 +++++++++++++-- .../Generated/Braintrust.Models.Ids.g.cs | 54 +++- .../Braintrust.Models.InvokeParent.g.cs | 58 ++++- .../Braintrust.Models.ModelParams.g.cs | 127 +++++++++- ...ntrust.Models.NullableSavedFunctionId.g.cs | 81 +++++- ...intrust.Models.ProjectScoreCategories.g.cs | 104 +++++++- .../Braintrust.Models.PromptBlockData.g.cs | 58 ++++- ...intrust.Models.PromptBlockDataNullish.g.cs | 81 +++++- ...aintrust.Models.ResponseFormatNullish.g.cs | 104 +++++++- .../Braintrust.Models.SavedFunctionId.g.cs | 81 +++++- ...trust.Models.TopicAutomationDataScope.g.cs | 104 +++++++- .../Braintrust.Models.UserEmail.g.cs | 58 ++++- .../Braintrust.Models.UserFamilyName.g.cs | 58 ++++- .../Braintrust.Models.UserGivenName.g.cs | 58 ++++- .../Braintrust.Models.ViewOptions.g.cs | 81 +++++- .../Generated/Braintrust.OneOf.2.g.cs | 50 ++++ .../Generated/Braintrust.OneOf.3.g.cs | 69 +++++ .../Generated/Braintrust.OneOf.5.g.cs | 107 ++++++++ .../Generated/Braintrust.OneOf.6.g.cs | 126 ++++++++++ 30 files changed, 2683 insertions(+), 168 deletions(-) diff --git a/src/libs/Braintrust/Generated/Braintrust.AllOf.2.g.cs b/src/libs/Braintrust/Generated/Braintrust.AllOf.2.g.cs index 5521ee1..fb36823 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AllOf.2.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AllOf.2.g.cs @@ -25,6 +25,19 @@ namespace Braintrust #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 Braintrust [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; + } /// /// /// @@ -157,6 +183,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/Braintrust/Generated/Braintrust.AnyOf.2.g.cs b/src/libs/Braintrust/Generated/Braintrust.AnyOf.2.g.cs index dd53ef3..0b14c50 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AnyOf.2.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AnyOf.2.g.cs @@ -25,6 +25,19 @@ namespace Braintrust #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 Braintrust [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/Braintrust/Generated/Braintrust.AnyOf.3.g.cs b/src/libs/Braintrust/Generated/Braintrust.AnyOf.3.g.cs index 21c27a1..50895a1 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AnyOf.3.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AnyOf.3.g.cs @@ -25,6 +25,19 @@ namespace Braintrust #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 Braintrust #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 Braintrust [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/Braintrust/Generated/Braintrust.AnyOf.4.g.cs b/src/libs/Braintrust/Generated/Braintrust.AnyOf.4.g.cs index 47a170a..f4b9c30 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AnyOf.4.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AnyOf.4.g.cs @@ -25,6 +25,19 @@ namespace Braintrust #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 Braintrust #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 Braintrust #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 Braintrust [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/Braintrust/Generated/Braintrust.BraintrustClient.Constructors.Bearer.g.cs b/src/libs/Braintrust/Generated/Braintrust.BraintrustClient.Constructors.Bearer.g.cs index 1818893..bf14dc5 100644 --- a/src/libs/Braintrust/Generated/Braintrust.BraintrustClient.Constructors.Bearer.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.BraintrustClient.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 diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.AISecretType.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.AISecretType.g.cs index 2da5599..0edc1c9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.AISecretType.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.AISecretType.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsAISecretTypeVariant1 => AISecretTypeVariant1 != null; + /// + /// + /// + public bool TryPickAISecretTypeVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out string? value) + { + value = AISecretTypeVariant1; + return IsAISecretTypeVariant1; + } + /// /// /// @@ -42,6 +55,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AISecretTypeVariant2))] #endif public bool IsAISecretTypeVariant2 => AISecretTypeVariant2 != null; + + /// + /// + /// + public bool TryPickAISecretTypeVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Collections.Generic.IList? value) + { + value = AISecretTypeVariant2; + return IsAISecretTypeVariant2; + } /// /// /// @@ -100,8 +126,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? aISecretTypeVariant1 = null, - global::System.Func?, TResult>? aISecretTypeVariant2 = null, + global::System.Func? aISecretTypeVariant1 = null, + global::System.Func, TResult>? aISecretTypeVariant2 = null, bool validate = true) { if (validate) @@ -125,8 +151,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? aISecretTypeVariant1 = null, - global::System.Action?>? aISecretTypeVariant2 = null, + global::System.Action? aISecretTypeVariant1 = null, + + global::System.Action>? aISecretTypeVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAISecretTypeVariant1) + { + aISecretTypeVariant1?.Invoke(AISecretTypeVariant1!); + } + else if (IsAISecretTypeVariant2) + { + aISecretTypeVariant2?.Invoke(AISecretTypeVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? aISecretTypeVariant1 = null, + global::System.Action>? aISecretTypeVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.ChatCompletionContentPart.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.ChatCompletionContentPart.g.cs index f073efa..e938bf8 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.ChatCompletionContentPart.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.ChatCompletionContentPart.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ChatCompletionContentPartTextWithTitle? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -43,6 +56,19 @@ namespace Braintrust #endif public bool IsImageUrl => ImageUrl != null; + /// + /// + /// + public bool TryPickImageUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ChatCompletionContentPartImageWithTitle? value) + { + value = ImageUrl; + return IsImageUrl; + } + /// /// /// @@ -59,6 +85,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(File))] #endif public bool IsFile => File != null; + + /// + /// + /// + public bool TryPickFile( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ChatCompletionContentPartFileWithTitle? value) + { + value = File; + return IsFile; + } /// /// /// @@ -157,9 +196,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? imageUrl = null, - global::System.Func? file = null, + global::System.Func? text = null, + global::System.Func? imageUrl = null, + global::System.Func? file = null, bool validate = true) { if (validate) @@ -187,9 +226,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? imageUrl = null, - global::System.Action? file = null, + global::System.Action? text = null, + + global::System.Action? imageUrl = null, + + global::System.Action? file = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImageUrl) + { + imageUrl?.Invoke(ImageUrl!); + } + else if (IsFile) + { + file?.Invoke(File!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? imageUrl = null, + global::System.Action? file = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.ChatCompletionMessageParam.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.ChatCompletionMessageParam.g.cs index 6642391..7939a4d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.ChatCompletionMessageParam.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.ChatCompletionMessageParam.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsSystem => System != null; + /// + /// + /// + public bool TryPickSystem( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ChatCompletionMessageParamSystem? value) + { + value = System; + return IsSystem; + } + /// /// /// @@ -43,6 +56,19 @@ namespace Braintrust #endif public bool IsUser => User != null; + /// + /// + /// + public bool TryPickUser( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ChatCompletionMessageParamUser? value) + { + value = User; + return IsUser; + } + /// /// /// @@ -60,6 +86,19 @@ namespace Braintrust #endif public bool IsAssistant => Assistant != null; + /// + /// + /// + public bool TryPickAssistant( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ChatCompletionMessageParamAssistant? value) + { + value = Assistant; + return IsAssistant; + } + /// /// /// @@ -77,6 +116,19 @@ namespace Braintrust #endif public bool IsTool => Tool != null; + /// + /// + /// + public bool TryPickTool( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ChatCompletionMessageParamTool? value) + { + value = Tool; + return IsTool; + } + /// /// /// @@ -94,6 +146,19 @@ namespace Braintrust #endif public bool IsFunction => Function != null; + /// + /// + /// + public bool TryPickFunction( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ChatCompletionMessageParamFunction? value) + { + value = Function; + return IsFunction; + } + /// /// /// @@ -111,6 +176,19 @@ namespace Braintrust #endif public bool IsDeveloper => Developer != null; + /// + /// + /// + public bool TryPickDeveloper( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ChatCompletionMessageParamDeveloper? value) + { + value = Developer; + return IsDeveloper; + } + /// /// /// @@ -127,6 +205,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Fallback))] #endif public bool IsFallback => Fallback != null; + + /// + /// + /// + public bool TryPickFallback( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ChatCompletionMessageParamFallback? value) + { + value = Fallback; + return IsFallback; + } /// /// /// @@ -313,13 +404,13 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? system = null, - global::System.Func? user = null, - global::System.Func? assistant = null, - global::System.Func? tool = null, - global::System.Func? function = null, - global::System.Func? developer = null, - global::System.Func? fallback = null, + global::System.Func? system = null, + global::System.Func? user = null, + global::System.Func? assistant = null, + global::System.Func? tool = null, + global::System.Func? function = null, + global::System.Func? developer = null, + global::System.Func? fallback = null, bool validate = true) { if (validate) @@ -363,13 +454,67 @@ public bool Validate() /// /// public void Match( - global::System.Action? system = null, - global::System.Action? user = null, - global::System.Action? assistant = null, - global::System.Action? tool = null, - global::System.Action? function = null, - global::System.Action? developer = null, - global::System.Action? fallback = null, + global::System.Action? system = null, + + global::System.Action? user = null, + + global::System.Action? assistant = null, + + global::System.Action? tool = null, + + global::System.Action? function = null, + + global::System.Action? developer = null, + + global::System.Action? fallback = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSystem) + { + system?.Invoke(System!); + } + else if (IsUser) + { + user?.Invoke(User!); + } + else if (IsAssistant) + { + assistant?.Invoke(Assistant!); + } + else if (IsTool) + { + tool?.Invoke(Tool!); + } + else if (IsFunction) + { + function?.Invoke(Function!); + } + else if (IsDeveloper) + { + developer?.Invoke(Developer!); + } + else if (IsFallback) + { + fallback?.Invoke(Fallback!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? system = null, + global::System.Action? user = null, + global::System.Action? assistant = null, + global::System.Action? tool = null, + global::System.Action? function = null, + global::System.Action? developer = null, + global::System.Action? fallback = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.FunctionData.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.FunctionData.g.cs index c85010c..e7ce7aa 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.FunctionData.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.FunctionData.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsPrompt => Prompt != null; + /// + /// + /// + public bool TryPickPrompt( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FunctionDataPrompt? value) + { + value = Prompt; + return IsPrompt; + } + /// /// /// @@ -43,6 +56,19 @@ namespace Braintrust #endif public bool IsCode => Code != null; + /// + /// + /// + public bool TryPickCode( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FunctionDataCode? value) + { + value = Code; + return IsCode; + } + /// /// This feature is preliminary and unsupported. /// @@ -60,6 +86,19 @@ namespace Braintrust #endif public bool IsGraph => Graph != null; + /// + /// + /// + public bool TryPickGraph( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.GraphData? value) + { + value = Graph; + return IsGraph; + } + /// /// A remote eval to run /// @@ -77,6 +116,19 @@ namespace Braintrust #endif public bool IsRemoteEval => RemoteEval != null; + /// + /// + /// + public bool TryPickRemoteEval( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FunctionDataRemoteEval? value) + { + value = RemoteEval; + return IsRemoteEval; + } + /// /// /// @@ -94,6 +146,19 @@ namespace Braintrust #endif public bool IsGlobal => Global != null; + /// + /// + /// + public bool TryPickGlobal( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FunctionDataGlobal? value) + { + value = Global; + return IsGlobal; + } + /// /// /// @@ -111,6 +176,19 @@ namespace Braintrust #endif public bool IsFacet => Facet != null; + /// + /// + /// + public bool TryPickFacet( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FacetData? value) + { + value = Facet; + return IsFacet; + } + /// /// /// @@ -128,6 +206,19 @@ namespace Braintrust #endif public bool IsBatchedFacet => BatchedFacet != null; + /// + /// + /// + public bool TryPickBatchedFacet( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.BatchedFacetData? value) + { + value = BatchedFacet; + return IsBatchedFacet; + } + /// /// /// @@ -145,6 +236,19 @@ namespace Braintrust #endif public bool IsParameters => Parameters != null; + /// + /// + /// + public bool TryPickParameters( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FunctionDataParameters? value) + { + value = Parameters; + return IsParameters; + } + /// /// /// @@ -161,6 +265,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(FunctionDataVariant9))] #endif public bool IsFunctionDataVariant9 => FunctionDataVariant9 != null; + + /// + /// + /// + public bool TryPickFunctionDataVariant9( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.AllOf? value) + { + value = FunctionDataVariant9; + return IsFunctionDataVariant9; + } /// /// /// @@ -391,14 +508,14 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? prompt = null, - global::System.Func? code = null, - global::System.Func? graph = null, - global::System.Func? remoteEval = null, - global::System.Func? global = null, - global::System.Func? facet = null, - global::System.Func? batchedFacet = null, - global::System.Func? parameters = null, + global::System.Func? prompt = null, + global::System.Func? code = null, + global::System.Func? graph = null, + global::System.Func? remoteEval = null, + global::System.Func? global = null, + global::System.Func? facet = null, + global::System.Func? batchedFacet = null, + global::System.Func? parameters = null, global::System.Func?, TResult>? functionDataVariant9 = null, bool validate = true) { @@ -451,14 +568,80 @@ public bool Validate() /// /// public void Match( - global::System.Action? prompt = null, - global::System.Action? code = null, - global::System.Action? graph = null, - global::System.Action? remoteEval = null, - global::System.Action? global = null, - global::System.Action? facet = null, - global::System.Action? batchedFacet = null, - global::System.Action? parameters = null, + global::System.Action? prompt = null, + + global::System.Action? code = null, + + global::System.Action? graph = null, + + global::System.Action? remoteEval = null, + + global::System.Action? global = null, + + global::System.Action? facet = null, + + global::System.Action? batchedFacet = null, + + global::System.Action? parameters = null, + + global::System.Action?>? functionDataVariant9 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsPrompt) + { + prompt?.Invoke(Prompt!); + } + else if (IsCode) + { + code?.Invoke(Code!); + } + else if (IsGraph) + { + graph?.Invoke(Graph!); + } + else if (IsRemoteEval) + { + remoteEval?.Invoke(RemoteEval!); + } + else if (IsGlobal) + { + global?.Invoke(Global!); + } + else if (IsFacet) + { + facet?.Invoke(Facet!); + } + else if (IsBatchedFacet) + { + batchedFacet?.Invoke(BatchedFacet!); + } + else if (IsParameters) + { + parameters?.Invoke(Parameters!); + } + else if (IsFunctionDataVariant9) + { + functionDataVariant9?.Invoke(FunctionDataVariant9!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? prompt = null, + global::System.Action? code = null, + global::System.Action? graph = null, + global::System.Action? remoteEval = null, + global::System.Action? global = null, + global::System.Action? facet = null, + global::System.Action? batchedFacet = null, + global::System.Action? parameters = null, global::System.Action?>? functionDataVariant9 = null, bool validate = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.FunctionDataNullish.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.FunctionDataNullish.g.cs index 97cd7e9..c95cd79 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.FunctionDataNullish.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.FunctionDataNullish.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsPrompt => Prompt != null; + /// + /// + /// + public bool TryPickPrompt( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FunctionDataNullishPrompt? value) + { + value = Prompt; + return IsPrompt; + } + /// /// /// @@ -43,6 +56,19 @@ namespace Braintrust #endif public bool IsCode => Code != null; + /// + /// + /// + public bool TryPickCode( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FunctionDataNullishCode? value) + { + value = Code; + return IsCode; + } + /// /// This feature is preliminary and unsupported. /// @@ -60,6 +86,19 @@ namespace Braintrust #endif public bool IsGraph => Graph != null; + /// + /// + /// + public bool TryPickGraph( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.GraphData? value) + { + value = Graph; + return IsGraph; + } + /// /// A remote eval to run /// @@ -77,6 +116,19 @@ namespace Braintrust #endif public bool IsRemoteEval => RemoteEval != null; + /// + /// + /// + public bool TryPickRemoteEval( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FunctionDataNullishRemoteEval? value) + { + value = RemoteEval; + return IsRemoteEval; + } + /// /// /// @@ -94,6 +146,19 @@ namespace Braintrust #endif public bool IsGlobal => Global != null; + /// + /// + /// + public bool TryPickGlobal( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FunctionDataNullishGlobal? value) + { + value = Global; + return IsGlobal; + } + /// /// /// @@ -111,6 +176,19 @@ namespace Braintrust #endif public bool IsFacet => Facet != null; + /// + /// + /// + public bool TryPickFacet( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FacetData? value) + { + value = Facet; + return IsFacet; + } + /// /// /// @@ -128,6 +206,19 @@ namespace Braintrust #endif public bool IsBatchedFacet => BatchedFacet != null; + /// + /// + /// + public bool TryPickBatchedFacet( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.BatchedFacetData? value) + { + value = BatchedFacet; + return IsBatchedFacet; + } + /// /// /// @@ -145,6 +236,19 @@ namespace Braintrust #endif public bool IsParameters => Parameters != null; + /// + /// + /// + public bool TryPickParameters( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FunctionDataNullishParameters? value) + { + value = Parameters; + return IsParameters; + } + /// /// /// @@ -162,6 +266,19 @@ namespace Braintrust #endif public bool IsFunctionDataNullishVariant9 => FunctionDataNullishVariant9 != null; + /// + /// + /// + public bool TryPickFunctionDataNullishVariant9( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.AllOf? value) + { + value = FunctionDataNullishVariant9; + return IsFunctionDataNullishVariant9; + } + /// /// /// @@ -178,6 +295,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(FunctionDataNullishVariant10))] #endif public bool IsFunctionDataNullishVariant10 => FunctionDataNullishVariant10 != null; + + /// + /// + /// + public bool TryPickFunctionDataNullishVariant10( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out object? value) + { + value = FunctionDataNullishVariant10; + return IsFunctionDataNullishVariant10; + } /// /// /// @@ -412,16 +542,16 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? prompt = null, - global::System.Func? code = null, - global::System.Func? graph = null, - global::System.Func? remoteEval = null, - global::System.Func? global = null, - global::System.Func? facet = null, - global::System.Func? batchedFacet = null, - global::System.Func? parameters = null, + global::System.Func? prompt = null, + global::System.Func? code = null, + global::System.Func? graph = null, + global::System.Func? remoteEval = null, + global::System.Func? global = null, + global::System.Func? facet = null, + global::System.Func? batchedFacet = null, + global::System.Func? parameters = null, global::System.Func?, TResult>? functionDataNullishVariant9 = null, - global::System.Func? functionDataNullishVariant10 = null, + global::System.Func? functionDataNullishVariant10 = null, bool validate = true) { if (validate) @@ -477,16 +607,88 @@ public bool Validate() /// /// public void Match( - global::System.Action? prompt = null, - global::System.Action? code = null, - global::System.Action? graph = null, - global::System.Action? remoteEval = null, - global::System.Action? global = null, - global::System.Action? facet = null, - global::System.Action? batchedFacet = null, - global::System.Action? parameters = null, + global::System.Action? prompt = null, + + global::System.Action? code = null, + + global::System.Action? graph = null, + + global::System.Action? remoteEval = null, + + global::System.Action? global = null, + + global::System.Action? facet = null, + + global::System.Action? batchedFacet = null, + + global::System.Action? parameters = null, + + global::System.Action?>? functionDataNullishVariant9 = null, + + global::System.Action? functionDataNullishVariant10 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsPrompt) + { + prompt?.Invoke(Prompt!); + } + else if (IsCode) + { + code?.Invoke(Code!); + } + else if (IsGraph) + { + graph?.Invoke(Graph!); + } + else if (IsRemoteEval) + { + remoteEval?.Invoke(RemoteEval!); + } + else if (IsGlobal) + { + global?.Invoke(Global!); + } + else if (IsFacet) + { + facet?.Invoke(Facet!); + } + else if (IsBatchedFacet) + { + batchedFacet?.Invoke(BatchedFacet!); + } + else if (IsParameters) + { + parameters?.Invoke(Parameters!); + } + else if (IsFunctionDataNullishVariant9) + { + functionDataNullishVariant9?.Invoke(FunctionDataNullishVariant9!); + } + else if (IsFunctionDataNullishVariant10) + { + functionDataNullishVariant10?.Invoke(FunctionDataNullishVariant10!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? prompt = null, + global::System.Action? code = null, + global::System.Action? graph = null, + global::System.Action? remoteEval = null, + global::System.Action? global = null, + global::System.Action? facet = null, + global::System.Action? batchedFacet = null, + global::System.Action? parameters = null, global::System.Action?>? functionDataNullishVariant9 = null, - global::System.Action? functionDataNullishVariant10 = null, + global::System.Action? functionDataNullishVariant10 = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.FunctionId.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.FunctionId.g.cs index c1b000b..1a5889b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.FunctionId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.FunctionId.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsId1 => Id1 != null; + /// + /// + /// + public bool TryPickId1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FunctionIdFunctionId1? value) + { + value = Id1; + return IsId1; + } + /// /// Project name and slug /// @@ -43,6 +56,19 @@ namespace Braintrust #endif public bool IsProjectSlug => ProjectSlug != null; + /// + /// + /// + public bool TryPickProjectSlug( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FunctionIdProjectSlug? value) + { + value = ProjectSlug; + return IsProjectSlug; + } + /// /// Global function name /// @@ -60,6 +86,19 @@ namespace Braintrust #endif public bool IsGlobalFunction => GlobalFunction != null; + /// + /// + /// + public bool TryPickGlobalFunction( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FunctionIdGlobalFunction? value) + { + value = GlobalFunction; + return IsGlobalFunction; + } + /// /// Prompt session id /// @@ -77,6 +116,19 @@ namespace Braintrust #endif public bool IsPromptSessionId => PromptSessionId != null; + /// + /// + /// + public bool TryPickPromptSessionId( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FunctionIdPromptSessionId? value) + { + value = PromptSessionId; + return IsPromptSessionId; + } + /// /// Inline code function /// @@ -94,6 +146,19 @@ namespace Braintrust #endif public bool IsInlineCode => InlineCode != null; + /// + /// + /// + public bool TryPickInlineCode( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FunctionIdInlineCode? value) + { + value = InlineCode; + return IsInlineCode; + } + /// /// Inline function definition /// @@ -111,6 +176,19 @@ namespace Braintrust #endif public bool IsInlineFunction => InlineFunction != null; + /// + /// + /// + public bool TryPickInlineFunction( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FunctionIdInlineFunction? value) + { + value = InlineFunction; + return IsInlineFunction; + } + /// /// Inline prompt definition /// @@ -127,6 +205,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(InlinePrompt))] #endif public bool IsInlinePrompt => InlinePrompt != null; + + /// + /// + /// + public bool TryPickInlinePrompt( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.FunctionIdInlinePrompt? value) + { + value = InlinePrompt; + return IsInlinePrompt; + } /// /// /// @@ -313,13 +404,13 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? id1 = null, - global::System.Func? projectSlug = null, - global::System.Func? globalFunction = null, - global::System.Func? promptSessionId = null, - global::System.Func? inlineCode = null, - global::System.Func? inlineFunction = null, - global::System.Func? inlinePrompt = null, + global::System.Func? id1 = null, + global::System.Func? projectSlug = null, + global::System.Func? globalFunction = null, + global::System.Func? promptSessionId = null, + global::System.Func? inlineCode = null, + global::System.Func? inlineFunction = null, + global::System.Func? inlinePrompt = null, bool validate = true) { if (validate) @@ -363,13 +454,67 @@ public bool Validate() /// /// public void Match( - global::System.Action? id1 = null, - global::System.Action? projectSlug = null, - global::System.Action? globalFunction = null, - global::System.Action? promptSessionId = null, - global::System.Action? inlineCode = null, - global::System.Action? inlineFunction = null, - global::System.Action? inlinePrompt = null, + global::System.Action? id1 = null, + + global::System.Action? projectSlug = null, + + global::System.Action? globalFunction = null, + + global::System.Action? promptSessionId = null, + + global::System.Action? inlineCode = null, + + global::System.Action? inlineFunction = null, + + global::System.Action? inlinePrompt = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsId1) + { + id1?.Invoke(Id1!); + } + else if (IsProjectSlug) + { + projectSlug?.Invoke(ProjectSlug!); + } + else if (IsGlobalFunction) + { + globalFunction?.Invoke(GlobalFunction!); + } + else if (IsPromptSessionId) + { + promptSessionId?.Invoke(PromptSessionId!); + } + else if (IsInlineCode) + { + inlineCode?.Invoke(InlineCode!); + } + else if (IsInlineFunction) + { + inlineFunction?.Invoke(InlineFunction!); + } + else if (IsInlinePrompt) + { + inlinePrompt?.Invoke(InlinePrompt!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? id1 = null, + global::System.Action? projectSlug = null, + global::System.Action? globalFunction = null, + global::System.Action? promptSessionId = null, + global::System.Action? inlineCode = null, + global::System.Action? inlineFunction = null, + global::System.Action? inlinePrompt = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.GraphNode.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.GraphNode.g.cs index 15cba0b..a6b1586 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.GraphNode.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.GraphNode.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsGraphNodeVariant1 => GraphNodeVariant1 != null; + /// + /// + /// + public bool TryPickGraphNodeVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.GraphNodeVariant1? value) + { + value = GraphNodeVariant1; + return IsGraphNodeVariant1; + } + /// /// /// @@ -43,6 +56,19 @@ namespace Braintrust #endif public bool IsGraphNodeVariant2 => GraphNodeVariant2 != null; + /// + /// + /// + public bool TryPickGraphNodeVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.GraphNodeVariant2? value) + { + value = GraphNodeVariant2; + return IsGraphNodeVariant2; + } + /// /// /// @@ -60,6 +86,19 @@ namespace Braintrust #endif public bool IsGraphNodeVariant3 => GraphNodeVariant3 != null; + /// + /// + /// + public bool TryPickGraphNodeVariant3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.GraphNodeVariant3? value) + { + value = GraphNodeVariant3; + return IsGraphNodeVariant3; + } + /// /// /// @@ -77,6 +116,19 @@ namespace Braintrust #endif public bool IsGraphNodeVariant4 => GraphNodeVariant4 != null; + /// + /// + /// + public bool TryPickGraphNodeVariant4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.GraphNodeVariant4? value) + { + value = GraphNodeVariant4; + return IsGraphNodeVariant4; + } + /// /// /// @@ -94,6 +146,19 @@ namespace Braintrust #endif public bool IsGraphNodeVariant5 => GraphNodeVariant5 != null; + /// + /// + /// + public bool TryPickGraphNodeVariant5( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.GraphNodeVariant5? value) + { + value = GraphNodeVariant5; + return IsGraphNodeVariant5; + } + /// /// /// @@ -111,6 +176,19 @@ namespace Braintrust #endif public bool IsGraphNodeVariant6 => GraphNodeVariant6 != null; + /// + /// + /// + public bool TryPickGraphNodeVariant6( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.GraphNodeVariant6? value) + { + value = GraphNodeVariant6; + return IsGraphNodeVariant6; + } + /// /// /// @@ -128,6 +206,19 @@ namespace Braintrust #endif public bool IsGraphNodeVariant7 => GraphNodeVariant7 != null; + /// + /// + /// + public bool TryPickGraphNodeVariant7( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.GraphNodeVariant7? value) + { + value = GraphNodeVariant7; + return IsGraphNodeVariant7; + } + /// /// /// @@ -144,6 +235,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(GraphNodeVariant8))] #endif public bool IsGraphNodeVariant8 => GraphNodeVariant8 != null; + + /// + /// + /// + public bool TryPickGraphNodeVariant8( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.GraphNodeVariant8? value) + { + value = GraphNodeVariant8; + return IsGraphNodeVariant8; + } /// /// /// @@ -352,14 +456,14 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? graphNodeVariant1 = null, - global::System.Func? graphNodeVariant2 = null, - global::System.Func? graphNodeVariant3 = null, - global::System.Func? graphNodeVariant4 = null, - global::System.Func? graphNodeVariant5 = null, - global::System.Func? graphNodeVariant6 = null, - global::System.Func? graphNodeVariant7 = null, - global::System.Func? graphNodeVariant8 = null, + global::System.Func? graphNodeVariant1 = null, + global::System.Func? graphNodeVariant2 = null, + global::System.Func? graphNodeVariant3 = null, + global::System.Func? graphNodeVariant4 = null, + global::System.Func? graphNodeVariant5 = null, + global::System.Func? graphNodeVariant6 = null, + global::System.Func? graphNodeVariant7 = null, + global::System.Func? graphNodeVariant8 = null, bool validate = true) { if (validate) @@ -407,14 +511,74 @@ public bool Validate() /// /// public void Match( - global::System.Action? graphNodeVariant1 = null, - global::System.Action? graphNodeVariant2 = null, - global::System.Action? graphNodeVariant3 = null, - global::System.Action? graphNodeVariant4 = null, - global::System.Action? graphNodeVariant5 = null, - global::System.Action? graphNodeVariant6 = null, - global::System.Action? graphNodeVariant7 = null, - global::System.Action? graphNodeVariant8 = null, + global::System.Action? graphNodeVariant1 = null, + + global::System.Action? graphNodeVariant2 = null, + + global::System.Action? graphNodeVariant3 = null, + + global::System.Action? graphNodeVariant4 = null, + + global::System.Action? graphNodeVariant5 = null, + + global::System.Action? graphNodeVariant6 = null, + + global::System.Action? graphNodeVariant7 = null, + + global::System.Action? graphNodeVariant8 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsGraphNodeVariant1) + { + graphNodeVariant1?.Invoke(GraphNodeVariant1!); + } + else if (IsGraphNodeVariant2) + { + graphNodeVariant2?.Invoke(GraphNodeVariant2!); + } + else if (IsGraphNodeVariant3) + { + graphNodeVariant3?.Invoke(GraphNodeVariant3!); + } + else if (IsGraphNodeVariant4) + { + graphNodeVariant4?.Invoke(GraphNodeVariant4!); + } + else if (IsGraphNodeVariant5) + { + graphNodeVariant5?.Invoke(GraphNodeVariant5!); + } + else if (IsGraphNodeVariant6) + { + graphNodeVariant6?.Invoke(GraphNodeVariant6!); + } + else if (IsGraphNodeVariant7) + { + graphNodeVariant7?.Invoke(GraphNodeVariant7!); + } + else if (IsGraphNodeVariant8) + { + graphNodeVariant8?.Invoke(GraphNodeVariant8!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? graphNodeVariant1 = null, + global::System.Action? graphNodeVariant2 = null, + global::System.Action? graphNodeVariant3 = null, + global::System.Action? graphNodeVariant4 = null, + global::System.Action? graphNodeVariant5 = null, + global::System.Action? graphNodeVariant6 = null, + global::System.Action? graphNodeVariant7 = null, + global::System.Action? graphNodeVariant8 = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.Ids.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.Ids.g.cs index fef7026..d9fd3a6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.Ids.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.Ids.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsGuid => Guid != null; + /// + /// + /// + public bool TryPickGuid( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Guid? value) + { + value = Guid; + return IsGuid; + } + /// /// /// @@ -42,6 +55,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(IdsVariant2))] #endif public bool IsIdsVariant2 => IdsVariant2 != null; + + /// + /// + /// + public bool TryPickIdsVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Collections.Generic.IList? value) + { + value = IdsVariant2; + return IsIdsVariant2; + } /// /// /// @@ -101,7 +127,7 @@ public bool Validate() /// public TResult? Match( global::System.Func? guid = null, - global::System.Func?, TResult>? idsVariant2 = null, + global::System.Func, TResult>? idsVariant2 = null, bool validate = true) { if (validate) @@ -126,7 +152,31 @@ public bool Validate() /// public void Match( global::System.Action? guid = null, - global::System.Action?>? idsVariant2 = null, + + global::System.Action>? idsVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsGuid) + { + guid?.Invoke(Guid!); + } + else if (IsIdsVariant2) + { + idsVariant2?.Invoke(IdsVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? guid = null, + global::System.Action>? idsVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.InvokeParent.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.InvokeParent.g.cs index a6e7a4f..73b3610 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.InvokeParent.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.InvokeParent.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsSpanParentStruct => SpanParentStruct != null; + /// + /// + /// + public bool TryPickSpanParentStruct( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.InvokeParentSpanParentStruct? value) + { + value = SpanParentStruct; + return IsSpanParentStruct; + } + /// /// The parent's span identifier, created by calling `.export()` on a span /// @@ -42,6 +55,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(InvokeParentVariant2))] #endif public bool IsInvokeParentVariant2 => InvokeParentVariant2 != null; + + /// + /// + /// + public bool TryPickInvokeParentVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out string? value) + { + value = InvokeParentVariant2; + return IsInvokeParentVariant2; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? spanParentStruct = null, - global::System.Func? invokeParentVariant2 = null, + global::System.Func? spanParentStruct = null, + global::System.Func? invokeParentVariant2 = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? spanParentStruct = null, - global::System.Action? invokeParentVariant2 = null, + global::System.Action? spanParentStruct = null, + + global::System.Action? invokeParentVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSpanParentStruct) + { + spanParentStruct?.Invoke(SpanParentStruct!); + } + else if (IsInvokeParentVariant2) + { + invokeParentVariant2?.Invoke(InvokeParentVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? spanParentStruct = null, + global::System.Action? invokeParentVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.ModelParams.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.ModelParams.g.cs index dc27036..a2fe1fd 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.ModelParams.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.ModelParams.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsOpenAIModelParams => OpenAIModelParams != null; + /// + /// + /// + public bool TryPickOpenAIModelParams( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ModelParamsOpenAIModelParams? value) + { + value = OpenAIModelParams; + return IsOpenAIModelParams; + } + /// /// /// @@ -43,6 +56,19 @@ namespace Braintrust #endif public bool IsAnthropicModelParams => AnthropicModelParams != null; + /// + /// + /// + public bool TryPickAnthropicModelParams( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ModelParamsAnthropicModelParams? value) + { + value = AnthropicModelParams; + return IsAnthropicModelParams; + } + /// /// /// @@ -60,6 +86,19 @@ namespace Braintrust #endif public bool IsGoogleModelParams => GoogleModelParams != null; + /// + /// + /// + public bool TryPickGoogleModelParams( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ModelParamsGoogleModelParams? value) + { + value = GoogleModelParams; + return IsGoogleModelParams; + } + /// /// /// @@ -77,6 +116,19 @@ namespace Braintrust #endif public bool IsWindowAIModelParams => WindowAIModelParams != null; + /// + /// + /// + public bool TryPickWindowAIModelParams( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ModelParamsWindowAIModelParams? value) + { + value = WindowAIModelParams; + return IsWindowAIModelParams; + } + /// /// /// @@ -93,6 +145,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(JsCompletionParams))] #endif public bool IsJsCompletionParams => JsCompletionParams != null; + + /// + /// + /// + public bool TryPickJsCompletionParams( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ModelParamsJsCompletionParams? value) + { + value = JsCompletionParams; + return IsJsCompletionParams; + } /// /// /// @@ -235,11 +300,11 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? openAIModelParams = null, - global::System.Func? anthropicModelParams = null, - global::System.Func? googleModelParams = null, - global::System.Func? windowAIModelParams = null, - global::System.Func? jsCompletionParams = null, + global::System.Func? openAIModelParams = null, + global::System.Func? anthropicModelParams = null, + global::System.Func? googleModelParams = null, + global::System.Func? windowAIModelParams = null, + global::System.Func? jsCompletionParams = null, bool validate = true) { if (validate) @@ -275,11 +340,53 @@ public bool Validate() /// /// public void Match( - global::System.Action? openAIModelParams = null, - global::System.Action? anthropicModelParams = null, - global::System.Action? googleModelParams = null, - global::System.Action? windowAIModelParams = null, - global::System.Action? jsCompletionParams = null, + global::System.Action? openAIModelParams = null, + + global::System.Action? anthropicModelParams = null, + + global::System.Action? googleModelParams = null, + + global::System.Action? windowAIModelParams = null, + + global::System.Action? jsCompletionParams = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOpenAIModelParams) + { + openAIModelParams?.Invoke(OpenAIModelParams!); + } + else if (IsAnthropicModelParams) + { + anthropicModelParams?.Invoke(AnthropicModelParams!); + } + else if (IsGoogleModelParams) + { + googleModelParams?.Invoke(GoogleModelParams!); + } + else if (IsWindowAIModelParams) + { + windowAIModelParams?.Invoke(WindowAIModelParams!); + } + else if (IsJsCompletionParams) + { + jsCompletionParams?.Invoke(JsCompletionParams!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? openAIModelParams = null, + global::System.Action? anthropicModelParams = null, + global::System.Action? googleModelParams = null, + global::System.Action? windowAIModelParams = null, + global::System.Action? jsCompletionParams = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.NullableSavedFunctionId.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.NullableSavedFunctionId.g.cs index 963ce0d..e53f13d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.NullableSavedFunctionId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.NullableSavedFunctionId.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsFunction => Function != null; + /// + /// + /// + public bool TryPickFunction( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.NullableSavedFunctionIdFunction? value) + { + value = Function; + return IsFunction; + } + /// /// /// @@ -43,6 +56,19 @@ namespace Braintrust #endif public bool IsGlobal => Global != null; + /// + /// + /// + public bool TryPickGlobal( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.NullableSavedFunctionIdGlobal? value) + { + value = Global; + return IsGlobal; + } + /// /// /// @@ -59,6 +85,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(NullableSavedFunctionIdVariant3))] #endif public bool IsNullableSavedFunctionIdVariant3 => NullableSavedFunctionIdVariant3 != null; + + /// + /// + /// + public bool TryPickNullableSavedFunctionIdVariant3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out object? value) + { + value = NullableSavedFunctionIdVariant3; + return IsNullableSavedFunctionIdVariant3; + } /// /// /// @@ -139,9 +178,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? function = null, - global::System.Func? global = null, - global::System.Func? nullableSavedFunctionIdVariant3 = null, + global::System.Func? function = null, + global::System.Func? global = null, + global::System.Func? nullableSavedFunctionIdVariant3 = null, bool validate = true) { if (validate) @@ -169,9 +208,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? function = null, - global::System.Action? global = null, - global::System.Action? nullableSavedFunctionIdVariant3 = null, + global::System.Action? function = null, + + global::System.Action? global = null, + + global::System.Action? nullableSavedFunctionIdVariant3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsFunction) + { + function?.Invoke(Function!); + } + else if (IsGlobal) + { + global?.Invoke(Global!); + } + else if (IsNullableSavedFunctionIdVariant3) + { + nullableSavedFunctionIdVariant3?.Invoke(NullableSavedFunctionIdVariant3!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? function = null, + global::System.Action? global = null, + global::System.Action? nullableSavedFunctionIdVariant3 = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.ProjectScoreCategories.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.ProjectScoreCategories.g.cs index 8658625..a4ac75b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.ProjectScoreCategories.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.ProjectScoreCategories.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsCategorical => Categorical != null; + /// + /// + /// + public bool TryPickCategorical( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Collections.Generic.IList? value) + { + value = Categorical; + return IsCategorical; + } + /// /// For weighted-type project scores, the weights of each score /// @@ -43,6 +56,19 @@ namespace Braintrust #endif public bool IsWeighted => Weighted != null; + /// + /// + /// + public bool TryPickWeighted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Collections.Generic.Dictionary? value) + { + value = Weighted; + return IsWeighted; + } + /// /// For minimum-type project scores, the list of included scores /// @@ -60,6 +86,19 @@ namespace Braintrust #endif public bool IsMinimum => Minimum != null; + /// + /// + /// + public bool TryPickMinimum( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Collections.Generic.IList? value) + { + value = Minimum; + return IsMinimum; + } + /// /// /// @@ -76,6 +115,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ProjectScoreCategoriesVariant4))] #endif public bool IsProjectScoreCategoriesVariant4 => ProjectScoreCategoriesVariant4 != null; + + /// + /// + /// + public bool TryPickProjectScoreCategoriesVariant4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out object? value) + { + value = ProjectScoreCategoriesVariant4; + return IsProjectScoreCategoriesVariant4; + } /// /// /// @@ -142,10 +194,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func?, TResult>? categorical = null, - global::System.Func?, TResult>? weighted = null, - global::System.Func?, TResult>? minimum = null, - global::System.Func? projectScoreCategoriesVariant4 = null, + global::System.Func, TResult>? categorical = null, + global::System.Func, TResult>? weighted = null, + global::System.Func, TResult>? minimum = null, + global::System.Func? projectScoreCategoriesVariant4 = null, bool validate = true) { if (validate) @@ -177,10 +229,46 @@ public bool Validate() /// /// public void Match( - global::System.Action?>? categorical = null, - global::System.Action?>? weighted = null, - global::System.Action?>? minimum = null, - global::System.Action? projectScoreCategoriesVariant4 = null, + global::System.Action>? categorical = null, + + global::System.Action>? weighted = null, + + global::System.Action>? minimum = null, + + global::System.Action? projectScoreCategoriesVariant4 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsCategorical) + { + categorical?.Invoke(Categorical!); + } + else if (IsWeighted) + { + weighted?.Invoke(Weighted!); + } + else if (IsMinimum) + { + minimum?.Invoke(Minimum!); + } + else if (IsProjectScoreCategoriesVariant4) + { + projectScoreCategoriesVariant4?.Invoke(ProjectScoreCategoriesVariant4!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action>? categorical = null, + global::System.Action>? weighted = null, + global::System.Action>? minimum = null, + global::System.Action? projectScoreCategoriesVariant4 = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.PromptBlockData.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.PromptBlockData.g.cs index 84fd059..6aec776 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.PromptBlockData.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.PromptBlockData.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsChat => Chat != null; + /// + /// + /// + public bool TryPickChat( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.PromptBlockDataChat? value) + { + value = Chat; + return IsChat; + } + /// /// /// @@ -42,6 +55,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Completion))] #endif public bool IsCompletion => Completion != null; + + /// + /// + /// + public bool TryPickCompletion( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.PromptBlockDataCompletion? value) + { + value = Completion; + return IsCompletion; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? chat = null, - global::System.Func? completion = null, + global::System.Func? chat = null, + global::System.Func? completion = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? chat = null, - global::System.Action? completion = null, + global::System.Action? chat = null, + + global::System.Action? completion = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsChat) + { + chat?.Invoke(Chat!); + } + else if (IsCompletion) + { + completion?.Invoke(Completion!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? chat = null, + global::System.Action? completion = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.PromptBlockDataNullish.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.PromptBlockDataNullish.g.cs index 9019136..25990e9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.PromptBlockDataNullish.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.PromptBlockDataNullish.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsChat => Chat != null; + /// + /// + /// + public bool TryPickChat( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.PromptBlockDataNullishChat? value) + { + value = Chat; + return IsChat; + } + /// /// /// @@ -43,6 +56,19 @@ namespace Braintrust #endif public bool IsCompletion => Completion != null; + /// + /// + /// + public bool TryPickCompletion( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.PromptBlockDataNullishCompletion? value) + { + value = Completion; + return IsCompletion; + } + /// /// /// @@ -59,6 +85,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(PromptBlockDataNullishVariant3))] #endif public bool IsPromptBlockDataNullishVariant3 => PromptBlockDataNullishVariant3 != null; + + /// + /// + /// + public bool TryPickPromptBlockDataNullishVariant3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out object? value) + { + value = PromptBlockDataNullishVariant3; + return IsPromptBlockDataNullishVariant3; + } /// /// /// @@ -139,9 +178,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? chat = null, - global::System.Func? completion = null, - global::System.Func? promptBlockDataNullishVariant3 = null, + global::System.Func? chat = null, + global::System.Func? completion = null, + global::System.Func? promptBlockDataNullishVariant3 = null, bool validate = true) { if (validate) @@ -169,9 +208,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? chat = null, - global::System.Action? completion = null, - global::System.Action? promptBlockDataNullishVariant3 = null, + global::System.Action? chat = null, + + global::System.Action? completion = null, + + global::System.Action? promptBlockDataNullishVariant3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsChat) + { + chat?.Invoke(Chat!); + } + else if (IsCompletion) + { + completion?.Invoke(Completion!); + } + else if (IsPromptBlockDataNullishVariant3) + { + promptBlockDataNullishVariant3?.Invoke(PromptBlockDataNullishVariant3!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? chat = null, + global::System.Action? completion = null, + global::System.Action? promptBlockDataNullishVariant3 = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.ResponseFormatNullish.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.ResponseFormatNullish.g.cs index 6e2ff83..9532e09 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.ResponseFormatNullish.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.ResponseFormatNullish.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsJsonObject => JsonObject != null; + /// + /// + /// + public bool TryPickJsonObject( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ResponseFormatNullishJsonObject? value) + { + value = JsonObject; + return IsJsonObject; + } + /// /// /// @@ -43,6 +56,19 @@ namespace Braintrust #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ResponseFormatNullishJsonSchema? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// /// @@ -60,6 +86,19 @@ namespace Braintrust #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ResponseFormatNullishText? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -76,6 +115,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ResponseFormatNullishVariant4))] #endif public bool IsResponseFormatNullishVariant4 => ResponseFormatNullishVariant4 != null; + + /// + /// + /// + public bool TryPickResponseFormatNullishVariant4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out object? value) + { + value = ResponseFormatNullishVariant4; + return IsResponseFormatNullishVariant4; + } /// /// /// @@ -178,10 +230,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? jsonObject = null, - global::System.Func? jsonSchema = null, - global::System.Func? text = null, - global::System.Func? responseFormatNullishVariant4 = null, + global::System.Func? jsonObject = null, + global::System.Func? jsonSchema = null, + global::System.Func? text = null, + global::System.Func? responseFormatNullishVariant4 = null, bool validate = true) { if (validate) @@ -213,10 +265,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? jsonObject = null, - global::System.Action? jsonSchema = null, - global::System.Action? text = null, - global::System.Action? responseFormatNullishVariant4 = null, + global::System.Action? jsonObject = null, + + global::System.Action? jsonSchema = null, + + global::System.Action? text = null, + + global::System.Action? responseFormatNullishVariant4 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsJsonObject) + { + jsonObject?.Invoke(JsonObject!); + } + else if (IsJsonSchema) + { + jsonSchema?.Invoke(JsonSchema!); + } + else if (IsText) + { + text?.Invoke(Text!); + } + else if (IsResponseFormatNullishVariant4) + { + responseFormatNullishVariant4?.Invoke(ResponseFormatNullishVariant4!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? jsonObject = null, + global::System.Action? jsonSchema = null, + global::System.Action? text = null, + global::System.Action? responseFormatNullishVariant4 = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.SavedFunctionId.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.SavedFunctionId.g.cs index 3a4e2a5..dba62cc 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.SavedFunctionId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.SavedFunctionId.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsFunction => Function != null; + /// + /// + /// + public bool TryPickFunction( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.SavedFunctionIdFunction? value) + { + value = Function; + return IsFunction; + } + /// /// /// @@ -43,6 +56,19 @@ namespace Braintrust #endif public bool IsGlobal => Global != null; + /// + /// + /// + public bool TryPickGlobal( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.SavedFunctionIdGlobal? value) + { + value = Global; + return IsGlobal; + } + /// /// /// @@ -59,6 +85,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SavedFunctionIdVariant3))] #endif public bool IsSavedFunctionIdVariant3 => SavedFunctionIdVariant3 != null; + + /// + /// + /// + public bool TryPickSavedFunctionIdVariant3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out object? value) + { + value = SavedFunctionIdVariant3; + return IsSavedFunctionIdVariant3; + } /// /// /// @@ -139,9 +178,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? function = null, - global::System.Func? global = null, - global::System.Func? savedFunctionIdVariant3 = null, + global::System.Func? function = null, + global::System.Func? global = null, + global::System.Func? savedFunctionIdVariant3 = null, bool validate = true) { if (validate) @@ -169,9 +208,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? function = null, - global::System.Action? global = null, - global::System.Action? savedFunctionIdVariant3 = null, + global::System.Action? function = null, + + global::System.Action? global = null, + + global::System.Action? savedFunctionIdVariant3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsFunction) + { + function?.Invoke(Function!); + } + else if (IsGlobal) + { + global?.Invoke(Global!); + } + else if (IsSavedFunctionIdVariant3) + { + savedFunctionIdVariant3?.Invoke(SavedFunctionIdVariant3!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? function = null, + global::System.Action? global = null, + global::System.Action? savedFunctionIdVariant3 = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.TopicAutomationDataScope.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.TopicAutomationDataScope.g.cs index ee2f4b3..bab5d55 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.TopicAutomationDataScope.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.TopicAutomationDataScope.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsTopicAutomationDataScopeVariant1 => TopicAutomationDataScopeVariant1 != null; + /// + /// + /// + public bool TryPickTopicAutomationDataScopeVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.TopicAutomationDataScopeVariant1? value) + { + value = TopicAutomationDataScopeVariant1; + return IsTopicAutomationDataScopeVariant1; + } + /// /// /// @@ -43,6 +56,19 @@ namespace Braintrust #endif public bool IsTopicAutomationDataScopeVariant2 => TopicAutomationDataScopeVariant2 != null; + /// + /// + /// + public bool TryPickTopicAutomationDataScopeVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.TopicAutomationDataScopeVariant2? value) + { + value = TopicAutomationDataScopeVariant2; + return IsTopicAutomationDataScopeVariant2; + } + /// /// /// @@ -60,6 +86,19 @@ namespace Braintrust #endif public bool IsTopicAutomationDataScopeVariant3 => TopicAutomationDataScopeVariant3 != null; + /// + /// + /// + public bool TryPickTopicAutomationDataScopeVariant3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.TopicAutomationDataScopeVariant3? value) + { + value = TopicAutomationDataScopeVariant3; + return IsTopicAutomationDataScopeVariant3; + } + /// /// /// @@ -76,6 +115,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(TopicAutomationDataScopeVariant4))] #endif public bool IsTopicAutomationDataScopeVariant4 => TopicAutomationDataScopeVariant4 != null; + + /// + /// + /// + public bool TryPickTopicAutomationDataScopeVariant4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out object? value) + { + value = TopicAutomationDataScopeVariant4; + return IsTopicAutomationDataScopeVariant4; + } /// /// /// @@ -178,10 +230,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? topicAutomationDataScopeVariant1 = null, - global::System.Func? topicAutomationDataScopeVariant2 = null, - global::System.Func? topicAutomationDataScopeVariant3 = null, - global::System.Func? topicAutomationDataScopeVariant4 = null, + global::System.Func? topicAutomationDataScopeVariant1 = null, + global::System.Func? topicAutomationDataScopeVariant2 = null, + global::System.Func? topicAutomationDataScopeVariant3 = null, + global::System.Func? topicAutomationDataScopeVariant4 = null, bool validate = true) { if (validate) @@ -213,10 +265,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? topicAutomationDataScopeVariant1 = null, - global::System.Action? topicAutomationDataScopeVariant2 = null, - global::System.Action? topicAutomationDataScopeVariant3 = null, - global::System.Action? topicAutomationDataScopeVariant4 = null, + global::System.Action? topicAutomationDataScopeVariant1 = null, + + global::System.Action? topicAutomationDataScopeVariant2 = null, + + global::System.Action? topicAutomationDataScopeVariant3 = null, + + global::System.Action? topicAutomationDataScopeVariant4 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsTopicAutomationDataScopeVariant1) + { + topicAutomationDataScopeVariant1?.Invoke(TopicAutomationDataScopeVariant1!); + } + else if (IsTopicAutomationDataScopeVariant2) + { + topicAutomationDataScopeVariant2?.Invoke(TopicAutomationDataScopeVariant2!); + } + else if (IsTopicAutomationDataScopeVariant3) + { + topicAutomationDataScopeVariant3?.Invoke(TopicAutomationDataScopeVariant3!); + } + else if (IsTopicAutomationDataScopeVariant4) + { + topicAutomationDataScopeVariant4?.Invoke(TopicAutomationDataScopeVariant4!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? topicAutomationDataScopeVariant1 = null, + global::System.Action? topicAutomationDataScopeVariant2 = null, + global::System.Action? topicAutomationDataScopeVariant3 = null, + global::System.Action? topicAutomationDataScopeVariant4 = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.UserEmail.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.UserEmail.g.cs index af50855..a8d2ddd 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.UserEmail.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.UserEmail.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsUserEmailVariant1 => UserEmailVariant1 != null; + /// + /// + /// + public bool TryPickUserEmailVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out string? value) + { + value = UserEmailVariant1; + return IsUserEmailVariant1; + } + /// /// /// @@ -42,6 +55,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(UserEmailVariant2))] #endif public bool IsUserEmailVariant2 => UserEmailVariant2 != null; + + /// + /// + /// + public bool TryPickUserEmailVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Collections.Generic.IList? value) + { + value = UserEmailVariant2; + return IsUserEmailVariant2; + } /// /// /// @@ -100,8 +126,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? userEmailVariant1 = null, - global::System.Func?, TResult>? userEmailVariant2 = null, + global::System.Func? userEmailVariant1 = null, + global::System.Func, TResult>? userEmailVariant2 = null, bool validate = true) { if (validate) @@ -125,8 +151,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? userEmailVariant1 = null, - global::System.Action?>? userEmailVariant2 = null, + global::System.Action? userEmailVariant1 = null, + + global::System.Action>? userEmailVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsUserEmailVariant1) + { + userEmailVariant1?.Invoke(UserEmailVariant1!); + } + else if (IsUserEmailVariant2) + { + userEmailVariant2?.Invoke(UserEmailVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? userEmailVariant1 = null, + global::System.Action>? userEmailVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.UserFamilyName.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.UserFamilyName.g.cs index 1804d19..23b3583 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.UserFamilyName.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.UserFamilyName.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsUserFamilyNameVariant1 => UserFamilyNameVariant1 != null; + /// + /// + /// + public bool TryPickUserFamilyNameVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out string? value) + { + value = UserFamilyNameVariant1; + return IsUserFamilyNameVariant1; + } + /// /// /// @@ -42,6 +55,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(UserFamilyNameVariant2))] #endif public bool IsUserFamilyNameVariant2 => UserFamilyNameVariant2 != null; + + /// + /// + /// + public bool TryPickUserFamilyNameVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Collections.Generic.IList? value) + { + value = UserFamilyNameVariant2; + return IsUserFamilyNameVariant2; + } /// /// /// @@ -100,8 +126,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? userFamilyNameVariant1 = null, - global::System.Func?, TResult>? userFamilyNameVariant2 = null, + global::System.Func? userFamilyNameVariant1 = null, + global::System.Func, TResult>? userFamilyNameVariant2 = null, bool validate = true) { if (validate) @@ -125,8 +151,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? userFamilyNameVariant1 = null, - global::System.Action?>? userFamilyNameVariant2 = null, + global::System.Action? userFamilyNameVariant1 = null, + + global::System.Action>? userFamilyNameVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsUserFamilyNameVariant1) + { + userFamilyNameVariant1?.Invoke(UserFamilyNameVariant1!); + } + else if (IsUserFamilyNameVariant2) + { + userFamilyNameVariant2?.Invoke(UserFamilyNameVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? userFamilyNameVariant1 = null, + global::System.Action>? userFamilyNameVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.UserGivenName.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.UserGivenName.g.cs index c0fad96..ec26a29 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.UserGivenName.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.UserGivenName.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsUserGivenNameVariant1 => UserGivenNameVariant1 != null; + /// + /// + /// + public bool TryPickUserGivenNameVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out string? value) + { + value = UserGivenNameVariant1; + return IsUserGivenNameVariant1; + } + /// /// /// @@ -42,6 +55,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(UserGivenNameVariant2))] #endif public bool IsUserGivenNameVariant2 => UserGivenNameVariant2 != null; + + /// + /// + /// + public bool TryPickUserGivenNameVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Collections.Generic.IList? value) + { + value = UserGivenNameVariant2; + return IsUserGivenNameVariant2; + } /// /// /// @@ -100,8 +126,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? userGivenNameVariant1 = null, - global::System.Func?, TResult>? userGivenNameVariant2 = null, + global::System.Func? userGivenNameVariant1 = null, + global::System.Func, TResult>? userGivenNameVariant2 = null, bool validate = true) { if (validate) @@ -125,8 +151,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? userGivenNameVariant1 = null, - global::System.Action?>? userGivenNameVariant2 = null, + global::System.Action? userGivenNameVariant1 = null, + + global::System.Action>? userGivenNameVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsUserGivenNameVariant1) + { + userGivenNameVariant1?.Invoke(UserGivenNameVariant1!); + } + else if (IsUserGivenNameVariant2) + { + userGivenNameVariant2?.Invoke(UserGivenNameVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? userGivenNameVariant1 = null, + global::System.Action>? userGivenNameVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.ViewOptions.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.ViewOptions.g.cs index b8e959c..ece6f25 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.ViewOptions.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.ViewOptions.g.cs @@ -26,6 +26,19 @@ namespace Braintrust #endif public bool IsMonitorViewOptions => MonitorViewOptions != null; + /// + /// + /// + public bool TryPickMonitorViewOptions( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ViewOptionsMonitorViewOptions? value) + { + value = MonitorViewOptions; + return IsMonitorViewOptions; + } + /// /// /// @@ -43,6 +56,19 @@ namespace Braintrust #endif public bool IsTableViewOptions => TableViewOptions != null; + /// + /// + /// + public bool TryPickTableViewOptions( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Braintrust.ViewOptionsTableViewOptions? value) + { + value = TableViewOptions; + return IsTableViewOptions; + } + /// /// /// @@ -59,6 +85,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ViewOptionsVariant3))] #endif public bool IsViewOptionsVariant3 => ViewOptionsVariant3 != null; + + /// + /// + /// + public bool TryPickViewOptionsVariant3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out object? value) + { + value = ViewOptionsVariant3; + return IsViewOptionsVariant3; + } /// /// /// @@ -139,9 +178,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? monitorViewOptions = null, - global::System.Func? tableViewOptions = null, - global::System.Func? viewOptionsVariant3 = null, + global::System.Func? monitorViewOptions = null, + global::System.Func? tableViewOptions = null, + global::System.Func? viewOptionsVariant3 = null, bool validate = true) { if (validate) @@ -169,9 +208,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? monitorViewOptions = null, - global::System.Action? tableViewOptions = null, - global::System.Action? viewOptionsVariant3 = null, + global::System.Action? monitorViewOptions = null, + + global::System.Action? tableViewOptions = null, + + global::System.Action? viewOptionsVariant3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMonitorViewOptions) + { + monitorViewOptions?.Invoke(MonitorViewOptions!); + } + else if (IsTableViewOptions) + { + tableViewOptions?.Invoke(TableViewOptions!); + } + else if (IsViewOptionsVariant3) + { + viewOptionsVariant3?.Invoke(ViewOptionsVariant3!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? monitorViewOptions = null, + global::System.Action? tableViewOptions = null, + global::System.Action? viewOptionsVariant3 = null, bool validate = true) { if (validate) diff --git a/src/libs/Braintrust/Generated/Braintrust.OneOf.2.g.cs b/src/libs/Braintrust/Generated/Braintrust.OneOf.2.g.cs index a4a1613..967b849 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OneOf.2.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OneOf.2.g.cs @@ -25,6 +25,19 @@ namespace Braintrust #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 Braintrust [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/Braintrust/Generated/Braintrust.OneOf.3.g.cs b/src/libs/Braintrust/Generated/Braintrust.OneOf.3.g.cs index e7619f7..d9ecc3f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OneOf.3.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OneOf.3.g.cs @@ -25,6 +25,19 @@ namespace Braintrust #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 Braintrust #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 Braintrust [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/Braintrust/Generated/Braintrust.OneOf.5.g.cs b/src/libs/Braintrust/Generated/Braintrust.OneOf.5.g.cs index 7f9dd7f..6ed67d9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OneOf.5.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OneOf.5.g.cs @@ -25,6 +25,19 @@ namespace Braintrust #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 Braintrust #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 Braintrust #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 Braintrust #endif public bool IsValue4 => Value4 != null; + /// + /// + /// + public bool TryPickValue4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T4? value) + { + value = Value4; + return IsValue4; + } + /// /// /// @@ -92,6 +144,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value5))] #endif public bool IsValue5 => Value5 != null; + + /// + /// + /// + public bool TryPickValue5( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T5? value) + { + value = Value5; + return IsValue5; + } /// /// /// @@ -275,6 +340,48 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + + global::System.Action? value4 = null, + + global::System.Action? value5 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + else if (IsValue4) + { + value4?.Invoke(Value4!); + } + else if (IsValue5) + { + value5?.Invoke(Value5!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, global::System.Action? value3 = null, global::System.Action? value4 = null, diff --git a/src/libs/Braintrust/Generated/Braintrust.OneOf.6.g.cs b/src/libs/Braintrust/Generated/Braintrust.OneOf.6.g.cs index 5624991..f94abba 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OneOf.6.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OneOf.6.g.cs @@ -25,6 +25,19 @@ namespace Braintrust #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 Braintrust #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 Braintrust #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 Braintrust #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 Braintrust #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; + } + /// /// /// @@ -109,6 +174,19 @@ namespace Braintrust [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value6))] #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; + } /// /// /// @@ -319,6 +397,54 @@ 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, + 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!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, global::System.Action? value3 = null, global::System.Action? value4 = null,