From 87b7934dfd4b781fad80b35da0b6689cfff386d5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 1 Oct 2024 00:53:40 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Generated/Anthropic.Models.Block.g.cs | 68 +++++++++++++ .../Anthropic.Models.BlockDelta.g.cs | 48 +++++++++ .../Anthropic.Models.MessageStreamEvent.g.cs | 98 +++++++++++++++++++ src/libs/Anthropic/Generated/AnyOf.2.g.cs | 48 +++++++++ src/libs/Anthropic/Generated/OneOf.2.g.cs | 48 +++++++++ 5 files changed, 310 insertions(+) diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.Block.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.Block.g.cs index 2a101b7..61075b8 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.Block.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.Block.g.cs @@ -184,6 +184,74 @@ public bool Validate() return IsText && !IsImage && !IsToolUse && !IsToolResult || !IsText && IsImage && !IsToolUse && !IsToolResult || !IsText && !IsImage && IsToolUse && !IsToolResult || !IsText && !IsImage && !IsToolUse && IsToolResult; } + /// + /// + /// + public TResult? Match( + global::System.Func? text = null, + global::System.Func? image = null, + global::System.Func? toolUse = null, + global::System.Func? toolResult = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText && text != null) + { + return text(Text!); + } + else if (IsImage && image != null) + { + return image(Image!); + } + else if (IsToolUse && toolUse != null) + { + return toolUse(ToolUse!); + } + else if (IsToolResult && toolResult != null) + { + return toolResult(ToolResult!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? text = null, + global::System.Action? image = null, + global::System.Action? toolUse = null, + global::System.Action? toolResult = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + else if (IsToolUse) + { + toolUse?.Invoke(ToolUse!); + } + else if (IsToolResult) + { + toolResult?.Invoke(ToolResult!); + } + } + /// /// /// diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.BlockDelta.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.BlockDelta.g.cs index f43d30c..d288d2e 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.BlockDelta.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.BlockDelta.g.cs @@ -108,6 +108,54 @@ public bool Validate() return IsText && !IsInputJson || !IsText && IsInputJson; } + /// + /// + /// + public TResult? Match( + global::System.Func? text = null, + global::System.Func? inputJson = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText && text != null) + { + return text(Text!); + } + else if (IsInputJson && inputJson != null) + { + return inputJson(InputJson!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? text = null, + global::System.Action? inputJson = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsInputJson) + { + inputJson?.Invoke(InputJson!); + } + } + /// /// /// diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.MessageStreamEvent.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.MessageStreamEvent.g.cs index 6f1834d..19abd55 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.MessageStreamEvent.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.MessageStreamEvent.g.cs @@ -298,6 +298,104 @@ public bool Validate() return IsStart && !IsDelta && !IsStop && !IsContentBlockStart && !IsContentBlockDelta && !IsContentBlockStop && !IsPing || !IsStart && IsDelta && !IsStop && !IsContentBlockStart && !IsContentBlockDelta && !IsContentBlockStop && !IsPing || !IsStart && !IsDelta && IsStop && !IsContentBlockStart && !IsContentBlockDelta && !IsContentBlockStop && !IsPing || !IsStart && !IsDelta && !IsStop && IsContentBlockStart && !IsContentBlockDelta && !IsContentBlockStop && !IsPing || !IsStart && !IsDelta && !IsStop && !IsContentBlockStart && IsContentBlockDelta && !IsContentBlockStop && !IsPing || !IsStart && !IsDelta && !IsStop && !IsContentBlockStart && !IsContentBlockDelta && IsContentBlockStop && !IsPing || !IsStart && !IsDelta && !IsStop && !IsContentBlockStart && !IsContentBlockDelta && !IsContentBlockStop && IsPing; } + /// + /// + /// + public TResult? Match( + global::System.Func? start = null, + global::System.Func? delta = null, + global::System.Func? stop = null, + global::System.Func? contentBlockStart = null, + global::System.Func? contentBlockDelta = null, + global::System.Func? contentBlockStop = null, + global::System.Func? ping = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsStart && start != null) + { + return start(Start!); + } + else if (IsDelta && delta != null) + { + return delta(Delta!); + } + else if (IsStop && stop != null) + { + return stop(Stop!); + } + else if (IsContentBlockStart && contentBlockStart != null) + { + return contentBlockStart(ContentBlockStart!); + } + else if (IsContentBlockDelta && contentBlockDelta != null) + { + return contentBlockDelta(ContentBlockDelta!); + } + else if (IsContentBlockStop && contentBlockStop != null) + { + return contentBlockStop(ContentBlockStop!); + } + else if (IsPing && ping != null) + { + return ping(Ping!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? start = null, + global::System.Action? delta = null, + global::System.Action? stop = null, + global::System.Action? contentBlockStart = null, + global::System.Action? contentBlockDelta = null, + global::System.Action? contentBlockStop = null, + global::System.Action? ping = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsStart) + { + start?.Invoke(Start!); + } + else if (IsDelta) + { + delta?.Invoke(Delta!); + } + else if (IsStop) + { + stop?.Invoke(Stop!); + } + else if (IsContentBlockStart) + { + contentBlockStart?.Invoke(ContentBlockStart!); + } + else if (IsContentBlockDelta) + { + contentBlockDelta?.Invoke(ContentBlockDelta!); + } + else if (IsContentBlockStop) + { + contentBlockStop?.Invoke(ContentBlockStop!); + } + else if (IsPing) + { + ping?.Invoke(Ping!); + } + } + /// /// /// diff --git a/src/libs/Anthropic/Generated/AnyOf.2.g.cs b/src/libs/Anthropic/Generated/AnyOf.2.g.cs index 95d215a..aeef28c 100644 --- a/src/libs/Anthropic/Generated/AnyOf.2.g.cs +++ b/src/libs/Anthropic/Generated/AnyOf.2.g.cs @@ -107,6 +107,54 @@ public bool Validate() return IsValue1 || IsValue2; } + /// + /// + /// + public TResult? Match( + global::System.Func? value1 = null, + global::System.Func? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1 && value1 != null) + { + return value1(Value1!); + } + else if (IsValue2 && value2 != null) + { + return value2(Value2!); + } + + return default(TResult); + } + + /// + /// + /// + 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!); + } + } + /// /// /// diff --git a/src/libs/Anthropic/Generated/OneOf.2.g.cs b/src/libs/Anthropic/Generated/OneOf.2.g.cs index 8e09420..1fdefe0 100644 --- a/src/libs/Anthropic/Generated/OneOf.2.g.cs +++ b/src/libs/Anthropic/Generated/OneOf.2.g.cs @@ -107,6 +107,54 @@ public bool Validate() return IsValue1 && !IsValue2 || !IsValue1 && IsValue2; } + /// + /// + /// + public TResult? Match( + global::System.Func? value1 = null, + global::System.Func? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1 && value1 != null) + { + return value1(Value1!); + } + else if (IsValue2 && value2 != null) + { + return value2(Value2!); + } + + return default(TResult); + } + + /// + /// + /// + 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!); + } + } + /// /// ///