diff --git a/src/libs/Recraft/Generated/Recraft.Models.CreateStyleResponse.g.cs b/src/libs/Recraft/Generated/Recraft.Models.CreateStyleResponse.g.cs index 3380f32..1bd81de 100644 --- a/src/libs/Recraft/Generated/Recraft.Models.CreateStyleResponse.g.cs +++ b/src/libs/Recraft/Generated/Recraft.Models.CreateStyleResponse.g.cs @@ -26,6 +26,19 @@ namespace Recraft #endif public bool IsStyle => Style != null; + /// + /// + /// + public bool TryPickStyle( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Recraft.Style? value) + { + value = Style; + return IsStyle; + } + /// /// /// @@ -42,6 +55,19 @@ namespace Recraft [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CreateStyleResponseVariant2))] #endif public bool IsCreateStyleResponseVariant2 => CreateStyleResponseVariant2 != null; + + /// + /// + /// + public bool TryPickCreateStyleResponseVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Recraft.CreateStyleResponseVariant2? value) + { + value = CreateStyleResponseVariant2; + return IsCreateStyleResponseVariant2; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? style = null, - global::System.Func? createStyleResponseVariant2 = null, + global::System.Func? style = null, + global::System.Func? createStyleResponseVariant2 = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? style = null, - global::System.Action? createStyleResponseVariant2 = null, + global::System.Action? style = null, + + global::System.Action? createStyleResponseVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsStyle) + { + style?.Invoke(Style!); + } + else if (IsCreateStyleResponseVariant2) + { + createStyleResponseVariant2?.Invoke(CreateStyleResponseVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? style = null, + global::System.Action? createStyleResponseVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/Recraft/Generated/Recraft.Models.TransformImageWithMaskRequest.g.cs b/src/libs/Recraft/Generated/Recraft.Models.TransformImageWithMaskRequest.g.cs index 72d4d2c..3f18db9 100644 --- a/src/libs/Recraft/Generated/Recraft.Models.TransformImageWithMaskRequest.g.cs +++ b/src/libs/Recraft/Generated/Recraft.Models.TransformImageWithMaskRequest.g.cs @@ -26,6 +26,19 @@ namespace Recraft #endif public bool IsTransformImageRequest => TransformImageRequest != null; + /// + /// + /// + public bool TryPickTransformImageRequest( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Recraft.TransformImageRequest? value) + { + value = TransformImageRequest; + return IsTransformImageRequest; + } + /// /// /// @@ -42,6 +55,19 @@ namespace Recraft [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(TransformImageWithMaskRequestVariant2))] #endif public bool IsTransformImageWithMaskRequestVariant2 => TransformImageWithMaskRequestVariant2 != null; + + /// + /// + /// + public bool TryPickTransformImageWithMaskRequestVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Recraft.TransformImageWithMaskRequestVariant2? value) + { + value = TransformImageWithMaskRequestVariant2; + return IsTransformImageWithMaskRequestVariant2; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? transformImageRequest = null, - global::System.Func? transformImageWithMaskRequestVariant2 = null, + global::System.Func? transformImageRequest = null, + global::System.Func? transformImageWithMaskRequestVariant2 = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? transformImageRequest = null, - global::System.Action? transformImageWithMaskRequestVariant2 = null, + global::System.Action? transformImageRequest = null, + + global::System.Action? transformImageWithMaskRequestVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsTransformImageRequest) + { + transformImageRequest?.Invoke(TransformImageRequest!); + } + else if (IsTransformImageWithMaskRequestVariant2) + { + transformImageWithMaskRequestVariant2?.Invoke(TransformImageWithMaskRequestVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? transformImageRequest = null, + global::System.Action? transformImageWithMaskRequestVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/Recraft/Generated/Recraft.Models.VectorizeImageRequest.g.cs b/src/libs/Recraft/Generated/Recraft.Models.VectorizeImageRequest.g.cs index 7298962..6b81379 100644 --- a/src/libs/Recraft/Generated/Recraft.Models.VectorizeImageRequest.g.cs +++ b/src/libs/Recraft/Generated/Recraft.Models.VectorizeImageRequest.g.cs @@ -26,6 +26,19 @@ namespace Recraft #endif public bool IsProcess => Process != null; + /// + /// + /// + public bool TryPickProcess( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Recraft.ProcessImageRequest? value) + { + value = Process; + return IsProcess; + } + /// /// /// @@ -42,6 +55,19 @@ namespace Recraft [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(VectorizeImageRequestVariant2))] #endif public bool IsVectorizeImageRequestVariant2 => VectorizeImageRequestVariant2 != null; + + /// + /// + /// + public bool TryPickVectorizeImageRequestVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Recraft.VectorizeImageRequestVariant2? value) + { + value = VectorizeImageRequestVariant2; + return IsVectorizeImageRequestVariant2; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? process = null, - global::System.Func? vectorizeImageRequestVariant2 = null, + global::System.Func? process = null, + global::System.Func? vectorizeImageRequestVariant2 = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? process = null, - global::System.Action? vectorizeImageRequestVariant2 = null, + global::System.Action? process = null, + + global::System.Action? vectorizeImageRequestVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsProcess) + { + process?.Invoke(Process!); + } + else if (IsVectorizeImageRequestVariant2) + { + vectorizeImageRequestVariant2?.Invoke(VectorizeImageRequestVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? process = null, + global::System.Action? vectorizeImageRequestVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/Recraft/Generated/Recraft.RecraftClient.Constructors.Bearer.g.cs b/src/libs/Recraft/Generated/Recraft.RecraftClient.Constructors.Bearer.g.cs index edbed77..986b7f2 100644 --- a/src/libs/Recraft/Generated/Recraft.RecraftClient.Constructors.Bearer.g.cs +++ b/src/libs/Recraft/Generated/Recraft.RecraftClient.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