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/Letta/Generated/Letta.AnyOf.2.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ namespace Letta
#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 Letta
[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/Letta/Generated/Letta.AnyOf.3.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ namespace Letta
#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 Letta
#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 Letta
[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/Letta/Generated/Letta.AnyOf.4.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ namespace Letta
#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 Letta
#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 Letta
#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 Letta
[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
Loading
Loading