diff --git a/src/libs/EachLabs/Generated/EachLabs.EachLabsClient.Constructors.ApiKeyInHeader.g.cs b/src/libs/EachLabs/Generated/EachLabs.EachLabsClient.Constructors.ApiKeyInHeader.g.cs index c840701..5a9e6f8 100644 --- a/src/libs/EachLabs/Generated/EachLabs.EachLabsClient.Constructors.ApiKeyInHeader.g.cs +++ b/src/libs/EachLabs/Generated/EachLabs.EachLabsClient.Constructors.ApiKeyInHeader.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/EachLabs/Generated/EachLabs.Models.WebhookWithAttempts.g.cs b/src/libs/EachLabs/Generated/EachLabs.Models.WebhookWithAttempts.g.cs index f2004af..6cbaa75 100644 --- a/src/libs/EachLabs/Generated/EachLabs.Models.WebhookWithAttempts.g.cs +++ b/src/libs/EachLabs/Generated/EachLabs.Models.WebhookWithAttempts.g.cs @@ -26,6 +26,19 @@ namespace EachLabs #endif public bool IsWebhook => Webhook != null; + /// + /// + /// + public bool TryPickWebhook( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::EachLabs.Webhook? value) + { + value = Webhook; + return IsWebhook; + } + /// /// /// @@ -42,6 +55,19 @@ namespace EachLabs [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(WebhookWithAttemptsVariant2))] #endif public bool IsWebhookWithAttemptsVariant2 => WebhookWithAttemptsVariant2 != null; + + /// + /// + /// + public bool TryPickWebhookWithAttemptsVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::EachLabs.WebhookWithAttemptsVariant2? value) + { + value = WebhookWithAttemptsVariant2; + return IsWebhookWithAttemptsVariant2; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? webhook = null, - global::System.Func? webhookWithAttemptsVariant2 = null, + global::System.Func? webhook = null, + global::System.Func? webhookWithAttemptsVariant2 = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? webhook = null, - global::System.Action? webhookWithAttemptsVariant2 = null, + global::System.Action? webhook = null, + + global::System.Action? webhookWithAttemptsVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsWebhook) + { + webhook?.Invoke(Webhook!); + } + else if (IsWebhookWithAttemptsVariant2) + { + webhookWithAttemptsVariant2?.Invoke(WebhookWithAttemptsVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? webhook = null, + global::System.Action? webhookWithAttemptsVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/EachLabs/Generated/EachLabs.OneOf.3.g.cs b/src/libs/EachLabs/Generated/EachLabs.OneOf.3.g.cs index cb1c7c7..d4ea14a 100644 --- a/src/libs/EachLabs/Generated/EachLabs.OneOf.3.g.cs +++ b/src/libs/EachLabs/Generated/EachLabs.OneOf.3.g.cs @@ -25,6 +25,19 @@ namespace EachLabs #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 EachLabs #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 EachLabs [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)