From 4e029e3e7fa11d187f06052df729d45936f05605 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 8 May 2026 03:24:54 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Generated/Mixedbread.AnyOf.2.g.cs | 50 +++++ .../Generated/Mixedbread.AnyOf.3.g.cs | 69 +++++++ .../Generated/Mixedbread.AnyOf.4.g.cs | 88 +++++++++ ....MixedbreadClient.Constructors.Bearer.g.cs | 1 + .../Mixedbread.Models.AuthParamsVariant1.g.cs | 58 +++++- ...Mixedbread.Models.AuthParamsVariant12.g.cs | 35 +++- ...Mixedbread.Models.AuthParamsVariant13.g.cs | 58 +++++- .../Mixedbread.Models.ChunksVariant1Item.g.cs | 104 ++++++++++- ...Mixedbread.Models.ChunksVariant1Item2.g.cs | 104 ++++++++++- .../Generated/Mixedbread.Models.DataItem.g.cs | 81 +++++++- .../Mixedbread.Models.DataItem2.g.cs | 104 ++++++++++- .../Mixedbread.Models.DataItem3.g.cs | 104 ++++++++++- .../Mixedbread.Models.DeletedRule.g.cs | 104 ++++++++++- .../Mixedbread.Models.DeletedRule2.g.cs | 104 ++++++++++- .../Mixedbread.Models.EmbeddingItem.g.cs | 81 +++++++- ...read.Models.GeneratedMetadataVariant1.g.cs | 173 ++++++++++++++++-- ...ad.Models.GeneratedMetadataVariant110.g.cs | 173 ++++++++++++++++-- ...ad.Models.GeneratedMetadataVariant111.g.cs | 173 ++++++++++++++++-- ...ad.Models.GeneratedMetadataVariant112.g.cs | 173 ++++++++++++++++-- ...ead.Models.GeneratedMetadataVariant12.g.cs | 173 ++++++++++++++++-- ...ead.Models.GeneratedMetadataVariant13.g.cs | 173 ++++++++++++++++-- ...ead.Models.GeneratedMetadataVariant14.g.cs | 173 ++++++++++++++++-- ...ead.Models.GeneratedMetadataVariant15.g.cs | 173 ++++++++++++++++-- ...ead.Models.GeneratedMetadataVariant16.g.cs | 173 ++++++++++++++++-- ...ead.Models.GeneratedMetadataVariant17.g.cs | 173 ++++++++++++++++-- ...ead.Models.GeneratedMetadataVariant18.g.cs | 173 ++++++++++++++++-- ...ead.Models.GeneratedMetadataVariant19.g.cs | 173 ++++++++++++++++-- .../Mixedbread.Models.MultiModalQuery.g.cs | 54 +++++- ...dbread.Models.MultiModalQueryVariant2.g.cs | 58 +++++- .../Generated/Mixedbread.Models.Rule.g.cs | 104 ++++++++++- .../Generated/Mixedbread.Models.Rule2.g.cs | 104 ++++++++++- .../Mixedbread.Models.RulesItem.g.cs | 104 ++++++++++- .../Mixedbread.Models.RulesItem2.g.cs | 104 ++++++++++- .../Mixedbread.Models.RulesItem3.g.cs | 104 ++++++++++- .../Mixedbread.Models.RulesItem4.g.cs | 104 ++++++++++- .../Mixedbread.Models.RulesVariant1Item.g.cs | 104 ++++++++++- .../Mixedbread.Models.RulesVariant1Item2.g.cs | 104 ++++++++++- .../Mixedbread.Models.SourcesItem.g.cs | 104 ++++++++++- .../Mixedbread.Models.SourcesItem2.g.cs | 104 ++++++++++- 39 files changed, 4049 insertions(+), 324 deletions(-) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.AnyOf.2.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.AnyOf.2.g.cs index 83622cf..d092dc0 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.AnyOf.2.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.AnyOf.2.g.cs @@ -25,6 +25,19 @@ namespace Mixedbread #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 Mixedbread [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/Mixedbread/Generated/Mixedbread.AnyOf.3.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.AnyOf.3.g.cs index 646757b..9e46497 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.AnyOf.3.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.AnyOf.3.g.cs @@ -25,6 +25,19 @@ namespace Mixedbread #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 Mixedbread #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 Mixedbread [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/Mixedbread/Generated/Mixedbread.AnyOf.4.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.AnyOf.4.g.cs index 9af2338..ca3cc49 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.AnyOf.4.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.AnyOf.4.g.cs @@ -25,6 +25,19 @@ namespace Mixedbread #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 Mixedbread #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 Mixedbread #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 Mixedbread [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/Mixedbread/Generated/Mixedbread.MixedbreadClient.Constructors.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.Constructors.Bearer.g.cs index 9a36058..dbe4b5a 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.Constructors.Bearer.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.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/Mixedbread/Generated/Mixedbread.Models.AuthParamsVariant1.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.AuthParamsVariant1.g.cs index b1a8aae..0fa5be2 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.AuthParamsVariant1.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.AuthParamsVariant1.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsOauth2 => Oauth2 != null; + /// + /// + /// + public bool TryPickOauth2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.DataSourceOAuth2Params? value) + { + value = Oauth2; + return IsOauth2; + } + /// /// Authentication parameters for a API key data source. /// @@ -47,6 +60,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ApiKey))] #endif public bool IsApiKey => ApiKey != null; + + /// + /// + /// + public bool TryPickApiKey( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.DataSourceApiKeyParams? value) + { + value = ApiKey; + return IsApiKey; + } /// /// /// @@ -126,8 +152,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? oauth2 = null, - global::System.Func? apiKey = null, + global::System.Func? oauth2 = null, + global::System.Func? apiKey = null, bool validate = true) { if (validate) @@ -151,8 +177,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? oauth2 = null, - global::System.Action? apiKey = null, + global::System.Action? oauth2 = null, + + global::System.Action? apiKey = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOauth2) + { + oauth2?.Invoke(Oauth2!); + } + else if (IsApiKey) + { + apiKey?.Invoke(ApiKey!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? oauth2 = null, + global::System.Action? apiKey = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.AuthParamsVariant12.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.AuthParamsVariant12.g.cs index d173624..d86cf04 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.AuthParamsVariant12.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.AuthParamsVariant12.g.cs @@ -30,6 +30,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Oauth2))] #endif public bool IsOauth2 => Oauth2 != null; + + /// + /// + /// + public bool TryPickOauth2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.OAuth2CreateOrUpdateParams? value) + { + value = Oauth2; + return IsOauth2; + } /// /// /// @@ -87,7 +100,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? oauth2 = null, + global::System.Func? oauth2 = null, bool validate = true) { if (validate) @@ -107,7 +120,25 @@ public bool Validate() /// /// public void Match( - global::System.Action? oauth2 = null, + global::System.Action? oauth2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOauth2) + { + oauth2?.Invoke(Oauth2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? oauth2 = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.AuthParamsVariant13.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.AuthParamsVariant13.g.cs index 687f338..bd18742 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.AuthParamsVariant13.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.AuthParamsVariant13.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsOauth2 => Oauth2 != null; + /// + /// + /// + public bool TryPickOauth2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.OAuth2CreateOrUpdateParams? value) + { + value = Oauth2; + return IsOauth2; + } + /// /// Base class for API key create or update parameters. /// @@ -47,6 +60,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ApiKey))] #endif public bool IsApiKey => ApiKey != null; + + /// + /// + /// + public bool TryPickApiKey( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ApiKeyCreateOrUpdateParams? value) + { + value = ApiKey; + return IsApiKey; + } /// /// /// @@ -126,8 +152,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? oauth2 = null, - global::System.Func? apiKey = null, + global::System.Func? oauth2 = null, + global::System.Func? apiKey = null, bool validate = true) { if (validate) @@ -151,8 +177,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? oauth2 = null, - global::System.Action? apiKey = null, + global::System.Action? oauth2 = null, + + global::System.Action? apiKey = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOauth2) + { + oauth2?.Invoke(Oauth2!); + } + else if (IsApiKey) + { + apiKey?.Invoke(ApiKey!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? oauth2 = null, + global::System.Action? apiKey = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.ChunksVariant1Item.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.ChunksVariant1Item.g.cs index 1ef92ba..83e5f0e 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.ChunksVariant1Item.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.ChunksVariant1Item.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.TextInputChunk? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsImageUrl => ImageUrl != null; + /// + /// + /// + public bool TryPickImageUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ImageUrlInputChunk? value) + { + value = ImageUrl; + return IsImageUrl; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsAudioUrl => AudioUrl != null; + /// + /// + /// + public bool TryPickAudioUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.AudioUrlInputChunk? value) + { + value = AudioUrl; + return IsAudioUrl; + } + /// /// /// @@ -81,6 +120,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(VideoUrl))] #endif public bool IsVideoUrl => VideoUrl != null; + + /// + /// + /// + public bool TryPickVideoUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.VideoUrlInputChunk? value) + { + value = VideoUrl; + return IsVideoUrl; + } /// /// /// @@ -204,10 +256,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? imageUrl = null, - global::System.Func? audioUrl = null, - global::System.Func? videoUrl = null, + global::System.Func? text = null, + global::System.Func? imageUrl = null, + global::System.Func? audioUrl = null, + global::System.Func? videoUrl = null, bool validate = true) { if (validate) @@ -239,10 +291,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? imageUrl = null, - global::System.Action? audioUrl = null, - global::System.Action? videoUrl = null, + global::System.Action? text = null, + + global::System.Action? imageUrl = null, + + global::System.Action? audioUrl = null, + + global::System.Action? videoUrl = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImageUrl) + { + imageUrl?.Invoke(ImageUrl!); + } + else if (IsAudioUrl) + { + audioUrl?.Invoke(AudioUrl!); + } + else if (IsVideoUrl) + { + videoUrl?.Invoke(VideoUrl!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? imageUrl = null, + global::System.Action? audioUrl = null, + global::System.Action? videoUrl = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.ChunksVariant1Item2.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.ChunksVariant1Item2.g.cs index d226110..80df080 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.ChunksVariant1Item2.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.ChunksVariant1Item2.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.TextInputChunk? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsImageUrl => ImageUrl != null; + /// + /// + /// + public bool TryPickImageUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ImageUrlInputChunk? value) + { + value = ImageUrl; + return IsImageUrl; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsAudioUrl => AudioUrl != null; + /// + /// + /// + public bool TryPickAudioUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.AudioUrlInputChunk? value) + { + value = AudioUrl; + return IsAudioUrl; + } + /// /// /// @@ -81,6 +120,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(VideoUrl))] #endif public bool IsVideoUrl => VideoUrl != null; + + /// + /// + /// + public bool TryPickVideoUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.VideoUrlInputChunk? value) + { + value = VideoUrl; + return IsVideoUrl; + } /// /// /// @@ -204,10 +256,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? imageUrl = null, - global::System.Func? audioUrl = null, - global::System.Func? videoUrl = null, + global::System.Func? text = null, + global::System.Func? imageUrl = null, + global::System.Func? audioUrl = null, + global::System.Func? videoUrl = null, bool validate = true) { if (validate) @@ -239,10 +291,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? imageUrl = null, - global::System.Action? audioUrl = null, - global::System.Action? videoUrl = null, + global::System.Action? text = null, + + global::System.Action? imageUrl = null, + + global::System.Action? audioUrl = null, + + global::System.Action? videoUrl = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImageUrl) + { + imageUrl?.Invoke(ImageUrl!); + } + else if (IsAudioUrl) + { + audioUrl?.Invoke(AudioUrl!); + } + else if (IsVideoUrl) + { + videoUrl?.Invoke(VideoUrl!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? imageUrl = null, + global::System.Action? audioUrl = null, + global::System.Action? videoUrl = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.DataItem.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.DataItem.g.cs index 57b8d95..bd564d3 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.DataItem.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.DataItem.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsIngestion => Ingestion != null; + /// + /// + /// + public bool TryPickIngestion( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.StoreIngestionEvent? value) + { + value = Ingestion; + return IsIngestion; + } + /// /// Represents a search event in a vector store. /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsSearch => Search != null; + /// + /// + /// + public bool TryPickSearch( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.StoreSearchEvent? value) + { + value = Search; + return IsSearch; + } + /// /// Represents an agentic search trace in a vector store.
/// Unlike StoreSearchEvent, this captures the full sequence of tool calls the
@@ -67,6 +93,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AgenticSearch))] #endif public bool IsAgenticSearch => AgenticSearch != null; + + /// + /// + /// + public bool TryPickAgenticSearch( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.StoreAgenticSearchEvent? value) + { + value = AgenticSearch; + return IsAgenticSearch; + } /// /// /// @@ -168,9 +207,9 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? ingestion = null, - global::System.Func? search = null, - global::System.Func? agenticSearch = null, + global::System.Func? ingestion = null, + global::System.Func? search = null, + global::System.Func? agenticSearch = null, bool validate = true) { if (validate) @@ -198,9 +237,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? ingestion = null, - global::System.Action? search = null, - global::System.Action? agenticSearch = null, + global::System.Action? ingestion = null, + + global::System.Action? search = null, + + global::System.Action? agenticSearch = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsIngestion) + { + ingestion?.Invoke(Ingestion!); + } + else if (IsSearch) + { + search?.Invoke(Search!); + } + else if (IsAgenticSearch) + { + agenticSearch?.Invoke(AgenticSearch!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? ingestion = null, + global::System.Action? search = null, + global::System.Action? agenticSearch = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.DataItem2.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.DataItem2.g.cs index 1001a2e..deb6899 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.DataItem2.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.DataItem2.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MxbaiOmniCoreStoreModelsChunkTypesScoredTextInputChunk? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsImageUrl => ImageUrl != null; + /// + /// + /// + public bool TryPickImageUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MxbaiOmniCoreStoreModelsChunkTypesScoredImageUrlInputChunk? value) + { + value = ImageUrl; + return IsImageUrl; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsAudioUrl => AudioUrl != null; + /// + /// + /// + public bool TryPickAudioUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MxbaiOmniCoreStoreModelsChunkTypesScoredAudioUrlInputChunk? value) + { + value = AudioUrl; + return IsAudioUrl; + } + /// /// /// @@ -81,6 +120,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(VideoUrl))] #endif public bool IsVideoUrl => VideoUrl != null; + + /// + /// + /// + public bool TryPickVideoUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MxbaiOmniCoreStoreModelsChunkTypesScoredVideoUrlInputChunk? value) + { + value = VideoUrl; + return IsVideoUrl; + } /// /// /// @@ -204,10 +256,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? imageUrl = null, - global::System.Func? audioUrl = null, - global::System.Func? videoUrl = null, + global::System.Func? text = null, + global::System.Func? imageUrl = null, + global::System.Func? audioUrl = null, + global::System.Func? videoUrl = null, bool validate = true) { if (validate) @@ -239,10 +291,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? imageUrl = null, - global::System.Action? audioUrl = null, - global::System.Action? videoUrl = null, + global::System.Action? text = null, + + global::System.Action? imageUrl = null, + + global::System.Action? audioUrl = null, + + global::System.Action? videoUrl = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImageUrl) + { + imageUrl?.Invoke(ImageUrl!); + } + else if (IsAudioUrl) + { + audioUrl?.Invoke(AudioUrl!); + } + else if (IsVideoUrl) + { + videoUrl?.Invoke(VideoUrl!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? imageUrl = null, + global::System.Action? audioUrl = null, + global::System.Action? videoUrl = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.DataItem3.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.DataItem3.g.cs index 48874a1..24bf15c 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.DataItem3.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.DataItem3.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MxbaiOmniApiRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk? value) + { + value = Text; + return IsText; + } + /// /// Scored image chunk for deprecated API. /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsImageUrl => ImageUrl != null; + /// + /// + /// + public bool TryPickImageUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MxbaiOmniApiRoutesV1DeprecatedVectorStoresModelsScoredImageUrlInputChunk? value) + { + value = ImageUrl; + return IsImageUrl; + } + /// /// Scored audio chunk for deprecated API. /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsAudioUrl => AudioUrl != null; + /// + /// + /// + public bool TryPickAudioUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MxbaiOmniApiRoutesV1DeprecatedVectorStoresModelsScoredAudioUrlInputChunk? value) + { + value = AudioUrl; + return IsAudioUrl; + } + /// /// Scored video chunk for deprecated API. /// @@ -81,6 +120,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(VideoUrl))] #endif public bool IsVideoUrl => VideoUrl != null; + + /// + /// + /// + public bool TryPickVideoUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MxbaiOmniApiRoutesV1DeprecatedVectorStoresModelsScoredVideoUrlInputChunk? value) + { + value = VideoUrl; + return IsVideoUrl; + } /// /// /// @@ -204,10 +256,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? imageUrl = null, - global::System.Func? audioUrl = null, - global::System.Func? videoUrl = null, + global::System.Func? text = null, + global::System.Func? imageUrl = null, + global::System.Func? audioUrl = null, + global::System.Func? videoUrl = null, bool validate = true) { if (validate) @@ -239,10 +291,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? imageUrl = null, - global::System.Action? audioUrl = null, - global::System.Action? videoUrl = null, + global::System.Action? text = null, + + global::System.Action? imageUrl = null, + + global::System.Action? audioUrl = null, + + global::System.Action? videoUrl = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImageUrl) + { + imageUrl?.Invoke(ImageUrl!); + } + else if (IsAudioUrl) + { + audioUrl?.Invoke(AudioUrl!); + } + else if (IsVideoUrl) + { + videoUrl?.Invoke(VideoUrl!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? imageUrl = null, + global::System.Action? audioUrl = null, + global::System.Action? videoUrl = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.DeletedRule.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.DeletedRule.g.cs index 06614a4..ac3468b 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.DeletedRule.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.DeletedRule.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsQueryString => QueryString != null; + /// + /// + /// + public bool TryPickQueryString( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryStringSubstitutionRule? value) + { + value = QueryString; + return IsQueryString; + } + /// /// Represents a regex query substitution rule for a vector store search. /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsQueryRegex => QueryRegex != null; + /// + /// + /// + public bool TryPickQueryRegex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryRegexSubstitutionRule? value) + { + value = QueryRegex; + return IsQueryRegex; + } + /// /// Represents a chunk search result rule for a vector store search. /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsChunkSearchResult => ChunkSearchResult != null; + /// + /// + /// + public bool TryPickChunkSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ChunkSearchResultRule? value) + { + value = ChunkSearchResult; + return IsChunkSearchResult; + } + /// /// Represents a file search result rule for a vector store search. /// @@ -81,6 +120,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(FileSearchResult))] #endif public bool IsFileSearchResult => FileSearchResult != null; + + /// + /// + /// + public bool TryPickFileSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.FileSearchResultRule? value) + { + value = FileSearchResult; + return IsFileSearchResult; + } /// /// /// @@ -204,10 +256,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? queryString = null, - global::System.Func? queryRegex = null, - global::System.Func? chunkSearchResult = null, - global::System.Func? fileSearchResult = null, + global::System.Func? queryString = null, + global::System.Func? queryRegex = null, + global::System.Func? chunkSearchResult = null, + global::System.Func? fileSearchResult = null, bool validate = true) { if (validate) @@ -239,10 +291,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? queryString = null, - global::System.Action? queryRegex = null, - global::System.Action? chunkSearchResult = null, - global::System.Action? fileSearchResult = null, + global::System.Action? queryString = null, + + global::System.Action? queryRegex = null, + + global::System.Action? chunkSearchResult = null, + + global::System.Action? fileSearchResult = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsQueryString) + { + queryString?.Invoke(QueryString!); + } + else if (IsQueryRegex) + { + queryRegex?.Invoke(QueryRegex!); + } + else if (IsChunkSearchResult) + { + chunkSearchResult?.Invoke(ChunkSearchResult!); + } + else if (IsFileSearchResult) + { + fileSearchResult?.Invoke(FileSearchResult!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? queryString = null, + global::System.Action? queryRegex = null, + global::System.Action? chunkSearchResult = null, + global::System.Action? fileSearchResult = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.DeletedRule2.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.DeletedRule2.g.cs index ea0c327..f1b901f 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.DeletedRule2.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.DeletedRule2.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsQueryString => QueryString != null; + /// + /// + /// + public bool TryPickQueryString( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryStringSubstitutionRule? value) + { + value = QueryString; + return IsQueryString; + } + /// /// Represents a regex query substitution rule for a vector store search. /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsQueryRegex => QueryRegex != null; + /// + /// + /// + public bool TryPickQueryRegex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryRegexSubstitutionRule? value) + { + value = QueryRegex; + return IsQueryRegex; + } + /// /// Represents a chunk search result rule for a vector store search. /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsChunkSearchResult => ChunkSearchResult != null; + /// + /// + /// + public bool TryPickChunkSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ChunkSearchResultRule? value) + { + value = ChunkSearchResult; + return IsChunkSearchResult; + } + /// /// Represents a file search result rule for a vector store search. /// @@ -81,6 +120,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(FileSearchResult))] #endif public bool IsFileSearchResult => FileSearchResult != null; + + /// + /// + /// + public bool TryPickFileSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.FileSearchResultRule? value) + { + value = FileSearchResult; + return IsFileSearchResult; + } /// /// /// @@ -204,10 +256,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? queryString = null, - global::System.Func? queryRegex = null, - global::System.Func? chunkSearchResult = null, - global::System.Func? fileSearchResult = null, + global::System.Func? queryString = null, + global::System.Func? queryRegex = null, + global::System.Func? chunkSearchResult = null, + global::System.Func? fileSearchResult = null, bool validate = true) { if (validate) @@ -239,10 +291,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? queryString = null, - global::System.Action? queryRegex = null, - global::System.Action? chunkSearchResult = null, - global::System.Action? fileSearchResult = null, + global::System.Action? queryString = null, + + global::System.Action? queryRegex = null, + + global::System.Action? chunkSearchResult = null, + + global::System.Action? fileSearchResult = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsQueryString) + { + queryString?.Invoke(QueryString!); + } + else if (IsQueryRegex) + { + queryRegex?.Invoke(QueryRegex!); + } + else if (IsChunkSearchResult) + { + chunkSearchResult?.Invoke(ChunkSearchResult!); + } + else if (IsFileSearchResult) + { + fileSearchResult?.Invoke(FileSearchResult!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? queryString = null, + global::System.Action? queryRegex = null, + global::System.Action? chunkSearchResult = null, + global::System.Action? fileSearchResult = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.EmbeddingItem.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.EmbeddingItem.g.cs index 6f89468..45329f3 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.EmbeddingItem.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.EmbeddingItem.g.cs @@ -26,6 +26,19 @@ namespace Mixedbread #endif public bool IsEmbeddingItemVariant1 => EmbeddingItemVariant1 != null; + /// + /// + /// + public bool TryPickEmbeddingItemVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Collections.Generic.IList? value) + { + value = EmbeddingItemVariant1; + return IsEmbeddingItemVariant1; + } + /// /// /// @@ -43,6 +56,19 @@ namespace Mixedbread #endif public bool IsEmbeddingItemVariant2 => EmbeddingItemVariant2 != null; + /// + /// + /// + public bool TryPickEmbeddingItemVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Collections.Generic.IList? value) + { + value = EmbeddingItemVariant2; + return IsEmbeddingItemVariant2; + } + /// /// /// @@ -59,6 +85,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(EmbeddingItemVariant3))] #endif public bool IsEmbeddingItemVariant3 => EmbeddingItemVariant3 != null; + + /// + /// + /// + public bool TryPickEmbeddingItemVariant3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out string? value) + { + value = EmbeddingItemVariant3; + return IsEmbeddingItemVariant3; + } /// /// /// @@ -121,9 +160,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func?, TResult>? embeddingItemVariant1 = null, - global::System.Func?, TResult>? embeddingItemVariant2 = null, - global::System.Func? embeddingItemVariant3 = null, + global::System.Func, TResult>? embeddingItemVariant1 = null, + global::System.Func, TResult>? embeddingItemVariant2 = null, + global::System.Func? embeddingItemVariant3 = null, bool validate = true) { if (validate) @@ -151,9 +190,39 @@ public bool Validate() /// /// public void Match( - global::System.Action?>? embeddingItemVariant1 = null, - global::System.Action?>? embeddingItemVariant2 = null, - global::System.Action? embeddingItemVariant3 = null, + global::System.Action>? embeddingItemVariant1 = null, + + global::System.Action>? embeddingItemVariant2 = null, + + global::System.Action? embeddingItemVariant3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsEmbeddingItemVariant1) + { + embeddingItemVariant1?.Invoke(EmbeddingItemVariant1!); + } + else if (IsEmbeddingItemVariant2) + { + embeddingItemVariant2?.Invoke(EmbeddingItemVariant2!); + } + else if (IsEmbeddingItemVariant3) + { + embeddingItemVariant3?.Invoke(EmbeddingItemVariant3!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action>? embeddingItemVariant1 = null, + global::System.Action>? embeddingItemVariant2 = null, + global::System.Action? embeddingItemVariant3 = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant1.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant1.g.cs index d4e08da..c22e26d 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant1.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant1.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsMarkdown => Markdown != null; + /// + /// + /// + public bool TryPickMarkdown( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MarkdownChunkGeneratedMetadata? value) + { + value = Markdown; + return IsMarkdown; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.TextChunkGeneratedMetadata? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsPdf => Pdf != null; + /// + /// + /// + public bool TryPickPdf( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.PDFChunkGeneratedMetadata? value) + { + value = Pdf; + return IsPdf; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Mixedbread #endif public bool IsCode => Code != null; + /// + /// + /// + public bool TryPickCode( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.CodeChunkGeneratedMetadata? value) + { + value = Code; + return IsCode; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Mixedbread #endif public bool IsAudio => Audio != null; + /// + /// + /// + public bool TryPickAudio( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.AudioChunkGeneratedMetadata? value) + { + value = Audio; + return IsAudio; + } + /// /// /// @@ -116,6 +181,19 @@ namespace Mixedbread #endif public bool IsVideo => Video != null; + /// + /// + /// + public bool TryPickVideo( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.VideoChunkGeneratedMetadata? value) + { + value = Video; + return IsVideo; + } + /// /// /// @@ -132,6 +210,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] #endif public bool IsImage => Image != null; + + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ImageChunkGeneratedMetadata? value) + { + value = Image; + return IsImage; + } /// /// /// @@ -321,13 +412,13 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? markdown = null, - global::System.Func? text = null, - global::System.Func? pdf = null, - global::System.Func? code = null, - global::System.Func? audio = null, - global::System.Func? video = null, - global::System.Func? image = null, + global::System.Func? markdown = null, + global::System.Func? text = null, + global::System.Func? pdf = null, + global::System.Func? code = null, + global::System.Func? audio = null, + global::System.Func? video = null, + global::System.Func? image = null, bool validate = true) { if (validate) @@ -371,13 +462,67 @@ public bool Validate() /// /// public void Match( - global::System.Action? markdown = null, - global::System.Action? text = null, - global::System.Action? pdf = null, - global::System.Action? code = null, - global::System.Action? audio = null, - global::System.Action? video = null, - global::System.Action? image = null, + global::System.Action? markdown = null, + + global::System.Action? text = null, + + global::System.Action? pdf = null, + + global::System.Action? code = null, + + global::System.Action? audio = null, + + global::System.Action? video = null, + + global::System.Action? image = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMarkdown) + { + markdown?.Invoke(Markdown!); + } + else if (IsText) + { + text?.Invoke(Text!); + } + else if (IsPdf) + { + pdf?.Invoke(Pdf!); + } + else if (IsCode) + { + code?.Invoke(Code!); + } + else if (IsAudio) + { + audio?.Invoke(Audio!); + } + else if (IsVideo) + { + video?.Invoke(Video!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? markdown = null, + global::System.Action? text = null, + global::System.Action? pdf = null, + global::System.Action? code = null, + global::System.Action? audio = null, + global::System.Action? video = null, + global::System.Action? image = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant110.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant110.g.cs index 8c8cd3a..19c0a0c 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant110.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant110.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsMarkdown => Markdown != null; + /// + /// + /// + public bool TryPickMarkdown( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MarkdownChunkGeneratedMetadata? value) + { + value = Markdown; + return IsMarkdown; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.TextChunkGeneratedMetadata? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsPdf => Pdf != null; + /// + /// + /// + public bool TryPickPdf( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.PDFChunkGeneratedMetadata? value) + { + value = Pdf; + return IsPdf; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Mixedbread #endif public bool IsCode => Code != null; + /// + /// + /// + public bool TryPickCode( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.CodeChunkGeneratedMetadata? value) + { + value = Code; + return IsCode; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Mixedbread #endif public bool IsAudio => Audio != null; + /// + /// + /// + public bool TryPickAudio( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.AudioChunkGeneratedMetadata? value) + { + value = Audio; + return IsAudio; + } + /// /// /// @@ -116,6 +181,19 @@ namespace Mixedbread #endif public bool IsVideo => Video != null; + /// + /// + /// + public bool TryPickVideo( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.VideoChunkGeneratedMetadata? value) + { + value = Video; + return IsVideo; + } + /// /// /// @@ -132,6 +210,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] #endif public bool IsImage => Image != null; + + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ImageChunkGeneratedMetadata? value) + { + value = Image; + return IsImage; + } /// /// /// @@ -321,13 +412,13 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? markdown = null, - global::System.Func? text = null, - global::System.Func? pdf = null, - global::System.Func? code = null, - global::System.Func? audio = null, - global::System.Func? video = null, - global::System.Func? image = null, + global::System.Func? markdown = null, + global::System.Func? text = null, + global::System.Func? pdf = null, + global::System.Func? code = null, + global::System.Func? audio = null, + global::System.Func? video = null, + global::System.Func? image = null, bool validate = true) { if (validate) @@ -371,13 +462,67 @@ public bool Validate() /// /// public void Match( - global::System.Action? markdown = null, - global::System.Action? text = null, - global::System.Action? pdf = null, - global::System.Action? code = null, - global::System.Action? audio = null, - global::System.Action? video = null, - global::System.Action? image = null, + global::System.Action? markdown = null, + + global::System.Action? text = null, + + global::System.Action? pdf = null, + + global::System.Action? code = null, + + global::System.Action? audio = null, + + global::System.Action? video = null, + + global::System.Action? image = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMarkdown) + { + markdown?.Invoke(Markdown!); + } + else if (IsText) + { + text?.Invoke(Text!); + } + else if (IsPdf) + { + pdf?.Invoke(Pdf!); + } + else if (IsCode) + { + code?.Invoke(Code!); + } + else if (IsAudio) + { + audio?.Invoke(Audio!); + } + else if (IsVideo) + { + video?.Invoke(Video!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? markdown = null, + global::System.Action? text = null, + global::System.Action? pdf = null, + global::System.Action? code = null, + global::System.Action? audio = null, + global::System.Action? video = null, + global::System.Action? image = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant111.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant111.g.cs index 4b395b1..ef3c3b6 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant111.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant111.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsMarkdown => Markdown != null; + /// + /// + /// + public bool TryPickMarkdown( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MarkdownChunkGeneratedMetadata? value) + { + value = Markdown; + return IsMarkdown; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.TextChunkGeneratedMetadata? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsPdf => Pdf != null; + /// + /// + /// + public bool TryPickPdf( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.PDFChunkGeneratedMetadata? value) + { + value = Pdf; + return IsPdf; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Mixedbread #endif public bool IsCode => Code != null; + /// + /// + /// + public bool TryPickCode( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.CodeChunkGeneratedMetadata? value) + { + value = Code; + return IsCode; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Mixedbread #endif public bool IsAudio => Audio != null; + /// + /// + /// + public bool TryPickAudio( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.AudioChunkGeneratedMetadata? value) + { + value = Audio; + return IsAudio; + } + /// /// /// @@ -116,6 +181,19 @@ namespace Mixedbread #endif public bool IsVideo => Video != null; + /// + /// + /// + public bool TryPickVideo( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.VideoChunkGeneratedMetadata? value) + { + value = Video; + return IsVideo; + } + /// /// /// @@ -132,6 +210,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] #endif public bool IsImage => Image != null; + + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ImageChunkGeneratedMetadata? value) + { + value = Image; + return IsImage; + } /// /// /// @@ -321,13 +412,13 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? markdown = null, - global::System.Func? text = null, - global::System.Func? pdf = null, - global::System.Func? code = null, - global::System.Func? audio = null, - global::System.Func? video = null, - global::System.Func? image = null, + global::System.Func? markdown = null, + global::System.Func? text = null, + global::System.Func? pdf = null, + global::System.Func? code = null, + global::System.Func? audio = null, + global::System.Func? video = null, + global::System.Func? image = null, bool validate = true) { if (validate) @@ -371,13 +462,67 @@ public bool Validate() /// /// public void Match( - global::System.Action? markdown = null, - global::System.Action? text = null, - global::System.Action? pdf = null, - global::System.Action? code = null, - global::System.Action? audio = null, - global::System.Action? video = null, - global::System.Action? image = null, + global::System.Action? markdown = null, + + global::System.Action? text = null, + + global::System.Action? pdf = null, + + global::System.Action? code = null, + + global::System.Action? audio = null, + + global::System.Action? video = null, + + global::System.Action? image = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMarkdown) + { + markdown?.Invoke(Markdown!); + } + else if (IsText) + { + text?.Invoke(Text!); + } + else if (IsPdf) + { + pdf?.Invoke(Pdf!); + } + else if (IsCode) + { + code?.Invoke(Code!); + } + else if (IsAudio) + { + audio?.Invoke(Audio!); + } + else if (IsVideo) + { + video?.Invoke(Video!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? markdown = null, + global::System.Action? text = null, + global::System.Action? pdf = null, + global::System.Action? code = null, + global::System.Action? audio = null, + global::System.Action? video = null, + global::System.Action? image = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant112.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant112.g.cs index dec4efe..b26cb7c 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant112.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant112.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsMarkdown => Markdown != null; + /// + /// + /// + public bool TryPickMarkdown( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MarkdownChunkGeneratedMetadata? value) + { + value = Markdown; + return IsMarkdown; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.TextChunkGeneratedMetadata? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsPdf => Pdf != null; + /// + /// + /// + public bool TryPickPdf( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.PDFChunkGeneratedMetadata? value) + { + value = Pdf; + return IsPdf; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Mixedbread #endif public bool IsCode => Code != null; + /// + /// + /// + public bool TryPickCode( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.CodeChunkGeneratedMetadata? value) + { + value = Code; + return IsCode; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Mixedbread #endif public bool IsAudio => Audio != null; + /// + /// + /// + public bool TryPickAudio( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.AudioChunkGeneratedMetadata? value) + { + value = Audio; + return IsAudio; + } + /// /// /// @@ -116,6 +181,19 @@ namespace Mixedbread #endif public bool IsVideo => Video != null; + /// + /// + /// + public bool TryPickVideo( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.VideoChunkGeneratedMetadata? value) + { + value = Video; + return IsVideo; + } + /// /// /// @@ -132,6 +210,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] #endif public bool IsImage => Image != null; + + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ImageChunkGeneratedMetadata? value) + { + value = Image; + return IsImage; + } /// /// /// @@ -321,13 +412,13 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? markdown = null, - global::System.Func? text = null, - global::System.Func? pdf = null, - global::System.Func? code = null, - global::System.Func? audio = null, - global::System.Func? video = null, - global::System.Func? image = null, + global::System.Func? markdown = null, + global::System.Func? text = null, + global::System.Func? pdf = null, + global::System.Func? code = null, + global::System.Func? audio = null, + global::System.Func? video = null, + global::System.Func? image = null, bool validate = true) { if (validate) @@ -371,13 +462,67 @@ public bool Validate() /// /// public void Match( - global::System.Action? markdown = null, - global::System.Action? text = null, - global::System.Action? pdf = null, - global::System.Action? code = null, - global::System.Action? audio = null, - global::System.Action? video = null, - global::System.Action? image = null, + global::System.Action? markdown = null, + + global::System.Action? text = null, + + global::System.Action? pdf = null, + + global::System.Action? code = null, + + global::System.Action? audio = null, + + global::System.Action? video = null, + + global::System.Action? image = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMarkdown) + { + markdown?.Invoke(Markdown!); + } + else if (IsText) + { + text?.Invoke(Text!); + } + else if (IsPdf) + { + pdf?.Invoke(Pdf!); + } + else if (IsCode) + { + code?.Invoke(Code!); + } + else if (IsAudio) + { + audio?.Invoke(Audio!); + } + else if (IsVideo) + { + video?.Invoke(Video!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? markdown = null, + global::System.Action? text = null, + global::System.Action? pdf = null, + global::System.Action? code = null, + global::System.Action? audio = null, + global::System.Action? video = null, + global::System.Action? image = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant12.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant12.g.cs index fcd21fd..b9b66ee 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant12.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant12.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsMarkdown => Markdown != null; + /// + /// + /// + public bool TryPickMarkdown( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MarkdownChunkGeneratedMetadata? value) + { + value = Markdown; + return IsMarkdown; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.TextChunkGeneratedMetadata? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsPdf => Pdf != null; + /// + /// + /// + public bool TryPickPdf( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.PDFChunkGeneratedMetadata? value) + { + value = Pdf; + return IsPdf; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Mixedbread #endif public bool IsCode => Code != null; + /// + /// + /// + public bool TryPickCode( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.CodeChunkGeneratedMetadata? value) + { + value = Code; + return IsCode; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Mixedbread #endif public bool IsAudio => Audio != null; + /// + /// + /// + public bool TryPickAudio( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.AudioChunkGeneratedMetadata? value) + { + value = Audio; + return IsAudio; + } + /// /// /// @@ -116,6 +181,19 @@ namespace Mixedbread #endif public bool IsVideo => Video != null; + /// + /// + /// + public bool TryPickVideo( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.VideoChunkGeneratedMetadata? value) + { + value = Video; + return IsVideo; + } + /// /// /// @@ -132,6 +210,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] #endif public bool IsImage => Image != null; + + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ImageChunkGeneratedMetadata? value) + { + value = Image; + return IsImage; + } /// /// /// @@ -321,13 +412,13 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? markdown = null, - global::System.Func? text = null, - global::System.Func? pdf = null, - global::System.Func? code = null, - global::System.Func? audio = null, - global::System.Func? video = null, - global::System.Func? image = null, + global::System.Func? markdown = null, + global::System.Func? text = null, + global::System.Func? pdf = null, + global::System.Func? code = null, + global::System.Func? audio = null, + global::System.Func? video = null, + global::System.Func? image = null, bool validate = true) { if (validate) @@ -371,13 +462,67 @@ public bool Validate() /// /// public void Match( - global::System.Action? markdown = null, - global::System.Action? text = null, - global::System.Action? pdf = null, - global::System.Action? code = null, - global::System.Action? audio = null, - global::System.Action? video = null, - global::System.Action? image = null, + global::System.Action? markdown = null, + + global::System.Action? text = null, + + global::System.Action? pdf = null, + + global::System.Action? code = null, + + global::System.Action? audio = null, + + global::System.Action? video = null, + + global::System.Action? image = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMarkdown) + { + markdown?.Invoke(Markdown!); + } + else if (IsText) + { + text?.Invoke(Text!); + } + else if (IsPdf) + { + pdf?.Invoke(Pdf!); + } + else if (IsCode) + { + code?.Invoke(Code!); + } + else if (IsAudio) + { + audio?.Invoke(Audio!); + } + else if (IsVideo) + { + video?.Invoke(Video!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? markdown = null, + global::System.Action? text = null, + global::System.Action? pdf = null, + global::System.Action? code = null, + global::System.Action? audio = null, + global::System.Action? video = null, + global::System.Action? image = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant13.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant13.g.cs index 91a1700..204678d 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant13.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant13.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsMarkdown => Markdown != null; + /// + /// + /// + public bool TryPickMarkdown( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MarkdownChunkGeneratedMetadata? value) + { + value = Markdown; + return IsMarkdown; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.TextChunkGeneratedMetadata? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsPdf => Pdf != null; + /// + /// + /// + public bool TryPickPdf( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.PDFChunkGeneratedMetadata? value) + { + value = Pdf; + return IsPdf; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Mixedbread #endif public bool IsCode => Code != null; + /// + /// + /// + public bool TryPickCode( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.CodeChunkGeneratedMetadata? value) + { + value = Code; + return IsCode; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Mixedbread #endif public bool IsAudio => Audio != null; + /// + /// + /// + public bool TryPickAudio( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.AudioChunkGeneratedMetadata? value) + { + value = Audio; + return IsAudio; + } + /// /// /// @@ -116,6 +181,19 @@ namespace Mixedbread #endif public bool IsVideo => Video != null; + /// + /// + /// + public bool TryPickVideo( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.VideoChunkGeneratedMetadata? value) + { + value = Video; + return IsVideo; + } + /// /// /// @@ -132,6 +210,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] #endif public bool IsImage => Image != null; + + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ImageChunkGeneratedMetadata? value) + { + value = Image; + return IsImage; + } /// /// /// @@ -321,13 +412,13 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? markdown = null, - global::System.Func? text = null, - global::System.Func? pdf = null, - global::System.Func? code = null, - global::System.Func? audio = null, - global::System.Func? video = null, - global::System.Func? image = null, + global::System.Func? markdown = null, + global::System.Func? text = null, + global::System.Func? pdf = null, + global::System.Func? code = null, + global::System.Func? audio = null, + global::System.Func? video = null, + global::System.Func? image = null, bool validate = true) { if (validate) @@ -371,13 +462,67 @@ public bool Validate() /// /// public void Match( - global::System.Action? markdown = null, - global::System.Action? text = null, - global::System.Action? pdf = null, - global::System.Action? code = null, - global::System.Action? audio = null, - global::System.Action? video = null, - global::System.Action? image = null, + global::System.Action? markdown = null, + + global::System.Action? text = null, + + global::System.Action? pdf = null, + + global::System.Action? code = null, + + global::System.Action? audio = null, + + global::System.Action? video = null, + + global::System.Action? image = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMarkdown) + { + markdown?.Invoke(Markdown!); + } + else if (IsText) + { + text?.Invoke(Text!); + } + else if (IsPdf) + { + pdf?.Invoke(Pdf!); + } + else if (IsCode) + { + code?.Invoke(Code!); + } + else if (IsAudio) + { + audio?.Invoke(Audio!); + } + else if (IsVideo) + { + video?.Invoke(Video!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? markdown = null, + global::System.Action? text = null, + global::System.Action? pdf = null, + global::System.Action? code = null, + global::System.Action? audio = null, + global::System.Action? video = null, + global::System.Action? image = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant14.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant14.g.cs index 34ba4be..952ad05 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant14.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant14.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsMarkdown => Markdown != null; + /// + /// + /// + public bool TryPickMarkdown( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MarkdownChunkGeneratedMetadata? value) + { + value = Markdown; + return IsMarkdown; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.TextChunkGeneratedMetadata? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsPdf => Pdf != null; + /// + /// + /// + public bool TryPickPdf( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.PDFChunkGeneratedMetadata? value) + { + value = Pdf; + return IsPdf; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Mixedbread #endif public bool IsCode => Code != null; + /// + /// + /// + public bool TryPickCode( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.CodeChunkGeneratedMetadata? value) + { + value = Code; + return IsCode; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Mixedbread #endif public bool IsAudio => Audio != null; + /// + /// + /// + public bool TryPickAudio( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.AudioChunkGeneratedMetadata? value) + { + value = Audio; + return IsAudio; + } + /// /// /// @@ -116,6 +181,19 @@ namespace Mixedbread #endif public bool IsVideo => Video != null; + /// + /// + /// + public bool TryPickVideo( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.VideoChunkGeneratedMetadata? value) + { + value = Video; + return IsVideo; + } + /// /// /// @@ -132,6 +210,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] #endif public bool IsImage => Image != null; + + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ImageChunkGeneratedMetadata? value) + { + value = Image; + return IsImage; + } /// /// /// @@ -321,13 +412,13 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? markdown = null, - global::System.Func? text = null, - global::System.Func? pdf = null, - global::System.Func? code = null, - global::System.Func? audio = null, - global::System.Func? video = null, - global::System.Func? image = null, + global::System.Func? markdown = null, + global::System.Func? text = null, + global::System.Func? pdf = null, + global::System.Func? code = null, + global::System.Func? audio = null, + global::System.Func? video = null, + global::System.Func? image = null, bool validate = true) { if (validate) @@ -371,13 +462,67 @@ public bool Validate() /// /// public void Match( - global::System.Action? markdown = null, - global::System.Action? text = null, - global::System.Action? pdf = null, - global::System.Action? code = null, - global::System.Action? audio = null, - global::System.Action? video = null, - global::System.Action? image = null, + global::System.Action? markdown = null, + + global::System.Action? text = null, + + global::System.Action? pdf = null, + + global::System.Action? code = null, + + global::System.Action? audio = null, + + global::System.Action? video = null, + + global::System.Action? image = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMarkdown) + { + markdown?.Invoke(Markdown!); + } + else if (IsText) + { + text?.Invoke(Text!); + } + else if (IsPdf) + { + pdf?.Invoke(Pdf!); + } + else if (IsCode) + { + code?.Invoke(Code!); + } + else if (IsAudio) + { + audio?.Invoke(Audio!); + } + else if (IsVideo) + { + video?.Invoke(Video!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? markdown = null, + global::System.Action? text = null, + global::System.Action? pdf = null, + global::System.Action? code = null, + global::System.Action? audio = null, + global::System.Action? video = null, + global::System.Action? image = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant15.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant15.g.cs index 3a00b9b..eb694c7 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant15.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant15.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsMarkdown => Markdown != null; + /// + /// + /// + public bool TryPickMarkdown( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MarkdownChunkGeneratedMetadata? value) + { + value = Markdown; + return IsMarkdown; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.TextChunkGeneratedMetadata? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsPdf => Pdf != null; + /// + /// + /// + public bool TryPickPdf( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.PDFChunkGeneratedMetadata? value) + { + value = Pdf; + return IsPdf; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Mixedbread #endif public bool IsCode => Code != null; + /// + /// + /// + public bool TryPickCode( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.CodeChunkGeneratedMetadata? value) + { + value = Code; + return IsCode; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Mixedbread #endif public bool IsAudio => Audio != null; + /// + /// + /// + public bool TryPickAudio( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.AudioChunkGeneratedMetadata? value) + { + value = Audio; + return IsAudio; + } + /// /// /// @@ -116,6 +181,19 @@ namespace Mixedbread #endif public bool IsVideo => Video != null; + /// + /// + /// + public bool TryPickVideo( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.VideoChunkGeneratedMetadata? value) + { + value = Video; + return IsVideo; + } + /// /// /// @@ -132,6 +210,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] #endif public bool IsImage => Image != null; + + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ImageChunkGeneratedMetadata? value) + { + value = Image; + return IsImage; + } /// /// /// @@ -321,13 +412,13 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? markdown = null, - global::System.Func? text = null, - global::System.Func? pdf = null, - global::System.Func? code = null, - global::System.Func? audio = null, - global::System.Func? video = null, - global::System.Func? image = null, + global::System.Func? markdown = null, + global::System.Func? text = null, + global::System.Func? pdf = null, + global::System.Func? code = null, + global::System.Func? audio = null, + global::System.Func? video = null, + global::System.Func? image = null, bool validate = true) { if (validate) @@ -371,13 +462,67 @@ public bool Validate() /// /// public void Match( - global::System.Action? markdown = null, - global::System.Action? text = null, - global::System.Action? pdf = null, - global::System.Action? code = null, - global::System.Action? audio = null, - global::System.Action? video = null, - global::System.Action? image = null, + global::System.Action? markdown = null, + + global::System.Action? text = null, + + global::System.Action? pdf = null, + + global::System.Action? code = null, + + global::System.Action? audio = null, + + global::System.Action? video = null, + + global::System.Action? image = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMarkdown) + { + markdown?.Invoke(Markdown!); + } + else if (IsText) + { + text?.Invoke(Text!); + } + else if (IsPdf) + { + pdf?.Invoke(Pdf!); + } + else if (IsCode) + { + code?.Invoke(Code!); + } + else if (IsAudio) + { + audio?.Invoke(Audio!); + } + else if (IsVideo) + { + video?.Invoke(Video!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? markdown = null, + global::System.Action? text = null, + global::System.Action? pdf = null, + global::System.Action? code = null, + global::System.Action? audio = null, + global::System.Action? video = null, + global::System.Action? image = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant16.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant16.g.cs index e470181..a955846 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant16.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant16.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsMarkdown => Markdown != null; + /// + /// + /// + public bool TryPickMarkdown( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MarkdownChunkGeneratedMetadata? value) + { + value = Markdown; + return IsMarkdown; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.TextChunkGeneratedMetadata? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsPdf => Pdf != null; + /// + /// + /// + public bool TryPickPdf( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.PDFChunkGeneratedMetadata? value) + { + value = Pdf; + return IsPdf; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Mixedbread #endif public bool IsCode => Code != null; + /// + /// + /// + public bool TryPickCode( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.CodeChunkGeneratedMetadata? value) + { + value = Code; + return IsCode; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Mixedbread #endif public bool IsAudio => Audio != null; + /// + /// + /// + public bool TryPickAudio( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.AudioChunkGeneratedMetadata? value) + { + value = Audio; + return IsAudio; + } + /// /// /// @@ -116,6 +181,19 @@ namespace Mixedbread #endif public bool IsVideo => Video != null; + /// + /// + /// + public bool TryPickVideo( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.VideoChunkGeneratedMetadata? value) + { + value = Video; + return IsVideo; + } + /// /// /// @@ -132,6 +210,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] #endif public bool IsImage => Image != null; + + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ImageChunkGeneratedMetadata? value) + { + value = Image; + return IsImage; + } /// /// /// @@ -321,13 +412,13 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? markdown = null, - global::System.Func? text = null, - global::System.Func? pdf = null, - global::System.Func? code = null, - global::System.Func? audio = null, - global::System.Func? video = null, - global::System.Func? image = null, + global::System.Func? markdown = null, + global::System.Func? text = null, + global::System.Func? pdf = null, + global::System.Func? code = null, + global::System.Func? audio = null, + global::System.Func? video = null, + global::System.Func? image = null, bool validate = true) { if (validate) @@ -371,13 +462,67 @@ public bool Validate() /// /// public void Match( - global::System.Action? markdown = null, - global::System.Action? text = null, - global::System.Action? pdf = null, - global::System.Action? code = null, - global::System.Action? audio = null, - global::System.Action? video = null, - global::System.Action? image = null, + global::System.Action? markdown = null, + + global::System.Action? text = null, + + global::System.Action? pdf = null, + + global::System.Action? code = null, + + global::System.Action? audio = null, + + global::System.Action? video = null, + + global::System.Action? image = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMarkdown) + { + markdown?.Invoke(Markdown!); + } + else if (IsText) + { + text?.Invoke(Text!); + } + else if (IsPdf) + { + pdf?.Invoke(Pdf!); + } + else if (IsCode) + { + code?.Invoke(Code!); + } + else if (IsAudio) + { + audio?.Invoke(Audio!); + } + else if (IsVideo) + { + video?.Invoke(Video!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? markdown = null, + global::System.Action? text = null, + global::System.Action? pdf = null, + global::System.Action? code = null, + global::System.Action? audio = null, + global::System.Action? video = null, + global::System.Action? image = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant17.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant17.g.cs index a670940..1c703e0 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant17.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant17.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsMarkdown => Markdown != null; + /// + /// + /// + public bool TryPickMarkdown( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MarkdownChunkGeneratedMetadata? value) + { + value = Markdown; + return IsMarkdown; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.TextChunkGeneratedMetadata? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsPdf => Pdf != null; + /// + /// + /// + public bool TryPickPdf( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.PDFChunkGeneratedMetadata? value) + { + value = Pdf; + return IsPdf; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Mixedbread #endif public bool IsCode => Code != null; + /// + /// + /// + public bool TryPickCode( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.CodeChunkGeneratedMetadata? value) + { + value = Code; + return IsCode; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Mixedbread #endif public bool IsAudio => Audio != null; + /// + /// + /// + public bool TryPickAudio( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.AudioChunkGeneratedMetadata? value) + { + value = Audio; + return IsAudio; + } + /// /// /// @@ -116,6 +181,19 @@ namespace Mixedbread #endif public bool IsVideo => Video != null; + /// + /// + /// + public bool TryPickVideo( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.VideoChunkGeneratedMetadata? value) + { + value = Video; + return IsVideo; + } + /// /// /// @@ -132,6 +210,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] #endif public bool IsImage => Image != null; + + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ImageChunkGeneratedMetadata? value) + { + value = Image; + return IsImage; + } /// /// /// @@ -321,13 +412,13 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? markdown = null, - global::System.Func? text = null, - global::System.Func? pdf = null, - global::System.Func? code = null, - global::System.Func? audio = null, - global::System.Func? video = null, - global::System.Func? image = null, + global::System.Func? markdown = null, + global::System.Func? text = null, + global::System.Func? pdf = null, + global::System.Func? code = null, + global::System.Func? audio = null, + global::System.Func? video = null, + global::System.Func? image = null, bool validate = true) { if (validate) @@ -371,13 +462,67 @@ public bool Validate() /// /// public void Match( - global::System.Action? markdown = null, - global::System.Action? text = null, - global::System.Action? pdf = null, - global::System.Action? code = null, - global::System.Action? audio = null, - global::System.Action? video = null, - global::System.Action? image = null, + global::System.Action? markdown = null, + + global::System.Action? text = null, + + global::System.Action? pdf = null, + + global::System.Action? code = null, + + global::System.Action? audio = null, + + global::System.Action? video = null, + + global::System.Action? image = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMarkdown) + { + markdown?.Invoke(Markdown!); + } + else if (IsText) + { + text?.Invoke(Text!); + } + else if (IsPdf) + { + pdf?.Invoke(Pdf!); + } + else if (IsCode) + { + code?.Invoke(Code!); + } + else if (IsAudio) + { + audio?.Invoke(Audio!); + } + else if (IsVideo) + { + video?.Invoke(Video!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? markdown = null, + global::System.Action? text = null, + global::System.Action? pdf = null, + global::System.Action? code = null, + global::System.Action? audio = null, + global::System.Action? video = null, + global::System.Action? image = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant18.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant18.g.cs index d823d08..b7bd873 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant18.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant18.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsMarkdown => Markdown != null; + /// + /// + /// + public bool TryPickMarkdown( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MarkdownChunkGeneratedMetadata? value) + { + value = Markdown; + return IsMarkdown; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.TextChunkGeneratedMetadata? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsPdf => Pdf != null; + /// + /// + /// + public bool TryPickPdf( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.PDFChunkGeneratedMetadata? value) + { + value = Pdf; + return IsPdf; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Mixedbread #endif public bool IsCode => Code != null; + /// + /// + /// + public bool TryPickCode( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.CodeChunkGeneratedMetadata? value) + { + value = Code; + return IsCode; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Mixedbread #endif public bool IsAudio => Audio != null; + /// + /// + /// + public bool TryPickAudio( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.AudioChunkGeneratedMetadata? value) + { + value = Audio; + return IsAudio; + } + /// /// /// @@ -116,6 +181,19 @@ namespace Mixedbread #endif public bool IsVideo => Video != null; + /// + /// + /// + public bool TryPickVideo( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.VideoChunkGeneratedMetadata? value) + { + value = Video; + return IsVideo; + } + /// /// /// @@ -132,6 +210,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] #endif public bool IsImage => Image != null; + + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ImageChunkGeneratedMetadata? value) + { + value = Image; + return IsImage; + } /// /// /// @@ -321,13 +412,13 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? markdown = null, - global::System.Func? text = null, - global::System.Func? pdf = null, - global::System.Func? code = null, - global::System.Func? audio = null, - global::System.Func? video = null, - global::System.Func? image = null, + global::System.Func? markdown = null, + global::System.Func? text = null, + global::System.Func? pdf = null, + global::System.Func? code = null, + global::System.Func? audio = null, + global::System.Func? video = null, + global::System.Func? image = null, bool validate = true) { if (validate) @@ -371,13 +462,67 @@ public bool Validate() /// /// public void Match( - global::System.Action? markdown = null, - global::System.Action? text = null, - global::System.Action? pdf = null, - global::System.Action? code = null, - global::System.Action? audio = null, - global::System.Action? video = null, - global::System.Action? image = null, + global::System.Action? markdown = null, + + global::System.Action? text = null, + + global::System.Action? pdf = null, + + global::System.Action? code = null, + + global::System.Action? audio = null, + + global::System.Action? video = null, + + global::System.Action? image = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMarkdown) + { + markdown?.Invoke(Markdown!); + } + else if (IsText) + { + text?.Invoke(Text!); + } + else if (IsPdf) + { + pdf?.Invoke(Pdf!); + } + else if (IsCode) + { + code?.Invoke(Code!); + } + else if (IsAudio) + { + audio?.Invoke(Audio!); + } + else if (IsVideo) + { + video?.Invoke(Video!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? markdown = null, + global::System.Action? text = null, + global::System.Action? pdf = null, + global::System.Action? code = null, + global::System.Action? audio = null, + global::System.Action? video = null, + global::System.Action? image = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant19.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant19.g.cs index 8ec5351..2f5fc34 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant19.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.GeneratedMetadataVariant19.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsMarkdown => Markdown != null; + /// + /// + /// + public bool TryPickMarkdown( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MarkdownChunkGeneratedMetadata? value) + { + value = Markdown; + return IsMarkdown; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.TextChunkGeneratedMetadata? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsPdf => Pdf != null; + /// + /// + /// + public bool TryPickPdf( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.PDFChunkGeneratedMetadata? value) + { + value = Pdf; + return IsPdf; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Mixedbread #endif public bool IsCode => Code != null; + /// + /// + /// + public bool TryPickCode( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.CodeChunkGeneratedMetadata? value) + { + value = Code; + return IsCode; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Mixedbread #endif public bool IsAudio => Audio != null; + /// + /// + /// + public bool TryPickAudio( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.AudioChunkGeneratedMetadata? value) + { + value = Audio; + return IsAudio; + } + /// /// /// @@ -116,6 +181,19 @@ namespace Mixedbread #endif public bool IsVideo => Video != null; + /// + /// + /// + public bool TryPickVideo( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.VideoChunkGeneratedMetadata? value) + { + value = Video; + return IsVideo; + } + /// /// /// @@ -132,6 +210,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] #endif public bool IsImage => Image != null; + + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ImageChunkGeneratedMetadata? value) + { + value = Image; + return IsImage; + } /// /// /// @@ -321,13 +412,13 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? markdown = null, - global::System.Func? text = null, - global::System.Func? pdf = null, - global::System.Func? code = null, - global::System.Func? audio = null, - global::System.Func? video = null, - global::System.Func? image = null, + global::System.Func? markdown = null, + global::System.Func? text = null, + global::System.Func? pdf = null, + global::System.Func? code = null, + global::System.Func? audio = null, + global::System.Func? video = null, + global::System.Func? image = null, bool validate = true) { if (validate) @@ -371,13 +462,67 @@ public bool Validate() /// /// public void Match( - global::System.Action? markdown = null, - global::System.Action? text = null, - global::System.Action? pdf = null, - global::System.Action? code = null, - global::System.Action? audio = null, - global::System.Action? video = null, - global::System.Action? image = null, + global::System.Action? markdown = null, + + global::System.Action? text = null, + + global::System.Action? pdf = null, + + global::System.Action? code = null, + + global::System.Action? audio = null, + + global::System.Action? video = null, + + global::System.Action? image = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMarkdown) + { + markdown?.Invoke(Markdown!); + } + else if (IsText) + { + text?.Invoke(Text!); + } + else if (IsPdf) + { + pdf?.Invoke(Pdf!); + } + else if (IsCode) + { + code?.Invoke(Code!); + } + else if (IsAudio) + { + audio?.Invoke(Audio!); + } + else if (IsVideo) + { + video?.Invoke(Video!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? markdown = null, + global::System.Action? text = null, + global::System.Action? pdf = null, + global::System.Action? code = null, + global::System.Action? audio = null, + global::System.Action? video = null, + global::System.Action? image = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.MultiModalQuery.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.MultiModalQuery.g.cs index ba47249..dc8218b 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.MultiModalQuery.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.MultiModalQuery.g.cs @@ -26,6 +26,19 @@ namespace Mixedbread #endif public bool IsMultiModalQueryVariant1 => MultiModalQueryVariant1 != null; + /// + /// + /// + public bool TryPickMultiModalQueryVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out string? value) + { + value = MultiModalQueryVariant1; + return IsMultiModalQueryVariant1; + } + /// /// The input to create embeddings for. /// @@ -42,6 +55,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(MultiModalQueryVariant2))] #endif public bool IsMultiModalQueryVariant2 => MultiModalQueryVariant2 != null; + + /// + /// + /// + public bool TryPickMultiModalQueryVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MultiModalQueryVariant2? value) + { + value = MultiModalQueryVariant2; + return IsMultiModalQueryVariant2; + } /// /// /// @@ -118,7 +144,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? multiModalQueryVariant1 = null, + global::System.Func? multiModalQueryVariant1 = null, global::System.Func? multiModalQueryVariant2 = null, bool validate = true) { @@ -143,7 +169,31 @@ public bool Validate() /// /// public void Match( - global::System.Action? multiModalQueryVariant1 = null, + global::System.Action? multiModalQueryVariant1 = null, + + global::System.Action? multiModalQueryVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMultiModalQueryVariant1) + { + multiModalQueryVariant1?.Invoke(MultiModalQueryVariant1!); + } + else if (IsMultiModalQueryVariant2) + { + multiModalQueryVariant2?.Invoke(MultiModalQueryVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? multiModalQueryVariant1 = null, global::System.Action? multiModalQueryVariant2 = null, bool validate = true) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.MultiModalQueryVariant2.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.MultiModalQueryVariant2.g.cs index a433db3..3fed905 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.MultiModalQueryVariant2.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.MultiModalQueryVariant2.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsImageUrl => ImageUrl != null; + /// + /// + /// + public bool TryPickImageUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ImageUrlInput2? value) + { + value = ImageUrl; + return IsImageUrl; + } + /// /// Model for text input validation.
/// Attributes:
@@ -50,6 +63,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Text))] #endif public bool IsText => Text != null; + + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.TextInput? value) + { + value = Text; + return IsText; + } /// /// /// @@ -129,8 +155,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? imageUrl = null, - global::System.Func? text = null, + global::System.Func? imageUrl = null, + global::System.Func? text = null, bool validate = true) { if (validate) @@ -154,8 +180,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? imageUrl = null, - global::System.Action? text = null, + global::System.Action? imageUrl = null, + + global::System.Action? text = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsImageUrl) + { + imageUrl?.Invoke(ImageUrl!); + } + else if (IsText) + { + text?.Invoke(Text!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? imageUrl = null, + global::System.Action? text = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.Rule.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.Rule.g.cs index b0a3ad0..211c0cb 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.Rule.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.Rule.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsQueryString => QueryString != null; + /// + /// + /// + public bool TryPickQueryString( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryStringSubstitutionRule? value) + { + value = QueryString; + return IsQueryString; + } + /// /// Represents a regex query substitution rule for a vector store search. /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsQueryRegex => QueryRegex != null; + /// + /// + /// + public bool TryPickQueryRegex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryRegexSubstitutionRule? value) + { + value = QueryRegex; + return IsQueryRegex; + } + /// /// Represents a chunk search result rule for a vector store search. /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsChunkSearchResult => ChunkSearchResult != null; + /// + /// + /// + public bool TryPickChunkSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ChunkSearchResultRule? value) + { + value = ChunkSearchResult; + return IsChunkSearchResult; + } + /// /// Represents a file search result rule for a vector store search. /// @@ -81,6 +120,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(FileSearchResult))] #endif public bool IsFileSearchResult => FileSearchResult != null; + + /// + /// + /// + public bool TryPickFileSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.FileSearchResultRule? value) + { + value = FileSearchResult; + return IsFileSearchResult; + } /// /// /// @@ -204,10 +256,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? queryString = null, - global::System.Func? queryRegex = null, - global::System.Func? chunkSearchResult = null, - global::System.Func? fileSearchResult = null, + global::System.Func? queryString = null, + global::System.Func? queryRegex = null, + global::System.Func? chunkSearchResult = null, + global::System.Func? fileSearchResult = null, bool validate = true) { if (validate) @@ -239,10 +291,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? queryString = null, - global::System.Action? queryRegex = null, - global::System.Action? chunkSearchResult = null, - global::System.Action? fileSearchResult = null, + global::System.Action? queryString = null, + + global::System.Action? queryRegex = null, + + global::System.Action? chunkSearchResult = null, + + global::System.Action? fileSearchResult = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsQueryString) + { + queryString?.Invoke(QueryString!); + } + else if (IsQueryRegex) + { + queryRegex?.Invoke(QueryRegex!); + } + else if (IsChunkSearchResult) + { + chunkSearchResult?.Invoke(ChunkSearchResult!); + } + else if (IsFileSearchResult) + { + fileSearchResult?.Invoke(FileSearchResult!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? queryString = null, + global::System.Action? queryRegex = null, + global::System.Action? chunkSearchResult = null, + global::System.Action? fileSearchResult = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.Rule2.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.Rule2.g.cs index 76ed871..e6b4527 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.Rule2.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.Rule2.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsQueryString => QueryString != null; + /// + /// + /// + public bool TryPickQueryString( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryStringSubstitutionRule? value) + { + value = QueryString; + return IsQueryString; + } + /// /// Represents a regex query substitution rule for a vector store search. /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsQueryRegex => QueryRegex != null; + /// + /// + /// + public bool TryPickQueryRegex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryRegexSubstitutionRule? value) + { + value = QueryRegex; + return IsQueryRegex; + } + /// /// Represents a chunk search result rule for a vector store search. /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsChunkSearchResult => ChunkSearchResult != null; + /// + /// + /// + public bool TryPickChunkSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ChunkSearchResultRule? value) + { + value = ChunkSearchResult; + return IsChunkSearchResult; + } + /// /// Represents a file search result rule for a vector store search. /// @@ -81,6 +120,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(FileSearchResult))] #endif public bool IsFileSearchResult => FileSearchResult != null; + + /// + /// + /// + public bool TryPickFileSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.FileSearchResultRule? value) + { + value = FileSearchResult; + return IsFileSearchResult; + } /// /// /// @@ -204,10 +256,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? queryString = null, - global::System.Func? queryRegex = null, - global::System.Func? chunkSearchResult = null, - global::System.Func? fileSearchResult = null, + global::System.Func? queryString = null, + global::System.Func? queryRegex = null, + global::System.Func? chunkSearchResult = null, + global::System.Func? fileSearchResult = null, bool validate = true) { if (validate) @@ -239,10 +291,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? queryString = null, - global::System.Action? queryRegex = null, - global::System.Action? chunkSearchResult = null, - global::System.Action? fileSearchResult = null, + global::System.Action? queryString = null, + + global::System.Action? queryRegex = null, + + global::System.Action? chunkSearchResult = null, + + global::System.Action? fileSearchResult = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsQueryString) + { + queryString?.Invoke(QueryString!); + } + else if (IsQueryRegex) + { + queryRegex?.Invoke(QueryRegex!); + } + else if (IsChunkSearchResult) + { + chunkSearchResult?.Invoke(ChunkSearchResult!); + } + else if (IsFileSearchResult) + { + fileSearchResult?.Invoke(FileSearchResult!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? queryString = null, + global::System.Action? queryRegex = null, + global::System.Action? chunkSearchResult = null, + global::System.Action? fileSearchResult = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesItem.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesItem.g.cs index f80497c..c4428b3 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesItem.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesItem.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsQueryString => QueryString != null; + /// + /// + /// + public bool TryPickQueryString( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryStringSubstitutionRule? value) + { + value = QueryString; + return IsQueryString; + } + /// /// Represents a regex query substitution rule for a vector store search. /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsQueryRegex => QueryRegex != null; + /// + /// + /// + public bool TryPickQueryRegex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryRegexSubstitutionRule? value) + { + value = QueryRegex; + return IsQueryRegex; + } + /// /// Represents a chunk search result rule for a vector store search. /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsChunkSearchResult => ChunkSearchResult != null; + /// + /// + /// + public bool TryPickChunkSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ChunkSearchResultRule? value) + { + value = ChunkSearchResult; + return IsChunkSearchResult; + } + /// /// Represents a file search result rule for a vector store search. /// @@ -81,6 +120,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(FileSearchResult))] #endif public bool IsFileSearchResult => FileSearchResult != null; + + /// + /// + /// + public bool TryPickFileSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.FileSearchResultRule? value) + { + value = FileSearchResult; + return IsFileSearchResult; + } /// /// /// @@ -204,10 +256,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? queryString = null, - global::System.Func? queryRegex = null, - global::System.Func? chunkSearchResult = null, - global::System.Func? fileSearchResult = null, + global::System.Func? queryString = null, + global::System.Func? queryRegex = null, + global::System.Func? chunkSearchResult = null, + global::System.Func? fileSearchResult = null, bool validate = true) { if (validate) @@ -239,10 +291,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? queryString = null, - global::System.Action? queryRegex = null, - global::System.Action? chunkSearchResult = null, - global::System.Action? fileSearchResult = null, + global::System.Action? queryString = null, + + global::System.Action? queryRegex = null, + + global::System.Action? chunkSearchResult = null, + + global::System.Action? fileSearchResult = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsQueryString) + { + queryString?.Invoke(QueryString!); + } + else if (IsQueryRegex) + { + queryRegex?.Invoke(QueryRegex!); + } + else if (IsChunkSearchResult) + { + chunkSearchResult?.Invoke(ChunkSearchResult!); + } + else if (IsFileSearchResult) + { + fileSearchResult?.Invoke(FileSearchResult!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? queryString = null, + global::System.Action? queryRegex = null, + global::System.Action? chunkSearchResult = null, + global::System.Action? fileSearchResult = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesItem2.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesItem2.g.cs index 9ace31d..23567ae 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesItem2.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesItem2.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsQueryString => QueryString != null; + /// + /// + /// + public bool TryPickQueryString( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryStringSubstitutionRule? value) + { + value = QueryString; + return IsQueryString; + } + /// /// Represents a regex query substitution rule for a vector store search. /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsQueryRegex => QueryRegex != null; + /// + /// + /// + public bool TryPickQueryRegex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryRegexSubstitutionRule? value) + { + value = QueryRegex; + return IsQueryRegex; + } + /// /// Represents a chunk search result rule for a vector store search. /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsChunkSearchResult => ChunkSearchResult != null; + /// + /// + /// + public bool TryPickChunkSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ChunkSearchResultRule? value) + { + value = ChunkSearchResult; + return IsChunkSearchResult; + } + /// /// Represents a file search result rule for a vector store search. /// @@ -81,6 +120,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(FileSearchResult))] #endif public bool IsFileSearchResult => FileSearchResult != null; + + /// + /// + /// + public bool TryPickFileSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.FileSearchResultRule? value) + { + value = FileSearchResult; + return IsFileSearchResult; + } /// /// /// @@ -204,10 +256,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? queryString = null, - global::System.Func? queryRegex = null, - global::System.Func? chunkSearchResult = null, - global::System.Func? fileSearchResult = null, + global::System.Func? queryString = null, + global::System.Func? queryRegex = null, + global::System.Func? chunkSearchResult = null, + global::System.Func? fileSearchResult = null, bool validate = true) { if (validate) @@ -239,10 +291,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? queryString = null, - global::System.Action? queryRegex = null, - global::System.Action? chunkSearchResult = null, - global::System.Action? fileSearchResult = null, + global::System.Action? queryString = null, + + global::System.Action? queryRegex = null, + + global::System.Action? chunkSearchResult = null, + + global::System.Action? fileSearchResult = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsQueryString) + { + queryString?.Invoke(QueryString!); + } + else if (IsQueryRegex) + { + queryRegex?.Invoke(QueryRegex!); + } + else if (IsChunkSearchResult) + { + chunkSearchResult?.Invoke(ChunkSearchResult!); + } + else if (IsFileSearchResult) + { + fileSearchResult?.Invoke(FileSearchResult!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? queryString = null, + global::System.Action? queryRegex = null, + global::System.Action? chunkSearchResult = null, + global::System.Action? fileSearchResult = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesItem3.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesItem3.g.cs index 8003813..45b210a 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesItem3.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesItem3.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsQueryString => QueryString != null; + /// + /// + /// + public bool TryPickQueryString( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryStringSubstitutionRule? value) + { + value = QueryString; + return IsQueryString; + } + /// /// Represents a regex query substitution rule for a vector store search. /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsQueryRegex => QueryRegex != null; + /// + /// + /// + public bool TryPickQueryRegex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryRegexSubstitutionRule? value) + { + value = QueryRegex; + return IsQueryRegex; + } + /// /// Represents a chunk search result rule for a vector store search. /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsChunkSearchResult => ChunkSearchResult != null; + /// + /// + /// + public bool TryPickChunkSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ChunkSearchResultRule? value) + { + value = ChunkSearchResult; + return IsChunkSearchResult; + } + /// /// Represents a file search result rule for a vector store search. /// @@ -81,6 +120,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(FileSearchResult))] #endif public bool IsFileSearchResult => FileSearchResult != null; + + /// + /// + /// + public bool TryPickFileSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.FileSearchResultRule? value) + { + value = FileSearchResult; + return IsFileSearchResult; + } /// /// /// @@ -204,10 +256,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? queryString = null, - global::System.Func? queryRegex = null, - global::System.Func? chunkSearchResult = null, - global::System.Func? fileSearchResult = null, + global::System.Func? queryString = null, + global::System.Func? queryRegex = null, + global::System.Func? chunkSearchResult = null, + global::System.Func? fileSearchResult = null, bool validate = true) { if (validate) @@ -239,10 +291,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? queryString = null, - global::System.Action? queryRegex = null, - global::System.Action? chunkSearchResult = null, - global::System.Action? fileSearchResult = null, + global::System.Action? queryString = null, + + global::System.Action? queryRegex = null, + + global::System.Action? chunkSearchResult = null, + + global::System.Action? fileSearchResult = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsQueryString) + { + queryString?.Invoke(QueryString!); + } + else if (IsQueryRegex) + { + queryRegex?.Invoke(QueryRegex!); + } + else if (IsChunkSearchResult) + { + chunkSearchResult?.Invoke(ChunkSearchResult!); + } + else if (IsFileSearchResult) + { + fileSearchResult?.Invoke(FileSearchResult!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? queryString = null, + global::System.Action? queryRegex = null, + global::System.Action? chunkSearchResult = null, + global::System.Action? fileSearchResult = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesItem4.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesItem4.g.cs index 03f3f18..ab7ea56 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesItem4.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesItem4.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsQueryString => QueryString != null; + /// + /// + /// + public bool TryPickQueryString( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryStringSubstitutionRule? value) + { + value = QueryString; + return IsQueryString; + } + /// /// Represents a regex query substitution rule for a vector store search. /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsQueryRegex => QueryRegex != null; + /// + /// + /// + public bool TryPickQueryRegex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryRegexSubstitutionRule? value) + { + value = QueryRegex; + return IsQueryRegex; + } + /// /// Represents a chunk search result rule for a vector store search. /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsChunkSearchResult => ChunkSearchResult != null; + /// + /// + /// + public bool TryPickChunkSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ChunkSearchResultRule? value) + { + value = ChunkSearchResult; + return IsChunkSearchResult; + } + /// /// Represents a file search result rule for a vector store search. /// @@ -81,6 +120,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(FileSearchResult))] #endif public bool IsFileSearchResult => FileSearchResult != null; + + /// + /// + /// + public bool TryPickFileSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.FileSearchResultRule? value) + { + value = FileSearchResult; + return IsFileSearchResult; + } /// /// /// @@ -204,10 +256,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? queryString = null, - global::System.Func? queryRegex = null, - global::System.Func? chunkSearchResult = null, - global::System.Func? fileSearchResult = null, + global::System.Func? queryString = null, + global::System.Func? queryRegex = null, + global::System.Func? chunkSearchResult = null, + global::System.Func? fileSearchResult = null, bool validate = true) { if (validate) @@ -239,10 +291,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? queryString = null, - global::System.Action? queryRegex = null, - global::System.Action? chunkSearchResult = null, - global::System.Action? fileSearchResult = null, + global::System.Action? queryString = null, + + global::System.Action? queryRegex = null, + + global::System.Action? chunkSearchResult = null, + + global::System.Action? fileSearchResult = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsQueryString) + { + queryString?.Invoke(QueryString!); + } + else if (IsQueryRegex) + { + queryRegex?.Invoke(QueryRegex!); + } + else if (IsChunkSearchResult) + { + chunkSearchResult?.Invoke(ChunkSearchResult!); + } + else if (IsFileSearchResult) + { + fileSearchResult?.Invoke(FileSearchResult!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? queryString = null, + global::System.Action? queryRegex = null, + global::System.Action? chunkSearchResult = null, + global::System.Action? fileSearchResult = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesVariant1Item.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesVariant1Item.g.cs index 0a7660f..1d8ebac 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesVariant1Item.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesVariant1Item.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsQueryString => QueryString != null; + /// + /// + /// + public bool TryPickQueryString( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryStringSubstitutionRule? value) + { + value = QueryString; + return IsQueryString; + } + /// /// Represents a regex query substitution rule for a vector store search. /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsQueryRegex => QueryRegex != null; + /// + /// + /// + public bool TryPickQueryRegex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryRegexSubstitutionRule? value) + { + value = QueryRegex; + return IsQueryRegex; + } + /// /// Represents a chunk search result rule for a vector store search. /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsChunkSearchResult => ChunkSearchResult != null; + /// + /// + /// + public bool TryPickChunkSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ChunkSearchResultRule? value) + { + value = ChunkSearchResult; + return IsChunkSearchResult; + } + /// /// Represents a file search result rule for a vector store search. /// @@ -81,6 +120,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(FileSearchResult))] #endif public bool IsFileSearchResult => FileSearchResult != null; + + /// + /// + /// + public bool TryPickFileSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.FileSearchResultRule? value) + { + value = FileSearchResult; + return IsFileSearchResult; + } /// /// /// @@ -204,10 +256,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? queryString = null, - global::System.Func? queryRegex = null, - global::System.Func? chunkSearchResult = null, - global::System.Func? fileSearchResult = null, + global::System.Func? queryString = null, + global::System.Func? queryRegex = null, + global::System.Func? chunkSearchResult = null, + global::System.Func? fileSearchResult = null, bool validate = true) { if (validate) @@ -239,10 +291,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? queryString = null, - global::System.Action? queryRegex = null, - global::System.Action? chunkSearchResult = null, - global::System.Action? fileSearchResult = null, + global::System.Action? queryString = null, + + global::System.Action? queryRegex = null, + + global::System.Action? chunkSearchResult = null, + + global::System.Action? fileSearchResult = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsQueryString) + { + queryString?.Invoke(QueryString!); + } + else if (IsQueryRegex) + { + queryRegex?.Invoke(QueryRegex!); + } + else if (IsChunkSearchResult) + { + chunkSearchResult?.Invoke(ChunkSearchResult!); + } + else if (IsFileSearchResult) + { + fileSearchResult?.Invoke(FileSearchResult!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? queryString = null, + global::System.Action? queryRegex = null, + global::System.Action? chunkSearchResult = null, + global::System.Action? fileSearchResult = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesVariant1Item2.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesVariant1Item2.g.cs index aa302a8..e912142 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesVariant1Item2.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.RulesVariant1Item2.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsQueryString => QueryString != null; + /// + /// + /// + public bool TryPickQueryString( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryStringSubstitutionRule? value) + { + value = QueryString; + return IsQueryString; + } + /// /// Represents a regex query substitution rule for a vector store search. /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsQueryRegex => QueryRegex != null; + /// + /// + /// + public bool TryPickQueryRegex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.QueryRegexSubstitutionRule? value) + { + value = QueryRegex; + return IsQueryRegex; + } + /// /// Represents a chunk search result rule for a vector store search. /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsChunkSearchResult => ChunkSearchResult != null; + /// + /// + /// + public bool TryPickChunkSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.ChunkSearchResultRule? value) + { + value = ChunkSearchResult; + return IsChunkSearchResult; + } + /// /// Represents a file search result rule for a vector store search. /// @@ -81,6 +120,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(FileSearchResult))] #endif public bool IsFileSearchResult => FileSearchResult != null; + + /// + /// + /// + public bool TryPickFileSearchResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.FileSearchResultRule? value) + { + value = FileSearchResult; + return IsFileSearchResult; + } /// /// /// @@ -204,10 +256,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? queryString = null, - global::System.Func? queryRegex = null, - global::System.Func? chunkSearchResult = null, - global::System.Func? fileSearchResult = null, + global::System.Func? queryString = null, + global::System.Func? queryRegex = null, + global::System.Func? chunkSearchResult = null, + global::System.Func? fileSearchResult = null, bool validate = true) { if (validate) @@ -239,10 +291,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? queryString = null, - global::System.Action? queryRegex = null, - global::System.Action? chunkSearchResult = null, - global::System.Action? fileSearchResult = null, + global::System.Action? queryString = null, + + global::System.Action? queryRegex = null, + + global::System.Action? chunkSearchResult = null, + + global::System.Action? fileSearchResult = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsQueryString) + { + queryString?.Invoke(QueryString!); + } + else if (IsQueryRegex) + { + queryRegex?.Invoke(QueryRegex!); + } + else if (IsChunkSearchResult) + { + chunkSearchResult?.Invoke(ChunkSearchResult!); + } + else if (IsFileSearchResult) + { + fileSearchResult?.Invoke(FileSearchResult!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? queryString = null, + global::System.Action? queryRegex = null, + global::System.Action? chunkSearchResult = null, + global::System.Action? fileSearchResult = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.SourcesItem.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.SourcesItem.g.cs index 7336999..d7afc03 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.SourcesItem.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.SourcesItem.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MxbaiOmniCoreStoreModelsChunkTypesScoredTextInputChunk? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsImageUrl => ImageUrl != null; + /// + /// + /// + public bool TryPickImageUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MxbaiOmniCoreStoreModelsChunkTypesScoredImageUrlInputChunk? value) + { + value = ImageUrl; + return IsImageUrl; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsAudioUrl => AudioUrl != null; + /// + /// + /// + public bool TryPickAudioUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MxbaiOmniCoreStoreModelsChunkTypesScoredAudioUrlInputChunk? value) + { + value = AudioUrl; + return IsAudioUrl; + } + /// /// /// @@ -81,6 +120,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(VideoUrl))] #endif public bool IsVideoUrl => VideoUrl != null; + + /// + /// + /// + public bool TryPickVideoUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MxbaiOmniCoreStoreModelsChunkTypesScoredVideoUrlInputChunk? value) + { + value = VideoUrl; + return IsVideoUrl; + } /// /// /// @@ -204,10 +256,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? imageUrl = null, - global::System.Func? audioUrl = null, - global::System.Func? videoUrl = null, + global::System.Func? text = null, + global::System.Func? imageUrl = null, + global::System.Func? audioUrl = null, + global::System.Func? videoUrl = null, bool validate = true) { if (validate) @@ -239,10 +291,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? imageUrl = null, - global::System.Action? audioUrl = null, - global::System.Action? videoUrl = null, + global::System.Action? text = null, + + global::System.Action? imageUrl = null, + + global::System.Action? audioUrl = null, + + global::System.Action? videoUrl = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImageUrl) + { + imageUrl?.Invoke(ImageUrl!); + } + else if (IsAudioUrl) + { + audioUrl?.Invoke(AudioUrl!); + } + else if (IsVideoUrl) + { + videoUrl?.Invoke(VideoUrl!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? imageUrl = null, + global::System.Action? audioUrl = null, + global::System.Action? videoUrl = null, bool validate = true) { if (validate) diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Models.SourcesItem2.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Models.SourcesItem2.g.cs index 39cb844..6ac944a 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.Models.SourcesItem2.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.Models.SourcesItem2.g.cs @@ -31,6 +31,19 @@ namespace Mixedbread #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MxbaiOmniApiRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk? value) + { + value = Text; + return IsText; + } + /// /// Scored image chunk for deprecated API. /// @@ -48,6 +61,19 @@ namespace Mixedbread #endif public bool IsImageUrl => ImageUrl != null; + /// + /// + /// + public bool TryPickImageUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MxbaiOmniApiRoutesV1DeprecatedVectorStoresModelsScoredImageUrlInputChunk? value) + { + value = ImageUrl; + return IsImageUrl; + } + /// /// Scored audio chunk for deprecated API. /// @@ -65,6 +91,19 @@ namespace Mixedbread #endif public bool IsAudioUrl => AudioUrl != null; + /// + /// + /// + public bool TryPickAudioUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MxbaiOmniApiRoutesV1DeprecatedVectorStoresModelsScoredAudioUrlInputChunk? value) + { + value = AudioUrl; + return IsAudioUrl; + } + /// /// Scored video chunk for deprecated API. /// @@ -81,6 +120,19 @@ namespace Mixedbread [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(VideoUrl))] #endif public bool IsVideoUrl => VideoUrl != null; + + /// + /// + /// + public bool TryPickVideoUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Mixedbread.MxbaiOmniApiRoutesV1DeprecatedVectorStoresModelsScoredVideoUrlInputChunk? value) + { + value = VideoUrl; + return IsVideoUrl; + } /// /// /// @@ -204,10 +256,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? imageUrl = null, - global::System.Func? audioUrl = null, - global::System.Func? videoUrl = null, + global::System.Func? text = null, + global::System.Func? imageUrl = null, + global::System.Func? audioUrl = null, + global::System.Func? videoUrl = null, bool validate = true) { if (validate) @@ -239,10 +291,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? imageUrl = null, - global::System.Action? audioUrl = null, - global::System.Action? videoUrl = null, + global::System.Action? text = null, + + global::System.Action? imageUrl = null, + + global::System.Action? audioUrl = null, + + global::System.Action? videoUrl = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImageUrl) + { + imageUrl?.Invoke(ImageUrl!); + } + else if (IsAudioUrl) + { + audioUrl?.Invoke(AudioUrl!); + } + else if (IsVideoUrl) + { + videoUrl?.Invoke(VideoUrl!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? imageUrl = null, + global::System.Action? audioUrl = null, + global::System.Action? videoUrl = null, bool validate = true) { if (validate)