Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions src/libs/Mixedbread/Generated/Mixedbread.AnyOf.2.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ namespace Mixedbread
#endif
public bool IsValue1 => Value1 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue1(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T1? value)
{
value = Value1;
return IsValue1;
}

/// <summary>
///
/// </summary>
Expand All @@ -41,6 +54,19 @@ namespace Mixedbread
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))]
#endif
public bool IsValue2 => Value2 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue2(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T2? value)
{
value = Value2;
return IsValue2;
}
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -143,6 +169,30 @@ public bool Validate()
/// </summary>
public void Match(
global::System.Action<T1>? value1 = null,

global::System.Action<T2>? value2 = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsValue1)
{
value1?.Invoke(Value1!);
}
else if (IsValue2)
{
value2?.Invoke(Value2!);
}
}

/// <summary>
///
/// </summary>
public void Switch(
global::System.Action<T1>? value1 = null,
global::System.Action<T2>? value2 = null,
bool validate = true)
{
Expand Down
69 changes: 69 additions & 0 deletions src/libs/Mixedbread/Generated/Mixedbread.AnyOf.3.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ namespace Mixedbread
#endif
public bool IsValue1 => Value1 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue1(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T1? value)
{
value = Value1;
return IsValue1;
}

/// <summary>
///
/// </summary>
Expand All @@ -42,6 +55,19 @@ namespace Mixedbread
#endif
public bool IsValue2 => Value2 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue2(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T2? value)
{
value = Value2;
return IsValue2;
}

/// <summary>
///
/// </summary>
Expand All @@ -58,6 +84,19 @@ namespace Mixedbread
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))]
#endif
public bool IsValue3 => Value3 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue3(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T3? value)
{
value = Value3;
return IsValue3;
}
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -187,6 +226,36 @@ public bool Validate()
/// </summary>
public void Match(
global::System.Action<T1>? value1 = null,

global::System.Action<T2>? value2 = null,

global::System.Action<T3>? 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!);
}
}

/// <summary>
///
/// </summary>
public void Switch(
global::System.Action<T1>? value1 = null,
global::System.Action<T2>? value2 = null,
global::System.Action<T3>? value3 = null,
bool validate = true)
Expand Down
88 changes: 88 additions & 0 deletions src/libs/Mixedbread/Generated/Mixedbread.AnyOf.4.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ namespace Mixedbread
#endif
public bool IsValue1 => Value1 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue1(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T1? value)
{
value = Value1;
return IsValue1;
}

/// <summary>
///
/// </summary>
Expand All @@ -42,6 +55,19 @@ namespace Mixedbread
#endif
public bool IsValue2 => Value2 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue2(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T2? value)
{
value = Value2;
return IsValue2;
}

/// <summary>
///
/// </summary>
Expand All @@ -59,6 +85,19 @@ namespace Mixedbread
#endif
public bool IsValue3 => Value3 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue3(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T3? value)
{
value = Value3;
return IsValue3;
}

/// <summary>
///
/// </summary>
Expand All @@ -75,6 +114,19 @@ namespace Mixedbread
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))]
#endif
public bool IsValue4 => Value4 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue4(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T4? value)
{
value = Value4;
return IsValue4;
}
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -231,6 +283,42 @@ public bool Validate()
/// </summary>
public void Match(
global::System.Action<T1>? value1 = null,

global::System.Action<T2>? value2 = null,

global::System.Action<T3>? value3 = null,

global::System.Action<T4>? 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!);
}
}

/// <summary>
///
/// </summary>
public void Switch(
global::System.Action<T1>? value1 = null,
global::System.Action<T2>? value2 = null,
global::System.Action<T3>? value3 = null,
global::System.Action<T4>? value4 = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ partial void Authorizing(
ref string apiKey);
partial void Authorized(
global::System.Net.Http.HttpClient client);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ namespace Mixedbread
#endif
public bool IsOauth2 => Oauth2 != null;

/// <summary>
///
/// </summary>
public bool TryPickOauth2(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::Mixedbread.DataSourceOAuth2Params? value)
{
value = Oauth2;
return IsOauth2;
}

/// <summary>
/// Authentication parameters for a API key data source.
/// </summary>
Expand All @@ -47,6 +60,19 @@ namespace Mixedbread
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ApiKey))]
#endif
public bool IsApiKey => ApiKey != null;

/// <summary>
///
/// </summary>
public bool TryPickApiKey(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::Mixedbread.DataSourceApiKeyParams? value)
{
value = ApiKey;
return IsApiKey;
}
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -126,8 +152,8 @@ public bool Validate()
///
/// </summary>
public TResult? Match<TResult>(
global::System.Func<global::Mixedbread.DataSourceOAuth2Params?, TResult>? oauth2 = null,
global::System.Func<global::Mixedbread.DataSourceApiKeyParams?, TResult>? apiKey = null,
global::System.Func<global::Mixedbread.DataSourceOAuth2Params, TResult>? oauth2 = null,
global::System.Func<global::Mixedbread.DataSourceApiKeyParams, TResult>? apiKey = null,
bool validate = true)
{
if (validate)
Expand All @@ -151,8 +177,32 @@ public bool Validate()
///
/// </summary>
public void Match(
global::System.Action<global::Mixedbread.DataSourceOAuth2Params?>? oauth2 = null,
global::System.Action<global::Mixedbread.DataSourceApiKeyParams?>? apiKey = null,
global::System.Action<global::Mixedbread.DataSourceOAuth2Params>? oauth2 = null,

global::System.Action<global::Mixedbread.DataSourceApiKeyParams>? apiKey = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsOauth2)
{
oauth2?.Invoke(Oauth2!);
}
else if (IsApiKey)
{
apiKey?.Invoke(ApiKey!);
}
}

/// <summary>
///
/// </summary>
public void Switch(
global::System.Action<global::Mixedbread.DataSourceOAuth2Params>? oauth2 = null,
global::System.Action<global::Mixedbread.DataSourceApiKeyParams>? apiKey = null,
bool validate = true)
{
if (validate)
Expand Down
Loading