From c0d86bacdf46cfbb6bb647d0e0e796683a3f86f0 Mon Sep 17 00:00:00 2001 From: Corina Gum <> Date: Wed, 18 Mar 2026 12:30:58 -0700 Subject: [PATCH 1/5] Deprecate Adaptive Cards actions that now have generated replacements --- Libraries/Microsoft.Teams.Cards/Actions/IMBackAction.cs | 4 ++++ Libraries/Microsoft.Teams.Cards/Actions/InvokeAction.cs | 3 ++- Libraries/Microsoft.Teams.Cards/Actions/MessageBackAction.cs | 4 ++++ Libraries/Microsoft.Teams.Cards/Actions/SignInAction.cs | 4 ++++ Libraries/Microsoft.Teams.Cards/Actions/TaskFetchAction.cs | 4 ++++ 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Libraries/Microsoft.Teams.Cards/Actions/IMBackAction.cs b/Libraries/Microsoft.Teams.Cards/Actions/IMBackAction.cs index ebe6cd54..31ed445a 100644 --- a/Libraries/Microsoft.Teams.Cards/Actions/IMBackAction.cs +++ b/Libraries/Microsoft.Teams.Cards/Actions/IMBackAction.cs @@ -5,6 +5,10 @@ namespace Microsoft.Teams.Cards; +/// +/// This class is deprecated. Please use instead. This will be removed in a future version of the SDK. +/// +[Obsolete("This class is deprecated. Use ImBackSubmitActionData instead. This will be removed in a future version of the SDK.")] public class IMBackAction : SubmitAction { /// diff --git a/Libraries/Microsoft.Teams.Cards/Actions/InvokeAction.cs b/Libraries/Microsoft.Teams.Cards/Actions/InvokeAction.cs index c416cf55..218d2ca9 100644 --- a/Libraries/Microsoft.Teams.Cards/Actions/InvokeAction.cs +++ b/Libraries/Microsoft.Teams.Cards/Actions/InvokeAction.cs @@ -6,8 +6,9 @@ namespace Microsoft.Teams.Cards; /// -/// Defines an invoke action. This action is used to trigger a bot action. +/// This class is deprecated. Please use instead. This will be removed in a future version of the SDK. /// +[Obsolete("This class is deprecated. Use InvokeSubmitActionData instead. This will be removed in a future version of the SDK.")] public class InvokeAction : SubmitAction { /// diff --git a/Libraries/Microsoft.Teams.Cards/Actions/MessageBackAction.cs b/Libraries/Microsoft.Teams.Cards/Actions/MessageBackAction.cs index 4628f120..207b0889 100644 --- a/Libraries/Microsoft.Teams.Cards/Actions/MessageBackAction.cs +++ b/Libraries/Microsoft.Teams.Cards/Actions/MessageBackAction.cs @@ -5,6 +5,10 @@ namespace Microsoft.Teams.Cards; +/// +/// This class is deprecated. Please use instead. This will be removed in a future version of the SDK. +/// +[Obsolete("This class is deprecated. Use MessageBackSubmitActionData instead. This will be removed in a future version of the SDK.")] public class MessageBackAction : SubmitAction { public MessageBackAction(string text, string value) diff --git a/Libraries/Microsoft.Teams.Cards/Actions/SignInAction.cs b/Libraries/Microsoft.Teams.Cards/Actions/SignInAction.cs index bf5cd4ec..bd614523 100644 --- a/Libraries/Microsoft.Teams.Cards/Actions/SignInAction.cs +++ b/Libraries/Microsoft.Teams.Cards/Actions/SignInAction.cs @@ -5,6 +5,10 @@ namespace Microsoft.Teams.Cards; +/// +/// This class is deprecated. Please use instead. This will be removed in a future version of the SDK. +/// +[Obsolete("This class is deprecated. Use SigninSubmitActionData instead. This will be removed in a future version of the SDK.")] public class SignInAction : SubmitAction { public SignInAction(string value) diff --git a/Libraries/Microsoft.Teams.Cards/Actions/TaskFetchAction.cs b/Libraries/Microsoft.Teams.Cards/Actions/TaskFetchAction.cs index 8b4bf71b..a55e1262 100644 --- a/Libraries/Microsoft.Teams.Cards/Actions/TaskFetchAction.cs +++ b/Libraries/Microsoft.Teams.Cards/Actions/TaskFetchAction.cs @@ -5,6 +5,10 @@ namespace Microsoft.Teams.Cards; +/// +/// This class is deprecated. Please use instead. This will be removed in a future version of the SDK. +/// +[Obsolete("This class is deprecated. Use TaskFetchSubmitActionData instead. This will be removed in a future version of the SDK.")] public class TaskFetchAction : SubmitAction { public TaskFetchAction(IDictionary? value = null) From 28301b86c02745f572379f701733ba084b83daf9 Mon Sep 17 00:00:00 2001 From: Corina Gum <> Date: Wed, 18 Mar 2026 12:31:39 -0700 Subject: [PATCH 2/5] Update InvokeAction to use new types --- Libraries/Microsoft.Teams.Cards/Actions/InvokeAction.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Microsoft.Teams.Cards/Actions/InvokeAction.cs b/Libraries/Microsoft.Teams.Cards/Actions/InvokeAction.cs index 218d2ca9..9009b8d2 100644 --- a/Libraries/Microsoft.Teams.Cards/Actions/InvokeAction.cs +++ b/Libraries/Microsoft.Teams.Cards/Actions/InvokeAction.cs @@ -19,7 +19,7 @@ public InvokeAction(object value) { Data = new Union(new SubmitActionData { - Msteams = new InvokeSubmitActionData(value) + Msteams = new InvokeSubmitActionData(new Union(value)) }); } } \ No newline at end of file From dc2f7e5204f45ee6b2254a81ad0b443d5f44537e Mon Sep 17 00:00:00 2001 From: Corina Gum <> Date: Wed, 18 Mar 2026 16:06:23 -0700 Subject: [PATCH 3/5] Apply 3/18 generated Core --- Libraries/Microsoft.Teams.Cards/Core.cs | 33305 ++++++++++++---------- 1 file changed, 17721 insertions(+), 15584 deletions(-) diff --git a/Libraries/Microsoft.Teams.Cards/Core.cs b/Libraries/Microsoft.Teams.Cards/Core.cs index 5605bb3f..54c22555 100644 --- a/Libraries/Microsoft.Teams.Cards/Core.cs +++ b/Libraries/Microsoft.Teams.Cards/Core.cs @@ -1,4 +1,4 @@ -// This file was automatically generated by a tool on 09/16/2025, 10:37 PM UTC. DO NOT UPDATE MANUALLY. +// This file was automatically generated by a tool on 03/18/2026, 10:44 PM UTC. DO NOT UPDATE MANUALLY. // It includes declarations for Adaptive Card features available in Teams, Copilot, Outlook, Word, Excel, PowerPoint. #pragma warning disable IDE0290 @@ -13,802 +13,1009 @@ namespace Microsoft.Teams.Cards; [JsonConverter(typeof(JsonConverter))] public class ActionStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ActionStyle Default = new("default"); - public bool IsDefault => Default.Equals(Value); + public static readonly ActionStyle Default = new("default"); + public bool IsDefault => Default.Equals(Value); - public static readonly ActionStyle Positive = new("positive"); - public bool IsPositive => Positive.Equals(Value); + public static readonly ActionStyle Positive = new("positive"); + public bool IsPositive => Positive.Equals(Value); - public static readonly ActionStyle Destructive = new("destructive"); - public bool IsDestructive => Destructive.Equals(Value); + public static readonly ActionStyle Destructive = new("destructive"); + public bool IsDestructive => Destructive.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ActionMode(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ActionMode Primary = new("primary"); - public bool IsPrimary => Primary.Equals(Value); + public static readonly ActionMode Primary = new("primary"); + public bool IsPrimary => Primary.Equals(Value); - public static readonly ActionMode Secondary = new("secondary"); - public bool IsSecondary => Secondary.Equals(Value); + public static readonly ActionMode Secondary = new("secondary"); + public bool IsSecondary => Secondary.Equals(Value); } -[JsonConverter(typeof(JsonConverter))] -public class AssociatedInputs(string value) : StringEnum(value, caseSensitive: false) +[JsonConverter(typeof(JsonConverter))] +public class ThemeName(string value) : StringEnum(value, caseSensitive: false) { - public static readonly AssociatedInputs Auto = new("auto"); - public bool IsAuto => Auto.Equals(Value); + public static readonly ThemeName Light = new("Light"); + public bool IsLight => Light.Equals(Value); - public static readonly AssociatedInputs None = new("none"); - public bool IsNone => None.Equals(Value); + public static readonly ThemeName Dark = new("Dark"); + public bool IsDark => Dark.Equals(Value); } -[JsonConverter(typeof(JsonConverter))] -public class ImageInsertPosition(string value) : StringEnum(value, caseSensitive: false) +[JsonConverter(typeof(JsonConverter))] +public class ElementHeight(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ImageInsertPosition Selection = new("Selection"); - public bool IsSelection => Selection.Equals(Value); + public static readonly ElementHeight Auto = new("auto"); + public bool IsAuto => Auto.Equals(Value); - public static readonly ImageInsertPosition Top = new("Top"); - public bool IsTop => Top.Equals(Value); - - public static readonly ImageInsertPosition Bottom = new("Bottom"); - public bool IsBottom => Bottom.Equals(Value); + public static readonly ElementHeight Stretch = new("stretch"); + public bool IsStretch => Stretch.Equals(Value); } -[JsonConverter(typeof(JsonConverter))] -public class FallbackAction(string value) : StringEnum(value, caseSensitive: false) +[JsonConverter(typeof(JsonConverter))] +public class HorizontalAlignment(string value) : StringEnum(value, caseSensitive: false) { - public static readonly FallbackAction Drop = new("drop"); - public bool IsDrop => Drop.Equals(Value); + public static readonly HorizontalAlignment Left = new("Left"); + public bool IsLeft => Left.Equals(Value); + + public static readonly HorizontalAlignment Center = new("Center"); + public bool IsCenter => Center.Equals(Value); + + public static readonly HorizontalAlignment Right = new("Right"); + public bool IsRight => Right.Equals(Value); } -[JsonConverter(typeof(JsonConverter))] -public class ContainerStyle(string value) : StringEnum(value, caseSensitive: false) +[JsonConverter(typeof(JsonConverter))] +public class Spacing(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ContainerStyle Default = new("default"); - public bool IsDefault => Default.Equals(Value); + public static readonly Spacing None = new("None"); + public bool IsNone => None.Equals(Value); + + public static readonly Spacing ExtraSmall = new("ExtraSmall"); + public bool IsExtraSmall => ExtraSmall.Equals(Value); - public static readonly ContainerStyle Emphasis = new("emphasis"); - public bool IsEmphasis => Emphasis.Equals(Value); + public static readonly Spacing Small = new("Small"); + public bool IsSmall => Small.Equals(Value); - public static readonly ContainerStyle Accent = new("accent"); - public bool IsAccent => Accent.Equals(Value); + public static readonly Spacing Default = new("Default"); + public bool IsDefault => Default.Equals(Value); - public static readonly ContainerStyle Good = new("good"); - public bool IsGood => Good.Equals(Value); + public static readonly Spacing Medium = new("Medium"); + public bool IsMedium => Medium.Equals(Value); - public static readonly ContainerStyle Attention = new("attention"); - public bool IsAttention => Attention.Equals(Value); + public static readonly Spacing Large = new("Large"); + public bool IsLarge => Large.Equals(Value); - public static readonly ContainerStyle Warning = new("warning"); - public bool IsWarning => Warning.Equals(Value); + public static readonly Spacing ExtraLarge = new("ExtraLarge"); + public bool IsExtraLarge => ExtraLarge.Equals(Value); + + public static readonly Spacing Padding = new("Padding"); + public bool IsPadding => Padding.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class TargetWidth(string value) : StringEnum(value, caseSensitive: false) { - public static readonly TargetWidth VeryNarrow = new("VeryNarrow"); - public bool IsVeryNarrow => VeryNarrow.Equals(Value); + public static readonly TargetWidth VeryNarrow = new("VeryNarrow"); + public bool IsVeryNarrow => VeryNarrow.Equals(Value); - public static readonly TargetWidth Narrow = new("Narrow"); - public bool IsNarrow => Narrow.Equals(Value); + public static readonly TargetWidth Narrow = new("Narrow"); + public bool IsNarrow => Narrow.Equals(Value); - public static readonly TargetWidth Standard = new("Standard"); - public bool IsStandard => Standard.Equals(Value); + public static readonly TargetWidth Standard = new("Standard"); + public bool IsStandard => Standard.Equals(Value); - public static readonly TargetWidth Wide = new("Wide"); - public bool IsWide => Wide.Equals(Value); + public static readonly TargetWidth Wide = new("Wide"); + public bool IsWide => Wide.Equals(Value); - public static readonly TargetWidth AtLeastVeryNarrow = new("atLeast:VeryNarrow"); - public bool IsAtLeastVeryNarrow => AtLeastVeryNarrow.Equals(Value); + public static readonly TargetWidth AtLeastVeryNarrow = new("atLeast:VeryNarrow"); + public bool IsAtLeastVeryNarrow => AtLeastVeryNarrow.Equals(Value); - public static readonly TargetWidth AtMostVeryNarrow = new("atMost:VeryNarrow"); - public bool IsAtMostVeryNarrow => AtMostVeryNarrow.Equals(Value); + public static readonly TargetWidth AtMostVeryNarrow = new("atMost:VeryNarrow"); + public bool IsAtMostVeryNarrow => AtMostVeryNarrow.Equals(Value); - public static readonly TargetWidth AtLeastNarrow = new("atLeast:Narrow"); - public bool IsAtLeastNarrow => AtLeastNarrow.Equals(Value); + public static readonly TargetWidth AtLeastNarrow = new("atLeast:Narrow"); + public bool IsAtLeastNarrow => AtLeastNarrow.Equals(Value); - public static readonly TargetWidth AtMostNarrow = new("atMost:Narrow"); - public bool IsAtMostNarrow => AtMostNarrow.Equals(Value); + public static readonly TargetWidth AtMostNarrow = new("atMost:Narrow"); + public bool IsAtMostNarrow => AtMostNarrow.Equals(Value); - public static readonly TargetWidth AtLeastStandard = new("atLeast:Standard"); - public bool IsAtLeastStandard => AtLeastStandard.Equals(Value); + public static readonly TargetWidth AtLeastStandard = new("atLeast:Standard"); + public bool IsAtLeastStandard => AtLeastStandard.Equals(Value); - public static readonly TargetWidth AtMostStandard = new("atMost:Standard"); - public bool IsAtMostStandard => AtMostStandard.Equals(Value); + public static readonly TargetWidth AtMostStandard = new("atMost:Standard"); + public bool IsAtMostStandard => AtMostStandard.Equals(Value); - public static readonly TargetWidth AtLeastWide = new("atLeast:Wide"); - public bool IsAtLeastWide => AtLeastWide.Equals(Value); + public static readonly TargetWidth AtLeastWide = new("atLeast:Wide"); + public bool IsAtLeastWide => AtLeastWide.Equals(Value); - public static readonly TargetWidth AtMostWide = new("atMost:Wide"); - public bool IsAtMostWide => AtMostWide.Equals(Value); + public static readonly TargetWidth AtMostWide = new("atMost:Wide"); + public bool IsAtMostWide => AtMostWide.Equals(Value); } -[JsonConverter(typeof(JsonConverter))] -public class HorizontalAlignment(string value) : StringEnum(value, caseSensitive: false) +[JsonConverter(typeof(JsonConverter))] +public class ContainerStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly HorizontalAlignment Left = new("Left"); - public bool IsLeft => Left.Equals(Value); + public static readonly ContainerStyle Default = new("default"); + public bool IsDefault => Default.Equals(Value); + + public static readonly ContainerStyle Emphasis = new("emphasis"); + public bool IsEmphasis => Emphasis.Equals(Value); + + public static readonly ContainerStyle Accent = new("accent"); + public bool IsAccent => Accent.Equals(Value); + + public static readonly ContainerStyle Good = new("good"); + public bool IsGood => Good.Equals(Value); - public static readonly HorizontalAlignment Center = new("Center"); - public bool IsCenter => Center.Equals(Value); + public static readonly ContainerStyle Attention = new("attention"); + public bool IsAttention => Attention.Equals(Value); - public static readonly HorizontalAlignment Right = new("Right"); - public bool IsRight => Right.Equals(Value); + public static readonly ContainerStyle Warning = new("warning"); + public bool IsWarning => Warning.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class VerticalAlignment(string value) : StringEnum(value, caseSensitive: false) { - public static readonly VerticalAlignment Top = new("Top"); - public bool IsTop => Top.Equals(Value); + public static readonly VerticalAlignment Top = new("Top"); + public bool IsTop => Top.Equals(Value); - public static readonly VerticalAlignment Center = new("Center"); - public bool IsCenter => Center.Equals(Value); + public static readonly VerticalAlignment Center = new("Center"); + public bool IsCenter => Center.Equals(Value); - public static readonly VerticalAlignment Bottom = new("Bottom"); - public bool IsBottom => Bottom.Equals(Value); + public static readonly VerticalAlignment Bottom = new("Bottom"); + public bool IsBottom => Bottom.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class FlowLayoutItemFit(string value) : StringEnum(value, caseSensitive: false) { - public static readonly FlowLayoutItemFit Fit = new("Fit"); - public bool IsFit => Fit.Equals(Value); - - public static readonly FlowLayoutItemFit Fill = new("Fill"); - public bool IsFill => Fill.Equals(Value); -} - -[JsonConverter(typeof(JsonConverter))] -public class Spacing(string value) : StringEnum(value, caseSensitive: false) -{ - public static readonly Spacing None = new("None"); - public bool IsNone => None.Equals(Value); - - public static readonly Spacing ExtraSmall = new("ExtraSmall"); - public bool IsExtraSmall => ExtraSmall.Equals(Value); - - public static readonly Spacing Small = new("Small"); - public bool IsSmall => Small.Equals(Value); - - public static readonly Spacing Default = new("Default"); - public bool IsDefault => Default.Equals(Value); - - public static readonly Spacing Medium = new("Medium"); - public bool IsMedium => Medium.Equals(Value); - - public static readonly Spacing Large = new("Large"); - public bool IsLarge => Large.Equals(Value); - - public static readonly Spacing ExtraLarge = new("ExtraLarge"); - public bool IsExtraLarge => ExtraLarge.Equals(Value); + public static readonly FlowLayoutItemFit Fit = new("Fit"); + public bool IsFit => Fit.Equals(Value); - public static readonly Spacing Padding = new("Padding"); - public bool IsPadding => Padding.Equals(Value); + public static readonly FlowLayoutItemFit Fill = new("Fill"); + public bool IsFill => Fill.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class FillMode(string value) : StringEnum(value, caseSensitive: false) { - public static readonly FillMode Cover = new("Cover"); - public bool IsCover => Cover.Equals(Value); - - public static readonly FillMode RepeatHorizontally = new("RepeatHorizontally"); - public bool IsRepeatHorizontally => RepeatHorizontally.Equals(Value); - - public static readonly FillMode RepeatVertically = new("RepeatVertically"); - public bool IsRepeatVertically => RepeatVertically.Equals(Value); - - public static readonly FillMode Repeat = new("Repeat"); - public bool IsRepeat => Repeat.Equals(Value); -} - -[JsonConverter(typeof(JsonConverter))] -public class Version(string value) : StringEnum(value, caseSensitive: false) -{ - public static readonly Version Version1_0 = new("1.0"); - public bool IsVersion1_0 => Version1_0.Equals(Value); - - public static readonly Version Version1_1 = new("1.1"); - public bool IsVersion1_1 => Version1_1.Equals(Value); - - public static readonly Version Version1_2 = new("1.2"); - public bool IsVersion1_2 => Version1_2.Equals(Value); - - public static readonly Version Version1_3 = new("1.3"); - public bool IsVersion1_3 => Version1_3.Equals(Value); - - public static readonly Version Version1_4 = new("1.4"); - public bool IsVersion1_4 => Version1_4.Equals(Value); - - public static readonly Version Version1_5 = new("1.5"); - public bool IsVersion1_5 => Version1_5.Equals(Value); - - public static readonly Version Version1_6 = new("1.6"); - public bool IsVersion1_6 => Version1_6.Equals(Value); -} - -[JsonConverter(typeof(JsonConverter))] -public class TeamsCardWidth(string value) : StringEnum(value, caseSensitive: false) -{ - public static readonly TeamsCardWidth Full = new("full"); - public bool IsFull => Full.Equals(Value); -} - -[JsonConverter(typeof(JsonConverter))] -public class MentionType(string value) : StringEnum(value, caseSensitive: false) -{ - public static readonly MentionType Person = new("Person"); - public bool IsPerson => Person.Equals(Value); + public static readonly FillMode Cover = new("Cover"); + public bool IsCover => Cover.Equals(Value); - public static readonly MentionType Tag = new("Tag"); - public bool IsTag => Tag.Equals(Value); -} + public static readonly FillMode RepeatHorizontally = new("RepeatHorizontally"); + public bool IsRepeatHorizontally => RepeatHorizontally.Equals(Value); -[JsonConverter(typeof(JsonConverter))] -public class ElementHeight(string value) : StringEnum(value, caseSensitive: false) -{ - public static readonly ElementHeight Auto = new("auto"); - public bool IsAuto => Auto.Equals(Value); + public static readonly FillMode RepeatVertically = new("RepeatVertically"); + public bool IsRepeatVertically => RepeatVertically.Equals(Value); - public static readonly ElementHeight Stretch = new("stretch"); - public bool IsStretch => Stretch.Equals(Value); + public static readonly FillMode Repeat = new("Repeat"); + public bool IsRepeat => Repeat.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class TextSize(string value) : StringEnum(value, caseSensitive: false) { - public static readonly TextSize Small = new("Small"); - public bool IsSmall => Small.Equals(Value); + public static readonly TextSize Small = new("Small"); + public bool IsSmall => Small.Equals(Value); - public static readonly TextSize Default = new("Default"); - public bool IsDefault => Default.Equals(Value); + public static readonly TextSize Default = new("Default"); + public bool IsDefault => Default.Equals(Value); - public static readonly TextSize Medium = new("Medium"); - public bool IsMedium => Medium.Equals(Value); + public static readonly TextSize Medium = new("Medium"); + public bool IsMedium => Medium.Equals(Value); - public static readonly TextSize Large = new("Large"); - public bool IsLarge => Large.Equals(Value); + public static readonly TextSize Large = new("Large"); + public bool IsLarge => Large.Equals(Value); - public static readonly TextSize ExtraLarge = new("ExtraLarge"); - public bool IsExtraLarge => ExtraLarge.Equals(Value); + public static readonly TextSize ExtraLarge = new("ExtraLarge"); + public bool IsExtraLarge => ExtraLarge.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class TextWeight(string value) : StringEnum(value, caseSensitive: false) { - public static readonly TextWeight Lighter = new("Lighter"); - public bool IsLighter => Lighter.Equals(Value); + public static readonly TextWeight Lighter = new("Lighter"); + public bool IsLighter => Lighter.Equals(Value); - public static readonly TextWeight Default = new("Default"); - public bool IsDefault => Default.Equals(Value); + public static readonly TextWeight Default = new("Default"); + public bool IsDefault => Default.Equals(Value); - public static readonly TextWeight Bolder = new("Bolder"); - public bool IsBolder => Bolder.Equals(Value); + public static readonly TextWeight Bolder = new("Bolder"); + public bool IsBolder => Bolder.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class TextColor(string value) : StringEnum(value, caseSensitive: false) { - public static readonly TextColor Default = new("Default"); - public bool IsDefault => Default.Equals(Value); + public static readonly TextColor Default = new("Default"); + public bool IsDefault => Default.Equals(Value); - public static readonly TextColor Dark = new("Dark"); - public bool IsDark => Dark.Equals(Value); + public static readonly TextColor Dark = new("Dark"); + public bool IsDark => Dark.Equals(Value); - public static readonly TextColor Light = new("Light"); - public bool IsLight => Light.Equals(Value); + public static readonly TextColor Light = new("Light"); + public bool IsLight => Light.Equals(Value); - public static readonly TextColor Accent = new("Accent"); - public bool IsAccent => Accent.Equals(Value); + public static readonly TextColor Accent = new("Accent"); + public bool IsAccent => Accent.Equals(Value); - public static readonly TextColor Good = new("Good"); - public bool IsGood => Good.Equals(Value); + public static readonly TextColor Good = new("Good"); + public bool IsGood => Good.Equals(Value); - public static readonly TextColor Warning = new("Warning"); - public bool IsWarning => Warning.Equals(Value); + public static readonly TextColor Warning = new("Warning"); + public bool IsWarning => Warning.Equals(Value); - public static readonly TextColor Attention = new("Attention"); - public bool IsAttention => Attention.Equals(Value); + public static readonly TextColor Attention = new("Attention"); + public bool IsAttention => Attention.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class FontType(string value) : StringEnum(value, caseSensitive: false) { - public static readonly FontType Default = new("Default"); - public bool IsDefault => Default.Equals(Value); + public static readonly FontType Default = new("Default"); + public bool IsDefault => Default.Equals(Value); - public static readonly FontType Monospace = new("Monospace"); - public bool IsMonospace => Monospace.Equals(Value); + public static readonly FontType Monospace = new("Monospace"); + public bool IsMonospace => Monospace.Equals(Value); } -[JsonConverter(typeof(JsonConverter))] -public class StyleEnum(string value) : StringEnum(value, caseSensitive: false) +[JsonConverter(typeof(JsonConverter))] +public class TextBlockStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly StyleEnum Compact = new("compact"); - public bool IsCompact => Compact.Equals(Value); + public static readonly TextBlockStyle Default = new("default"); + public bool IsDefault => Default.Equals(Value); - public static readonly StyleEnum Expanded = new("expanded"); - public bool IsExpanded => Expanded.Equals(Value); + public static readonly TextBlockStyle ColumnHeader = new("columnHeader"); + public bool IsColumnHeader => ColumnHeader.Equals(Value); - public static readonly StyleEnum Filtered = new("filtered"); - public bool IsFiltered => Filtered.Equals(Value); + public static readonly TextBlockStyle Heading = new("heading"); + public bool IsHeading => Heading.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ImageStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ImageStyle Default = new("Default"); - public bool IsDefault => Default.Equals(Value); + public static readonly ImageStyle Default = new("Default"); + public bool IsDefault => Default.Equals(Value); - public static readonly ImageStyle Person = new("Person"); - public bool IsPerson => Person.Equals(Value); + public static readonly ImageStyle Person = new("Person"); + public bool IsPerson => Person.Equals(Value); - public static readonly ImageStyle RoundedCorners = new("RoundedCorners"); - public bool IsRoundedCorners => RoundedCorners.Equals(Value); + public static readonly ImageStyle RoundedCorners = new("RoundedCorners"); + public bool IsRoundedCorners => RoundedCorners.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class Size(string value) : StringEnum(value, caseSensitive: false) { - public static readonly Size Auto = new("Auto"); - public bool IsAuto => Auto.Equals(Value); + public static readonly Size Auto = new("Auto"); + public bool IsAuto => Auto.Equals(Value); - public static readonly Size Stretch = new("Stretch"); - public bool IsStretch => Stretch.Equals(Value); + public static readonly Size Stretch = new("Stretch"); + public bool IsStretch => Stretch.Equals(Value); + + public static readonly Size Small = new("Small"); + public bool IsSmall => Small.Equals(Value); + + public static readonly Size Medium = new("Medium"); + public bool IsMedium => Medium.Equals(Value); + + public static readonly Size Large = new("Large"); + public bool IsLarge => Large.Equals(Value); +} - public static readonly Size Small = new("Small"); - public bool IsSmall => Small.Equals(Value); +[JsonConverter(typeof(JsonConverter))] +public class ImageFitMode(string value) : StringEnum(value, caseSensitive: false) +{ + public static readonly ImageFitMode Cover = new("Cover"); + public bool IsCover => Cover.Equals(Value); - public static readonly Size Medium = new("Medium"); - public bool IsMedium => Medium.Equals(Value); + public static readonly ImageFitMode Contain = new("Contain"); + public bool IsContain => Contain.Equals(Value); - public static readonly Size Large = new("Large"); - public bool IsLarge => Large.Equals(Value); + public static readonly ImageFitMode Fill = new("Fill"); + public bool IsFill => Fill.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class InputTextStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly InputTextStyle Text = new("Text"); - public bool IsText => Text.Equals(Value); + public static readonly InputTextStyle Text = new("Text"); + public bool IsText => Text.Equals(Value); + + public static readonly InputTextStyle Tel = new("Tel"); + public bool IsTel => Tel.Equals(Value); + + public static readonly InputTextStyle Url = new("Url"); + public bool IsUrl => Url.Equals(Value); + + public static readonly InputTextStyle Email = new("Email"); + public bool IsEmail => Email.Equals(Value); + + public static readonly InputTextStyle Password = new("Password"); + public bool IsPassword => Password.Equals(Value); +} + +[JsonConverter(typeof(JsonConverter))] +public class AssociatedInputs(string value) : StringEnum(value, caseSensitive: false) +{ + public static readonly AssociatedInputs Auto = new("auto"); + public bool IsAuto => Auto.Equals(Value); - public static readonly InputTextStyle Tel = new("Tel"); - public bool IsTel => Tel.Equals(Value); + public static readonly AssociatedInputs None = new("none"); + public bool IsNone => None.Equals(Value); +} - public static readonly InputTextStyle Url = new("Url"); - public bool IsUrl => Url.Equals(Value); +[JsonConverter(typeof(JsonConverter))] +public class ChoiceSetInputStyle(string value) : StringEnum(value, caseSensitive: false) +{ + public static readonly ChoiceSetInputStyle Compact = new("compact"); + public bool IsCompact => Compact.Equals(Value); - public static readonly InputTextStyle Email = new("Email"); - public bool IsEmail => Email.Equals(Value); + public static readonly ChoiceSetInputStyle Expanded = new("expanded"); + public bool IsExpanded => Expanded.Equals(Value); - public static readonly InputTextStyle Password = new("Password"); - public bool IsPassword => Password.Equals(Value); + public static readonly ChoiceSetInputStyle Filtered = new("filtered"); + public bool IsFiltered => Filtered.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class RatingSize(string value) : StringEnum(value, caseSensitive: false) { - public static readonly RatingSize Medium = new("Medium"); - public bool IsMedium => Medium.Equals(Value); + public static readonly RatingSize Medium = new("Medium"); + public bool IsMedium => Medium.Equals(Value); - public static readonly RatingSize Large = new("Large"); - public bool IsLarge => Large.Equals(Value); + public static readonly RatingSize Large = new("Large"); + public bool IsLarge => Large.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class RatingColor(string value) : StringEnum(value, caseSensitive: false) { - public static readonly RatingColor Neutral = new("Neutral"); - public bool IsNeutral => Neutral.Equals(Value); + public static readonly RatingColor Neutral = new("Neutral"); + public bool IsNeutral => Neutral.Equals(Value); - public static readonly RatingColor Marigold = new("Marigold"); - public bool IsMarigold => Marigold.Equals(Value); + public static readonly RatingColor Marigold = new("Marigold"); + public bool IsMarigold => Marigold.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class RatingStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly RatingStyle Default = new("Default"); - public bool IsDefault => Default.Equals(Value); + public static readonly RatingStyle Default = new("Default"); + public bool IsDefault => Default.Equals(Value); - public static readonly RatingStyle Compact = new("Compact"); - public bool IsCompact => Compact.Equals(Value); + public static readonly RatingStyle Compact = new("Compact"); + public bool IsCompact => Compact.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class IconSize(string value) : StringEnum(value, caseSensitive: false) { - public static readonly IconSize XxSmall = new("xxSmall"); - public bool IsXxSmall => XxSmall.Equals(Value); + public static readonly IconSize XxSmall = new("xxSmall"); + public bool IsXxSmall => XxSmall.Equals(Value); - public static readonly IconSize XSmall = new("xSmall"); - public bool IsXSmall => XSmall.Equals(Value); + public static readonly IconSize XSmall = new("xSmall"); + public bool IsXSmall => XSmall.Equals(Value); - public static readonly IconSize Small = new("Small"); - public bool IsSmall => Small.Equals(Value); + public static readonly IconSize Small = new("Small"); + public bool IsSmall => Small.Equals(Value); - public static readonly IconSize Standard = new("Standard"); - public bool IsStandard => Standard.Equals(Value); + public static readonly IconSize Standard = new("Standard"); + public bool IsStandard => Standard.Equals(Value); - public static readonly IconSize Medium = new("Medium"); - public bool IsMedium => Medium.Equals(Value); + public static readonly IconSize Medium = new("Medium"); + public bool IsMedium => Medium.Equals(Value); - public static readonly IconSize Large = new("Large"); - public bool IsLarge => Large.Equals(Value); + public static readonly IconSize Large = new("Large"); + public bool IsLarge => Large.Equals(Value); - public static readonly IconSize XLarge = new("xLarge"); - public bool IsXLarge => XLarge.Equals(Value); + public static readonly IconSize XLarge = new("xLarge"); + public bool IsXLarge => XLarge.Equals(Value); - public static readonly IconSize XxLarge = new("xxLarge"); - public bool IsXxLarge => XxLarge.Equals(Value); + public static readonly IconSize XxLarge = new("xxLarge"); + public bool IsXxLarge => XxLarge.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class IconStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly IconStyle Regular = new("Regular"); - public bool IsRegular => Regular.Equals(Value); + public static readonly IconStyle Regular = new("Regular"); + public bool IsRegular => Regular.Equals(Value); - public static readonly IconStyle Filled = new("Filled"); - public bool IsFilled => Filled.Equals(Value); + public static readonly IconStyle Filled = new("Filled"); + public bool IsFilled => Filled.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class CarouselPageAnimation(string value) : StringEnum(value, caseSensitive: false) { - public static readonly CarouselPageAnimation Slide = new("Slide"); - public bool IsSlide => Slide.Equals(Value); + public static readonly CarouselPageAnimation Slide = new("Slide"); + public bool IsSlide => Slide.Equals(Value); - public static readonly CarouselPageAnimation CrossFade = new("CrossFade"); - public bool IsCrossFade => CrossFade.Equals(Value); + public static readonly CarouselPageAnimation CrossFade = new("CrossFade"); + public bool IsCrossFade => CrossFade.Equals(Value); - public static readonly CarouselPageAnimation None = new("None"); - public bool IsNone => None.Equals(Value); + public static readonly CarouselPageAnimation None = new("None"); + public bool IsNone => None.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class BadgeIconPosition(string value) : StringEnum(value, caseSensitive: false) { - public static readonly BadgeIconPosition Before = new("Before"); - public bool IsBefore => Before.Equals(Value); + public static readonly BadgeIconPosition Before = new("Before"); + public bool IsBefore => Before.Equals(Value); - public static readonly BadgeIconPosition After = new("After"); - public bool IsAfter => After.Equals(Value); + public static readonly BadgeIconPosition After = new("After"); + public bool IsAfter => After.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class BadgeAppearance(string value) : StringEnum(value, caseSensitive: false) { - public static readonly BadgeAppearance Filled = new("Filled"); - public bool IsFilled => Filled.Equals(Value); + public static readonly BadgeAppearance Filled = new("Filled"); + public bool IsFilled => Filled.Equals(Value); - public static readonly BadgeAppearance Tint = new("Tint"); - public bool IsTint => Tint.Equals(Value); + public static readonly BadgeAppearance Tint = new("Tint"); + public bool IsTint => Tint.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class BadgeSize(string value) : StringEnum(value, caseSensitive: false) { - public static readonly BadgeSize Medium = new("Medium"); - public bool IsMedium => Medium.Equals(Value); + public static readonly BadgeSize Medium = new("Medium"); + public bool IsMedium => Medium.Equals(Value); - public static readonly BadgeSize Large = new("Large"); - public bool IsLarge => Large.Equals(Value); + public static readonly BadgeSize Large = new("Large"); + public bool IsLarge => Large.Equals(Value); - public static readonly BadgeSize ExtraLarge = new("ExtraLarge"); - public bool IsExtraLarge => ExtraLarge.Equals(Value); + public static readonly BadgeSize ExtraLarge = new("ExtraLarge"); + public bool IsExtraLarge => ExtraLarge.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class BadgeShape(string value) : StringEnum(value, caseSensitive: false) { - public static readonly BadgeShape Square = new("Square"); - public bool IsSquare => Square.Equals(Value); + public static readonly BadgeShape Square = new("Square"); + public bool IsSquare => Square.Equals(Value); - public static readonly BadgeShape Rounded = new("Rounded"); - public bool IsRounded => Rounded.Equals(Value); + public static readonly BadgeShape Rounded = new("Rounded"); + public bool IsRounded => Rounded.Equals(Value); - public static readonly BadgeShape Circular = new("Circular"); - public bool IsCircular => Circular.Equals(Value); + public static readonly BadgeShape Circular = new("Circular"); + public bool IsCircular => Circular.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class BadgeStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly BadgeStyle Default = new("Default"); - public bool IsDefault => Default.Equals(Value); + public static readonly BadgeStyle Default = new("Default"); + public bool IsDefault => Default.Equals(Value); + + public static readonly BadgeStyle Subtle = new("Subtle"); + public bool IsSubtle => Subtle.Equals(Value); + + public static readonly BadgeStyle Informative = new("Informative"); + public bool IsInformative => Informative.Equals(Value); + + public static readonly BadgeStyle Accent = new("Accent"); + public bool IsAccent => Accent.Equals(Value); + + public static readonly BadgeStyle Good = new("Good"); + public bool IsGood => Good.Equals(Value); + + public static readonly BadgeStyle Attention = new("Attention"); + public bool IsAttention => Attention.Equals(Value); + + public static readonly BadgeStyle Warning = new("Warning"); + public bool IsWarning => Warning.Equals(Value); +} + +[JsonConverter(typeof(JsonConverter))] +public class ProgressRingLabelPosition(string value) : StringEnum(value, caseSensitive: false) +{ + public static readonly ProgressRingLabelPosition Before = new("Before"); + public bool IsBefore => Before.Equals(Value); + + public static readonly ProgressRingLabelPosition After = new("After"); + public bool IsAfter => After.Equals(Value); + + public static readonly ProgressRingLabelPosition Above = new("Above"); + public bool IsAbove => Above.Equals(Value); + + public static readonly ProgressRingLabelPosition Below = new("Below"); + public bool IsBelow => Below.Equals(Value); +} + +[JsonConverter(typeof(JsonConverter))] +public class ProgressRingSize(string value) : StringEnum(value, caseSensitive: false) +{ + public static readonly ProgressRingSize Tiny = new("Tiny"); + public bool IsTiny => Tiny.Equals(Value); + + public static readonly ProgressRingSize Small = new("Small"); + public bool IsSmall => Small.Equals(Value); - public static readonly BadgeStyle Subtle = new("Subtle"); - public bool IsSubtle => Subtle.Equals(Value); + public static readonly ProgressRingSize Medium = new("Medium"); + public bool IsMedium => Medium.Equals(Value); - public static readonly BadgeStyle Informative = new("Informative"); - public bool IsInformative => Informative.Equals(Value); + public static readonly ProgressRingSize Large = new("Large"); + public bool IsLarge => Large.Equals(Value); +} - public static readonly BadgeStyle Accent = new("Accent"); - public bool IsAccent => Accent.Equals(Value); +[JsonConverter(typeof(JsonConverter))] +public class ProgressBarColor(string value) : StringEnum(value, caseSensitive: false) +{ + public static readonly ProgressBarColor Accent = new("Accent"); + public bool IsAccent => Accent.Equals(Value); - public static readonly BadgeStyle Good = new("Good"); - public bool IsGood => Good.Equals(Value); + public static readonly ProgressBarColor Good = new("Good"); + public bool IsGood => Good.Equals(Value); - public static readonly BadgeStyle Attention = new("Attention"); - public bool IsAttention => Attention.Equals(Value); + public static readonly ProgressBarColor Warning = new("Warning"); + public bool IsWarning => Warning.Equals(Value); - public static readonly BadgeStyle Warning = new("Warning"); - public bool IsWarning => Warning.Equals(Value); + public static readonly ProgressBarColor Attention = new("Attention"); + public bool IsAttention => Attention.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ChartColorSet(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ChartColorSet Categorical = new("categorical"); - public bool IsCategorical => Categorical.Equals(Value); + public static readonly ChartColorSet Categorical = new("categorical"); + public bool IsCategorical => Categorical.Equals(Value); + + public static readonly ChartColorSet Sequential = new("sequential"); + public bool IsSequential => Sequential.Equals(Value); + + public static readonly ChartColorSet Sequentialred = new("sequentialred"); + public bool IsSequentialred => Sequentialred.Equals(Value); - public static readonly ChartColorSet Sequential = new("sequential"); - public bool IsSequential => Sequential.Equals(Value); + public static readonly ChartColorSet Sequentialgreen = new("sequentialgreen"); + public bool IsSequentialgreen => Sequentialgreen.Equals(Value); - public static readonly ChartColorSet Diverging = new("diverging"); - public bool IsDiverging => Diverging.Equals(Value); + public static readonly ChartColorSet Sequentialyellow = new("sequentialyellow"); + public bool IsSequentialyellow => Sequentialyellow.Equals(Value); + + public static readonly ChartColorSet Diverging = new("diverging"); + public bool IsDiverging => Diverging.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ChartColor(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ChartColor Good = new("good"); - public bool IsGood => Good.Equals(Value); + public static readonly ChartColor Good = new("good"); + public bool IsGood => Good.Equals(Value); + + public static readonly ChartColor Warning = new("warning"); + public bool IsWarning => Warning.Equals(Value); + + public static readonly ChartColor Attention = new("attention"); + public bool IsAttention => Attention.Equals(Value); + + public static readonly ChartColor Neutral = new("neutral"); + public bool IsNeutral => Neutral.Equals(Value); + + public static readonly ChartColor CategoricalRed = new("categoricalRed"); + public bool IsCategoricalRed => CategoricalRed.Equals(Value); + + public static readonly ChartColor CategoricalPurple = new("categoricalPurple"); + public bool IsCategoricalPurple => CategoricalPurple.Equals(Value); + + public static readonly ChartColor CategoricalLavender = new("categoricalLavender"); + public bool IsCategoricalLavender => CategoricalLavender.Equals(Value); + + public static readonly ChartColor CategoricalBlue = new("categoricalBlue"); + public bool IsCategoricalBlue => CategoricalBlue.Equals(Value); + + public static readonly ChartColor CategoricalLightBlue = new("categoricalLightBlue"); + public bool IsCategoricalLightBlue => CategoricalLightBlue.Equals(Value); + + public static readonly ChartColor CategoricalTeal = new("categoricalTeal"); + public bool IsCategoricalTeal => CategoricalTeal.Equals(Value); + + public static readonly ChartColor CategoricalGreen = new("categoricalGreen"); + public bool IsCategoricalGreen => CategoricalGreen.Equals(Value); + + public static readonly ChartColor CategoricalLime = new("categoricalLime"); + public bool IsCategoricalLime => CategoricalLime.Equals(Value); + + public static readonly ChartColor CategoricalMarigold = new("categoricalMarigold"); + public bool IsCategoricalMarigold => CategoricalMarigold.Equals(Value); + + public static readonly ChartColor Sequential1 = new("sequential1"); + public bool IsSequential1 => Sequential1.Equals(Value); + + public static readonly ChartColor Sequential2 = new("sequential2"); + public bool IsSequential2 => Sequential2.Equals(Value); + + public static readonly ChartColor Sequential3 = new("sequential3"); + public bool IsSequential3 => Sequential3.Equals(Value); + + public static readonly ChartColor Sequential4 = new("sequential4"); + public bool IsSequential4 => Sequential4.Equals(Value); + + public static readonly ChartColor Sequential5 = new("sequential5"); + public bool IsSequential5 => Sequential5.Equals(Value); + + public static readonly ChartColor Sequential6 = new("sequential6"); + public bool IsSequential6 => Sequential6.Equals(Value); + + public static readonly ChartColor Sequential7 = new("sequential7"); + public bool IsSequential7 => Sequential7.Equals(Value); + + public static readonly ChartColor Sequential8 = new("sequential8"); + public bool IsSequential8 => Sequential8.Equals(Value); + + public static readonly ChartColor DivergingBlue = new("divergingBlue"); + public bool IsDivergingBlue => DivergingBlue.Equals(Value); + + public static readonly ChartColor DivergingLightBlue = new("divergingLightBlue"); + public bool IsDivergingLightBlue => DivergingLightBlue.Equals(Value); + + public static readonly ChartColor DivergingCyan = new("divergingCyan"); + public bool IsDivergingCyan => DivergingCyan.Equals(Value); - public static readonly ChartColor Warning = new("warning"); - public bool IsWarning => Warning.Equals(Value); + public static readonly ChartColor DivergingTeal = new("divergingTeal"); + public bool IsDivergingTeal => DivergingTeal.Equals(Value); - public static readonly ChartColor Attention = new("attention"); - public bool IsAttention => Attention.Equals(Value); + public static readonly ChartColor DivergingYellow = new("divergingYellow"); + public bool IsDivergingYellow => DivergingYellow.Equals(Value); - public static readonly ChartColor Neutral = new("neutral"); - public bool IsNeutral => Neutral.Equals(Value); + public static readonly ChartColor DivergingPeach = new("divergingPeach"); + public bool IsDivergingPeach => DivergingPeach.Equals(Value); - public static readonly ChartColor CategoricalRed = new("categoricalRed"); - public bool IsCategoricalRed => CategoricalRed.Equals(Value); + public static readonly ChartColor DivergingLightRed = new("divergingLightRed"); + public bool IsDivergingLightRed => DivergingLightRed.Equals(Value); - public static readonly ChartColor CategoricalPurple = new("categoricalPurple"); - public bool IsCategoricalPurple => CategoricalPurple.Equals(Value); + public static readonly ChartColor DivergingRed = new("divergingRed"); + public bool IsDivergingRed => DivergingRed.Equals(Value); - public static readonly ChartColor CategoricalLavender = new("categoricalLavender"); - public bool IsCategoricalLavender => CategoricalLavender.Equals(Value); + public static readonly ChartColor DivergingMaroon = new("divergingMaroon"); + public bool IsDivergingMaroon => DivergingMaroon.Equals(Value); - public static readonly ChartColor CategoricalBlue = new("categoricalBlue"); - public bool IsCategoricalBlue => CategoricalBlue.Equals(Value); + public static readonly ChartColor DivergingGray = new("divergingGray"); + public bool IsDivergingGray => DivergingGray.Equals(Value); - public static readonly ChartColor CategoricalLightBlue = new("categoricalLightBlue"); - public bool IsCategoricalLightBlue => CategoricalLightBlue.Equals(Value); + public static readonly ChartColor SequentialRed1 = new("sequentialRed1"); + public bool IsSequentialRed1 => SequentialRed1.Equals(Value); - public static readonly ChartColor CategoricalTeal = new("categoricalTeal"); - public bool IsCategoricalTeal => CategoricalTeal.Equals(Value); + public static readonly ChartColor SequentialRed2 = new("sequentialRed2"); + public bool IsSequentialRed2 => SequentialRed2.Equals(Value); - public static readonly ChartColor CategoricalGreen = new("categoricalGreen"); - public bool IsCategoricalGreen => CategoricalGreen.Equals(Value); + public static readonly ChartColor SequentialRed3 = new("sequentialRed3"); + public bool IsSequentialRed3 => SequentialRed3.Equals(Value); - public static readonly ChartColor CategoricalLime = new("categoricalLime"); - public bool IsCategoricalLime => CategoricalLime.Equals(Value); + public static readonly ChartColor SequentialRed4 = new("sequentialRed4"); + public bool IsSequentialRed4 => SequentialRed4.Equals(Value); - public static readonly ChartColor CategoricalMarigold = new("categoricalMarigold"); - public bool IsCategoricalMarigold => CategoricalMarigold.Equals(Value); + public static readonly ChartColor SequentialRed5 = new("sequentialRed5"); + public bool IsSequentialRed5 => SequentialRed5.Equals(Value); - public static readonly ChartColor Sequential1 = new("sequential1"); - public bool IsSequential1 => Sequential1.Equals(Value); + public static readonly ChartColor SequentialRed6 = new("sequentialRed6"); + public bool IsSequentialRed6 => SequentialRed6.Equals(Value); - public static readonly ChartColor Sequential2 = new("sequential2"); - public bool IsSequential2 => Sequential2.Equals(Value); + public static readonly ChartColor SequentialRed7 = new("sequentialRed7"); + public bool IsSequentialRed7 => SequentialRed7.Equals(Value); - public static readonly ChartColor Sequential3 = new("sequential3"); - public bool IsSequential3 => Sequential3.Equals(Value); + public static readonly ChartColor SequentialRed8 = new("sequentialRed8"); + public bool IsSequentialRed8 => SequentialRed8.Equals(Value); - public static readonly ChartColor Sequential4 = new("sequential4"); - public bool IsSequential4 => Sequential4.Equals(Value); + public static readonly ChartColor SequentialGreen1 = new("sequentialGreen1"); + public bool IsSequentialGreen1 => SequentialGreen1.Equals(Value); - public static readonly ChartColor Sequential5 = new("sequential5"); - public bool IsSequential5 => Sequential5.Equals(Value); + public static readonly ChartColor SequentialGreen2 = new("sequentialGreen2"); + public bool IsSequentialGreen2 => SequentialGreen2.Equals(Value); - public static readonly ChartColor Sequential6 = new("sequential6"); - public bool IsSequential6 => Sequential6.Equals(Value); + public static readonly ChartColor SequentialGreen3 = new("sequentialGreen3"); + public bool IsSequentialGreen3 => SequentialGreen3.Equals(Value); - public static readonly ChartColor Sequential7 = new("sequential7"); - public bool IsSequential7 => Sequential7.Equals(Value); + public static readonly ChartColor SequentialGreen4 = new("sequentialGreen4"); + public bool IsSequentialGreen4 => SequentialGreen4.Equals(Value); - public static readonly ChartColor Sequential8 = new("sequential8"); - public bool IsSequential8 => Sequential8.Equals(Value); + public static readonly ChartColor SequentialGreen5 = new("sequentialGreen5"); + public bool IsSequentialGreen5 => SequentialGreen5.Equals(Value); - public static readonly ChartColor DivergingBlue = new("divergingBlue"); - public bool IsDivergingBlue => DivergingBlue.Equals(Value); + public static readonly ChartColor SequentialGreen6 = new("sequentialGreen6"); + public bool IsSequentialGreen6 => SequentialGreen6.Equals(Value); - public static readonly ChartColor DivergingLightBlue = new("divergingLightBlue"); - public bool IsDivergingLightBlue => DivergingLightBlue.Equals(Value); + public static readonly ChartColor SequentialGreen7 = new("sequentialGreen7"); + public bool IsSequentialGreen7 => SequentialGreen7.Equals(Value); - public static readonly ChartColor DivergingCyan = new("divergingCyan"); - public bool IsDivergingCyan => DivergingCyan.Equals(Value); + public static readonly ChartColor SequentialGreen8 = new("sequentialGreen8"); + public bool IsSequentialGreen8 => SequentialGreen8.Equals(Value); - public static readonly ChartColor DivergingTeal = new("divergingTeal"); - public bool IsDivergingTeal => DivergingTeal.Equals(Value); + public static readonly ChartColor SequentialYellow1 = new("sequentialYellow1"); + public bool IsSequentialYellow1 => SequentialYellow1.Equals(Value); - public static readonly ChartColor DivergingYellow = new("divergingYellow"); - public bool IsDivergingYellow => DivergingYellow.Equals(Value); + public static readonly ChartColor SequentialYellow2 = new("sequentialYellow2"); + public bool IsSequentialYellow2 => SequentialYellow2.Equals(Value); - public static readonly ChartColor DivergingPeach = new("divergingPeach"); - public bool IsDivergingPeach => DivergingPeach.Equals(Value); + public static readonly ChartColor SequentialYellow3 = new("sequentialYellow3"); + public bool IsSequentialYellow3 => SequentialYellow3.Equals(Value); - public static readonly ChartColor DivergingLightRed = new("divergingLightRed"); - public bool IsDivergingLightRed => DivergingLightRed.Equals(Value); + public static readonly ChartColor SequentialYellow4 = new("sequentialYellow4"); + public bool IsSequentialYellow4 => SequentialYellow4.Equals(Value); - public static readonly ChartColor DivergingRed = new("divergingRed"); - public bool IsDivergingRed => DivergingRed.Equals(Value); + public static readonly ChartColor SequentialYellow5 = new("sequentialYellow5"); + public bool IsSequentialYellow5 => SequentialYellow5.Equals(Value); - public static readonly ChartColor DivergingMaroon = new("divergingMaroon"); - public bool IsDivergingMaroon => DivergingMaroon.Equals(Value); + public static readonly ChartColor SequentialYellow6 = new("sequentialYellow6"); + public bool IsSequentialYellow6 => SequentialYellow6.Equals(Value); - public static readonly ChartColor DivergingGray = new("divergingGray"); - public bool IsDivergingGray => DivergingGray.Equals(Value); + public static readonly ChartColor SequentialYellow7 = new("sequentialYellow7"); + public bool IsSequentialYellow7 => SequentialYellow7.Equals(Value); + + public static readonly ChartColor SequentialYellow8 = new("sequentialYellow8"); + public bool IsSequentialYellow8 => SequentialYellow8.Equals(Value); +} + +[JsonConverter(typeof(JsonConverter))] +public class DonutThickness(string value) : StringEnum(value, caseSensitive: false) +{ + public static readonly DonutThickness Thin = new("Thin"); + public bool IsThin => Thin.Equals(Value); + + public static readonly DonutThickness Thick = new("Thick"); + public bool IsThick => Thick.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class HorizontalBarChartDisplayMode(string value) : StringEnum(value, caseSensitive: false) { - public static readonly HorizontalBarChartDisplayMode AbsoluteWithAxis = new("AbsoluteWithAxis"); - public bool IsAbsoluteWithAxis => AbsoluteWithAxis.Equals(Value); + public static readonly HorizontalBarChartDisplayMode AbsoluteWithAxis = new("AbsoluteWithAxis"); + public bool IsAbsoluteWithAxis => AbsoluteWithAxis.Equals(Value); - public static readonly HorizontalBarChartDisplayMode AbsoluteNoAxis = new("AbsoluteNoAxis"); - public bool IsAbsoluteNoAxis => AbsoluteNoAxis.Equals(Value); + public static readonly HorizontalBarChartDisplayMode AbsoluteNoAxis = new("AbsoluteNoAxis"); + public bool IsAbsoluteNoAxis => AbsoluteNoAxis.Equals(Value); - public static readonly HorizontalBarChartDisplayMode PartToWhole = new("PartToWhole"); - public bool IsPartToWhole => PartToWhole.Equals(Value); + public static readonly HorizontalBarChartDisplayMode PartToWhole = new("PartToWhole"); + public bool IsPartToWhole => PartToWhole.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class GaugeChartValueFormat(string value) : StringEnum(value, caseSensitive: false) { - public static readonly GaugeChartValueFormat Percentage = new("Percentage"); - public bool IsPercentage => Percentage.Equals(Value); + public static readonly GaugeChartValueFormat Percentage = new("Percentage"); + public bool IsPercentage => Percentage.Equals(Value); - public static readonly GaugeChartValueFormat Fraction = new("Fraction"); - public bool IsFraction => Fraction.Equals(Value); + public static readonly GaugeChartValueFormat Fraction = new("Fraction"); + public bool IsFraction => Fraction.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class CodeLanguage(string value) : StringEnum(value, caseSensitive: false) { - public static readonly CodeLanguage Bash = new("Bash"); - public bool IsBash => Bash.Equals(Value); + public static readonly CodeLanguage Bash = new("Bash"); + public bool IsBash => Bash.Equals(Value); + + public static readonly CodeLanguage C = new("C"); + public bool IsC => C.Equals(Value); + + public static readonly CodeLanguage Cpp = new("Cpp"); + public bool IsCpp => Cpp.Equals(Value); + + public static readonly CodeLanguage CSharp = new("CSharp"); + public bool IsCSharp => CSharp.Equals(Value); - public static readonly CodeLanguage C = new("C"); - public bool IsC => C.Equals(Value); + public static readonly CodeLanguage Css = new("Css"); + public bool IsCss => Css.Equals(Value); - public static readonly CodeLanguage Cpp = new("Cpp"); - public bool IsCpp => Cpp.Equals(Value); + public static readonly CodeLanguage Dos = new("Dos"); + public bool IsDos => Dos.Equals(Value); - public static readonly CodeLanguage CSharp = new("CSharp"); - public bool IsCSharp => CSharp.Equals(Value); + public static readonly CodeLanguage Go = new("Go"); + public bool IsGo => Go.Equals(Value); - public static readonly CodeLanguage Css = new("Css"); - public bool IsCss => Css.Equals(Value); + public static readonly CodeLanguage Graphql = new("Graphql"); + public bool IsGraphql => Graphql.Equals(Value); - public static readonly CodeLanguage Dos = new("Dos"); - public bool IsDos => Dos.Equals(Value); + public static readonly CodeLanguage Html = new("Html"); + public bool IsHtml => Html.Equals(Value); - public static readonly CodeLanguage Go = new("Go"); - public bool IsGo => Go.Equals(Value); + public static readonly CodeLanguage Java = new("Java"); + public bool IsJava => Java.Equals(Value); - public static readonly CodeLanguage Graphql = new("Graphql"); - public bool IsGraphql => Graphql.Equals(Value); + public static readonly CodeLanguage JavaScript = new("JavaScript"); + public bool IsJavaScript => JavaScript.Equals(Value); - public static readonly CodeLanguage Html = new("Html"); - public bool IsHtml => Html.Equals(Value); + public static readonly CodeLanguage Json = new("Json"); + public bool IsJson => Json.Equals(Value); - public static readonly CodeLanguage Java = new("Java"); - public bool IsJava => Java.Equals(Value); + public static readonly CodeLanguage ObjectiveC = new("ObjectiveC"); + public bool IsObjectiveC => ObjectiveC.Equals(Value); - public static readonly CodeLanguage JavaScript = new("JavaScript"); - public bool IsJavaScript => JavaScript.Equals(Value); + public static readonly CodeLanguage Perl = new("Perl"); + public bool IsPerl => Perl.Equals(Value); - public static readonly CodeLanguage Json = new("Json"); - public bool IsJson => Json.Equals(Value); + public static readonly CodeLanguage Php = new("Php"); + public bool IsPhp => Php.Equals(Value); - public static readonly CodeLanguage ObjectiveC = new("ObjectiveC"); - public bool IsObjectiveC => ObjectiveC.Equals(Value); + public static readonly CodeLanguage PlainText = new("PlainText"); + public bool IsPlainText => PlainText.Equals(Value); - public static readonly CodeLanguage Perl = new("Perl"); - public bool IsPerl => Perl.Equals(Value); + public static readonly CodeLanguage PowerShell = new("PowerShell"); + public bool IsPowerShell => PowerShell.Equals(Value); - public static readonly CodeLanguage Php = new("Php"); - public bool IsPhp => Php.Equals(Value); + public static readonly CodeLanguage Python = new("Python"); + public bool IsPython => Python.Equals(Value); - public static readonly CodeLanguage PlainText = new("PlainText"); - public bool IsPlainText => PlainText.Equals(Value); + public static readonly CodeLanguage Sql = new("Sql"); + public bool IsSql => Sql.Equals(Value); - public static readonly CodeLanguage PowerShell = new("PowerShell"); - public bool IsPowerShell => PowerShell.Equals(Value); + public static readonly CodeLanguage TypeScript = new("TypeScript"); + public bool IsTypeScript => TypeScript.Equals(Value); - public static readonly CodeLanguage Python = new("Python"); - public bool IsPython => Python.Equals(Value); + public static readonly CodeLanguage VbNet = new("VbNet"); + public bool IsVbNet => VbNet.Equals(Value); - public static readonly CodeLanguage Sql = new("Sql"); - public bool IsSql => Sql.Equals(Value); + public static readonly CodeLanguage Verilog = new("Verilog"); + public bool IsVerilog => Verilog.Equals(Value); - public static readonly CodeLanguage TypeScript = new("TypeScript"); - public bool IsTypeScript => TypeScript.Equals(Value); + public static readonly CodeLanguage Vhdl = new("Vhdl"); + public bool IsVhdl => Vhdl.Equals(Value); - public static readonly CodeLanguage VbNet = new("VbNet"); - public bool IsVbNet => VbNet.Equals(Value); + public static readonly CodeLanguage Xml = new("Xml"); + public bool IsXml => Xml.Equals(Value); +} + +[JsonConverter(typeof(JsonConverter))] +public class PersonaIconStyle(string value) : StringEnum(value, caseSensitive: false) +{ + public static readonly PersonaIconStyle ProfilePicture = new("profilePicture"); + public bool IsProfilePicture => ProfilePicture.Equals(Value); + + public static readonly PersonaIconStyle ContactCard = new("contactCard"); + public bool IsContactCard => ContactCard.Equals(Value); - public static readonly CodeLanguage Verilog = new("Verilog"); - public bool IsVerilog => Verilog.Equals(Value); + public static readonly PersonaIconStyle None = new("none"); + public bool IsNone => None.Equals(Value); +} + +[JsonConverter(typeof(JsonConverter))] +public class PersonaDisplayStyle(string value) : StringEnum(value, caseSensitive: false) +{ + public static readonly PersonaDisplayStyle IconAndName = new("iconAndName"); + public bool IsIconAndName => IconAndName.Equals(Value); - public static readonly CodeLanguage Vhdl = new("Vhdl"); - public bool IsVhdl => Vhdl.Equals(Value); + public static readonly PersonaDisplayStyle IconOnly = new("iconOnly"); + public bool IsIconOnly => IconOnly.Equals(Value); - public static readonly CodeLanguage Xml = new("Xml"); - public bool IsXml => Xml.Equals(Value); + public static readonly PersonaDisplayStyle NameOnly = new("nameOnly"); + public bool IsNameOnly => NameOnly.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class FallbackElement(string value) : StringEnum(value, caseSensitive: false) { - public static readonly FallbackElement Drop = new("drop"); - public bool IsDrop => Drop.Equals(Value); + public static readonly FallbackElement Drop = new("drop"); + public bool IsDrop => Drop.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ImageSize(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ImageSize Small = new("Small"); - public bool IsSmall => Small.Equals(Value); + public static readonly ImageSize Small = new("Small"); + public bool IsSmall => Small.Equals(Value); - public static readonly ImageSize Medium = new("Medium"); - public bool IsMedium => Medium.Equals(Value); + public static readonly ImageSize Medium = new("Medium"); + public bool IsMedium => Medium.Equals(Value); - public static readonly ImageSize Large = new("Large"); - public bool IsLarge => Large.Equals(Value); + public static readonly ImageSize Large = new("Large"); + public bool IsLarge => Large.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class SizeEnum(string value) : StringEnum(value, caseSensitive: false) { - public static readonly SizeEnum Small = new("Small"); - public bool IsSmall => Small.Equals(Value); + public static readonly SizeEnum Small = new("Small"); + public bool IsSmall => Small.Equals(Value); - public static readonly SizeEnum Default = new("Default"); - public bool IsDefault => Default.Equals(Value); + public static readonly SizeEnum Default = new("Default"); + public bool IsDefault => Default.Equals(Value); - public static readonly SizeEnum Medium = new("Medium"); - public bool IsMedium => Medium.Equals(Value); + public static readonly SizeEnum Medium = new("Medium"); + public bool IsMedium => Medium.Equals(Value); - public static readonly SizeEnum Large = new("Large"); - public bool IsLarge => Large.Equals(Value); + public static readonly SizeEnum Large = new("Large"); + public bool IsLarge => Large.Equals(Value); - public static readonly SizeEnum ExtraLarge = new("ExtraLarge"); - public bool IsExtraLarge => ExtraLarge.Equals(Value); + public static readonly SizeEnum ExtraLarge = new("ExtraLarge"); + public bool IsExtraLarge => ExtraLarge.Equals(Value); } -[JsonConverter(typeof(JsonConverter))] -public class ThemeName(string value) : StringEnum(value, caseSensitive: false) +[JsonConverter(typeof(JsonConverter))] +public class PopoverPosition(string value) : StringEnum(value, caseSensitive: false) +{ + public static readonly PopoverPosition Above = new("Above"); + public bool IsAbove => Above.Equals(Value); + + public static readonly PopoverPosition Below = new("Below"); + public bool IsBelow => Below.Equals(Value); + + public static readonly PopoverPosition Before = new("Before"); + public bool IsBefore => Before.Equals(Value); + + public static readonly PopoverPosition After = new("After"); + public bool IsAfter => After.Equals(Value); +} + +[JsonConverter(typeof(JsonConverter))] +public class FallbackAction(string value) : StringEnum(value, caseSensitive: false) +{ + public static readonly FallbackAction Drop = new("drop"); + public bool IsDrop => Drop.Equals(Value); +} + +[JsonConverter(typeof(JsonConverter))] +public class ImageInsertPosition(string value) : StringEnum(value, caseSensitive: false) +{ + public static readonly ImageInsertPosition Selection = new("Selection"); + public bool IsSelection => Selection.Equals(Value); + + public static readonly ImageInsertPosition Top = new("Top"); + public bool IsTop => Top.Equals(Value); + + public static readonly ImageInsertPosition Bottom = new("Bottom"); + public bool IsBottom => Bottom.Equals(Value); +} + +[JsonConverter(typeof(JsonConverter))] +public class Version(string value) : StringEnum(value, caseSensitive: false) +{ + public static readonly Version Version1_0 = new("1.0"); + public bool IsVersion1_0 => Version1_0.Equals(Value); + + public static readonly Version Version1_1 = new("1.1"); + public bool IsVersion1_1 => Version1_1.Equals(Value); + + public static readonly Version Version1_2 = new("1.2"); + public bool IsVersion1_2 => Version1_2.Equals(Value); + + public static readonly Version Version1_3 = new("1.3"); + public bool IsVersion1_3 => Version1_3.Equals(Value); + + public static readonly Version Version1_4 = new("1.4"); + public bool IsVersion1_4 => Version1_4.Equals(Value); + + public static readonly Version Version1_5 = new("1.5"); + public bool IsVersion1_5 => Version1_5.Equals(Value); + + public static readonly Version Version1_6 = new("1.6"); + public bool IsVersion1_6 => Version1_6.Equals(Value); +} + +[JsonConverter(typeof(JsonConverter))] +public class TeamsCardWidth(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ThemeName Light = new("Light"); - public bool IsLight => Light.Equals(Value); + public static readonly TeamsCardWidth Full = new("full"); + public bool IsFull => Full.Equals(Value); +} + +[JsonConverter(typeof(JsonConverter))] +public class MentionType(string value) : StringEnum(value, caseSensitive: false) +{ + public static readonly MentionType Person = new("Person"); + public bool IsPerson => Person.Equals(Value); - public static readonly ThemeName Dark = new("Dark"); - public bool IsDark => Dark.Equals(Value); + public static readonly MentionType Tag = new("Tag"); + public bool IsTag => Tag.Equals(Value); } internal record ObjectType(string[] DiscriminatorPropertyNames, string DiscriminatorValue, Type Type) { } -public abstract class SerializableObject { } +public abstract class SerializableObject {} internal sealed class CardElementJsonConverter : JsonConverter { - private static readonly List _typeMap = new() + private static readonly List _typeMap = new() { new ObjectType(["type"], "AdaptiveCard", typeof(AdaptiveCard)), - new ObjectType(["type"], "Container", typeof(Container)), new ObjectType(["type"], "ActionSet", typeof(ActionSet)), + new ObjectType(["type"], "Container", typeof(Container)), new ObjectType(["type"], "ColumnSet", typeof(ColumnSet)), new ObjectType(["type"], "Media", typeof(Media)), new ObjectType(["type"], "RichTextBlock", typeof(RichTextBlock)), @@ -829,6 +1036,8 @@ internal sealed class CardElementJsonConverter : JsonConverter new ObjectType(["type"], "Icon", typeof(Icon)), new ObjectType(["type"], "Carousel", typeof(Carousel)), new ObjectType(["type"], "Badge", typeof(Badge)), + new ObjectType(["type"], "ProgressRing", typeof(ProgressRing)), + new ObjectType(["type"], "ProgressBar", typeof(ProgressBar)), new ObjectType(["type"], "Chart.Donut", typeof(DonutChart)), new ObjectType(["type"], "Chart.Pie", typeof(PieChart)), new ObjectType(["type"], "Chart.VerticalBar.Grouped", typeof(GroupedVerticalBarChart)), @@ -852,15114 +1061,15788 @@ internal sealed class CardElementJsonConverter : JsonConverter new ObjectType(["type"], "Column", typeof(Column)), }; - public override CardElement? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TokenType == JsonTokenType.Null) return null; + public override CardElement? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.Null) return null; + + using var doc = JsonDocument.ParseValue(ref reader); + var root = doc.RootElement; - using var doc = JsonDocument.ParseValue(ref reader); - var root = doc.RootElement; + foreach (var type in _typeMap) + { + var discriminatorPropertyValues = new List(); - foreach (var type in _typeMap) + foreach (var propName in type.DiscriminatorPropertyNames) + { + if (root.TryGetProperty(propName, out var prop) && prop.ValueKind == JsonValueKind.String) { - var discriminatorPropertyValues = new List(); - - foreach (var propName in type.DiscriminatorPropertyNames) - { - if (root.TryGetProperty(propName, out var prop) && prop.ValueKind == JsonValueKind.String) - { - discriminatorPropertyValues.Insert(0, prop.GetString()); - } - } - - if (string.Join("", discriminatorPropertyValues) == type.DiscriminatorValue) - { - return (CardElement?)JsonSerializer.Deserialize(root.GetRawText(), type.Type, options); - } + discriminatorPropertyValues.Insert(0, prop.GetString()); } + } - throw new NotSupportedException($"Unable to deserialize '{root.GetRawText()}'."); + if (string.Join("", discriminatorPropertyValues) == type.DiscriminatorValue) + { + return (CardElement?)JsonSerializer.Deserialize(root.GetRawText(), type.Type, options); + } } - public override void Write(Utf8JsonWriter writer, CardElement value, JsonSerializerOptions options) - { - JsonSerializer.Serialize(writer, (object)value, value.GetType(), options); - } + throw new NotSupportedException($"Unable to deserialize '{root.GetRawText()}'."); + } + + public override void Write(Utf8JsonWriter writer, CardElement value, JsonSerializerOptions options) + { + JsonSerializer.Serialize(writer, (object)value, value.GetType(), options); + } } [JsonConverter(typeof(CardElementJsonConverter))] -public abstract class CardElement : SerializableObject { } +public abstract class CardElement : SerializableObject {} internal sealed class ActionJsonConverter : JsonConverter { - private static readonly List _typeMap = new() + private static readonly List _typeMap = new() { new ObjectType(["type"], "Action.Execute", typeof(ExecuteAction)), - new ObjectType(["type"], "Action.Submit", typeof(SubmitAction)), + new ObjectType(["type"], "Action.InsertImage", typeof(InsertImageAction)), new ObjectType(["type"], "Action.OpenUrl", typeof(OpenUrlAction)), + new ObjectType(["type"], "Action.OpenUrlDialog", typeof(OpenUrlDialogAction)), + new ObjectType(["type"], "Action.ResetInputs", typeof(ResetInputsAction)), + new ObjectType(["type"], "Action.Submit", typeof(SubmitAction)), new ObjectType(["type"], "Action.ToggleVisibility", typeof(ToggleVisibilityAction)), new ObjectType(["type"], "Action.ShowCard", typeof(ShowCardAction)), - new ObjectType(["type"], "Action.ResetInputs", typeof(ResetInputsAction)), - new ObjectType(["type"], "Action.InsertImage", typeof(InsertImageAction)), + new ObjectType(["type"], "Action.Popover", typeof(PopoverAction)), }; - public override Action? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TokenType == JsonTokenType.Null) return null; + public override Action? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.Null) return null; + + using var doc = JsonDocument.ParseValue(ref reader); + var root = doc.RootElement; - using var doc = JsonDocument.ParseValue(ref reader); - var root = doc.RootElement; + foreach (var type in _typeMap) + { + var discriminatorPropertyValues = new List(); - foreach (var type in _typeMap) + foreach (var propName in type.DiscriminatorPropertyNames) + { + if (root.TryGetProperty(propName, out var prop) && prop.ValueKind == JsonValueKind.String) { - var discriminatorPropertyValues = new List(); - - foreach (var propName in type.DiscriminatorPropertyNames) - { - if (root.TryGetProperty(propName, out var prop) && prop.ValueKind == JsonValueKind.String) - { - discriminatorPropertyValues.Insert(0, prop.GetString()); - } - } - - if (string.Join("", discriminatorPropertyValues) == type.DiscriminatorValue) - { - return (Action?)JsonSerializer.Deserialize(root.GetRawText(), type.Type, options); - } + discriminatorPropertyValues.Insert(0, prop.GetString()); } + } - throw new NotSupportedException($"Unable to deserialize '{root.GetRawText()}'."); + if (string.Join("", discriminatorPropertyValues) == type.DiscriminatorValue) + { + return (Action?)JsonSerializer.Deserialize(root.GetRawText(), type.Type, options); + } } - public override void Write(Utf8JsonWriter writer, Action value, JsonSerializerOptions options) - { - JsonSerializer.Serialize(writer, (object)value, value.GetType(), options); - } + throw new NotSupportedException($"Unable to deserialize '{root.GetRawText()}'."); + } + + public override void Write(Utf8JsonWriter writer, Action value, JsonSerializerOptions options) + { + JsonSerializer.Serialize(writer, (object)value, value.GetType(), options); + } } [JsonConverter(typeof(ActionJsonConverter))] -public abstract class Action : SerializableObject { } +public abstract class Action : SerializableObject {} internal sealed class ContainerLayoutJsonConverter : JsonConverter { - private static readonly List _typeMap = new() + private static readonly List _typeMap = new() { new ObjectType(["type"], "Layout.Stack", typeof(StackLayout)), new ObjectType(["type"], "Layout.Flow", typeof(FlowLayout)), new ObjectType(["type"], "Layout.AreaGrid", typeof(AreaGridLayout)), }; - public override ContainerLayout? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TokenType == JsonTokenType.Null) return null; + public override ContainerLayout? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.Null) return null; + + using var doc = JsonDocument.ParseValue(ref reader); + var root = doc.RootElement; - using var doc = JsonDocument.ParseValue(ref reader); - var root = doc.RootElement; + foreach (var type in _typeMap) + { + var discriminatorPropertyValues = new List(); - foreach (var type in _typeMap) + foreach (var propName in type.DiscriminatorPropertyNames) + { + if (root.TryGetProperty(propName, out var prop) && prop.ValueKind == JsonValueKind.String) { - var discriminatorPropertyValues = new List(); - - foreach (var propName in type.DiscriminatorPropertyNames) - { - if (root.TryGetProperty(propName, out var prop) && prop.ValueKind == JsonValueKind.String) - { - discriminatorPropertyValues.Insert(0, prop.GetString()); - } - } - - if (string.Join("", discriminatorPropertyValues) == type.DiscriminatorValue) - { - return (ContainerLayout?)JsonSerializer.Deserialize(root.GetRawText(), type.Type, options); - } + discriminatorPropertyValues.Insert(0, prop.GetString()); } + } - throw new NotSupportedException($"Unable to deserialize '{root.GetRawText()}'."); + if (string.Join("", discriminatorPropertyValues) == type.DiscriminatorValue) + { + return (ContainerLayout?)JsonSerializer.Deserialize(root.GetRawText(), type.Type, options); + } } - public override void Write(Utf8JsonWriter writer, ContainerLayout value, JsonSerializerOptions options) - { - JsonSerializer.Serialize(writer, (object)value, value.GetType(), options); - } + throw new NotSupportedException($"Unable to deserialize '{root.GetRawText()}'."); + } + + public override void Write(Utf8JsonWriter writer, ContainerLayout value, JsonSerializerOptions options) + { + JsonSerializer.Serialize(writer, (object)value, value.GetType(), options); + } } [JsonConverter(typeof(ContainerLayoutJsonConverter))] -public abstract class ContainerLayout : SerializableObject { } +public abstract class ContainerLayout : SerializableObject {} /// /// An Adaptive Card, containing a free-form body of card elements, and an optional set of actions. /// public class AdaptiveCard : CardElement { - /// - /// Deserializes a JSON string into an object of type AdaptiveCard. - /// - public static AdaptiveCard? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **AdaptiveCard**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "AdaptiveCard"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - /// - [JsonPropertyName("style")] - public ContainerStyle? Style { get; set; } - - /// - /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. - /// - [JsonPropertyName("layouts")] - public IList? Layouts { get; set; } - - /// - /// The minimum height, in pixels, of the container, in the `px` format. - /// - [JsonPropertyName("minHeight")] - public string? MinHeight { get; set; } - - /// - /// Defines the container's background image. - /// - [JsonPropertyName("backgroundImage")] - public IUnion? BackgroundImage { get; set; } - - /// - /// Controls how the container's content should be vertically aligned. - /// - [JsonPropertyName("verticalContentAlignment")] - public VerticalAlignment? VerticalContentAlignment { get; set; } - - /// - /// Controls if the content of the card is to be rendered left-to-right or right-to-left. - /// - [JsonPropertyName("rtl")] - public bool? Rtl { get; set; } - - /// - /// A URL to the Adaptive Card schema the card is authored against. - /// - [JsonPropertyName("$schema")] - public string? Schema { get; set; } - - /// - /// The Adaptive Card schema version the card is authored against. - /// - [JsonPropertyName("version")] - public Version? Version { get; set; } - - /// - /// The text that should be displayed if the client is not able to render the card. - /// - [JsonPropertyName("fallbackText")] - public string? FallbackText { get; set; } - - /// - /// The text that should be spoken for the entire card. - /// - [JsonPropertyName("speak")] - public string? Speak { get; set; } - - /// - /// Defines how the card can be refreshed by making a request to the target Bot. - /// - [JsonPropertyName("refresh")] - public RefreshDefinition? Refresh { get; set; } - - /// - /// Defines authentication information to enable on-behalf-of single-sign-on or just-in-time OAuth. This information is used in conjunction with the refresh property and Action.Execute in general. - /// - [JsonPropertyName("authentication")] - public Authentication? Authentication { get; set; } - - [JsonPropertyName("msteams")] - public TeamsCardProperties? Msteams { get; set; } - - /// - /// Metadata associated with the card. - /// - [JsonPropertyName("metadata")] - public CardMetadata? Metadata { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The body of the card, comprised of a list of elements displayed according to the layouts property. If the layouts property is not specified, a Layout.Stack is used. - /// - [JsonPropertyName("body")] - public IList? Body { get; set; } - - /// - /// The card level actions, which always appear at the bottom of the card. - /// - [JsonPropertyName("actions")] - public IList? Actions { get; set; } - - public AdaptiveCard(params IList body) - { - this.Body = body; - } + /// + /// Deserializes a JSON string into an object of type AdaptiveCard. + /// + public static AdaptiveCard? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **AdaptiveCard**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "AdaptiveCard"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + /// + [JsonPropertyName("style")] + public ContainerStyle? Style { get; set; } + + /// + /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. + /// + [JsonPropertyName("layouts")] + public IList? Layouts { get; set; } + + /// + /// The minimum height, in pixels, of the container, in the `px` format. + /// + [JsonPropertyName("minHeight")] + public string? MinHeight { get; set; } + + /// + /// Defines the container's background image. + /// + [JsonPropertyName("backgroundImage")] + public IUnion? BackgroundImage { get; set; } + + /// + /// Controls how the container's content should be vertically aligned. + /// + [JsonPropertyName("verticalContentAlignment")] + public VerticalAlignment? VerticalContentAlignment { get; set; } + + /// + /// Controls if the content of the card is to be rendered left-to-right or right-to-left. + /// + [JsonPropertyName("rtl")] + public bool? Rtl { get; set; } + + /// + /// A URL to the Adaptive Card schema the card is authored against. + /// + [JsonPropertyName("$schema")] + public string? Schema { get; set; } + + /// + /// The Adaptive Card schema version the card is authored against. + /// + [JsonPropertyName("version")] + public Version? Version { get; set; } = Version.Version1_5; + + /// + /// The text that should be displayed if the client is not able to render the card. + /// + [JsonPropertyName("fallbackText")] + public string? FallbackText { get; set; } + + /// + /// The text that should be spoken for the entire card. + /// + [JsonPropertyName("speak")] + public string? Speak { get; set; } + + /// + /// Defines how the card can be refreshed by making a request to the target Bot. + /// + [JsonPropertyName("refresh")] + public RefreshDefinition? Refresh { get; set; } + + /// + /// Defines authentication information to enable on-behalf-of single-sign-on or just-in-time OAuth. This information is used in conjunction with the refresh property and Action.Execute in general. + /// + [JsonPropertyName("authentication")] + public Authentication? Authentication { get; set; } + + /// + /// Teams-specific metadata associated with the card. + /// + [JsonPropertyName("msteams")] + public TeamsCardProperties? Msteams { get; set; } + + /// + /// Teams-specific metadata associated with the card. Equivalent to `msteams`. + /// + [JsonPropertyName("msTeams")] + public TeamsCardProperties? MsTeams { get; set; } + + /// + /// Metadata associated with the card. + /// + [JsonPropertyName("metadata")] + public CardMetadata? Metadata { get; set; } + + /// + /// Resources card elements can reference. + /// + [JsonPropertyName("resources")] + public Resources? Resources { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The body of the card, comprised of a list of elements displayed according to the layouts property. If the layouts property is not specified, a Layout.Stack is used. + /// + [JsonPropertyName("body")] + public IList? Body { get; set; } + + /// + /// The card level actions, which always appear at the bottom of the card. + /// + [JsonPropertyName("actions")] + public IList? Actions { get; set; } + + public AdaptiveCard(params IList body) + { + this.Body = body; + } - /// - /// Serializes this AdaptiveCard into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } + /// + /// Serializes this AdaptiveCard into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public AdaptiveCard WithKey(string value) { + this.Key = value; + return this; + } + + public AdaptiveCard WithId(string value) { + this.Id = value; + return this; + } + + public AdaptiveCard WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public AdaptiveCard WithLang(string value) { + this.Lang = value; + return this; + } + + public AdaptiveCard WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public AdaptiveCard WithSelectAction(Action value) { + this.SelectAction = value; + return this; + } + + public AdaptiveCard WithStyle(ContainerStyle value) { + this.Style = value; + return this; + } + + public AdaptiveCard WithLayouts(params IList value) { + this.Layouts = value; + return this; + } + + public AdaptiveCard WithMinHeight(string value) { + this.MinHeight = value; + return this; + } + + public AdaptiveCard WithBackgroundImage(IUnion value) { + this.BackgroundImage = value; + return this; + } + + public AdaptiveCard WithVerticalContentAlignment(VerticalAlignment value) { + this.VerticalContentAlignment = value; + return this; + } + + public AdaptiveCard WithRtl(bool value) { + this.Rtl = value; + return this; + } + + public AdaptiveCard WithSchema(string value) { + this.Schema = value; + return this; + } + + public AdaptiveCard WithVersion(Version value) { + this.Version = value; + return this; + } + + public AdaptiveCard WithFallbackText(string value) { + this.FallbackText = value; + return this; + } + + public AdaptiveCard WithSpeak(string value) { + this.Speak = value; + return this; + } + + public AdaptiveCard WithRefresh(RefreshDefinition value) { + this.Refresh = value; + return this; + } + + public AdaptiveCard WithAuthentication(Authentication value) { + this.Authentication = value; + return this; + } + + public AdaptiveCard WithMsteams(TeamsCardProperties value) { + this.Msteams = value; + return this; + } + + public AdaptiveCard WithMsTeams(TeamsCardProperties value) { + this.MsTeams = value; + return this; + } + + public AdaptiveCard WithMetadata(CardMetadata value) { + this.Metadata = value; + return this; + } + + public AdaptiveCard WithResources(Resources value) { + this.Resources = value; + return this; + } + + public AdaptiveCard WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public AdaptiveCard WithFallback(IUnion value) { + this.Fallback = value; + return this; + } + + public AdaptiveCard WithBody(params IList value) { + this.Body = value; + return this; + } + + public AdaptiveCard WithActions(params IList value) { + this.Actions = value; + return this; + } +} - public AdaptiveCard WithId(string value) - { - this.Id = value; - return this; - } +/// +/// Represents a list of versioned capabilities a host application must support. +/// +public class HostCapabilities : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type HostCapabilities. + /// + public static HostCapabilities? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Serializes this HostCapabilities into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public HostCapabilities WithKey(string value) { + this.Key = value; + return this; + } + [JsonExtensionData] + public IDictionary NonSchemaProperties { get; set; } = new Dictionary(); +} - public AdaptiveCard WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } +/// +/// Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can respond synchronously and return an updated Adaptive Card to be displayed by the client. Action.Execute works in all Adaptive Card hosts. +/// +public class ExecuteAction : Action +{ + /// + /// Deserializes a JSON string into an object of type ExecuteAction. + /// + public static ExecuteAction? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Action.Execute**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Action.Execute"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The title of the action, as it appears on buttons. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + /// + /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + /// + [JsonPropertyName("iconUrl")] + public string? IconUrl { get; set; } + + /// + /// Control the style of the action, affecting its visual and spoken representations. + /// + [JsonPropertyName("style")] + public ActionStyle? Style { get; set; } = ActionStyle.Default; + + /// + /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + /// + [JsonPropertyName("mode")] + public ActionMode? Mode { get; set; } = ActionMode.Primary; + + /// + /// The tooltip text to display when the action is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + /// + [JsonPropertyName("isEnabled")] + public bool? IsEnabled { get; set; } = true; + + /// + /// The actions to display in the overflow menu of a Split action button. + /// + [JsonPropertyName("menuActions")] + public IList? MenuActions { get; set; } + + /// + /// A set of theme-specific icon URLs. + /// + [JsonPropertyName("themedIconUrls")] + public IList? ThemedIconUrls { get; set; } + + /// + /// The data to send to the Bot when the action is executed. When expressed as an object, `data` is sent back to the Bot when the action is executed, adorned with the values of the inputs expressed as key/value pairs, where the key is the Id of the input. If `data` is expressed as a string, input values are not sent to the Bot. + /// + [JsonPropertyName("data")] + public IUnion? Data { get; set; } + + /// + /// The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("associatedInputs")] + public AssociatedInputs? AssociatedInputs { get; set; } + + /// + /// Controls if the action is enabled only if at least one required input has been filled by the user. + /// + [JsonPropertyName("conditionallyEnabled")] + public bool? ConditionallyEnabled { get; set; } = false; + + /// + /// The verb of the action. + /// + [JsonPropertyName("verb")] + public string? Verb { get; set; } + + /// + /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ExecuteAction into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ExecuteAction WithKey(string value) { + this.Key = value; + return this; + } + + public ExecuteAction WithId(string value) { + this.Id = value; + return this; + } + + public ExecuteAction WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public ExecuteAction WithTitle(string value) { + this.Title = value; + return this; + } + + public ExecuteAction WithIconUrl(string value) { + this.IconUrl = value; + return this; + } + + public ExecuteAction WithStyle(ActionStyle value) { + this.Style = value; + return this; + } + + public ExecuteAction WithMode(ActionMode value) { + this.Mode = value; + return this; + } + + public ExecuteAction WithTooltip(string value) { + this.Tooltip = value; + return this; + } + + public ExecuteAction WithIsEnabled(bool value) { + this.IsEnabled = value; + return this; + } + + public ExecuteAction WithMenuActions(params IList value) { + this.MenuActions = value; + return this; + } + + public ExecuteAction WithThemedIconUrls(params IList value) { + this.ThemedIconUrls = value; + return this; + } + + public ExecuteAction WithData(IUnion value) { + this.Data = value; + return this; + } + + public ExecuteAction WithAssociatedInputs(AssociatedInputs value) { + this.AssociatedInputs = value; + return this; + } + + public ExecuteAction WithConditionallyEnabled(bool value) { + this.ConditionallyEnabled = value; + return this; + } + + public ExecuteAction WithVerb(string value) { + this.Verb = value; + return this; + } + + public ExecuteAction WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - public AdaptiveCard WithLang(string value) - { - this.Lang = value; - return this; - } +/// +/// Inserts an image into the host application's canvas. +/// +public class InsertImageAction : Action +{ + /// + /// Deserializes a JSON string into an object of type InsertImageAction. + /// + public static InsertImageAction? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Action.InsertImage**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Action.InsertImage"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The title of the action, as it appears on buttons. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + /// + /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + /// + [JsonPropertyName("iconUrl")] + public string? IconUrl { get; set; } + + /// + /// Control the style of the action, affecting its visual and spoken representations. + /// + [JsonPropertyName("style")] + public ActionStyle? Style { get; set; } = ActionStyle.Default; + + /// + /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + /// + [JsonPropertyName("mode")] + public ActionMode? Mode { get; set; } = ActionMode.Primary; + + /// + /// The tooltip text to display when the action is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + /// + [JsonPropertyName("isEnabled")] + public bool? IsEnabled { get; set; } = true; + + /// + /// The actions to display in the overflow menu of a Split action button. + /// + [JsonPropertyName("menuActions")] + public IList? MenuActions { get; set; } + + /// + /// A set of theme-specific icon URLs. + /// + [JsonPropertyName("themedIconUrls")] + public IList? ThemedIconUrls { get; set; } + + /// + /// The URL of the image to insert. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// The alternate text for the image. + /// + [JsonPropertyName("altText")] + public string? AltText { get; set; } + + /// + /// The position at which to insert the image. + /// + [JsonPropertyName("insertPosition")] + public ImageInsertPosition? InsertPosition { get; set; } = ImageInsertPosition.Selection; + + /// + /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this InsertImageAction into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public InsertImageAction WithKey(string value) { + this.Key = value; + return this; + } + + public InsertImageAction WithId(string value) { + this.Id = value; + return this; + } + + public InsertImageAction WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public InsertImageAction WithTitle(string value) { + this.Title = value; + return this; + } + + public InsertImageAction WithIconUrl(string value) { + this.IconUrl = value; + return this; + } + + public InsertImageAction WithStyle(ActionStyle value) { + this.Style = value; + return this; + } + + public InsertImageAction WithMode(ActionMode value) { + this.Mode = value; + return this; + } + + public InsertImageAction WithTooltip(string value) { + this.Tooltip = value; + return this; + } + + public InsertImageAction WithIsEnabled(bool value) { + this.IsEnabled = value; + return this; + } + + public InsertImageAction WithMenuActions(params IList value) { + this.MenuActions = value; + return this; + } + + public InsertImageAction WithThemedIconUrls(params IList value) { + this.ThemedIconUrls = value; + return this; + } + + public InsertImageAction WithUrl(string value) { + this.Url = value; + return this; + } + + public InsertImageAction WithAltText(string value) { + this.AltText = value; + return this; + } + + public InsertImageAction WithInsertPosition(ImageInsertPosition value) { + this.InsertPosition = value; + return this; + } + + public InsertImageAction WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - public AdaptiveCard WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public AdaptiveCard WithSelectAction(Action value) - { - this.SelectAction = value; - return this; - } - - public AdaptiveCard WithStyle(ContainerStyle value) - { - this.Style = value; - return this; - } - - public AdaptiveCard WithLayouts(params IList value) - { - this.Layouts = value; - return this; - } - - public AdaptiveCard WithMinHeight(string value) - { - this.MinHeight = value; - return this; - } - - public AdaptiveCard WithBackgroundImage(IUnion value) - { - this.BackgroundImage = value; - return this; - } - - public AdaptiveCard WithVerticalContentAlignment(VerticalAlignment value) - { - this.VerticalContentAlignment = value; - return this; - } - - public AdaptiveCard WithRtl(bool value) - { - this.Rtl = value; - return this; - } - - public AdaptiveCard WithSchema(string value) - { - this.Schema = value; - return this; - } - - public AdaptiveCard WithVersion(Version value) - { - this.Version = value; - return this; - } - - public AdaptiveCard WithFallbackText(string value) - { - this.FallbackText = value; - return this; - } - - public AdaptiveCard WithSpeak(string value) - { - this.Speak = value; - return this; - } - - public AdaptiveCard WithRefresh(RefreshDefinition value) - { - this.Refresh = value; - return this; - } - - public AdaptiveCard WithAuthentication(Authentication value) - { - this.Authentication = value; - return this; - } - - public AdaptiveCard WithMsteams(TeamsCardProperties value) - { - this.Msteams = value; - return this; - } - - public AdaptiveCard WithMetadata(CardMetadata value) - { - this.Metadata = value; - return this; - } - - public AdaptiveCard WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public AdaptiveCard WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } - - public AdaptiveCard WithBody(params IList value) - { - this.Body = value; - return this; - } +/// +/// Opens the provided URL in either a separate browser tab or within the host application. +/// +public class OpenUrlAction : Action +{ + /// + /// Deserializes a JSON string into an object of type OpenUrlAction. + /// + public static OpenUrlAction? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Action.OpenUrl**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Action.OpenUrl"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The title of the action, as it appears on buttons. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + /// + /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + /// + [JsonPropertyName("iconUrl")] + public string? IconUrl { get; set; } + + /// + /// Control the style of the action, affecting its visual and spoken representations. + /// + [JsonPropertyName("style")] + public ActionStyle? Style { get; set; } = ActionStyle.Default; + + /// + /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + /// + [JsonPropertyName("mode")] + public ActionMode? Mode { get; set; } = ActionMode.Primary; + + /// + /// The tooltip text to display when the action is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + /// + [JsonPropertyName("isEnabled")] + public bool? IsEnabled { get; set; } = true; + + /// + /// The actions to display in the overflow menu of a Split action button. + /// + [JsonPropertyName("menuActions")] + public IList? MenuActions { get; set; } + + /// + /// A set of theme-specific icon URLs. + /// + [JsonPropertyName("themedIconUrls")] + public IList? ThemedIconUrls { get; set; } + + /// + /// The URL to open. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + public OpenUrlAction(string url) + { + this.Url = url; + } - public AdaptiveCard WithActions(params IList value) - { - this.Actions = value; - return this; - } + /// + /// Serializes this OpenUrlAction into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public OpenUrlAction WithKey(string value) { + this.Key = value; + return this; + } + + public OpenUrlAction WithId(string value) { + this.Id = value; + return this; + } + + public OpenUrlAction WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public OpenUrlAction WithTitle(string value) { + this.Title = value; + return this; + } + + public OpenUrlAction WithIconUrl(string value) { + this.IconUrl = value; + return this; + } + + public OpenUrlAction WithStyle(ActionStyle value) { + this.Style = value; + return this; + } + + public OpenUrlAction WithMode(ActionMode value) { + this.Mode = value; + return this; + } + + public OpenUrlAction WithTooltip(string value) { + this.Tooltip = value; + return this; + } + + public OpenUrlAction WithIsEnabled(bool value) { + this.IsEnabled = value; + return this; + } + + public OpenUrlAction WithMenuActions(params IList value) { + this.MenuActions = value; + return this; + } + + public OpenUrlAction WithThemedIconUrls(params IList value) { + this.ThemedIconUrls = value; + return this; + } + + public OpenUrlAction WithUrl(string value) { + this.Url = value; + return this; + } + + public OpenUrlAction WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// Represents a list of versioned capabilities a host application must support. +/// Opens a task module in a modal dialog hosting the content at a provided URL. /// -public class HostCapabilities : SerializableObject +public class OpenUrlDialogAction : Action { - /// - /// Deserializes a JSON string into an object of type HostCapabilities. - /// - public static HostCapabilities? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - - /// - /// Serializes this HostCapabilities into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - [JsonExtensionData] - public IDictionary NonSchemaProperties { get; set; } = new Dictionary(); + /// + /// Deserializes a JSON string into an object of type OpenUrlDialogAction. + /// + public static OpenUrlDialogAction? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Action.OpenUrlDialog**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Action.OpenUrlDialog"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The title of the action, as it appears on buttons. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + /// + /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + /// + [JsonPropertyName("iconUrl")] + public string? IconUrl { get; set; } + + /// + /// Control the style of the action, affecting its visual and spoken representations. + /// + [JsonPropertyName("style")] + public ActionStyle? Style { get; set; } = ActionStyle.Default; + + /// + /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + /// + [JsonPropertyName("mode")] + public ActionMode? Mode { get; set; } = ActionMode.Primary; + + /// + /// The tooltip text to display when the action is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + /// + [JsonPropertyName("isEnabled")] + public bool? IsEnabled { get; set; } = true; + + /// + /// The actions to display in the overflow menu of a Split action button. + /// + [JsonPropertyName("menuActions")] + public IList? MenuActions { get; set; } + + /// + /// A set of theme-specific icon URLs. + /// + [JsonPropertyName("themedIconUrls")] + public IList? ThemedIconUrls { get; set; } + + /// + /// The title of the dialog to be displayed in the dialog header. + /// + [JsonPropertyName("dialogTitle")] + public string? DialogTitle { get; set; } + + /// + /// The height of the dialog. To define height as a number of pixels, use the px format. + /// + [JsonPropertyName("dialogHeight")] + public string? DialogHeight { get; set; } + + /// + /// The width of the dialog. To define width as a number of pixels, use the px format. + /// + [JsonPropertyName("dialogWidth")] + public string? DialogWidth { get; set; } + + /// + /// The URL to open. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this OpenUrlDialogAction into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public OpenUrlDialogAction WithKey(string value) { + this.Key = value; + return this; + } + + public OpenUrlDialogAction WithId(string value) { + this.Id = value; + return this; + } + + public OpenUrlDialogAction WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public OpenUrlDialogAction WithTitle(string value) { + this.Title = value; + return this; + } + + public OpenUrlDialogAction WithIconUrl(string value) { + this.IconUrl = value; + return this; + } + + public OpenUrlDialogAction WithStyle(ActionStyle value) { + this.Style = value; + return this; + } + + public OpenUrlDialogAction WithMode(ActionMode value) { + this.Mode = value; + return this; + } + + public OpenUrlDialogAction WithTooltip(string value) { + this.Tooltip = value; + return this; + } + + public OpenUrlDialogAction WithIsEnabled(bool value) { + this.IsEnabled = value; + return this; + } + + public OpenUrlDialogAction WithMenuActions(params IList value) { + this.MenuActions = value; + return this; + } + + public OpenUrlDialogAction WithThemedIconUrls(params IList value) { + this.ThemedIconUrls = value; + return this; + } + + public OpenUrlDialogAction WithDialogTitle(string value) { + this.DialogTitle = value; + return this; + } + + public OpenUrlDialogAction WithDialogHeight(string value) { + this.DialogHeight = value; + return this; + } + + public OpenUrlDialogAction WithDialogWidth(string value) { + this.DialogWidth = value; + return this; + } + + public OpenUrlDialogAction WithUrl(string value) { + this.Url = value; + return this; + } + + public OpenUrlDialogAction WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can respond synchronously and return an updated Adaptive Card to be displayed by the client. Action.Execute works in all Adaptive Card hosts. +/// Resets the values of the inputs in the card. /// -public class ExecuteAction : Action +public class ResetInputsAction : Action { - /// - /// Deserializes a JSON string into an object of type ExecuteAction. - /// - public static ExecuteAction? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Action.Execute**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Action.Execute"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The title of the action, as it appears on buttons. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - /// - /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. - /// - [JsonPropertyName("iconUrl")] - public string? IconUrl { get; set; } - - /// - /// Control the style of the action, affecting its visual and spoken representations. - /// - [JsonPropertyName("style")] - public ActionStyle? Style { get; set; } - - /// - /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. - /// - [JsonPropertyName("mode")] - public ActionMode? Mode { get; set; } - - /// - /// The tooltip text to display when the action is hovered over. - /// - [JsonPropertyName("tooltip")] - public string? Tooltip { get; set; } - - /// - /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. - /// - [JsonPropertyName("isEnabled")] - public bool? IsEnabled { get; set; } - - /// - /// The data to send to the Bot when the action is executed. When expressed as an object, `data` is sent back to the Bot when the action is executed, adorned with the values of the inputs expressed as key/value pairs, where the key is the Id of the input. If `data` is expressed as a string, input values are not sent to the Bot. - /// - [JsonPropertyName("data")] - public IUnion? Data { get; set; } - - /// - /// The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("associatedInputs")] - public AssociatedInputs? AssociatedInputs { get; set; } - - /// - /// Controls if the action is enabled only if at least one required input has been filled by the user. - /// - [JsonPropertyName("conditionallyEnabled")] - public bool? ConditionallyEnabled { get; set; } - - /// - /// The verb of the action. - /// - [JsonPropertyName("verb")] - public string? Verb { get; set; } - - /// - /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ExecuteAction into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ExecuteAction WithId(string value) - { - this.Id = value; - return this; - } - - public ExecuteAction WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public ExecuteAction WithTitle(string value) - { - this.Title = value; - return this; - } - - public ExecuteAction WithIconUrl(string value) - { - this.IconUrl = value; - return this; - } - - public ExecuteAction WithStyle(ActionStyle value) - { - this.Style = value; - return this; - } - - public ExecuteAction WithMode(ActionMode value) - { - this.Mode = value; - return this; - } - - public ExecuteAction WithTooltip(string value) - { - this.Tooltip = value; - return this; - } - - public ExecuteAction WithIsEnabled(bool value) - { - this.IsEnabled = value; - return this; - } - - public ExecuteAction WithData(IUnion value) - { - this.Data = value; - return this; - } - - public ExecuteAction WithAssociatedInputs(AssociatedInputs value) - { - this.AssociatedInputs = value; - return this; - } - - public ExecuteAction WithConditionallyEnabled(bool value) - { - this.ConditionallyEnabled = value; - return this; - } - - public ExecuteAction WithVerb(string value) - { - this.Verb = value; - return this; - } - - public ExecuteAction WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type ResetInputsAction. + /// + public static ResetInputsAction? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Action.ResetInputs**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Action.ResetInputs"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The title of the action, as it appears on buttons. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + /// + /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + /// + [JsonPropertyName("iconUrl")] + public string? IconUrl { get; set; } + + /// + /// Control the style of the action, affecting its visual and spoken representations. + /// + [JsonPropertyName("style")] + public ActionStyle? Style { get; set; } = ActionStyle.Default; + + /// + /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + /// + [JsonPropertyName("mode")] + public ActionMode? Mode { get; set; } = ActionMode.Primary; + + /// + /// The tooltip text to display when the action is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + /// + [JsonPropertyName("isEnabled")] + public bool? IsEnabled { get; set; } = true; + + /// + /// The actions to display in the overflow menu of a Split action button. + /// + [JsonPropertyName("menuActions")] + public IList? MenuActions { get; set; } + + /// + /// A set of theme-specific icon URLs. + /// + [JsonPropertyName("themedIconUrls")] + public IList? ThemedIconUrls { get; set; } + + /// + /// The Ids of the inputs that should be reset. + /// + [JsonPropertyName("targetInputIds")] + public IList? TargetInputIds { get; set; } + + /// + /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ResetInputsAction into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ResetInputsAction WithKey(string value) { + this.Key = value; + return this; + } + + public ResetInputsAction WithId(string value) { + this.Id = value; + return this; + } + + public ResetInputsAction WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public ResetInputsAction WithTitle(string value) { + this.Title = value; + return this; + } + + public ResetInputsAction WithIconUrl(string value) { + this.IconUrl = value; + return this; + } + + public ResetInputsAction WithStyle(ActionStyle value) { + this.Style = value; + return this; + } + + public ResetInputsAction WithMode(ActionMode value) { + this.Mode = value; + return this; + } + + public ResetInputsAction WithTooltip(string value) { + this.Tooltip = value; + return this; + } + + public ResetInputsAction WithIsEnabled(bool value) { + this.IsEnabled = value; + return this; + } + + public ResetInputsAction WithMenuActions(params IList value) { + this.MenuActions = value; + return this; + } + + public ResetInputsAction WithThemedIconUrls(params IList value) { + this.ThemedIconUrls = value; + return this; + } + + public ResetInputsAction WithTargetInputIds(params IList value) { + this.TargetInputIds = value; + return this; + } + + public ResetInputsAction WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// Represents the data of an Action.Submit. +/// Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can only acknowledge is has received the request. /// -public class SubmitActionData : SerializableObject +public class SubmitAction : Action { - /// - /// Deserializes a JSON string into an object of type SubmitActionData. - /// - public static SubmitActionData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - [JsonPropertyName("msteams")] - public object? Msteams { get; set; } - - /// - /// Serializes this SubmitActionData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public SubmitActionData WithMsteams(object value) - { - this.Msteams = value; - return this; - } - [JsonExtensionData] - public IDictionary NonSchemaProperties { get; set; } = new Dictionary(); + /// + /// Deserializes a JSON string into an object of type SubmitAction. + /// + public static SubmitAction? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Action.Submit**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Action.Submit"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The title of the action, as it appears on buttons. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + /// + /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + /// + [JsonPropertyName("iconUrl")] + public string? IconUrl { get; set; } + + /// + /// Control the style of the action, affecting its visual and spoken representations. + /// + [JsonPropertyName("style")] + public ActionStyle? Style { get; set; } = ActionStyle.Default; + + /// + /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + /// + [JsonPropertyName("mode")] + public ActionMode? Mode { get; set; } = ActionMode.Primary; + + /// + /// The tooltip text to display when the action is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + /// + [JsonPropertyName("isEnabled")] + public bool? IsEnabled { get; set; } = true; + + /// + /// The actions to display in the overflow menu of a Split action button. + /// + [JsonPropertyName("menuActions")] + public IList? MenuActions { get; set; } + + /// + /// A set of theme-specific icon URLs. + /// + [JsonPropertyName("themedIconUrls")] + public IList? ThemedIconUrls { get; set; } + + /// + /// The data to send to the Bot when the action is executed. When expressed as an object, `data` is sent back to the Bot when the action is executed, adorned with the values of the inputs expressed as key/value pairs, where the key is the Id of the input. If `data` is expressed as a string, input values are not sent to the Bot. + /// + [JsonPropertyName("data")] + public IUnion? Data { get; set; } + + /// + /// The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("associatedInputs")] + public AssociatedInputs? AssociatedInputs { get; set; } + + /// + /// Controls if the action is enabled only if at least one required input has been filled by the user. + /// + [JsonPropertyName("conditionallyEnabled")] + public bool? ConditionallyEnabled { get; set; } = false; + + /// + /// Teams-specific metadata associated with the action. + /// + [JsonPropertyName("msteams")] + public TeamsSubmitActionProperties? Msteams { get; set; } + + /// + /// Teams-specific metadata associated with the action. Equivalent to `msteams`. + /// + [JsonPropertyName("msTeams")] + public TeamsSubmitActionProperties? MsTeams { get; set; } + + /// + /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this SubmitAction into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public SubmitAction WithKey(string value) { + this.Key = value; + return this; + } + + public SubmitAction WithId(string value) { + this.Id = value; + return this; + } + + public SubmitAction WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public SubmitAction WithTitle(string value) { + this.Title = value; + return this; + } + + public SubmitAction WithIconUrl(string value) { + this.IconUrl = value; + return this; + } + + public SubmitAction WithStyle(ActionStyle value) { + this.Style = value; + return this; + } + + public SubmitAction WithMode(ActionMode value) { + this.Mode = value; + return this; + } + + public SubmitAction WithTooltip(string value) { + this.Tooltip = value; + return this; + } + + public SubmitAction WithIsEnabled(bool value) { + this.IsEnabled = value; + return this; + } + + public SubmitAction WithMenuActions(params IList value) { + this.MenuActions = value; + return this; + } + + public SubmitAction WithThemedIconUrls(params IList value) { + this.ThemedIconUrls = value; + return this; + } + + public SubmitAction WithData(IUnion value) { + this.Data = value; + return this; + } + + public SubmitAction WithAssociatedInputs(AssociatedInputs value) { + this.AssociatedInputs = value; + return this; + } + + public SubmitAction WithConditionallyEnabled(bool value) { + this.ConditionallyEnabled = value; + return this; + } + + public SubmitAction WithMsteams(TeamsSubmitActionProperties value) { + this.Msteams = value; + return this; + } + + public SubmitAction WithMsTeams(TeamsSubmitActionProperties value) { + this.MsTeams = value; + return this; + } + + public SubmitAction WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// Represents Teams-specific data in an Action.Submit to send an Instant Message back to the Bot. +/// Toggles the visibility of a set of elements. Action.ToggleVisibility is useful for creating "Show more" type UI patterns. /// -public class ImBackSubmitActionData : SerializableObject +public class ToggleVisibilityAction : Action { - /// - /// Deserializes a JSON string into an object of type ImBackSubmitActionData. - /// - public static ImBackSubmitActionData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **imBack**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "imBack"; - - /// - /// The value that will be sent to the Bot. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - public ImBackSubmitActionData(string value) - { - this.Value = value; - } - - /// - /// Serializes this ImBackSubmitActionData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ImBackSubmitActionData WithValue(string value) - { - this.Value = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type ToggleVisibilityAction. + /// + public static ToggleVisibilityAction? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Action.ToggleVisibility**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Action.ToggleVisibility"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The title of the action, as it appears on buttons. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + /// + /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + /// + [JsonPropertyName("iconUrl")] + public string? IconUrl { get; set; } + + /// + /// Control the style of the action, affecting its visual and spoken representations. + /// + [JsonPropertyName("style")] + public ActionStyle? Style { get; set; } = ActionStyle.Default; + + /// + /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + /// + [JsonPropertyName("mode")] + public ActionMode? Mode { get; set; } = ActionMode.Primary; + + /// + /// The tooltip text to display when the action is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + /// + [JsonPropertyName("isEnabled")] + public bool? IsEnabled { get; set; } = true; + + /// + /// The actions to display in the overflow menu of a Split action button. + /// + [JsonPropertyName("menuActions")] + public IList? MenuActions { get; set; } + + /// + /// A set of theme-specific icon URLs. + /// + [JsonPropertyName("themedIconUrls")] + public IList? ThemedIconUrls { get; set; } + + /// + /// The Ids of the elements to toggle the visibility of. + /// + [JsonPropertyName("targetElements")] + public IUnion, IList>? TargetElements { get; set; } + + /// + /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ToggleVisibilityAction into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ToggleVisibilityAction WithKey(string value) { + this.Key = value; + return this; + } + + public ToggleVisibilityAction WithId(string value) { + this.Id = value; + return this; + } + + public ToggleVisibilityAction WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public ToggleVisibilityAction WithTitle(string value) { + this.Title = value; + return this; + } + + public ToggleVisibilityAction WithIconUrl(string value) { + this.IconUrl = value; + return this; + } + + public ToggleVisibilityAction WithStyle(ActionStyle value) { + this.Style = value; + return this; + } + + public ToggleVisibilityAction WithMode(ActionMode value) { + this.Mode = value; + return this; + } + + public ToggleVisibilityAction WithTooltip(string value) { + this.Tooltip = value; + return this; + } + + public ToggleVisibilityAction WithIsEnabled(bool value) { + this.IsEnabled = value; + return this; + } + + public ToggleVisibilityAction WithMenuActions(params IList value) { + this.MenuActions = value; + return this; + } + + public ToggleVisibilityAction WithThemedIconUrls(params IList value) { + this.ThemedIconUrls = value; + return this; + } + + public ToggleVisibilityAction WithTargetElements(IUnion, IList> value) { + this.TargetElements = value; + return this; + } + + public ToggleVisibilityAction WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// Represents Teams-specific data in an Action.Submit to make an Invoke request to the Bot. +/// Defines a theme-specific URL. /// -public class InvokeSubmitActionData : SerializableObject +public class ThemedUrl : SerializableObject { - /// - /// Deserializes a JSON string into an object of type InvokeSubmitActionData. - /// - public static InvokeSubmitActionData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **invoke**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "invoke"; - - /// - /// The object to send to the Bot with the Invoke request. - /// - [JsonPropertyName("value")] - public object? Value { get; set; } - - public InvokeSubmitActionData(object value) - { - this.Value = value; - } - - /// - /// Serializes this InvokeSubmitActionData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public InvokeSubmitActionData WithValue(object value) - { - this.Value = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type ThemedUrl. + /// + public static ThemedUrl? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The theme this URL applies to. + /// + [JsonPropertyName("theme")] + public ThemeName? Theme { get; set; } = ThemeName.Light; + + /// + /// The URL to use for the associated theme. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// Serializes this ThemedUrl into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ThemedUrl WithKey(string value) { + this.Key = value; + return this; + } + + public ThemedUrl WithTheme(ThemeName value) { + this.Theme = value; + return this; + } + + public ThemedUrl WithUrl(string value) { + this.Url = value; + return this; + } } /// -/// Represents Teams-specific data in an Action.Submit to send a message back to the Bot. +/// Defines a target element in an Action.ToggleVisibility. /// -public class MessageBackSubmitActionData : SerializableObject +public class TargetElement : SerializableObject { - /// - /// Deserializes a JSON string into an object of type MessageBackSubmitActionData. - /// - public static MessageBackSubmitActionData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **messageBack**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "messageBack"; - - /// - /// The text that will be sent to the Bot. - /// - [JsonPropertyName("text")] - public string? Text { get; set; } - - /// - /// The optional text that will be displayed as a new message in the conversation, as if the end-user sent it. `displayText` is not sent to the Bot. - /// - [JsonPropertyName("displayText")] - public string? DisplayText { get; set; } - - /// - /// Optional additional value that will be sent to the Bot. For instance, `value` can encode specific context for the action, such as unique identifiers or a JSON object. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - /// - /// Serializes this MessageBackSubmitActionData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public MessageBackSubmitActionData WithText(string value) - { - this.Text = value; - return this; - } - - public MessageBackSubmitActionData WithDisplayText(string value) - { - this.DisplayText = value; - return this; - } - - public MessageBackSubmitActionData WithValue(string value) - { - this.Value = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type TargetElement. + /// + public static TargetElement? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// The Id of the element to change the visibility of. + /// + [JsonPropertyName("elementId")] + public string? ElementId { get; set; } + + /// + /// The new visibility state of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } + + /// + /// Serializes this TargetElement into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TargetElement WithElementId(string value) { + this.ElementId = value; + return this; + } + + public TargetElement WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } } /// -/// Represents Teams-specific data in an Action.Submit to sign in a user. +/// Expands or collapses an embedded card within the main card. /// -public class SigninSubmitActionData : SerializableObject +public class ShowCardAction : Action { - /// - /// Deserializes a JSON string into an object of type SigninSubmitActionData. - /// - public static SigninSubmitActionData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **signin**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "signin"; - - /// - /// The URL to redirect the end-user for signing in. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } + /// + /// Deserializes a JSON string into an object of type ShowCardAction. + /// + public static ShowCardAction? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Action.ShowCard**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Action.ShowCard"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The title of the action, as it appears on buttons. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + /// + /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + /// + [JsonPropertyName("iconUrl")] + public string? IconUrl { get; set; } + + /// + /// Control the style of the action, affecting its visual and spoken representations. + /// + [JsonPropertyName("style")] + public ActionStyle? Style { get; set; } = ActionStyle.Default; + + /// + /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + /// + [JsonPropertyName("mode")] + public ActionMode? Mode { get; set; } = ActionMode.Primary; + + /// + /// The tooltip text to display when the action is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + /// + [JsonPropertyName("isEnabled")] + public bool? IsEnabled { get; set; } = true; + + /// + /// The actions to display in the overflow menu of a Split action button. + /// + [JsonPropertyName("menuActions")] + public IList? MenuActions { get; set; } + + /// + /// A set of theme-specific icon URLs. + /// + [JsonPropertyName("themedIconUrls")] + public IList? ThemedIconUrls { get; set; } + + /// + /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The card that should be displayed when the action is executed. + /// + [JsonPropertyName("card")] + public AdaptiveCard? Card { get; set; } + + /// + /// Serializes this ShowCardAction into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ShowCardAction WithKey(string value) { + this.Key = value; + return this; + } + + public ShowCardAction WithId(string value) { + this.Id = value; + return this; + } + + public ShowCardAction WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public ShowCardAction WithTitle(string value) { + this.Title = value; + return this; + } + + public ShowCardAction WithIconUrl(string value) { + this.IconUrl = value; + return this; + } + + public ShowCardAction WithStyle(ActionStyle value) { + this.Style = value; + return this; + } + + public ShowCardAction WithMode(ActionMode value) { + this.Mode = value; + return this; + } + + public ShowCardAction WithTooltip(string value) { + this.Tooltip = value; + return this; + } + + public ShowCardAction WithIsEnabled(bool value) { + this.IsEnabled = value; + return this; + } + + public ShowCardAction WithMenuActions(params IList value) { + this.MenuActions = value; + return this; + } + + public ShowCardAction WithThemedIconUrls(params IList value) { + this.ThemedIconUrls = value; + return this; + } + + public ShowCardAction WithFallback(IUnion value) { + this.Fallback = value; + return this; + } + + public ShowCardAction WithCard(AdaptiveCard value) { + this.Card = value; + return this; + } +} - public SigninSubmitActionData(string value) - { - this.Value = value; - } +/// +/// Shows a popover to display more information to the user. +/// +public class PopoverAction : Action +{ + /// + /// Deserializes a JSON string into an object of type PopoverAction. + /// + public static PopoverAction? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Action.Popover**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Action.Popover"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The title of the action, as it appears on buttons. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + /// + /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + /// + [JsonPropertyName("iconUrl")] + public string? IconUrl { get; set; } + + /// + /// Control the style of the action, affecting its visual and spoken representations. + /// + [JsonPropertyName("style")] + public ActionStyle? Style { get; set; } = ActionStyle.Default; + + /// + /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + /// + [JsonPropertyName("mode")] + public ActionMode? Mode { get; set; } = ActionMode.Primary; + + /// + /// The tooltip text to display when the action is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + /// + [JsonPropertyName("isEnabled")] + public bool? IsEnabled { get; set; } = true; + + /// + /// A set of theme-specific icon URLs. + /// + [JsonPropertyName("themedIconUrls")] + public IList? ThemedIconUrls { get; set; } + + /// + /// The content of the popover, which can be any element. + /// + [JsonPropertyName("content")] + public CardElement? Content { get; set; } + + /// + /// Controls if an arrow should be displayed towards the element that triggered the popover. + /// + [JsonPropertyName("displayArrow")] + public bool? DisplayArrow { get; set; } = true; + + /// + /// Controls where the popover should be displayed with regards to the element that triggered it. + /// + [JsonPropertyName("position")] + public PopoverPosition? Position { get; set; } = PopoverPosition.Above; + + /// + /// The maximum width of the popover in pixels, in the `px` format + /// + [JsonPropertyName("maxPopoverWidth")] + public string? MaxPopoverWidth { get; set; } + + /// + /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this PopoverAction into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public PopoverAction WithKey(string value) { + this.Key = value; + return this; + } + + public PopoverAction WithId(string value) { + this.Id = value; + return this; + } + + public PopoverAction WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public PopoverAction WithTitle(string value) { + this.Title = value; + return this; + } + + public PopoverAction WithIconUrl(string value) { + this.IconUrl = value; + return this; + } + + public PopoverAction WithStyle(ActionStyle value) { + this.Style = value; + return this; + } + + public PopoverAction WithMode(ActionMode value) { + this.Mode = value; + return this; + } + + public PopoverAction WithTooltip(string value) { + this.Tooltip = value; + return this; + } + + public PopoverAction WithIsEnabled(bool value) { + this.IsEnabled = value; + return this; + } + + public PopoverAction WithThemedIconUrls(params IList value) { + this.ThemedIconUrls = value; + return this; + } + + public PopoverAction WithContent(CardElement value) { + this.Content = value; + return this; + } + + public PopoverAction WithDisplayArrow(bool value) { + this.DisplayArrow = value; + return this; + } + + public PopoverAction WithPosition(PopoverPosition value) { + this.Position = value; + return this; + } + + public PopoverAction WithMaxPopoverWidth(string value) { + this.MaxPopoverWidth = value; + return this; + } + + public PopoverAction WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - /// - /// Serializes this SigninSubmitActionData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } +/// +/// Displays a set of action, which can be placed anywhere in the card. +/// +public class ActionSet : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ActionSet. + /// + public static ActionSet? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **ActionSet**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "ActionSet"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The actions in the set. + /// + [JsonPropertyName("actions")] + public IList? Actions { get; set; } + + public ActionSet(params IList actions) + { + this.Actions = actions; + } - public SigninSubmitActionData WithValue(string value) - { - this.Value = value; - return this; - } + /// + /// Serializes this ActionSet into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ActionSet WithKey(string value) { + this.Key = value; + return this; + } + + public ActionSet WithId(string value) { + this.Id = value; + return this; + } + + public ActionSet WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public ActionSet WithLang(string value) { + this.Lang = value; + return this; + } + + public ActionSet WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public ActionSet WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public ActionSet WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public ActionSet WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public ActionSet WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public ActionSet WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public ActionSet WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public ActionSet WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public ActionSet WithFallback(IUnion value) { + this.Fallback = value; + return this; + } + + public ActionSet WithActions(params IList value) { + this.Actions = value; + return this; + } } /// -/// Represents Teams-specific data in an Action.Submit to open a task module. +/// A container for other elements. Use containers for styling purposes and/or to logically group a set of elements together, which can be especially useful when used with Action.ToggleVisibility. /// -public class TaskFetchSubmitActionData : SerializableObject +public class Container : CardElement { - /// - /// Deserializes a JSON string into an object of type TaskFetchSubmitActionData. - /// - public static TaskFetchSubmitActionData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } + /// + /// Deserializes a JSON string into an object of type Container. + /// + public static Container? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Container**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Container"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + /// + [JsonPropertyName("style")] + public ContainerStyle? Style { get; set; } + + /// + /// Controls if a border should be displayed around the container. + /// + [JsonPropertyName("showBorder")] + public bool? ShowBorder { get; set; } = false; + + /// + /// Controls if the container should have rounded corners. + /// + [JsonPropertyName("roundedCorners")] + public bool? RoundedCorners { get; set; } = false; + + /// + /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. + /// + [JsonPropertyName("layouts")] + public IList? Layouts { get; set; } + + /// + /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + /// + [JsonPropertyName("bleed")] + public bool? Bleed { get; set; } = false; + + /// + /// The minimum height, in pixels, of the container, in the `px` format. + /// + [JsonPropertyName("minHeight")] + public string? MinHeight { get; set; } + + /// + /// Defines the container's background image. + /// + [JsonPropertyName("backgroundImage")] + public IUnion? BackgroundImage { get; set; } + + /// + /// Controls how the container's content should be vertically aligned. + /// + [JsonPropertyName("verticalContentAlignment")] + public VerticalAlignment? VerticalContentAlignment { get; set; } + + /// + /// Controls if the content of the card is to be rendered left-to-right or right-to-left. + /// + [JsonPropertyName("rtl")] + public bool? Rtl { get; set; } + + /// + /// The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. + /// + [JsonPropertyName("maxHeight")] + public string? MaxHeight { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The elements in the container. + /// + [JsonPropertyName("items")] + public IList? Items { get; set; } + + public Container(params IList items) + { + this.Items = items; + } - /// - /// Must be **task/fetch**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "task/fetch"; + /// + /// Serializes this Container into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Container WithKey(string value) { + this.Key = value; + return this; + } + + public Container WithId(string value) { + this.Id = value; + return this; + } + + public Container WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public Container WithLang(string value) { + this.Lang = value; + return this; + } + + public Container WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public Container WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public Container WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public Container WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public Container WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public Container WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public Container WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public Container WithSelectAction(Action value) { + this.SelectAction = value; + return this; + } + + public Container WithStyle(ContainerStyle value) { + this.Style = value; + return this; + } + + public Container WithShowBorder(bool value) { + this.ShowBorder = value; + return this; + } + + public Container WithRoundedCorners(bool value) { + this.RoundedCorners = value; + return this; + } + + public Container WithLayouts(params IList value) { + this.Layouts = value; + return this; + } + + public Container WithBleed(bool value) { + this.Bleed = value; + return this; + } + + public Container WithMinHeight(string value) { + this.MinHeight = value; + return this; + } + + public Container WithBackgroundImage(IUnion value) { + this.BackgroundImage = value; + return this; + } + + public Container WithVerticalContentAlignment(VerticalAlignment value) { + this.VerticalContentAlignment = value; + return this; + } + + public Container WithRtl(bool value) { + this.Rtl = value; + return this; + } + + public Container WithMaxHeight(string value) { + this.MaxHeight = value; + return this; + } + + public Container WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public Container WithFallback(IUnion value) { + this.Fallback = value; + return this; + } + + public Container WithItems(params IList value) { + this.Items = value; + return this; + } +} - /// - /// Serializes this TaskFetchSubmitActionData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } +/// +/// A layout that stacks elements on top of each other. Layout.Stack is the default layout used by AdaptiveCard and all containers. +/// +public class StackLayout : ContainerLayout +{ + /// + /// Deserializes a JSON string into an object of type StackLayout. + /// + public static StackLayout? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Layout.Stack**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Layout.Stack"; + + /// + /// Controls for which card width the layout should be used. + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Serializes this StackLayout into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public StackLayout WithKey(string value) { + this.Key = value; + return this; + } + + public StackLayout WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } } /// -/// Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can only acknowledge is has received the request. +/// A layout that spreads elements horizontally and wraps them across multiple rows, as needed. /// -public class SubmitAction : Action +public class FlowLayout : ContainerLayout { - /// - /// Deserializes a JSON string into an object of type SubmitAction. - /// - public static SubmitAction? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } + /// + /// Deserializes a JSON string into an object of type FlowLayout. + /// + public static FlowLayout? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Layout.Flow**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Layout.Flow"; + + /// + /// Controls for which card width the layout should be used. + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls how the content of the container should be horizontally aligned. + /// + [JsonPropertyName("horizontalItemsAlignment")] + public HorizontalAlignment? HorizontalItemsAlignment { get; set; } = HorizontalAlignment.Center; + + /// + /// Controls how the content of the container should be vertically aligned. + /// + [JsonPropertyName("verticalItemsAlignment")] + public VerticalAlignment? VerticalItemsAlignment { get; set; } = VerticalAlignment.Top; + + /// + /// Controls how item should fit inside the container. + /// + [JsonPropertyName("itemFit")] + public FlowLayoutItemFit? ItemFit { get; set; } = FlowLayoutItemFit.Fit; + + /// + /// The minimum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. + /// + [JsonPropertyName("minItemWidth")] + public string? MinItemWidth { get; set; } + + /// + /// The maximum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. + /// + [JsonPropertyName("maxItemWidth")] + public string? MaxItemWidth { get; set; } + + /// + /// The width, in pixels, of each item, in the `px` format. Should not be used if maxItemWidth and/or minItemWidth are set. + /// + [JsonPropertyName("itemWidth")] + public string? ItemWidth { get; set; } + + /// + /// The space between items. + /// + [JsonPropertyName("columnSpacing")] + public Spacing? ColumnSpacing { get; set; } = Spacing.Default; + + /// + /// The space between rows of items. + /// + [JsonPropertyName("rowSpacing")] + public Spacing? RowSpacing { get; set; } = Spacing.Default; + + /// + /// Serializes this FlowLayout into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public FlowLayout WithKey(string value) { + this.Key = value; + return this; + } + + public FlowLayout WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public FlowLayout WithHorizontalItemsAlignment(HorizontalAlignment value) { + this.HorizontalItemsAlignment = value; + return this; + } + + public FlowLayout WithVerticalItemsAlignment(VerticalAlignment value) { + this.VerticalItemsAlignment = value; + return this; + } + + public FlowLayout WithItemFit(FlowLayoutItemFit value) { + this.ItemFit = value; + return this; + } + + public FlowLayout WithMinItemWidth(string value) { + this.MinItemWidth = value; + return this; + } + + public FlowLayout WithMaxItemWidth(string value) { + this.MaxItemWidth = value; + return this; + } + + public FlowLayout WithItemWidth(string value) { + this.ItemWidth = value; + return this; + } + + public FlowLayout WithColumnSpacing(Spacing value) { + this.ColumnSpacing = value; + return this; + } + + public FlowLayout WithRowSpacing(Spacing value) { + this.RowSpacing = value; + return this; + } +} - /// - /// Must be **Action.Submit**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Action.Submit"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The title of the action, as it appears on buttons. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - /// - /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. - /// - [JsonPropertyName("iconUrl")] - public string? IconUrl { get; set; } - - /// - /// Control the style of the action, affecting its visual and spoken representations. - /// - [JsonPropertyName("style")] - public ActionStyle? Style { get; set; } - - /// - /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. - /// - [JsonPropertyName("mode")] - public ActionMode? Mode { get; set; } - - /// - /// The tooltip text to display when the action is hovered over. - /// - [JsonPropertyName("tooltip")] - public string? Tooltip { get; set; } - - /// - /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. - /// - [JsonPropertyName("isEnabled")] - public bool? IsEnabled { get; set; } - - /// - /// The data to send to the Bot when the action is executed. When expressed as an object, `data` is sent back to the Bot when the action is executed, adorned with the values of the inputs expressed as key/value pairs, where the key is the Id of the input. If `data` is expressed as a string, input values are not sent to the Bot. - /// - [JsonPropertyName("data")] - public IUnion? Data { get; set; } - - /// - /// The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("associatedInputs")] - public AssociatedInputs? AssociatedInputs { get; set; } - - /// - /// Controls if the action is enabled only if at least one required input has been filled by the user. - /// - [JsonPropertyName("conditionallyEnabled")] - public bool? ConditionallyEnabled { get; set; } - - [JsonPropertyName("msteams")] - public TeamsSubmitActionProperties? Msteams { get; set; } - - /// - /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this SubmitAction into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public SubmitAction WithId(string value) - { - this.Id = value; - return this; - } - - public SubmitAction WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public SubmitAction WithTitle(string value) - { - this.Title = value; - return this; - } - - public SubmitAction WithIconUrl(string value) - { - this.IconUrl = value; - return this; - } - - public SubmitAction WithStyle(ActionStyle value) - { - this.Style = value; - return this; - } - - public SubmitAction WithMode(ActionMode value) - { - this.Mode = value; - return this; - } - - public SubmitAction WithTooltip(string value) - { - this.Tooltip = value; - return this; - } - - public SubmitAction WithIsEnabled(bool value) - { - this.IsEnabled = value; - return this; - } - - public SubmitAction WithData(IUnion value) - { - this.Data = value; - return this; - } - - public SubmitAction WithAssociatedInputs(AssociatedInputs value) - { - this.AssociatedInputs = value; - return this; - } - - public SubmitAction WithConditionallyEnabled(bool value) - { - this.ConditionallyEnabled = value; - return this; - } - - public SubmitAction WithMsteams(TeamsSubmitActionProperties value) - { - this.Msteams = value; - return this; - } - - public SubmitAction WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } +/// +/// A layout that divides a container into named areas into which elements can be placed. +/// +public class AreaGridLayout : ContainerLayout +{ + /// + /// Deserializes a JSON string into an object of type AreaGridLayout. + /// + public static AreaGridLayout? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Layout.AreaGrid**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Layout.AreaGrid"; + + /// + /// Controls for which card width the layout should be used. + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// The columns in the grid layout, defined as a percentage of the available width or in pixels using the `px` format. + /// + [JsonPropertyName("columns")] + public IUnion, IList>? Columns { get; set; } + + /// + /// The areas in the grid layout. + /// + [JsonPropertyName("areas")] + public IList? Areas { get; set; } + + /// + /// The space between columns. + /// + [JsonPropertyName("columnSpacing")] + public Spacing? ColumnSpacing { get; set; } = Spacing.Default; + + /// + /// The space between rows. + /// + [JsonPropertyName("rowSpacing")] + public Spacing? RowSpacing { get; set; } = Spacing.Default; + + /// + /// Serializes this AreaGridLayout into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public AreaGridLayout WithKey(string value) { + this.Key = value; + return this; + } + + public AreaGridLayout WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public AreaGridLayout WithColumns(IUnion, IList> value) { + this.Columns = value; + return this; + } + + public AreaGridLayout WithAreas(params IList value) { + this.Areas = value; + return this; + } + + public AreaGridLayout WithColumnSpacing(Spacing value) { + this.ColumnSpacing = value; + return this; + } + + public AreaGridLayout WithRowSpacing(Spacing value) { + this.RowSpacing = value; + return this; + } } /// -/// Teams-specific properties associated with the action. +/// Defines an area in a Layout.AreaGrid layout. /// -public class TeamsSubmitActionProperties : SerializableObject +public class GridArea : SerializableObject { - /// - /// Deserializes a JSON string into an object of type TeamsSubmitActionProperties. - /// - public static TeamsSubmitActionProperties? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines how feedback is provided to the end-user when the action is executed. - /// - [JsonPropertyName("feedback")] - public TeamsSubmitActionFeedback? Feedback { get; set; } - - /// - /// Serializes this TeamsSubmitActionProperties into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TeamsSubmitActionProperties WithFeedback(TeamsSubmitActionFeedback value) - { - this.Feedback = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type GridArea. + /// + public static GridArea? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The name of the area. To place an element in this area, set its `grid.area` property to match the name of the area. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The start column index of the area. Column indices start at 1. + /// + [JsonPropertyName("column")] + public float? Column { get; set; } = 1; + + /// + /// Defines how many columns the area should span. + /// + [JsonPropertyName("columnSpan")] + public float? ColumnSpan { get; set; } = 1; + + /// + /// The start row index of the area. Row indices start at 1. + /// + [JsonPropertyName("row")] + public float? Row { get; set; } = 1; + + /// + /// Defines how many rows the area should span. + /// + [JsonPropertyName("rowSpan")] + public float? RowSpan { get; set; } = 1; + + /// + /// Serializes this GridArea into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public GridArea WithKey(string value) { + this.Key = value; + return this; + } + + public GridArea WithName(string value) { + this.Name = value; + return this; + } + + public GridArea WithColumn(float value) { + this.Column = value; + return this; + } + + public GridArea WithColumnSpan(float value) { + this.ColumnSpan = value; + return this; + } + + public GridArea WithRow(float value) { + this.Row = value; + return this; + } + + public GridArea WithRowSpan(float value) { + this.RowSpan = value; + return this; + } } /// -/// Represents feedback options for an [Action.Submit](https://adaptivecards.microsoft.com/?topic=Action.Submit). +/// Defines a container's background image and the way it should be rendered. /// -public class TeamsSubmitActionFeedback : SerializableObject +public class BackgroundImage : SerializableObject { - /// - /// Deserializes a JSON string into an object of type TeamsSubmitActionFeedback. - /// - public static TeamsSubmitActionFeedback? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines if a feedback message should be displayed after the action is executed. - /// - [JsonPropertyName("hide")] - public bool? Hide { get; set; } - - /// - /// Serializes this TeamsSubmitActionFeedback into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TeamsSubmitActionFeedback WithHide(bool value) - { - this.Hide = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type BackgroundImage. + /// + public static BackgroundImage? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// Controls how the image should fill the area. + /// + [JsonPropertyName("fillMode")] + public FillMode? FillMode { get; set; } = FillMode.Cover; + + /// + /// Controls how the image should be aligned if it must be cropped or if using repeat fill mode. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } = HorizontalAlignment.Left; + + /// + /// Controls how the image should be aligned if it must be cropped or if using repeat fill mode. + /// + [JsonPropertyName("verticalAlignment")] + public VerticalAlignment? VerticalAlignment { get; set; } = VerticalAlignment.Top; + + /// + /// A set of theme-specific image URLs. + /// + [JsonPropertyName("themedUrls")] + public IList? ThemedUrls { get; set; } + + /// + /// Serializes this BackgroundImage into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public BackgroundImage WithKey(string value) { + this.Key = value; + return this; + } + + public BackgroundImage WithUrl(string value) { + this.Url = value; + return this; + } + + public BackgroundImage WithFillMode(FillMode value) { + this.FillMode = value; + return this; + } + + public BackgroundImage WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public BackgroundImage WithVerticalAlignment(VerticalAlignment value) { + this.VerticalAlignment = value; + return this; + } + + public BackgroundImage WithThemedUrls(params IList value) { + this.ThemedUrls = value; + return this; + } } /// -/// Opens the provided URL in either a separate browser tab or within the host application. +/// Splits the available horizontal space into separate columns, so elements can be organized in a row. /// -public class OpenUrlAction : Action +public class ColumnSet : CardElement { - /// - /// Deserializes a JSON string into an object of type OpenUrlAction. - /// - public static OpenUrlAction? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Action.OpenUrl**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Action.OpenUrl"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The title of the action, as it appears on buttons. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - /// - /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. - /// - [JsonPropertyName("iconUrl")] - public string? IconUrl { get; set; } - - /// - /// Control the style of the action, affecting its visual and spoken representations. - /// - [JsonPropertyName("style")] - public ActionStyle? Style { get; set; } - - /// - /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. - /// - [JsonPropertyName("mode")] - public ActionMode? Mode { get; set; } - - /// - /// The tooltip text to display when the action is hovered over. - /// - [JsonPropertyName("tooltip")] - public string? Tooltip { get; set; } - - /// - /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. - /// - [JsonPropertyName("isEnabled")] - public bool? IsEnabled { get; set; } - - /// - /// The URL to open. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - public OpenUrlAction(string url) - { - this.Url = url; - } - - /// - /// Serializes this OpenUrlAction into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public OpenUrlAction WithId(string value) - { - this.Id = value; - return this; - } - - public OpenUrlAction WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public OpenUrlAction WithTitle(string value) - { - this.Title = value; - return this; - } - - public OpenUrlAction WithIconUrl(string value) - { - this.IconUrl = value; - return this; - } - - public OpenUrlAction WithStyle(ActionStyle value) - { - this.Style = value; - return this; - } - - public OpenUrlAction WithMode(ActionMode value) - { - this.Mode = value; - return this; - } - - public OpenUrlAction WithTooltip(string value) - { - this.Tooltip = value; - return this; - } - - public OpenUrlAction WithIsEnabled(bool value) - { - this.IsEnabled = value; - return this; - } - - public OpenUrlAction WithUrl(string value) - { - this.Url = value; - return this; - } - - public OpenUrlAction WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type ColumnSet. + /// + public static ColumnSet? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **ColumnSet**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "ColumnSet"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + /// + [JsonPropertyName("style")] + public ContainerStyle? Style { get; set; } + + /// + /// Controls if a border should be displayed around the container. + /// + [JsonPropertyName("showBorder")] + public bool? ShowBorder { get; set; } = false; + + /// + /// Controls if the container should have rounded corners. + /// + [JsonPropertyName("roundedCorners")] + public bool? RoundedCorners { get; set; } = false; + + /// + /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + /// + [JsonPropertyName("bleed")] + public bool? Bleed { get; set; } = false; + + /// + /// The minimum height, in pixels, of the container, in the `px` format. + /// + [JsonPropertyName("minHeight")] + public string? MinHeight { get; set; } + + /// + /// The minimum width of the column set. `auto` will automatically adjust the column set's minimum width according to its content and using the `px` format will give the column set an explicit minimum width in pixels. A scrollbar will be displayed if the available width is less than the specified minimum width. + /// + [JsonPropertyName("minWidth")] + public string? MinWidth { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The columns in the set. + /// + [JsonPropertyName("columns")] + public IList? Columns { get; set; } + + /// + /// Serializes this ColumnSet into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ColumnSet WithKey(string value) { + this.Key = value; + return this; + } + + public ColumnSet WithId(string value) { + this.Id = value; + return this; + } + + public ColumnSet WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public ColumnSet WithLang(string value) { + this.Lang = value; + return this; + } + + public ColumnSet WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public ColumnSet WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public ColumnSet WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public ColumnSet WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public ColumnSet WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public ColumnSet WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public ColumnSet WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public ColumnSet WithSelectAction(Action value) { + this.SelectAction = value; + return this; + } + + public ColumnSet WithStyle(ContainerStyle value) { + this.Style = value; + return this; + } + + public ColumnSet WithShowBorder(bool value) { + this.ShowBorder = value; + return this; + } + + public ColumnSet WithRoundedCorners(bool value) { + this.RoundedCorners = value; + return this; + } + + public ColumnSet WithBleed(bool value) { + this.Bleed = value; + return this; + } + + public ColumnSet WithMinHeight(string value) { + this.MinHeight = value; + return this; + } + + public ColumnSet WithMinWidth(string value) { + this.MinWidth = value; + return this; + } + + public ColumnSet WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public ColumnSet WithFallback(IUnion value) { + this.Fallback = value; + return this; + } + + public ColumnSet WithColumns(params IList value) { + this.Columns = value; + return this; + } } /// -/// Toggles the visibility of a set of elements. Action.ToggleVisibility is useful for creating "Show more" type UI patterns. +/// A media element, that makes it possible to embed videos inside a card. /// -public class ToggleVisibilityAction : Action +public class Media : CardElement { - /// - /// Deserializes a JSON string into an object of type ToggleVisibilityAction. - /// - public static ToggleVisibilityAction? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Action.ToggleVisibility**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Action.ToggleVisibility"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The title of the action, as it appears on buttons. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - /// - /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. - /// - [JsonPropertyName("iconUrl")] - public string? IconUrl { get; set; } - - /// - /// Control the style of the action, affecting its visual and spoken representations. - /// - [JsonPropertyName("style")] - public ActionStyle? Style { get; set; } - - /// - /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. - /// - [JsonPropertyName("mode")] - public ActionMode? Mode { get; set; } - - /// - /// The tooltip text to display when the action is hovered over. - /// - [JsonPropertyName("tooltip")] - public string? Tooltip { get; set; } - - /// - /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. - /// - [JsonPropertyName("isEnabled")] - public bool? IsEnabled { get; set; } - - /// - /// The Ids of the elements to toggle the visibility of. - /// - [JsonPropertyName("targetElements")] - public IUnion, IList>? TargetElements { get; set; } - - /// - /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ToggleVisibilityAction into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } + /// + /// Deserializes a JSON string into an object of type Media. + /// + public static Media? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Media**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Media"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The sources for the media. For YouTube, Dailymotion and Vimeo, only one source can be specified. + /// + [JsonPropertyName("sources")] + public IList? Sources { get; set; } + + /// + /// The caption sources for the media. Caption sources are not used for YouTube, Dailymotion or Vimeo sources. + /// + [JsonPropertyName("captionSources")] + public IList? CaptionSources { get; set; } + + /// + /// The URL of the poster image to display. + /// + [JsonPropertyName("poster")] + public string? Poster { get; set; } + + /// + /// The alternate text for the media, used for accessibility purposes. + /// + [JsonPropertyName("altText")] + public string? AltText { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this Media into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Media WithKey(string value) { + this.Key = value; + return this; + } + + public Media WithId(string value) { + this.Id = value; + return this; + } + + public Media WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public Media WithLang(string value) { + this.Lang = value; + return this; + } + + public Media WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public Media WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public Media WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public Media WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public Media WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public Media WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public Media WithSources(params IList value) { + this.Sources = value; + return this; + } + + public Media WithCaptionSources(params IList value) { + this.CaptionSources = value; + return this; + } + + public Media WithPoster(string value) { + this.Poster = value; + return this; + } + + public Media WithAltText(string value) { + this.AltText = value; + return this; + } + + public Media WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public Media WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - public ToggleVisibilityAction WithId(string value) - { - this.Id = value; - return this; - } +/// +/// Defines the source URL of a media stream. YouTube, Dailymotion, Vimeo and Microsoft Stream URLs are supported. +/// +public class MediaSource : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type MediaSource. + /// + public static MediaSource? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The MIME type of the source. + /// + [JsonPropertyName("mimeType")] + public string? MimeType { get; set; } + + /// + /// The URL of the source. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// Serializes this MediaSource into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public MediaSource WithKey(string value) { + this.Key = value; + return this; + } + + public MediaSource WithMimeType(string value) { + this.MimeType = value; + return this; + } + + public MediaSource WithUrl(string value) { + this.Url = value; + return this; + } +} - public ToggleVisibilityAction WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } +/// +/// Defines a source URL for a video captions. +/// +public class CaptionSource : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type CaptionSource. + /// + public static CaptionSource? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The MIME type of the source. + /// + [JsonPropertyName("mimeType")] + public string? MimeType { get; set; } + + /// + /// The URL of the source. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// The label of this caption source. + /// + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// + /// Serializes this CaptionSource into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public CaptionSource WithKey(string value) { + this.Key = value; + return this; + } + + public CaptionSource WithMimeType(string value) { + this.MimeType = value; + return this; + } + + public CaptionSource WithUrl(string value) { + this.Url = value; + return this; + } + + public CaptionSource WithLabel(string value) { + this.Label = value; + return this; + } +} - public ToggleVisibilityAction WithTitle(string value) - { - this.Title = value; - return this; - } +/// +/// A rich text block that displays formatted text. +/// +public class RichTextBlock : CardElement +{ + /// + /// Deserializes a JSON string into an object of type RichTextBlock. + /// + public static RichTextBlock? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **RichTextBlock**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "RichTextBlock"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The Id of the input the RichTextBlock should act as the label of. + /// + [JsonPropertyName("labelFor")] + public string? LabelFor { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The inlines making up the rich text block. + /// + [JsonPropertyName("inlines")] + public IUnion, IList>? Inlines { get; set; } + + /// + /// Serializes this RichTextBlock into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public RichTextBlock WithKey(string value) { + this.Key = value; + return this; + } + + public RichTextBlock WithId(string value) { + this.Id = value; + return this; + } + + public RichTextBlock WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public RichTextBlock WithLang(string value) { + this.Lang = value; + return this; + } + + public RichTextBlock WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public RichTextBlock WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public RichTextBlock WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public RichTextBlock WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public RichTextBlock WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public RichTextBlock WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public RichTextBlock WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public RichTextBlock WithLabelFor(string value) { + this.LabelFor = value; + return this; + } + + public RichTextBlock WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public RichTextBlock WithFallback(IUnion value) { + this.Fallback = value; + return this; + } + + public RichTextBlock WithInlines(IUnion, IList> value) { + this.Inlines = value; + return this; + } +} - public ToggleVisibilityAction WithIconUrl(string value) - { - this.IconUrl = value; - return this; - } +/// +/// Use tables to display data in a tabular way, with rows, columns and cells. +/// +public class Table : CardElement +{ + /// + /// Deserializes a JSON string into an object of type Table. + /// + public static Table? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Table**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Table"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + /// + [JsonPropertyName("style")] + public ContainerStyle? Style { get; set; } + + /// + /// Controls if a border should be displayed around the container. + /// + [JsonPropertyName("showBorder")] + public bool? ShowBorder { get; set; } = false; + + /// + /// Controls if the container should have rounded corners. + /// + [JsonPropertyName("roundedCorners")] + public bool? RoundedCorners { get; set; } = false; + + /// + /// The columns in the table. + /// + [JsonPropertyName("columns")] + public IList? Columns { get; set; } + + /// + /// The minimum width of the table in pixels. `auto` will automatically adjust the table's minimum width according to its content and using the `px` format will give the table an explicit minimum width in pixels. A scrollbar will be displayed if the available width is less than the specified minimum width. + /// + [JsonPropertyName("minWidth")] + public string? MinWidth { get; set; } + + /// + /// Controls whether the first row of the table should be treated as a header. + /// + [JsonPropertyName("firstRowAsHeaders")] + public bool? FirstRowAsHeaders { get; set; } = true; + + /// + /// Controls if grid lines should be displayed. + /// + [JsonPropertyName("showGridLines")] + public bool? ShowGridLines { get; set; } = true; + + /// + /// The style of the grid lines between cells. + /// + [JsonPropertyName("gridStyle")] + public ContainerStyle? GridStyle { get; set; } + + /// + /// Controls how the content of every cell in the table should be horizontally aligned by default. + /// + [JsonPropertyName("horizontalCellContentAlignment")] + public HorizontalAlignment? HorizontalCellContentAlignment { get; set; } + + /// + /// Controls how the content of every cell in the table should be vertically aligned by default. + /// + [JsonPropertyName("verticalCellContentAlignment")] + public VerticalAlignment? VerticalCellContentAlignment { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The rows of the table. + /// + [JsonPropertyName("rows")] + public IList? Rows { get; set; } + + /// + /// Serializes this Table into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Table WithKey(string value) { + this.Key = value; + return this; + } + + public Table WithId(string value) { + this.Id = value; + return this; + } + + public Table WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public Table WithLang(string value) { + this.Lang = value; + return this; + } + + public Table WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public Table WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public Table WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public Table WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public Table WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public Table WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public Table WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public Table WithStyle(ContainerStyle value) { + this.Style = value; + return this; + } + + public Table WithShowBorder(bool value) { + this.ShowBorder = value; + return this; + } + + public Table WithRoundedCorners(bool value) { + this.RoundedCorners = value; + return this; + } + + public Table WithColumns(params IList value) { + this.Columns = value; + return this; + } + + public Table WithMinWidth(string value) { + this.MinWidth = value; + return this; + } + + public Table WithFirstRowAsHeaders(bool value) { + this.FirstRowAsHeaders = value; + return this; + } + + public Table WithShowGridLines(bool value) { + this.ShowGridLines = value; + return this; + } + + public Table WithGridStyle(ContainerStyle value) { + this.GridStyle = value; + return this; + } + + public Table WithHorizontalCellContentAlignment(HorizontalAlignment value) { + this.HorizontalCellContentAlignment = value; + return this; + } + + public Table WithVerticalCellContentAlignment(VerticalAlignment value) { + this.VerticalCellContentAlignment = value; + return this; + } + + public Table WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public Table WithFallback(IUnion value) { + this.Fallback = value; + return this; + } + + public Table WithRows(params IList value) { + this.Rows = value; + return this; + } +} - public ToggleVisibilityAction WithStyle(ActionStyle value) - { - this.Style = value; - return this; - } +/// +/// Defines a column in a Table element. +/// +public class ColumnDefinition : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type ColumnDefinition. + /// + public static ColumnDefinition? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Controls how the content of every cell in the table should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table. + /// + [JsonPropertyName("horizontalCellContentAlignment")] + public HorizontalAlignment? HorizontalCellContentAlignment { get; set; } + + /// + /// Controls how the content of every cell in the column should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table. + /// + [JsonPropertyName("verticalCellContentAlignment")] + public VerticalAlignment? VerticalCellContentAlignment { get; set; } + + /// + /// The width of the column in the table. If expressed as a number, represents the relative weight of the column in the table. If expressed as a string, `auto` will automatically adjust the column's width according to its content and using the `px` format will give the column an explicit width in pixels. + /// + [JsonPropertyName("width")] + public IUnion? Width { get; set; } + + /// + /// Serializes this ColumnDefinition into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ColumnDefinition WithKey(string value) { + this.Key = value; + return this; + } + + public ColumnDefinition WithHorizontalCellContentAlignment(HorizontalAlignment value) { + this.HorizontalCellContentAlignment = value; + return this; + } + + public ColumnDefinition WithVerticalCellContentAlignment(VerticalAlignment value) { + this.VerticalCellContentAlignment = value; + return this; + } + + public ColumnDefinition WithWidth(IUnion value) { + this.Width = value; + return this; + } +} - public ToggleVisibilityAction WithMode(ActionMode value) - { - this.Mode = value; - return this; - } +/// +/// A block of text, optionally formatted using Markdown. +/// +public class TextBlock : CardElement +{ + /// + /// Deserializes a JSON string into an object of type TextBlock. + /// + public static TextBlock? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **TextBlock**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "TextBlock"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The text to display. A subset of markdown is supported. + /// + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// + /// The size of the text. + /// + [JsonPropertyName("size")] + public TextSize? Size { get; set; } + + /// + /// The weight of the text. + /// + [JsonPropertyName("weight")] + public TextWeight? Weight { get; set; } + + /// + /// The color of the text. + /// + [JsonPropertyName("color")] + public TextColor? Color { get; set; } + + /// + /// Controls whether the text should be renderer using a subtler variant of the select color. + /// + [JsonPropertyName("isSubtle")] + public bool? IsSubtle { get; set; } + + /// + /// The type of font to use for rendering. + /// + [JsonPropertyName("fontType")] + public FontType? FontType { get; set; } + + /// + /// Controls if the text should wrap. + /// + [JsonPropertyName("wrap")] + public bool? Wrap { get; set; } = false; + + /// + /// The maximum number of lines to display. + /// + [JsonPropertyName("maxLines")] + public float? MaxLines { get; set; } + + /// + /// The style of the text. + /// + [JsonPropertyName("style")] + public TextBlockStyle? Style { get; set; } + + /// + /// The Id of the input the TextBlock should act as the label of. + /// + [JsonPropertyName("labelFor")] + public string? LabelFor { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + public TextBlock(string text) + { + this.Text = text; + } - public ToggleVisibilityAction WithTooltip(string value) - { - this.Tooltip = value; - return this; - } + /// + /// Serializes this TextBlock into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TextBlock WithKey(string value) { + this.Key = value; + return this; + } + + public TextBlock WithId(string value) { + this.Id = value; + return this; + } + + public TextBlock WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public TextBlock WithLang(string value) { + this.Lang = value; + return this; + } + + public TextBlock WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public TextBlock WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public TextBlock WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public TextBlock WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public TextBlock WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public TextBlock WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public TextBlock WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public TextBlock WithText(string value) { + this.Text = value; + return this; + } + + public TextBlock WithSize(TextSize value) { + this.Size = value; + return this; + } + + public TextBlock WithWeight(TextWeight value) { + this.Weight = value; + return this; + } + + public TextBlock WithColor(TextColor value) { + this.Color = value; + return this; + } + + public TextBlock WithIsSubtle(bool value) { + this.IsSubtle = value; + return this; + } + + public TextBlock WithFontType(FontType value) { + this.FontType = value; + return this; + } + + public TextBlock WithWrap(bool value) { + this.Wrap = value; + return this; + } + + public TextBlock WithMaxLines(float value) { + this.MaxLines = value; + return this; + } + + public TextBlock WithStyle(TextBlockStyle value) { + this.Style = value; + return this; + } + + public TextBlock WithLabelFor(string value) { + this.LabelFor = value; + return this; + } + + public TextBlock WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public TextBlock WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - public ToggleVisibilityAction WithIsEnabled(bool value) - { - this.IsEnabled = value; - return this; - } +/// +/// A set of facts, displayed as a table or a vertical list when horizontal space is constrained. +/// +public class FactSet : CardElement +{ + /// + /// Deserializes a JSON string into an object of type FactSet. + /// + public static FactSet? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **FactSet**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "FactSet"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The facts in the set. + /// + [JsonPropertyName("facts")] + public IList? Facts { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + public FactSet(params IList facts) + { + this.Facts = facts; + } - public ToggleVisibilityAction WithTargetElements(IUnion, IList> value) - { - this.TargetElements = value; - return this; - } + /// + /// Serializes this FactSet into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public FactSet WithKey(string value) { + this.Key = value; + return this; + } + + public FactSet WithId(string value) { + this.Id = value; + return this; + } + + public FactSet WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public FactSet WithLang(string value) { + this.Lang = value; + return this; + } + + public FactSet WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public FactSet WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public FactSet WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public FactSet WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public FactSet WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public FactSet WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public FactSet WithFacts(params IList value) { + this.Facts = value; + return this; + } + + public FactSet WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public FactSet WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - public ToggleVisibilityAction WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } +/// +/// A fact in a FactSet element. +/// +public class Fact : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type Fact. + /// + public static Fact? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The fact's title. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// The fact's value. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + public Fact(string title, string value) + { + this.Title = title; + this.Value = value; + } + + /// + /// Serializes this Fact into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Fact WithKey(string value) { + this.Key = value; + return this; + } + + public Fact WithTitle(string value) { + this.Title = value; + return this; + } + + public Fact WithValue(string value) { + this.Value = value; + return this; + } } /// -/// Defines a target element in an Action.ToggleVisibility. +/// A set of images, displayed side-by-side and wrapped across multiple rows as needed. /// -public class TargetElement : SerializableObject +public class ImageSet : CardElement { - /// - /// Deserializes a JSON string into an object of type TargetElement. - /// - public static TargetElement? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } + /// + /// Deserializes a JSON string into an object of type ImageSet. + /// + public static ImageSet? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **ImageSet**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "ImageSet"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The images in the set. + /// + [JsonPropertyName("images")] + public IList? Images { get; set; } + + /// + /// The size to use to render all images in the set. + /// + [JsonPropertyName("imageSize")] + public ImageSize? ImageSize { get; set; } = ImageSize.Medium; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + public ImageSet(params IList images) + { + this.Images = images; + } - /// - /// The Id of the element to change the visibility of. - /// - [JsonPropertyName("elementId")] - public string? ElementId { get; set; } - - /// - /// The new visibility state of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Serializes this TargetElement into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } + /// + /// Serializes this ImageSet into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ImageSet WithKey(string value) { + this.Key = value; + return this; + } + + public ImageSet WithId(string value) { + this.Id = value; + return this; + } + + public ImageSet WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public ImageSet WithLang(string value) { + this.Lang = value; + return this; + } + + public ImageSet WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public ImageSet WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public ImageSet WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public ImageSet WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public ImageSet WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public ImageSet WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public ImageSet WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public ImageSet WithImages(params IList value) { + this.Images = value; + return this; + } + + public ImageSet WithImageSize(ImageSize value) { + this.ImageSize = value; + return this; + } + + public ImageSet WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public ImageSet WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - public TargetElement WithElementId(string value) - { - this.ElementId = value; - return this; - } +/// +/// A standalone image element. +/// +public class Image : CardElement +{ + /// + /// Deserializes a JSON string into an object of type Image. + /// + public static Image? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Image**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Image"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// The alternate text for the image, used for accessibility purposes. + /// + [JsonPropertyName("altText")] + public string? AltText { get; set; } + + /// + /// The background color of the image. + /// + [JsonPropertyName("backgroundColor")] + public string? BackgroundColor { get; set; } + + /// + /// The style of the image. + /// + [JsonPropertyName("style")] + public ImageStyle? Style { get; set; } = ImageStyle.Default; + + /// + /// The size of the image. + /// + [JsonPropertyName("size")] + public Size? Size { get; set; } = Size.Auto; + + /// + /// The width of the image. + /// + [JsonPropertyName("width")] + public string? Width { get; set; } = "auto"; + + /// + /// An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// Controls if the image can be expanded to full screen. + /// + [JsonPropertyName("allowExpand")] + public bool? AllowExpand { get; set; } = false; + + /// + /// Teams-specific metadata associated with the image. + /// + [JsonPropertyName("msteams")] + public TeamsImageProperties? Msteams { get; set; } + + /// + /// Teams-specific metadata associated with the image. Equivalent to `msteams`. + /// + [JsonPropertyName("msTeams")] + public TeamsImageProperties? MsTeams { get; set; } + + /// + /// A set of theme-specific image URLs. + /// + [JsonPropertyName("themedUrls")] + public IList? ThemedUrls { get; set; } + + /// + /// Controls how the image should be fitted inside its bounding box. imageFit is only meaningful when both the width and height properties are set. When fitMode is set to contain, the default style is always used. + /// + [JsonPropertyName("fitMode")] + public ImageFitMode? FitMode { get; set; } = ImageFitMode.Fill; + + /// + /// Controls the horizontal position of the image within its bounding box. horizontalContentAlignment is only meaningful when both the width and height properties are set and fitMode is set to either cover or contain. + /// + [JsonPropertyName("horizontalContentAlignment")] + public HorizontalAlignment? HorizontalContentAlignment { get; set; } = HorizontalAlignment.Left; + + /// + /// Controls the vertical position of the image within its bounding box. verticalContentAlignment is only meaningful when both the width and height properties are set and fitMode is set to either cover or contain. + /// + [JsonPropertyName("verticalContentAlignment")] + public VerticalAlignment? VerticalContentAlignment { get; set; } = VerticalAlignment.Top; + + /// + /// The height of the image. + /// + [JsonPropertyName("height")] + public string? Height { get; set; } = "auto"; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + public Image(string url) + { + this.Url = url; + } - public TargetElement WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } + /// + /// Serializes this Image into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Image WithKey(string value) { + this.Key = value; + return this; + } + + public Image WithId(string value) { + this.Id = value; + return this; + } + + public Image WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public Image WithLang(string value) { + this.Lang = value; + return this; + } + + public Image WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public Image WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public Image WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public Image WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public Image WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public Image WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public Image WithUrl(string value) { + this.Url = value; + return this; + } + + public Image WithAltText(string value) { + this.AltText = value; + return this; + } + + public Image WithBackgroundColor(string value) { + this.BackgroundColor = value; + return this; + } + + public Image WithStyle(ImageStyle value) { + this.Style = value; + return this; + } + + public Image WithSize(Size value) { + this.Size = value; + return this; + } + + public Image WithWidth(string value) { + this.Width = value; + return this; + } + + public Image WithSelectAction(Action value) { + this.SelectAction = value; + return this; + } + + public Image WithAllowExpand(bool value) { + this.AllowExpand = value; + return this; + } + + public Image WithMsteams(TeamsImageProperties value) { + this.Msteams = value; + return this; + } + + public Image WithMsTeams(TeamsImageProperties value) { + this.MsTeams = value; + return this; + } + + public Image WithThemedUrls(params IList value) { + this.ThemedUrls = value; + return this; + } + + public Image WithFitMode(ImageFitMode value) { + this.FitMode = value; + return this; + } + + public Image WithHorizontalContentAlignment(HorizontalAlignment value) { + this.HorizontalContentAlignment = value; + return this; + } + + public Image WithVerticalContentAlignment(VerticalAlignment value) { + this.VerticalContentAlignment = value; + return this; + } + + public Image WithHeight(string value) { + this.Height = value; + return this; + } + + public Image WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public Image WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// Expands or collapses an embedded card within the main card. +/// Represents a set of Teams-specific properties on an image. /// -public class ShowCardAction : Action +public class TeamsImageProperties : SerializableObject { - /// - /// Deserializes a JSON string into an object of type ShowCardAction. - /// - public static ShowCardAction? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Action.ShowCard**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Action.ShowCard"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The title of the action, as it appears on buttons. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - /// - /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. - /// - [JsonPropertyName("iconUrl")] - public string? IconUrl { get; set; } - - /// - /// Control the style of the action, affecting its visual and spoken representations. - /// - [JsonPropertyName("style")] - public ActionStyle? Style { get; set; } - - /// - /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. - /// - [JsonPropertyName("mode")] - public ActionMode? Mode { get; set; } - - /// - /// The tooltip text to display when the action is hovered over. - /// - [JsonPropertyName("tooltip")] - public string? Tooltip { get; set; } - - /// - /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. - /// - [JsonPropertyName("isEnabled")] - public bool? IsEnabled { get; set; } - - /// - /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The card that should be displayed when the action is executed. - /// - [JsonPropertyName("card")] - public AdaptiveCard? Card { get; set; } - - /// - /// Serializes this ShowCardAction into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } + /// + /// Deserializes a JSON string into an object of type TeamsImageProperties. + /// + public static TeamsImageProperties? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Controls if the image is expandable in Teams. This property is equivalent to the Image.allowExpand property. + /// + [JsonPropertyName("allowExpand")] + public bool? AllowExpand { get; set; } + + /// + /// Serializes this TeamsImageProperties into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TeamsImageProperties WithKey(string value) { + this.Key = value; + return this; + } + + public TeamsImageProperties WithAllowExpand(bool value) { + this.AllowExpand = value; + return this; + } +} - public ShowCardAction WithId(string value) - { - this.Id = value; - return this; - } - - public ShowCardAction WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public ShowCardAction WithTitle(string value) - { - this.Title = value; - return this; - } - - public ShowCardAction WithIconUrl(string value) - { - this.IconUrl = value; - return this; - } - - public ShowCardAction WithStyle(ActionStyle value) - { - this.Style = value; - return this; - } - - public ShowCardAction WithMode(ActionMode value) - { - this.Mode = value; - return this; - } - - public ShowCardAction WithTooltip(string value) - { - this.Tooltip = value; - return this; - } - - public ShowCardAction WithIsEnabled(bool value) - { - this.IsEnabled = value; - return this; - } - - public ShowCardAction WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } - - public ShowCardAction WithCard(AdaptiveCard value) - { - this.Card = value; - return this; - } +/// +/// An input to allow the user to enter text. +/// +public class TextInput : CardElement +{ + /// + /// Deserializes a JSON string into an object of type TextInput. + /// + public static TextInput? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Input.Text**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Input.Text"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The label of the input. + /// + /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + /// + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// + /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("isRequired")] + public bool? IsRequired { get; set; } = false; + + /// + /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("errorMessage")] + public string? ErrorMessage { get; set; } + + /// + /// An Action.ResetInputs action that will be executed when the value of the input changes. + /// + [JsonPropertyName("valueChangedAction")] + public Action? ValueChangedAction { get; set; } + + /// + /// The default value of the input. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + /// + /// The maximum length of the text in the input. + /// + [JsonPropertyName("maxLength")] + public float? MaxLength { get; set; } + + /// + /// Controls if the input should allow multiple lines of text. + /// + [JsonPropertyName("isMultiline")] + public bool? IsMultiline { get; set; } = false; + + /// + /// The text to display as a placeholder when the user hasn't entered a value. + /// + [JsonPropertyName("placeholder")] + public string? Placeholder { get; set; } + + /// + /// The style of the input. + /// + [JsonPropertyName("style")] + public InputTextStyle? Style { get; set; } = InputTextStyle.Text; + + /// + /// The action that should be displayed as a button alongside the input. Action.ShowCard is not supported. + /// + [JsonPropertyName("inlineAction")] + public Action? InlineAction { get; set; } + + /// + /// The regular expression to validate the input. + /// + [JsonPropertyName("regex")] + public string? Regex { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this TextInput into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TextInput WithKey(string value) { + this.Key = value; + return this; + } + + public TextInput WithId(string value) { + this.Id = value; + return this; + } + + public TextInput WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public TextInput WithLang(string value) { + this.Lang = value; + return this; + } + + public TextInput WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public TextInput WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public TextInput WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public TextInput WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public TextInput WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public TextInput WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public TextInput WithLabel(string value) { + this.Label = value; + return this; + } + + public TextInput WithIsRequired(bool value) { + this.IsRequired = value; + return this; + } + + public TextInput WithErrorMessage(string value) { + this.ErrorMessage = value; + return this; + } + + public TextInput WithValueChangedAction(Action value) { + this.ValueChangedAction = value; + return this; + } + + public TextInput WithValue(string value) { + this.Value = value; + return this; + } + + public TextInput WithMaxLength(float value) { + this.MaxLength = value; + return this; + } + + public TextInput WithIsMultiline(bool value) { + this.IsMultiline = value; + return this; + } + + public TextInput WithPlaceholder(string value) { + this.Placeholder = value; + return this; + } + + public TextInput WithStyle(InputTextStyle value) { + this.Style = value; + return this; + } + + public TextInput WithInlineAction(Action value) { + this.InlineAction = value; + return this; + } + + public TextInput WithRegex(string value) { + this.Regex = value; + return this; + } + + public TextInput WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public TextInput WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// Resets the values of the inputs in the card. +/// An input to allow the user to select a date. /// -public class ResetInputsAction : Action +public class DateInput : CardElement { - /// - /// Deserializes a JSON string into an object of type ResetInputsAction. - /// - public static ResetInputsAction? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Action.ResetInputs**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Action.ResetInputs"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The title of the action, as it appears on buttons. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - /// - /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. - /// - [JsonPropertyName("iconUrl")] - public string? IconUrl { get; set; } - - /// - /// Control the style of the action, affecting its visual and spoken representations. - /// - [JsonPropertyName("style")] - public ActionStyle? Style { get; set; } - - /// - /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. - /// - [JsonPropertyName("mode")] - public ActionMode? Mode { get; set; } - - /// - /// The tooltip text to display when the action is hovered over. - /// - [JsonPropertyName("tooltip")] - public string? Tooltip { get; set; } - - /// - /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. - /// - [JsonPropertyName("isEnabled")] - public bool? IsEnabled { get; set; } - - /// - /// The Ids of the inputs that should be reset. - /// - [JsonPropertyName("targetInputIds")] - public IList? TargetInputIds { get; set; } - - /// - /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ResetInputsAction into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ResetInputsAction WithId(string value) - { - this.Id = value; - return this; - } - - public ResetInputsAction WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public ResetInputsAction WithTitle(string value) - { - this.Title = value; - return this; - } - - public ResetInputsAction WithIconUrl(string value) - { - this.IconUrl = value; - return this; - } - - public ResetInputsAction WithStyle(ActionStyle value) - { - this.Style = value; - return this; - } - - public ResetInputsAction WithMode(ActionMode value) - { - this.Mode = value; - return this; - } - - public ResetInputsAction WithTooltip(string value) - { - this.Tooltip = value; - return this; - } - - public ResetInputsAction WithIsEnabled(bool value) - { - this.IsEnabled = value; - return this; - } - - public ResetInputsAction WithTargetInputIds(params IList value) - { - this.TargetInputIds = value; - return this; - } - - public ResetInputsAction WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type DateInput. + /// + public static DateInput? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Input.Date**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Input.Date"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The label of the input. + /// + /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + /// + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// + /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("isRequired")] + public bool? IsRequired { get; set; } = false; + + /// + /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("errorMessage")] + public string? ErrorMessage { get; set; } + + /// + /// An Action.ResetInputs action that will be executed when the value of the input changes. + /// + [JsonPropertyName("valueChangedAction")] + public Action? ValueChangedAction { get; set; } + + /// + /// The default value of the input, in the `YYYY-MM-DD` format. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + /// + /// The text to display as a placeholder when the user has not selected a date. + /// + [JsonPropertyName("placeholder")] + public string? Placeholder { get; set; } + + /// + /// The minimum date that can be selected. + /// + [JsonPropertyName("min")] + public string? Min { get; set; } + + /// + /// The maximum date that can be selected. + /// + [JsonPropertyName("max")] + public string? Max { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this DateInput into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public DateInput WithKey(string value) { + this.Key = value; + return this; + } + + public DateInput WithId(string value) { + this.Id = value; + return this; + } + + public DateInput WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public DateInput WithLang(string value) { + this.Lang = value; + return this; + } + + public DateInput WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public DateInput WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public DateInput WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public DateInput WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public DateInput WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public DateInput WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public DateInput WithLabel(string value) { + this.Label = value; + return this; + } + + public DateInput WithIsRequired(bool value) { + this.IsRequired = value; + return this; + } + + public DateInput WithErrorMessage(string value) { + this.ErrorMessage = value; + return this; + } + + public DateInput WithValueChangedAction(Action value) { + this.ValueChangedAction = value; + return this; + } + + public DateInput WithValue(string value) { + this.Value = value; + return this; + } + + public DateInput WithPlaceholder(string value) { + this.Placeholder = value; + return this; + } + + public DateInput WithMin(string value) { + this.Min = value; + return this; + } + + public DateInput WithMax(string value) { + this.Max = value; + return this; + } + + public DateInput WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public DateInput WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// Inserts an image into the host application's canvas. +/// An input to allow the user to select a time. /// -public class InsertImageAction : Action +public class TimeInput : CardElement { - /// - /// Deserializes a JSON string into an object of type InsertImageAction. - /// - public static InsertImageAction? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Action.InsertImage**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Action.InsertImage"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The title of the action, as it appears on buttons. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - /// - /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. - /// - [JsonPropertyName("iconUrl")] - public string? IconUrl { get; set; } - - /// - /// Control the style of the action, affecting its visual and spoken representations. - /// - [JsonPropertyName("style")] - public ActionStyle? Style { get; set; } - - /// - /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. - /// - [JsonPropertyName("mode")] - public ActionMode? Mode { get; set; } - - /// - /// The tooltip text to display when the action is hovered over. - /// - [JsonPropertyName("tooltip")] - public string? Tooltip { get; set; } - - /// - /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. - /// - [JsonPropertyName("isEnabled")] - public bool? IsEnabled { get; set; } - - /// - /// The URL of the image to insert. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The alternate text for the image. - /// - [JsonPropertyName("altText")] - public string? AltText { get; set; } - - /// - /// The position at which to insert the image. - /// - [JsonPropertyName("insertPosition")] - public ImageInsertPosition? InsertPosition { get; set; } - - /// - /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this InsertImageAction into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public InsertImageAction WithId(string value) - { - this.Id = value; - return this; - } - - public InsertImageAction WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public InsertImageAction WithTitle(string value) - { - this.Title = value; - return this; - } - - public InsertImageAction WithIconUrl(string value) - { - this.IconUrl = value; - return this; - } - - public InsertImageAction WithStyle(ActionStyle value) - { - this.Style = value; - return this; - } - - public InsertImageAction WithMode(ActionMode value) - { - this.Mode = value; - return this; - } - - public InsertImageAction WithTooltip(string value) - { - this.Tooltip = value; - return this; - } - - public InsertImageAction WithIsEnabled(bool value) - { - this.IsEnabled = value; - return this; - } - - public InsertImageAction WithUrl(string value) - { - this.Url = value; - return this; - } - - public InsertImageAction WithAltText(string value) - { - this.AltText = value; - return this; - } - - public InsertImageAction WithInsertPosition(ImageInsertPosition value) - { - this.InsertPosition = value; - return this; - } - - public InsertImageAction WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type TimeInput. + /// + public static TimeInput? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Input.Time**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Input.Time"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The label of the input. + /// + /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + /// + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// + /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("isRequired")] + public bool? IsRequired { get; set; } = false; + + /// + /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("errorMessage")] + public string? ErrorMessage { get; set; } + + /// + /// An Action.ResetInputs action that will be executed when the value of the input changes. + /// + [JsonPropertyName("valueChangedAction")] + public Action? ValueChangedAction { get; set; } + + /// + /// The default value of the input, in the `HH:MM` format. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + /// + /// The text to display as a placeholder when the user hasn't entered a value. + /// + [JsonPropertyName("placeholder")] + public string? Placeholder { get; set; } + + /// + /// The minimum time that can be selected, in the `HH:MM` format. + /// + [JsonPropertyName("min")] + public string? Min { get; set; } + + /// + /// The maximum time that can be selected, in the `HH:MM` format. + /// + [JsonPropertyName("max")] + public string? Max { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this TimeInput into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TimeInput WithKey(string value) { + this.Key = value; + return this; + } + + public TimeInput WithId(string value) { + this.Id = value; + return this; + } + + public TimeInput WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public TimeInput WithLang(string value) { + this.Lang = value; + return this; + } + + public TimeInput WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public TimeInput WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public TimeInput WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public TimeInput WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public TimeInput WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public TimeInput WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public TimeInput WithLabel(string value) { + this.Label = value; + return this; + } + + public TimeInput WithIsRequired(bool value) { + this.IsRequired = value; + return this; + } + + public TimeInput WithErrorMessage(string value) { + this.ErrorMessage = value; + return this; + } + + public TimeInput WithValueChangedAction(Action value) { + this.ValueChangedAction = value; + return this; + } + + public TimeInput WithValue(string value) { + this.Value = value; + return this; + } + + public TimeInput WithPlaceholder(string value) { + this.Placeholder = value; + return this; + } + + public TimeInput WithMin(string value) { + this.Min = value; + return this; + } + + public TimeInput WithMax(string value) { + this.Max = value; + return this; + } + + public TimeInput WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public TimeInput WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// A layout that stacks elements on top of each other. Layout.Stack is the default layout used by AdaptiveCard and all containers. +/// An input to allow the user to enter a number. /// -public class StackLayout : ContainerLayout +public class NumberInput : CardElement { - /// - /// Deserializes a JSON string into an object of type StackLayout. - /// - public static StackLayout? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Layout.Stack**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Layout.Stack"; - - /// - /// Controls for which card width the layout should be used. - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Serializes this StackLayout into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public StackLayout WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type NumberInput. + /// + public static NumberInput? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Input.Number**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Input.Number"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The label of the input. + /// + /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + /// + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// + /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("isRequired")] + public bool? IsRequired { get; set; } = false; + + /// + /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("errorMessage")] + public string? ErrorMessage { get; set; } + + /// + /// An Action.ResetInputs action that will be executed when the value of the input changes. + /// + [JsonPropertyName("valueChangedAction")] + public Action? ValueChangedAction { get; set; } + + /// + /// The default value of the input. + /// + [JsonPropertyName("value")] + public float? Value { get; set; } + + /// + /// The text to display as a placeholder when the user hasn't entered a value. + /// + [JsonPropertyName("placeholder")] + public string? Placeholder { get; set; } + + /// + /// The minimum value that can be entered. + /// + [JsonPropertyName("min")] + public float? Min { get; set; } + + /// + /// The maximum value that can be entered. + /// + [JsonPropertyName("max")] + public float? Max { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this NumberInput into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public NumberInput WithKey(string value) { + this.Key = value; + return this; + } + + public NumberInput WithId(string value) { + this.Id = value; + return this; + } + + public NumberInput WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public NumberInput WithLang(string value) { + this.Lang = value; + return this; + } + + public NumberInput WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public NumberInput WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public NumberInput WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public NumberInput WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public NumberInput WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public NumberInput WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public NumberInput WithLabel(string value) { + this.Label = value; + return this; + } + + public NumberInput WithIsRequired(bool value) { + this.IsRequired = value; + return this; + } + + public NumberInput WithErrorMessage(string value) { + this.ErrorMessage = value; + return this; + } + + public NumberInput WithValueChangedAction(Action value) { + this.ValueChangedAction = value; + return this; + } + + public NumberInput WithValue(float value) { + this.Value = value; + return this; + } + + public NumberInput WithPlaceholder(string value) { + this.Placeholder = value; + return this; + } + + public NumberInput WithMin(float value) { + this.Min = value; + return this; + } + + public NumberInput WithMax(float value) { + this.Max = value; + return this; + } + + public NumberInput WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public NumberInput WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// A layout that spreads elements horizontally and wraps them across multiple rows, as needed. +/// An input to allow the user to select between on/off states. /// -public class FlowLayout : ContainerLayout +public class ToggleInput : CardElement { - /// - /// Deserializes a JSON string into an object of type FlowLayout. - /// - public static FlowLayout? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Layout.Flow**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Layout.Flow"; - - /// - /// Controls for which card width the layout should be used. - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls how the content of the container should be horizontally aligned. - /// - [JsonPropertyName("horizontalItemsAlignment")] - public HorizontalAlignment? HorizontalItemsAlignment { get; set; } - - /// - /// Controls how the content of the container should be vertically aligned. - /// - [JsonPropertyName("verticalItemsAlignment")] - public VerticalAlignment? VerticalItemsAlignment { get; set; } - - /// - /// Controls how item should fit inside the container. - /// - [JsonPropertyName("itemFit")] - public FlowLayoutItemFit? ItemFit { get; set; } - - /// - /// The minimum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. - /// - [JsonPropertyName("minItemWidth")] - public string? MinItemWidth { get; set; } - - /// - /// The maximum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. - /// - [JsonPropertyName("maxItemWidth")] - public string? MaxItemWidth { get; set; } - - /// - /// The width, in pixels, of each item, in the `px` format. Should not be used if maxItemWidth and/or minItemWidth are set. - /// - [JsonPropertyName("itemWidth")] - public string? ItemWidth { get; set; } - - /// - /// The space between items. - /// - [JsonPropertyName("columnSpacing")] - public Spacing? ColumnSpacing { get; set; } - - /// - /// The space between rows of items. - /// - [JsonPropertyName("rowSpacing")] - public Spacing? RowSpacing { get; set; } - - /// - /// Serializes this FlowLayout into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public FlowLayout WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public FlowLayout WithHorizontalItemsAlignment(HorizontalAlignment value) - { - this.HorizontalItemsAlignment = value; - return this; - } - - public FlowLayout WithVerticalItemsAlignment(VerticalAlignment value) - { - this.VerticalItemsAlignment = value; - return this; - } - - public FlowLayout WithItemFit(FlowLayoutItemFit value) - { - this.ItemFit = value; - return this; - } - - public FlowLayout WithMinItemWidth(string value) - { - this.MinItemWidth = value; - return this; - } - - public FlowLayout WithMaxItemWidth(string value) - { - this.MaxItemWidth = value; - return this; - } - - public FlowLayout WithItemWidth(string value) - { - this.ItemWidth = value; - return this; - } - - public FlowLayout WithColumnSpacing(Spacing value) - { - this.ColumnSpacing = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type ToggleInput. + /// + public static ToggleInput? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Input.Toggle**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Input.Toggle"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The label of the input. + /// + /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + /// + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// + /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("isRequired")] + public bool? IsRequired { get; set; } = false; + + /// + /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("errorMessage")] + public string? ErrorMessage { get; set; } + + /// + /// An Action.ResetInputs action that will be executed when the value of the input changes. + /// + [JsonPropertyName("valueChangedAction")] + public Action? ValueChangedAction { get; set; } + + /// + /// The default value of the input. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } = "false"; + + /// + /// The title (caption) to display next to the toggle. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// The value to send to the Bot when the toggle is on. + /// + [JsonPropertyName("valueOn")] + public string? ValueOn { get; set; } = "true"; + + /// + /// The value to send to the Bot when the toggle is off. + /// + [JsonPropertyName("valueOff")] + public string? ValueOff { get; set; } = "false"; + + /// + /// Controls if the title should wrap. + /// + [JsonPropertyName("wrap")] + public bool? Wrap { get; set; } = true; + + /// + /// Controls whether the title is visually displayed. When set to false, the title is hidden from view but remains accessible to screen readers for accessibility purposes. + /// + [JsonPropertyName("showTitle")] + public bool? ShowTitle { get; set; } = true; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + public ToggleInput(string title) + { + this.Title = title; + } - public FlowLayout WithRowSpacing(Spacing value) - { - this.RowSpacing = value; - return this; - } + /// + /// Serializes this ToggleInput into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ToggleInput WithKey(string value) { + this.Key = value; + return this; + } + + public ToggleInput WithId(string value) { + this.Id = value; + return this; + } + + public ToggleInput WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public ToggleInput WithLang(string value) { + this.Lang = value; + return this; + } + + public ToggleInput WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public ToggleInput WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public ToggleInput WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public ToggleInput WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public ToggleInput WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public ToggleInput WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public ToggleInput WithLabel(string value) { + this.Label = value; + return this; + } + + public ToggleInput WithIsRequired(bool value) { + this.IsRequired = value; + return this; + } + + public ToggleInput WithErrorMessage(string value) { + this.ErrorMessage = value; + return this; + } + + public ToggleInput WithValueChangedAction(Action value) { + this.ValueChangedAction = value; + return this; + } + + public ToggleInput WithValue(string value) { + this.Value = value; + return this; + } + + public ToggleInput WithTitle(string value) { + this.Title = value; + return this; + } + + public ToggleInput WithValueOn(string value) { + this.ValueOn = value; + return this; + } + + public ToggleInput WithValueOff(string value) { + this.ValueOff = value; + return this; + } + + public ToggleInput WithWrap(bool value) { + this.Wrap = value; + return this; + } + + public ToggleInput WithShowTitle(bool value) { + this.ShowTitle = value; + return this; + } + + public ToggleInput WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public ToggleInput WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// A layout that divides a container into named areas into which elements can be placed. +/// An input to allow the user to select one or more values. /// -public class AreaGridLayout : ContainerLayout +public class ChoiceSetInput : CardElement { - /// - /// Deserializes a JSON string into an object of type AreaGridLayout. - /// - public static AreaGridLayout? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Layout.AreaGrid**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Layout.AreaGrid"; - - /// - /// Controls for which card width the layout should be used. - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// The columns in the grid layout, defined as a percentage of the available width or in pixels using the `px` format. - /// - [JsonPropertyName("columns")] - public IUnion, IList>? Columns { get; set; } - - /// - /// The areas in the grid layout. - /// - [JsonPropertyName("areas")] - public IList? Areas { get; set; } - - /// - /// The space between columns. - /// - [JsonPropertyName("columnSpacing")] - public Spacing? ColumnSpacing { get; set; } - - /// - /// The space between rows. - /// - [JsonPropertyName("rowSpacing")] - public Spacing? RowSpacing { get; set; } - - /// - /// Serializes this AreaGridLayout into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public AreaGridLayout WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public AreaGridLayout WithColumns(IUnion, IList> value) - { - this.Columns = value; - return this; - } - - public AreaGridLayout WithAreas(params IList value) - { - this.Areas = value; - return this; - } - - public AreaGridLayout WithColumnSpacing(Spacing value) - { - this.ColumnSpacing = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type ChoiceSetInput. + /// + public static ChoiceSetInput? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Input.ChoiceSet**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Input.ChoiceSet"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The label of the input. + /// + /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + /// + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// + /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("isRequired")] + public bool? IsRequired { get; set; } = false; + + /// + /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("errorMessage")] + public string? ErrorMessage { get; set; } + + /// + /// An Action.ResetInputs action that will be executed when the value of the input changes. + /// + [JsonPropertyName("valueChangedAction")] + public Action? ValueChangedAction { get; set; } + + /// + /// The default value of the input. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + /// + /// The choices associated with the input. + /// + [JsonPropertyName("choices")] + public IList? Choices { get; set; } + + /// + /// A Data.Query object that defines the dataset from which to dynamically fetch the choices for the input. + /// + [JsonPropertyName("choices.data")] + public QueryData? ChoicesData { get; set; } + + /// + /// Controls whether the input should be displayed as a dropdown (compact) or a list of radio buttons or checkboxes (expanded). + /// + [JsonPropertyName("style")] + public ChoiceSetInputStyle? Style { get; set; } = ChoiceSetInputStyle.Compact; + + /// + /// Controls whether multiple choices can be selected. + /// + [JsonPropertyName("isMultiSelect")] + public bool? IsMultiSelect { get; set; } = false; + + /// + /// The text to display as a placeholder when the user has not entered any value. + /// + [JsonPropertyName("placeholder")] + public string? Placeholder { get; set; } + + /// + /// Controls if choice titles should wrap. + /// + [JsonPropertyName("wrap")] + public bool? Wrap { get; set; } = true; + + /// + /// Controls whether choice items are arranged in multiple columns in expanded mode, or in a single column. Default is false. + /// + [JsonPropertyName("useMultipleColumns")] + public bool? UseMultipleColumns { get; set; } = false; + + /// + /// The minimum width, in pixels, for each column when using a multi-column layout. This ensures that choice items remain readable even when horizontal space is limited. Default is 100 pixels. + /// + [JsonPropertyName("minColumnWidth")] + public string? MinColumnWidth { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + public ChoiceSetInput(params IList choices) + { + this.Choices = choices; + } - public AreaGridLayout WithRowSpacing(Spacing value) - { - this.RowSpacing = value; - return this; - } + /// + /// Serializes this ChoiceSetInput into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ChoiceSetInput WithKey(string value) { + this.Key = value; + return this; + } + + public ChoiceSetInput WithId(string value) { + this.Id = value; + return this; + } + + public ChoiceSetInput WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public ChoiceSetInput WithLang(string value) { + this.Lang = value; + return this; + } + + public ChoiceSetInput WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public ChoiceSetInput WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public ChoiceSetInput WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public ChoiceSetInput WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public ChoiceSetInput WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public ChoiceSetInput WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public ChoiceSetInput WithLabel(string value) { + this.Label = value; + return this; + } + + public ChoiceSetInput WithIsRequired(bool value) { + this.IsRequired = value; + return this; + } + + public ChoiceSetInput WithErrorMessage(string value) { + this.ErrorMessage = value; + return this; + } + + public ChoiceSetInput WithValueChangedAction(Action value) { + this.ValueChangedAction = value; + return this; + } + + public ChoiceSetInput WithValue(string value) { + this.Value = value; + return this; + } + + public ChoiceSetInput WithChoices(params IList value) { + this.Choices = value; + return this; + } + + public ChoiceSetInput WithChoicesData(QueryData value) { + this.ChoicesData = value; + return this; + } + + public ChoiceSetInput WithStyle(ChoiceSetInputStyle value) { + this.Style = value; + return this; + } + + public ChoiceSetInput WithIsMultiSelect(bool value) { + this.IsMultiSelect = value; + return this; + } + + public ChoiceSetInput WithPlaceholder(string value) { + this.Placeholder = value; + return this; + } + + public ChoiceSetInput WithWrap(bool value) { + this.Wrap = value; + return this; + } + + public ChoiceSetInput WithUseMultipleColumns(bool value) { + this.UseMultipleColumns = value; + return this; + } + + public ChoiceSetInput WithMinColumnWidth(string value) { + this.MinColumnWidth = value; + return this; + } + + public ChoiceSetInput WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public ChoiceSetInput WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// Defines an area in a Layout.AreaGrid layout. +/// A choice as used by the Input.ChoiceSet input. /// -public class GridArea : SerializableObject +public class Choice : SerializableObject { - /// - /// Deserializes a JSON string into an object of type GridArea. - /// - public static GridArea? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The name of the area. To place an element in this area, set its `grid.area` property to match the name of the area. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// The start column index of the area. Column indices start at 1. - /// - [JsonPropertyName("column")] - public float? Column { get; set; } - - /// - /// Defines how many columns the area should span. - /// - [JsonPropertyName("columnSpan")] - public float? ColumnSpan { get; set; } - - /// - /// The start row index of the area. Row indices start at 1. - /// - [JsonPropertyName("row")] - public float? Row { get; set; } - - /// - /// Defines how many rows the area should span. - /// - [JsonPropertyName("rowSpan")] - public float? RowSpan { get; set; } - - /// - /// Serializes this GridArea into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public GridArea WithName(string value) - { - this.Name = value; - return this; - } - - public GridArea WithColumn(float value) - { - this.Column = value; - return this; - } - - public GridArea WithColumnSpan(float value) - { - this.ColumnSpan = value; - return this; - } - - public GridArea WithRow(float value) - { - this.Row = value; - return this; - } - - public GridArea WithRowSpan(float value) - { - this.RowSpan = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type Choice. + /// + public static Choice? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The text to display for the choice. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// The value associated with the choice, as sent to the Bot when an Action.Submit or Action.Execute is invoked + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + /// + /// Serializes this Choice into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Choice WithKey(string value) { + this.Key = value; + return this; + } + + public Choice WithTitle(string value) { + this.Title = value; + return this; + } + + public Choice WithValue(string value) { + this.Value = value; + return this; + } } /// -/// Defines a container's background image and the way it should be rendered. +/// Defines a query to dynamically fetch data from a Bot. /// -public class BackgroundImage : SerializableObject +public class QueryData : SerializableObject { - /// - /// Deserializes a JSON string into an object of type BackgroundImage. - /// - public static BackgroundImage? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// Controls how the image should fill the area. - /// - [JsonPropertyName("fillMode")] - public FillMode? FillMode { get; set; } - - /// - /// Controls how the image should be aligned if it must be cropped or if using repeat fill mode. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls how the image should be aligned if it must be cropped or if using repeat fill mode. - /// - [JsonPropertyName("verticalAlignment")] - public VerticalAlignment? VerticalAlignment { get; set; } - - /// - /// Serializes this BackgroundImage into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public BackgroundImage WithUrl(string value) - { - this.Url = value; - return this; - } - - public BackgroundImage WithFillMode(FillMode value) - { - this.FillMode = value; - return this; - } - - public BackgroundImage WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public BackgroundImage WithVerticalAlignment(VerticalAlignment value) - { - this.VerticalAlignment = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type QueryData. + /// + public static QueryData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Data.Query**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Data.Query"; + + /// + /// The dataset from which to fetch the data. + /// + [JsonPropertyName("dataset")] + public string? Dataset { get; set; } + + /// + /// Controls which inputs are associated with the Data.Query. When a Data.Query is executed, the values of the associated inputs are sent to the Bot, allowing it to perform filtering operations based on the user's input. + /// + [JsonPropertyName("associatedInputs")] + public AssociatedInputs? AssociatedInputs { get; set; } + + /// + /// The maximum number of data items that should be returned by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. + /// + [JsonPropertyName("count")] + public float? Count { get; set; } + + /// + /// The number of data items to be skipped by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. + /// + [JsonPropertyName("skip")] + public float? Skip { get; set; } + + /// + /// Serializes this QueryData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public QueryData WithKey(string value) { + this.Key = value; + return this; + } + + public QueryData WithDataset(string value) { + this.Dataset = value; + return this; + } + + public QueryData WithAssociatedInputs(AssociatedInputs value) { + this.AssociatedInputs = value; + return this; + } + + public QueryData WithCount(float value) { + this.Count = value; + return this; + } + + public QueryData WithSkip(float value) { + this.Skip = value; + return this; + } } /// -/// Defines how a card can be refreshed by making a request to the target Bot. +/// An input to allow the user to rate something using stars. /// -public class RefreshDefinition : SerializableObject +public class RatingInput : CardElement { - /// - /// Deserializes a JSON string into an object of type RefreshDefinition. - /// - public static RefreshDefinition? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The Action.Execute action to invoke to refresh the card. - /// - [JsonPropertyName("action")] - public ExecuteAction? Action { get; set; } - - /// - /// The list of user Ids for which the card will be automatically refreshed. In Teams, in chats or channels with more than 60 users, the card will automatically refresh only for users specified in the userIds list. Other users will have to manually click on a "refresh" button. In contexts with fewer than 60 users, the card will automatically refresh for all users. - /// - [JsonPropertyName("userIds")] - public IList? UserIds { get; set; } - - /// - /// Serializes this RefreshDefinition into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public RefreshDefinition WithAction(ExecuteAction value) - { - this.Action = value; - return this; - } - - public RefreshDefinition WithUserIds(params IList value) - { - this.UserIds = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type RatingInput. + /// + public static RatingInput? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Input.Rating**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Input.Rating"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The label of the input. + /// + /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + /// + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// + /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("isRequired")] + public bool? IsRequired { get; set; } = false; + + /// + /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("errorMessage")] + public string? ErrorMessage { get; set; } + + /// + /// An Action.ResetInputs action that will be executed when the value of the input changes. + /// + [JsonPropertyName("valueChangedAction")] + public Action? ValueChangedAction { get; set; } + + /// + /// The default value of the input. + /// + [JsonPropertyName("value")] + public float? Value { get; set; } + + /// + /// The number of stars to display. + /// + [JsonPropertyName("max")] + public float? Max { get; set; } = 5; + + /// + /// Controls if the user can select half stars. + /// + [JsonPropertyName("allowHalfSteps")] + public bool? AllowHalfSteps { get; set; } = false; + + /// + /// The size of the stars. + /// + [JsonPropertyName("size")] + public RatingSize? Size { get; set; } = RatingSize.Large; + + /// + /// The color of the stars. + /// + [JsonPropertyName("color")] + public RatingColor? Color { get; set; } = RatingColor.Neutral; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this RatingInput into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public RatingInput WithKey(string value) { + this.Key = value; + return this; + } + + public RatingInput WithId(string value) { + this.Id = value; + return this; + } + + public RatingInput WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public RatingInput WithLang(string value) { + this.Lang = value; + return this; + } + + public RatingInput WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public RatingInput WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public RatingInput WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public RatingInput WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public RatingInput WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public RatingInput WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public RatingInput WithLabel(string value) { + this.Label = value; + return this; + } + + public RatingInput WithIsRequired(bool value) { + this.IsRequired = value; + return this; + } + + public RatingInput WithErrorMessage(string value) { + this.ErrorMessage = value; + return this; + } + + public RatingInput WithValueChangedAction(Action value) { + this.ValueChangedAction = value; + return this; + } + + public RatingInput WithValue(float value) { + this.Value = value; + return this; + } + + public RatingInput WithMax(float value) { + this.Max = value; + return this; + } + + public RatingInput WithAllowHalfSteps(bool value) { + this.AllowHalfSteps = value; + return this; + } + + public RatingInput WithSize(RatingSize value) { + this.Size = value; + return this; + } + + public RatingInput WithColor(RatingColor value) { + this.Color = value; + return this; + } + + public RatingInput WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public RatingInput WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// Defines authentication information associated with a card. For more information, refer to the [Bot Framework OAuthCard type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.oauthcard) +/// A read-only star rating element, to display the rating of something. /// -public class Authentication : SerializableObject +public class Rating : CardElement { - /// - /// Deserializes a JSON string into an object of type Authentication. - /// - public static Authentication? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The text that can be displayed to the end user when prompting them to authenticate. - /// - [JsonPropertyName("text")] - public string? Text { get; set; } - - /// - /// The identifier for registered OAuth connection setting information. - /// - [JsonPropertyName("connectionName")] - public string? ConnectionName { get; set; } - - /// - /// The buttons that should be displayed to the user when prompting for authentication. The array MUST contain one button of type “signin”. Other button types are not currently supported. - /// - [JsonPropertyName("buttons")] - public IList? Buttons { get; set; } - - /// - /// Provides information required to enable on-behalf-of single sign-on user authentication. - /// - [JsonPropertyName("tokenExchangeResource")] - public TokenExchangeResource? TokenExchangeResource { get; set; } - - /// - /// Serializes this Authentication into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Authentication WithText(string value) - { - this.Text = value; - return this; - } - - public Authentication WithConnectionName(string value) - { - this.ConnectionName = value; - return this; - } - - public Authentication WithButtons(params IList value) - { - this.Buttons = value; - return this; - } - - public Authentication WithTokenExchangeResource(TokenExchangeResource value) - { - this.TokenExchangeResource = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type Rating. + /// + public static Rating? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Rating**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Rating"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The value of the rating. Must be between 0 and max. + /// + [JsonPropertyName("value")] + public float? Value { get; set; } + + /// + /// The number of "votes" associated with the rating. + /// + [JsonPropertyName("count")] + public float? Count { get; set; } + + /// + /// The number of stars to display. + /// + [JsonPropertyName("max")] + public float? Max { get; set; } = 5; + + /// + /// The size of the stars. + /// + [JsonPropertyName("size")] + public RatingSize? Size { get; set; } = RatingSize.Large; + + /// + /// The color of the stars. + /// + [JsonPropertyName("color")] + public RatingColor? Color { get; set; } = RatingColor.Neutral; + + /// + /// The style of the stars. + /// + [JsonPropertyName("style")] + public RatingStyle? Style { get; set; } = RatingStyle.Default; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this Rating into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Rating WithKey(string value) { + this.Key = value; + return this; + } + + public Rating WithId(string value) { + this.Id = value; + return this; + } + + public Rating WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public Rating WithLang(string value) { + this.Lang = value; + return this; + } + + public Rating WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public Rating WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public Rating WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public Rating WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public Rating WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public Rating WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public Rating WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public Rating WithValue(float value) { + this.Value = value; + return this; + } + + public Rating WithCount(float value) { + this.Count = value; + return this; + } + + public Rating WithMax(float value) { + this.Max = value; + return this; + } + + public Rating WithSize(RatingSize value) { + this.Size = value; + return this; + } + + public Rating WithColor(RatingColor value) { + this.Color = value; + return this; + } + + public Rating WithStyle(RatingStyle value) { + this.Style = value; + return this; + } + + public Rating WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public Rating WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// Defines a button as displayed when prompting a user to authenticate. For more information, refer to the [Bot Framework CardAction type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.cardaction). +/// A special type of button with an icon, title and description. /// -public class AuthCardButton : SerializableObject +public class CompoundButton : CardElement { - /// - /// Deserializes a JSON string into an object of type AuthCardButton. - /// - public static AuthCardButton? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **signin**. - /// - [JsonPropertyName("type")] - public string? Type { get; set; } - - /// - /// The caption of the button. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// A URL to an image to display alongside the button’s caption. - /// - [JsonPropertyName("image")] - public string? Image { get; set; } - - /// - /// The value associated with the button. The meaning of value depends on the button’s type. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - /// - /// Serializes this AuthCardButton into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public AuthCardButton WithType(string value) - { - this.Type = value; - return this; - } - - public AuthCardButton WithTitle(string value) - { - this.Title = value; - return this; - } - - public AuthCardButton WithImage(string value) - { - this.Image = value; - return this; - } - - public AuthCardButton WithValue(string value) - { - this.Value = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type CompoundButton. + /// + public static CompoundButton? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **CompoundButton**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "CompoundButton"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The icon to show on the button. + /// + [JsonPropertyName("icon")] + public IconInfo? Icon { get; set; } + + /// + /// The badge to show on the button. + /// + [JsonPropertyName("badge")] + public string? Badge { get; set; } + + /// + /// The title of the button. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// The description text of the button. + /// + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// An Action that will be invoked when the button is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this CompoundButton into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public CompoundButton WithKey(string value) { + this.Key = value; + return this; + } + + public CompoundButton WithId(string value) { + this.Id = value; + return this; + } + + public CompoundButton WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public CompoundButton WithLang(string value) { + this.Lang = value; + return this; + } + + public CompoundButton WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public CompoundButton WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public CompoundButton WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public CompoundButton WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public CompoundButton WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public CompoundButton WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public CompoundButton WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public CompoundButton WithIcon(IconInfo value) { + this.Icon = value; + return this; + } + + public CompoundButton WithBadge(string value) { + this.Badge = value; + return this; + } + + public CompoundButton WithTitle(string value) { + this.Title = value; + return this; + } + + public CompoundButton WithDescription(string value) { + this.Description = value; + return this; + } + + public CompoundButton WithSelectAction(Action value) { + this.SelectAction = value; + return this; + } + + public CompoundButton WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public CompoundButton WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// Defines information required to enable on-behalf-of single sign-on user authentication. For more information, refer to the [Bot Framework TokenExchangeResource type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.tokenexchangeresource) +/// Defines information about a Fluent icon and how it should be rendered. /// -public class TokenExchangeResource : SerializableObject +public class IconInfo : SerializableObject { - /// - /// Deserializes a JSON string into an object of type TokenExchangeResource. - /// - public static TokenExchangeResource? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The unique identified of this token exchange instance. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// An application ID or resource identifier with which to exchange a token on behalf of. This property is identity provider- and application-specific. - /// - [JsonPropertyName("uri")] - public string? Uri { get; set; } - - /// - /// An identifier for the identity provider with which to attempt a token exchange. - /// - [JsonPropertyName("providerId")] - public string? ProviderId { get; set; } - - /// - /// Serializes this TokenExchangeResource into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TokenExchangeResource WithId(string value) - { - this.Id = value; - return this; - } - - public TokenExchangeResource WithUri(string value) - { - this.Uri = value; - return this; - } - - public TokenExchangeResource WithProviderId(string value) - { - this.ProviderId = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type IconInfo. + /// + public static IconInfo? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The name of the icon to display. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The size of the icon. + /// + [JsonPropertyName("size")] + public IconSize? Size { get; set; } = IconSize.XSmall; + + /// + /// The style of the icon. + /// + [JsonPropertyName("style")] + public IconStyle? Style { get; set; } = IconStyle.Regular; + + /// + /// The color of the icon. + /// + [JsonPropertyName("color")] + public TextColor? Color { get; set; } = TextColor.Default; + + /// + /// Serializes this IconInfo into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public IconInfo WithKey(string value) { + this.Key = value; + return this; + } + + public IconInfo WithName(string value) { + this.Name = value; + return this; + } + + public IconInfo WithSize(IconSize value) { + this.Size = value; + return this; + } + + public IconInfo WithStyle(IconStyle value) { + this.Style = value; + return this; + } + + public IconInfo WithColor(TextColor value) { + this.Color = value; + return this; + } } /// -/// Represents a set of Teams-specific properties on a card. +/// A standalone icon element. Icons can be picked from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog). /// -public class TeamsCardProperties : SerializableObject +public class Icon : CardElement { - /// - /// Deserializes a JSON string into an object of type TeamsCardProperties. - /// - public static TeamsCardProperties? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } + /// + /// Deserializes a JSON string into an object of type Icon. + /// + public static Icon? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Icon**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Icon"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The name of the icon to display. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The size of the icon. + /// + [JsonPropertyName("size")] + public IconSize? Size { get; set; } = IconSize.Standard; + + /// + /// The style of the icon. + /// + [JsonPropertyName("style")] + public IconStyle? Style { get; set; } = IconStyle.Regular; + + /// + /// The color of the icon. + /// + [JsonPropertyName("color")] + public TextColor? Color { get; set; } = TextColor.Default; + + /// + /// An Action that will be invoked when the icon is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + public Icon(string name) + { + this.Name = name; + } - /// - /// Controls the width of the card in a Teams chat. - /// - /// Note that setting `width` to "full" will not actually stretch the card to the "full width" of the chat pane. It will only make the card wider than when the `width` property isn't set. - /// - [JsonPropertyName("width")] - public TeamsCardWidth? Width { get; set; } - - /// - /// The Teams-specific entities associated with the card. - /// - [JsonPropertyName("entities")] - public IList? Entities { get; set; } - - /// - /// Serializes this TeamsCardProperties into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } + /// + /// Serializes this Icon into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Icon WithKey(string value) { + this.Key = value; + return this; + } + + public Icon WithId(string value) { + this.Id = value; + return this; + } + + public Icon WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public Icon WithLang(string value) { + this.Lang = value; + return this; + } + + public Icon WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public Icon WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public Icon WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public Icon WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public Icon WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public Icon WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public Icon WithName(string value) { + this.Name = value; + return this; + } + + public Icon WithSize(IconSize value) { + this.Size = value; + return this; + } + + public Icon WithStyle(IconStyle value) { + this.Style = value; + return this; + } + + public Icon WithColor(TextColor value) { + this.Color = value; + return this; + } + + public Icon WithSelectAction(Action value) { + this.SelectAction = value; + return this; + } + + public Icon WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public Icon WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - public TeamsCardProperties WithWidth(TeamsCardWidth value) - { - this.Width = value; - return this; - } +/// +/// A carousel with sliding pages. +/// +public class Carousel : CardElement +{ + /// + /// Deserializes a JSON string into an object of type Carousel. + /// + public static Carousel? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Carousel**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Carousel"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + /// + [JsonPropertyName("bleed")] + public bool? Bleed { get; set; } = false; + + /// + /// The minimum height, in pixels, of the container, in the `px` format. + /// + [JsonPropertyName("minHeight")] + public string? MinHeight { get; set; } + + /// + /// Controls the type of animation to use to navigate between pages. + /// + [JsonPropertyName("pageAnimation")] + public CarouselPageAnimation? PageAnimation { get; set; } = CarouselPageAnimation.Slide; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The pages in the carousel. + /// + [JsonPropertyName("pages")] + public IList? Pages { get; set; } + + /// + /// Serializes this Carousel into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Carousel WithKey(string value) { + this.Key = value; + return this; + } + + public Carousel WithId(string value) { + this.Id = value; + return this; + } + + public Carousel WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public Carousel WithLang(string value) { + this.Lang = value; + return this; + } + + public Carousel WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public Carousel WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public Carousel WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public Carousel WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public Carousel WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public Carousel WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public Carousel WithBleed(bool value) { + this.Bleed = value; + return this; + } + + public Carousel WithMinHeight(string value) { + this.MinHeight = value; + return this; + } + + public Carousel WithPageAnimation(CarouselPageAnimation value) { + this.PageAnimation = value; + return this; + } + + public Carousel WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public Carousel WithFallback(IUnion value) { + this.Fallback = value; + return this; + } + + public Carousel WithPages(params IList value) { + this.Pages = value; + return this; + } +} - public TeamsCardProperties WithEntities(params IList value) - { - this.Entities = value; - return this; - } +/// +/// A badge element to show an icon and/or text in a compact form over a colored background. +/// +public class Badge : CardElement +{ + /// + /// Deserializes a JSON string into an object of type Badge. + /// + public static Badge? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Badge**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Badge"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The text to display. + /// + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// + /// The name of an icon from the [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) to display, in the `[,regular|filled]` format. If the style is not specified, the regular style is used. + /// + [JsonPropertyName("icon")] + public string? Icon { get; set; } + + /// + /// Controls the position of the icon. + /// + [JsonPropertyName("iconPosition")] + public BadgeIconPosition? IconPosition { get; set; } = BadgeIconPosition.Before; + + /// + /// Controls the strength of the background color. + /// + [JsonPropertyName("appearance")] + public BadgeAppearance? Appearance { get; set; } = BadgeAppearance.Filled; + + /// + /// The size of the badge. + /// + [JsonPropertyName("size")] + public BadgeSize? Size { get; set; } = BadgeSize.Medium; + + /// + /// Controls the shape of the badge. + /// + [JsonPropertyName("shape")] + public BadgeShape? Shape { get; set; } = BadgeShape.Circular; + + /// + /// The style of the badge. + /// + [JsonPropertyName("style")] + public BadgeStyle? Style { get; set; } = BadgeStyle.Default; + + /// + /// Controls the tooltip text to display when the badge is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this Badge into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Badge WithKey(string value) { + this.Key = value; + return this; + } + + public Badge WithId(string value) { + this.Id = value; + return this; + } + + public Badge WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public Badge WithLang(string value) { + this.Lang = value; + return this; + } + + public Badge WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public Badge WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public Badge WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public Badge WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public Badge WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public Badge WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public Badge WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public Badge WithText(string value) { + this.Text = value; + return this; + } + + public Badge WithIcon(string value) { + this.Icon = value; + return this; + } + + public Badge WithIconPosition(BadgeIconPosition value) { + this.IconPosition = value; + return this; + } + + public Badge WithAppearance(BadgeAppearance value) { + this.Appearance = value; + return this; + } + + public Badge WithSize(BadgeSize value) { + this.Size = value; + return this; + } + + public Badge WithShape(BadgeShape value) { + this.Shape = value; + return this; + } + + public Badge WithStyle(BadgeStyle value) { + this.Style = value; + return this; + } + + public Badge WithTooltip(string value) { + this.Tooltip = value; + return this; + } + + public Badge WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public Badge WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// Represents a mention to a person. +/// A spinning ring element, to indicate progress. /// -public class Mention : SerializableObject +public class ProgressRing : CardElement { - /// - /// Deserializes a JSON string into an object of type Mention. - /// - public static Mention? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } + /// + /// Deserializes a JSON string into an object of type ProgressRing. + /// + public static ProgressRing? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **ProgressRing**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "ProgressRing"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The label of the progress ring. + /// + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// + /// Controls the relative position of the label to the progress ring. + /// + [JsonPropertyName("labelPosition")] + public ProgressRingLabelPosition? LabelPosition { get; set; } = ProgressRingLabelPosition.Below; + + /// + /// The size of the progress ring. + /// + [JsonPropertyName("size")] + public ProgressRingSize? Size { get; set; } = ProgressRingSize.Medium; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ProgressRing into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ProgressRing WithKey(string value) { + this.Key = value; + return this; + } + + public ProgressRing WithId(string value) { + this.Id = value; + return this; + } + + public ProgressRing WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public ProgressRing WithLang(string value) { + this.Lang = value; + return this; + } + + public ProgressRing WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public ProgressRing WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public ProgressRing WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public ProgressRing WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public ProgressRing WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public ProgressRing WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public ProgressRing WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public ProgressRing WithLabel(string value) { + this.Label = value; + return this; + } + + public ProgressRing WithLabelPosition(ProgressRingLabelPosition value) { + this.LabelPosition = value; + return this; + } + + public ProgressRing WithSize(ProgressRingSize value) { + this.Size = value; + return this; + } + + public ProgressRing WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public ProgressRing WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - /// - /// Must be **mention**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "mention"; - - /// - /// The text that will be substituted with the mention. - /// - [JsonPropertyName("text")] - public string? Text { get; set; } - - /// - /// Defines the entity being mentioned. - /// - [JsonPropertyName("mentioned")] - public MentionedEntity? Mentioned { get; set; } - - /// - /// Serializes this Mention into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } +/// +/// A progress bar element, to represent a value within a range. +/// +public class ProgressBar : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ProgressBar. + /// + public static ProgressBar? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **ProgressBar**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "ProgressBar"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The value of the progress bar. Must be between 0 and max. + /// + [JsonPropertyName("value")] + public float? Value { get; set; } + + /// + /// The maximum value of the progress bar. + /// + [JsonPropertyName("max")] + public float? Max { get; set; } = 100; + + /// + /// The color of the progress bar. `color` has no effect when the `ProgressBar` is in indeterminate mode, in which case the "accent" color is always used. + /// + [JsonPropertyName("color")] + public ProgressBarColor? Color { get; set; } = ProgressBarColor.Accent; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ProgressBar into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ProgressBar WithKey(string value) { + this.Key = value; + return this; + } + + public ProgressBar WithId(string value) { + this.Id = value; + return this; + } + + public ProgressBar WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public ProgressBar WithLang(string value) { + this.Lang = value; + return this; + } + + public ProgressBar WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public ProgressBar WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public ProgressBar WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public ProgressBar WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public ProgressBar WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public ProgressBar WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public ProgressBar WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public ProgressBar WithValue(float value) { + this.Value = value; + return this; + } + + public ProgressBar WithMax(float value) { + this.Max = value; + return this; + } + + public ProgressBar WithColor(ProgressBarColor value) { + this.Color = value; + return this; + } + + public ProgressBar WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public ProgressBar WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - public Mention WithText(string value) - { - this.Text = value; - return this; - } +/// +/// A donut chart. +/// +public class DonutChart : CardElement +{ + /// + /// Deserializes a JSON string into an object of type DonutChart. + /// + public static DonutChart? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Chart.Donut**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Chart.Donut"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The title of the chart. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Controls whether the chart's title should be displayed. Defaults to `false`. + /// + [JsonPropertyName("showTitle")] + public bool? ShowTitle { get; set; } = false; + + /// + /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("colorSet")] + public ChartColorSet? ColorSet { get; set; } + + /// + /// The maximum width, in pixels, of the chart, in the `px` format. + /// + [JsonPropertyName("maxWidth")] + public string? MaxWidth { get; set; } + + /// + /// Controls whether the chart's legend should be displayed. + /// + [JsonPropertyName("showLegend")] + public bool? ShowLegend { get; set; } = true; + + /// + /// The data to display in the chart. + /// + [JsonPropertyName("data")] + public IList? Data { get; set; } + + /// + /// The value that should be displayed in the center of a Donut chart. `value` is ignored for Pie charts. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + /// + /// Controls the color of the value displayed in the center of a Donut chart. + /// + [JsonPropertyName("valueColor")] + public ChartColor? ValueColor { get; set; } + + /// + /// Controls the thickness of the donut segments. Default is **Thick**. + /// + [JsonPropertyName("thickness")] + public DonutThickness? Thickness { get; set; } + + /// + /// Controls whether the outlines of the donut segments are displayed. + /// + [JsonPropertyName("showOutlines")] + public bool? ShowOutlines { get; set; } = true; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this DonutChart into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public DonutChart WithKey(string value) { + this.Key = value; + return this; + } + + public DonutChart WithId(string value) { + this.Id = value; + return this; + } + + public DonutChart WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public DonutChart WithLang(string value) { + this.Lang = value; + return this; + } + + public DonutChart WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public DonutChart WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public DonutChart WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public DonutChart WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public DonutChart WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public DonutChart WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public DonutChart WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public DonutChart WithTitle(string value) { + this.Title = value; + return this; + } + + public DonutChart WithShowTitle(bool value) { + this.ShowTitle = value; + return this; + } + + public DonutChart WithColorSet(ChartColorSet value) { + this.ColorSet = value; + return this; + } + + public DonutChart WithMaxWidth(string value) { + this.MaxWidth = value; + return this; + } + + public DonutChart WithShowLegend(bool value) { + this.ShowLegend = value; + return this; + } + + public DonutChart WithData(params IList value) { + this.Data = value; + return this; + } + + public DonutChart WithValue(string value) { + this.Value = value; + return this; + } + + public DonutChart WithValueColor(ChartColor value) { + this.ValueColor = value; + return this; + } + + public DonutChart WithThickness(DonutThickness value) { + this.Thickness = value; + return this; + } + + public DonutChart WithShowOutlines(bool value) { + this.ShowOutlines = value; + return this; + } + + public DonutChart WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public DonutChart WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - public Mention WithMentioned(MentionedEntity value) - { - this.Mentioned = value; - return this; - } +/// +/// A data point in a Donut chart. +/// +public class DonutChartData : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type DonutChartData. + /// + public static DonutChartData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The legend of the chart. + /// + [JsonPropertyName("legend")] + public string? Legend { get; set; } + + /// + /// The value associated with the data point. + /// + [JsonPropertyName("value")] + public float? Value { get; set; } = 0; + + /// + /// The color to use for the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// Serializes this DonutChartData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public DonutChartData WithKey(string value) { + this.Key = value; + return this; + } + + public DonutChartData WithLegend(string value) { + this.Legend = value; + return this; + } + + public DonutChartData WithValue(float value) { + this.Value = value; + return this; + } + + public DonutChartData WithColor(ChartColor value) { + this.Color = value; + return this; + } } /// -/// Represents a mentioned person or tag. +/// A pie chart. /// -public class MentionedEntity : SerializableObject +public class PieChart : CardElement { - /// - /// Deserializes a JSON string into an object of type MentionedEntity. - /// - public static MentionedEntity? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } + /// + /// Deserializes a JSON string into an object of type PieChart. + /// + public static PieChart? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Chart.Pie**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Chart.Pie"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The title of the chart. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Controls whether the chart's title should be displayed. Defaults to `false`. + /// + [JsonPropertyName("showTitle")] + public bool? ShowTitle { get; set; } = false; + + /// + /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("colorSet")] + public ChartColorSet? ColorSet { get; set; } + + /// + /// The maximum width, in pixels, of the chart, in the `px` format. + /// + [JsonPropertyName("maxWidth")] + public string? MaxWidth { get; set; } + + /// + /// Controls whether the chart's legend should be displayed. + /// + [JsonPropertyName("showLegend")] + public bool? ShowLegend { get; set; } = true; + + /// + /// The data to display in the chart. + /// + [JsonPropertyName("data")] + public IList? Data { get; set; } + + /// + /// The value that should be displayed in the center of a Donut chart. `value` is ignored for Pie charts. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + /// + /// Controls the color of the value displayed in the center of a Donut chart. + /// + [JsonPropertyName("valueColor")] + public ChartColor? ValueColor { get; set; } + + /// + /// Controls the thickness of the donut segments. Default is **Thick**. + /// + [JsonPropertyName("thickness")] + public DonutThickness? Thickness { get; set; } + + /// + /// Controls whether the outlines of the donut segments are displayed. + /// + [JsonPropertyName("showOutlines")] + public bool? ShowOutlines { get; set; } = true; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this PieChart into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public PieChart WithKey(string value) { + this.Key = value; + return this; + } + + public PieChart WithId(string value) { + this.Id = value; + return this; + } + + public PieChart WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public PieChart WithLang(string value) { + this.Lang = value; + return this; + } + + public PieChart WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public PieChart WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public PieChart WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public PieChart WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public PieChart WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public PieChart WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public PieChart WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public PieChart WithTitle(string value) { + this.Title = value; + return this; + } + + public PieChart WithShowTitle(bool value) { + this.ShowTitle = value; + return this; + } + + public PieChart WithColorSet(ChartColorSet value) { + this.ColorSet = value; + return this; + } + + public PieChart WithMaxWidth(string value) { + this.MaxWidth = value; + return this; + } + + public PieChart WithShowLegend(bool value) { + this.ShowLegend = value; + return this; + } + + public PieChart WithData(params IList value) { + this.Data = value; + return this; + } + + public PieChart WithValue(string value) { + this.Value = value; + return this; + } + + public PieChart WithValueColor(ChartColor value) { + this.ValueColor = value; + return this; + } + + public PieChart WithThickness(DonutThickness value) { + this.Thickness = value; + return this; + } + + public PieChart WithShowOutlines(bool value) { + this.ShowOutlines = value; + return this; + } + + public PieChart WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public PieChart WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - /// - /// The Id of a person (typically a Microsoft Entra user Id) or tag. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// The name of the mentioned entity. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// The type of the mentioned entity. - /// - [JsonPropertyName("mentionType")] - public MentionType? MentionType { get; set; } - - /// - /// Serializes this MentionedEntity into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } +/// +/// A grouped vertical bar chart. +/// +public class GroupedVerticalBarChart : CardElement +{ + /// + /// Deserializes a JSON string into an object of type GroupedVerticalBarChart. + /// + public static GroupedVerticalBarChart? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Chart.VerticalBar.Grouped**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Chart.VerticalBar.Grouped"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The title of the chart. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Controls whether the chart's title should be displayed. Defaults to `false`. + /// + [JsonPropertyName("showTitle")] + public bool? ShowTitle { get; set; } = false; + + /// + /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("colorSet")] + public ChartColorSet? ColorSet { get; set; } + + /// + /// The maximum width, in pixels, of the chart, in the `px` format. + /// + [JsonPropertyName("maxWidth")] + public string? MaxWidth { get; set; } + + /// + /// Controls whether the chart's legend should be displayed. + /// + [JsonPropertyName("showLegend")] + public bool? ShowLegend { get; set; } = true; + + /// + /// The title of the x axis. + /// + [JsonPropertyName("xAxisTitle")] + public string? XAxisTitle { get; set; } + + /// + /// The title of the y axis. + /// + [JsonPropertyName("yAxisTitle")] + public string? YAxisTitle { get; set; } + + /// + /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// Controls if bars in the chart should be displayed as stacks instead of groups. + /// + /// **Note:** stacked vertical bar charts do not support custom Y ranges nor negative Y values. + /// + [JsonPropertyName("stacked")] + public bool? Stacked { get; set; } = false; + + /// + /// The data points in a series. + /// + [JsonPropertyName("data")] + public IList? Data { get; set; } + + /// + /// Controls if values should be displayed on each bar. + /// + [JsonPropertyName("showBarValues")] + public bool? ShowBarValues { get; set; } = false; + + /// + /// The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation. + /// + /// `yMin` is ignored if `stacked` is set to `true`. + /// + [JsonPropertyName("yMin")] + public float? YMin { get; set; } + + /// + /// The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation. + /// + /// `yMax` is ignored if `stacked` is set to `true`. + /// + [JsonPropertyName("yMax")] + public float? YMax { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this GroupedVerticalBarChart into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public GroupedVerticalBarChart WithKey(string value) { + this.Key = value; + return this; + } + + public GroupedVerticalBarChart WithId(string value) { + this.Id = value; + return this; + } + + public GroupedVerticalBarChart WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public GroupedVerticalBarChart WithLang(string value) { + this.Lang = value; + return this; + } + + public GroupedVerticalBarChart WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public GroupedVerticalBarChart WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public GroupedVerticalBarChart WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public GroupedVerticalBarChart WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public GroupedVerticalBarChart WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public GroupedVerticalBarChart WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public GroupedVerticalBarChart WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public GroupedVerticalBarChart WithTitle(string value) { + this.Title = value; + return this; + } + + public GroupedVerticalBarChart WithShowTitle(bool value) { + this.ShowTitle = value; + return this; + } + + public GroupedVerticalBarChart WithColorSet(ChartColorSet value) { + this.ColorSet = value; + return this; + } + + public GroupedVerticalBarChart WithMaxWidth(string value) { + this.MaxWidth = value; + return this; + } + + public GroupedVerticalBarChart WithShowLegend(bool value) { + this.ShowLegend = value; + return this; + } + + public GroupedVerticalBarChart WithXAxisTitle(string value) { + this.XAxisTitle = value; + return this; + } + + public GroupedVerticalBarChart WithYAxisTitle(string value) { + this.YAxisTitle = value; + return this; + } + + public GroupedVerticalBarChart WithColor(ChartColor value) { + this.Color = value; + return this; + } + + public GroupedVerticalBarChart WithStacked(bool value) { + this.Stacked = value; + return this; + } + + public GroupedVerticalBarChart WithData(params IList value) { + this.Data = value; + return this; + } + + public GroupedVerticalBarChart WithShowBarValues(bool value) { + this.ShowBarValues = value; + return this; + } + + public GroupedVerticalBarChart WithYMin(float value) { + this.YMin = value; + return this; + } + + public GroupedVerticalBarChart WithYMax(float value) { + this.YMax = value; + return this; + } + + public GroupedVerticalBarChart WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public GroupedVerticalBarChart WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - public MentionedEntity WithId(string value) - { - this.Id = value; - return this; - } +/// +/// Represents a series of data points. +/// +public class GroupedVerticalBarChartData : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type GroupedVerticalBarChartData. + /// + public static GroupedVerticalBarChartData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The legend of the chart. + /// + [JsonPropertyName("legend")] + public string? Legend { get; set; } + + /// + /// The data points in the series. + /// + [JsonPropertyName("values")] + public IList? Values { get; set; } + + /// + /// The color to use for all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// Serializes this GroupedVerticalBarChartData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public GroupedVerticalBarChartData WithKey(string value) { + this.Key = value; + return this; + } + + public GroupedVerticalBarChartData WithLegend(string value) { + this.Legend = value; + return this; + } + + public GroupedVerticalBarChartData WithValues(params IList value) { + this.Values = value; + return this; + } + + public GroupedVerticalBarChartData WithColor(ChartColor value) { + this.Color = value; + return this; + } +} - public MentionedEntity WithName(string value) - { - this.Name = value; - return this; - } +/// +/// A single data point in a bar chart. +/// +public class BarChartDataValue : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type BarChartDataValue. + /// + public static BarChartDataValue? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The x axis value of the data point. + /// + [JsonPropertyName("x")] + public string? X { get; set; } + + /// + /// The y axis value of the data point. + /// + [JsonPropertyName("y")] + public float? Y { get; set; } = 0; + + /// + /// Serializes this BarChartDataValue into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public BarChartDataValue WithKey(string value) { + this.Key = value; + return this; + } + + public BarChartDataValue WithX(string value) { + this.X = value; + return this; + } + + public BarChartDataValue WithY(float value) { + this.Y = value; + return this; + } +} - public MentionedEntity WithMentionType(MentionType value) - { - this.MentionType = value; - return this; - } +/// +/// A vertical bar chart. +/// +public class VerticalBarChart : CardElement +{ + /// + /// Deserializes a JSON string into an object of type VerticalBarChart. + /// + public static VerticalBarChart? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Chart.VerticalBar**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Chart.VerticalBar"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The title of the chart. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Controls whether the chart's title should be displayed. Defaults to `false`. + /// + [JsonPropertyName("showTitle")] + public bool? ShowTitle { get; set; } = false; + + /// + /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("colorSet")] + public ChartColorSet? ColorSet { get; set; } + + /// + /// The maximum width, in pixels, of the chart, in the `px` format. + /// + [JsonPropertyName("maxWidth")] + public string? MaxWidth { get; set; } + + /// + /// Controls whether the chart's legend should be displayed. + /// + [JsonPropertyName("showLegend")] + public bool? ShowLegend { get; set; } = true; + + /// + /// The title of the x axis. + /// + [JsonPropertyName("xAxisTitle")] + public string? XAxisTitle { get; set; } + + /// + /// The title of the y axis. + /// + [JsonPropertyName("yAxisTitle")] + public string? YAxisTitle { get; set; } + + /// + /// The data to display in the chart. + /// + [JsonPropertyName("data")] + public IList? Data { get; set; } + + /// + /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// Controls if the bar values should be displayed. + /// + [JsonPropertyName("showBarValues")] + public bool? ShowBarValues { get; set; } = false; + + /// + /// The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation. + /// + [JsonPropertyName("yMin")] + public float? YMin { get; set; } + + /// + /// The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation. + /// + [JsonPropertyName("yMax")] + public float? YMax { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this VerticalBarChart into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public VerticalBarChart WithKey(string value) { + this.Key = value; + return this; + } + + public VerticalBarChart WithId(string value) { + this.Id = value; + return this; + } + + public VerticalBarChart WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public VerticalBarChart WithLang(string value) { + this.Lang = value; + return this; + } + + public VerticalBarChart WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public VerticalBarChart WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public VerticalBarChart WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public VerticalBarChart WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public VerticalBarChart WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public VerticalBarChart WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public VerticalBarChart WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public VerticalBarChart WithTitle(string value) { + this.Title = value; + return this; + } + + public VerticalBarChart WithShowTitle(bool value) { + this.ShowTitle = value; + return this; + } + + public VerticalBarChart WithColorSet(ChartColorSet value) { + this.ColorSet = value; + return this; + } + + public VerticalBarChart WithMaxWidth(string value) { + this.MaxWidth = value; + return this; + } + + public VerticalBarChart WithShowLegend(bool value) { + this.ShowLegend = value; + return this; + } + + public VerticalBarChart WithXAxisTitle(string value) { + this.XAxisTitle = value; + return this; + } + + public VerticalBarChart WithYAxisTitle(string value) { + this.YAxisTitle = value; + return this; + } + + public VerticalBarChart WithData(params IList value) { + this.Data = value; + return this; + } + + public VerticalBarChart WithColor(ChartColor value) { + this.Color = value; + return this; + } + + public VerticalBarChart WithShowBarValues(bool value) { + this.ShowBarValues = value; + return this; + } + + public VerticalBarChart WithYMin(float value) { + this.YMin = value; + return this; + } + + public VerticalBarChart WithYMax(float value) { + this.YMax = value; + return this; + } + + public VerticalBarChart WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public VerticalBarChart WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// Card-level metadata. +/// Represents a data point in a vertical bar chart. /// -public class CardMetadata : SerializableObject +public class VerticalBarChartDataValue : SerializableObject { - /// - /// Deserializes a JSON string into an object of type CardMetadata. - /// - public static CardMetadata? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } + /// + /// Deserializes a JSON string into an object of type VerticalBarChartDataValue. + /// + public static VerticalBarChartDataValue? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The x axis value of the data point. + /// + [JsonPropertyName("x")] + public IUnion? X { get; set; } + + /// + /// The y axis value of the data point. + /// + [JsonPropertyName("y")] + public float? Y { get; set; } = 0; + + /// + /// The color to use for the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// Serializes this VerticalBarChartDataValue into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public VerticalBarChartDataValue WithKey(string value) { + this.Key = value; + return this; + } + + public VerticalBarChartDataValue WithX(IUnion value) { + this.X = value; + return this; + } + + public VerticalBarChartDataValue WithY(float value) { + this.Y = value; + return this; + } + + public VerticalBarChartDataValue WithColor(ChartColor value) { + this.Color = value; + return this; + } +} - /// - /// The URL the card originates from. When `webUrl` is set, the card is dubbed an **Adaptive Card-based Loop Component** and, when pasted in Teams or other Loop Component-capable host applications, the URL will unfurl to the same exact card. - /// - [JsonPropertyName("webUrl")] - public string? WebUrl { get; set; } +/// +/// A horizontal bar chart. +/// +public class HorizontalBarChart : CardElement +{ + /// + /// Deserializes a JSON string into an object of type HorizontalBarChart. + /// + public static HorizontalBarChart? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Chart.HorizontalBar**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Chart.HorizontalBar"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The title of the chart. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Controls whether the chart's title should be displayed. Defaults to `false`. + /// + [JsonPropertyName("showTitle")] + public bool? ShowTitle { get; set; } = false; + + /// + /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("colorSet")] + public ChartColorSet? ColorSet { get; set; } + + /// + /// The maximum width, in pixels, of the chart, in the `px` format. + /// + [JsonPropertyName("maxWidth")] + public string? MaxWidth { get; set; } + + /// + /// Controls whether the chart's legend should be displayed. + /// + [JsonPropertyName("showLegend")] + public bool? ShowLegend { get; set; } = true; + + /// + /// The title of the x axis. + /// + [JsonPropertyName("xAxisTitle")] + public string? XAxisTitle { get; set; } + + /// + /// The title of the y axis. + /// + [JsonPropertyName("yAxisTitle")] + public string? YAxisTitle { get; set; } + + /// + /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// The data points in the chart. + /// + [JsonPropertyName("data")] + public IList? Data { get; set; } + + /// + /// Controls how the chart should be visually laid out. + /// + [JsonPropertyName("displayMode")] + public HorizontalBarChartDisplayMode? DisplayMode { get; set; } = HorizontalBarChartDisplayMode.AbsoluteWithAxis; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this HorizontalBarChart into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public HorizontalBarChart WithKey(string value) { + this.Key = value; + return this; + } + + public HorizontalBarChart WithId(string value) { + this.Id = value; + return this; + } + + public HorizontalBarChart WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public HorizontalBarChart WithLang(string value) { + this.Lang = value; + return this; + } + + public HorizontalBarChart WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public HorizontalBarChart WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public HorizontalBarChart WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public HorizontalBarChart WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public HorizontalBarChart WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public HorizontalBarChart WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public HorizontalBarChart WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public HorizontalBarChart WithTitle(string value) { + this.Title = value; + return this; + } + + public HorizontalBarChart WithShowTitle(bool value) { + this.ShowTitle = value; + return this; + } + + public HorizontalBarChart WithColorSet(ChartColorSet value) { + this.ColorSet = value; + return this; + } + + public HorizontalBarChart WithMaxWidth(string value) { + this.MaxWidth = value; + return this; + } + + public HorizontalBarChart WithShowLegend(bool value) { + this.ShowLegend = value; + return this; + } + + public HorizontalBarChart WithXAxisTitle(string value) { + this.XAxisTitle = value; + return this; + } + + public HorizontalBarChart WithYAxisTitle(string value) { + this.YAxisTitle = value; + return this; + } + + public HorizontalBarChart WithColor(ChartColor value) { + this.Color = value; + return this; + } + + public HorizontalBarChart WithData(params IList value) { + this.Data = value; + return this; + } + + public HorizontalBarChart WithDisplayMode(HorizontalBarChartDisplayMode value) { + this.DisplayMode = value; + return this; + } + + public HorizontalBarChart WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public HorizontalBarChart WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - /// - /// Serializes this CardMetadata into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } +/// +/// Represents a single data point in a horizontal bar chart. +/// +public class HorizontalBarChartDataValue : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type HorizontalBarChartDataValue. + /// + public static HorizontalBarChartDataValue? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The x axis value of the data point. + /// + [JsonPropertyName("x")] + public string? X { get; set; } + + /// + /// The y axis value of the data point. + /// + [JsonPropertyName("y")] + public float? Y { get; set; } = 0; + + /// + /// The color of the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// Serializes this HorizontalBarChartDataValue into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public HorizontalBarChartDataValue WithKey(string value) { + this.Key = value; + return this; + } + + public HorizontalBarChartDataValue WithX(string value) { + this.X = value; + return this; + } + + public HorizontalBarChartDataValue WithY(float value) { + this.Y = value; + return this; + } + + public HorizontalBarChartDataValue WithColor(ChartColor value) { + this.Color = value; + return this; + } +} - public CardMetadata WithWebUrl(string value) - { - this.WebUrl = value; - return this; - } +/// +/// A stacked horizontal bar chart. +/// +public class StackedHorizontalBarChart : CardElement +{ + /// + /// Deserializes a JSON string into an object of type StackedHorizontalBarChart. + /// + public static StackedHorizontalBarChart? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Chart.HorizontalBar.Stacked**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Chart.HorizontalBar.Stacked"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The title of the chart. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Controls whether the chart's title should be displayed. Defaults to `false`. + /// + [JsonPropertyName("showTitle")] + public bool? ShowTitle { get; set; } = false; + + /// + /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("colorSet")] + public ChartColorSet? ColorSet { get; set; } + + /// + /// The maximum width, in pixels, of the chart, in the `px` format. + /// + [JsonPropertyName("maxWidth")] + public string? MaxWidth { get; set; } + + /// + /// Controls whether the chart's legend should be displayed. + /// + [JsonPropertyName("showLegend")] + public bool? ShowLegend { get; set; } = true; + + /// + /// The title of the x axis. + /// + [JsonPropertyName("xAxisTitle")] + public string? XAxisTitle { get; set; } + + /// + /// The title of the y axis. + /// + [JsonPropertyName("yAxisTitle")] + public string? YAxisTitle { get; set; } + + /// + /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// The data to display in the chart. + /// + [JsonPropertyName("data")] + public IList? Data { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this StackedHorizontalBarChart into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public StackedHorizontalBarChart WithKey(string value) { + this.Key = value; + return this; + } + + public StackedHorizontalBarChart WithId(string value) { + this.Id = value; + return this; + } + + public StackedHorizontalBarChart WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public StackedHorizontalBarChart WithLang(string value) { + this.Lang = value; + return this; + } + + public StackedHorizontalBarChart WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public StackedHorizontalBarChart WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public StackedHorizontalBarChart WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public StackedHorizontalBarChart WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public StackedHorizontalBarChart WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public StackedHorizontalBarChart WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public StackedHorizontalBarChart WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public StackedHorizontalBarChart WithTitle(string value) { + this.Title = value; + return this; + } + + public StackedHorizontalBarChart WithShowTitle(bool value) { + this.ShowTitle = value; + return this; + } + + public StackedHorizontalBarChart WithColorSet(ChartColorSet value) { + this.ColorSet = value; + return this; + } + + public StackedHorizontalBarChart WithMaxWidth(string value) { + this.MaxWidth = value; + return this; + } + + public StackedHorizontalBarChart WithShowLegend(bool value) { + this.ShowLegend = value; + return this; + } + + public StackedHorizontalBarChart WithXAxisTitle(string value) { + this.XAxisTitle = value; + return this; + } + + public StackedHorizontalBarChart WithYAxisTitle(string value) { + this.YAxisTitle = value; + return this; + } + + public StackedHorizontalBarChart WithColor(ChartColor value) { + this.Color = value; + return this; + } + + public StackedHorizontalBarChart WithData(params IList value) { + this.Data = value; + return this; + } + + public StackedHorizontalBarChart WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public StackedHorizontalBarChart WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// A container for other elements. Use containers for styling purposes and/or to logically group a set of elements together, which can be especially useful when used with Action.ToggleVisibility. +/// Defines the collection of data series to display in as a stacked horizontal bar chart. /// -public class Container : CardElement +public class StackedHorizontalBarChartData : SerializableObject { - /// - /// Deserializes a JSON string into an object of type Container. - /// - public static Container? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } + /// + /// Deserializes a JSON string into an object of type StackedHorizontalBarChartData. + /// + public static StackedHorizontalBarChartData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The title of the series. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// The data points in the series. + /// + [JsonPropertyName("data")] + public IList? Data { get; set; } + + /// + /// Serializes this StackedHorizontalBarChartData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public StackedHorizontalBarChartData WithKey(string value) { + this.Key = value; + return this; + } + + public StackedHorizontalBarChartData WithTitle(string value) { + this.Title = value; + return this; + } + + public StackedHorizontalBarChartData WithData(params IList value) { + this.Data = value; + return this; + } +} - /// - /// Must be **Container**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Container"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - /// - [JsonPropertyName("style")] - public ContainerStyle? Style { get; set; } - - /// - /// Controls if a border should be displayed around the container. - /// - [JsonPropertyName("showBorder")] - public bool? ShowBorder { get; set; } - - /// - /// Controls if the container should have rounded corners. - /// - [JsonPropertyName("roundedCorners")] - public bool? RoundedCorners { get; set; } - - /// - /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. - /// - [JsonPropertyName("layouts")] - public IList? Layouts { get; set; } - - /// - /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. - /// - [JsonPropertyName("bleed")] - public bool? Bleed { get; set; } - - /// - /// The minimum height, in pixels, of the container, in the `px` format. - /// - [JsonPropertyName("minHeight")] - public string? MinHeight { get; set; } - - /// - /// Defines the container's background image. - /// - [JsonPropertyName("backgroundImage")] - public IUnion? BackgroundImage { get; set; } - - /// - /// Controls how the container's content should be vertically aligned. - /// - [JsonPropertyName("verticalContentAlignment")] - public VerticalAlignment? VerticalContentAlignment { get; set; } - - /// - /// Controls if the content of the card is to be rendered left-to-right or right-to-left. - /// - [JsonPropertyName("rtl")] - public bool? Rtl { get; set; } - - /// - /// The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. - /// - [JsonPropertyName("maxHeight")] - public string? MaxHeight { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The elements in the container. - /// - [JsonPropertyName("items")] - public IList? Items { get; set; } - - public Container(params IList items) - { - this.Items = items; - } +/// +/// A data point in a series. +/// +public class StackedHorizontalBarChartDataPoint : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type StackedHorizontalBarChartDataPoint. + /// + public static StackedHorizontalBarChartDataPoint? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The legend associated with the data point. + /// + [JsonPropertyName("legend")] + public string? Legend { get; set; } + + /// + /// The value of the data point. + /// + [JsonPropertyName("value")] + public float? Value { get; set; } = 0; + + /// + /// The color to use to render the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// Serializes this StackedHorizontalBarChartDataPoint into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public StackedHorizontalBarChartDataPoint WithKey(string value) { + this.Key = value; + return this; + } + + public StackedHorizontalBarChartDataPoint WithLegend(string value) { + this.Legend = value; + return this; + } + + public StackedHorizontalBarChartDataPoint WithValue(float value) { + this.Value = value; + return this; + } + + public StackedHorizontalBarChartDataPoint WithColor(ChartColor value) { + this.Color = value; + return this; + } +} - /// - /// Serializes this Container into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Container WithId(string value) - { - this.Id = value; - return this; - } - - public Container WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public Container WithLang(string value) - { - this.Lang = value; - return this; - } - - public Container WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public Container WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public Container WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public Container WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public Container WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public Container WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public Container WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public Container WithSelectAction(Action value) - { - this.SelectAction = value; - return this; - } - - public Container WithStyle(ContainerStyle value) - { - this.Style = value; - return this; - } - - public Container WithShowBorder(bool value) - { - this.ShowBorder = value; - return this; - } - - public Container WithRoundedCorners(bool value) - { - this.RoundedCorners = value; - return this; - } - - public Container WithLayouts(params IList value) - { - this.Layouts = value; - return this; - } - - public Container WithBleed(bool value) - { - this.Bleed = value; - return this; - } - - public Container WithMinHeight(string value) - { - this.MinHeight = value; - return this; - } - - public Container WithBackgroundImage(IUnion value) - { - this.BackgroundImage = value; - return this; - } - - public Container WithVerticalContentAlignment(VerticalAlignment value) - { - this.VerticalContentAlignment = value; - return this; - } - - public Container WithRtl(bool value) - { - this.Rtl = value; - return this; - } - - public Container WithMaxHeight(string value) - { - this.MaxHeight = value; - return this; - } - - public Container WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public Container WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } - - public Container WithItems(params IList value) - { - this.Items = value; - return this; - } -} - -/// -/// Displays a set of action, which can be placed anywhere in the card. -/// -public class ActionSet : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ActionSet. - /// - public static ActionSet? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **ActionSet**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "ActionSet"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The actions in the set. - /// - [JsonPropertyName("actions")] - public IList? Actions { get; set; } - - public ActionSet(params IList actions) - { - this.Actions = actions; - } - - /// - /// Serializes this ActionSet into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ActionSet WithId(string value) - { - this.Id = value; - return this; - } - - public ActionSet WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public ActionSet WithLang(string value) - { - this.Lang = value; - return this; - } - - public ActionSet WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public ActionSet WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public ActionSet WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public ActionSet WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public ActionSet WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public ActionSet WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public ActionSet WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public ActionSet WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public ActionSet WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } - - public ActionSet WithActions(params IList value) - { - this.Actions = value; - return this; - } -} - -/// -/// Splits the available horizontal space into separate columns, so elements can be organized in a row. -/// -public class ColumnSet : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ColumnSet. - /// - public static ColumnSet? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **ColumnSet**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "ColumnSet"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - /// - [JsonPropertyName("style")] - public ContainerStyle? Style { get; set; } - - /// - /// Controls if a border should be displayed around the container. - /// - [JsonPropertyName("showBorder")] - public bool? ShowBorder { get; set; } - - /// - /// Controls if the container should have rounded corners. - /// - [JsonPropertyName("roundedCorners")] - public bool? RoundedCorners { get; set; } - - /// - /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. - /// - [JsonPropertyName("bleed")] - public bool? Bleed { get; set; } - - /// - /// The minimum height, in pixels, of the container, in the `px` format. - /// - [JsonPropertyName("minHeight")] - public string? MinHeight { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The columns in the set. - /// - [JsonPropertyName("columns")] - public IList? Columns { get; set; } - - /// - /// Serializes this ColumnSet into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ColumnSet WithId(string value) - { - this.Id = value; - return this; - } - - public ColumnSet WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public ColumnSet WithLang(string value) - { - this.Lang = value; - return this; - } - - public ColumnSet WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public ColumnSet WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public ColumnSet WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public ColumnSet WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public ColumnSet WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public ColumnSet WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public ColumnSet WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public ColumnSet WithSelectAction(Action value) - { - this.SelectAction = value; - return this; - } - - public ColumnSet WithStyle(ContainerStyle value) - { - this.Style = value; - return this; - } - - public ColumnSet WithShowBorder(bool value) - { - this.ShowBorder = value; - return this; - } - - public ColumnSet WithRoundedCorners(bool value) - { - this.RoundedCorners = value; - return this; - } - - public ColumnSet WithBleed(bool value) - { - this.Bleed = value; - return this; - } - - public ColumnSet WithMinHeight(string value) - { - this.MinHeight = value; - return this; - } - - public ColumnSet WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public ColumnSet WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } - - public ColumnSet WithColumns(params IList value) - { - this.Columns = value; - return this; - } -} - -/// -/// A media element, that makes it possible to embed videos inside a card. -/// -public class Media : CardElement -{ - /// - /// Deserializes a JSON string into an object of type Media. - /// - public static Media? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Media**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Media"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The sources for the media. For YouTube, Dailymotion and Vimeo, only one source can be specified. - /// - [JsonPropertyName("sources")] - public IList? Sources { get; set; } - - /// - /// The caption sources for the media. Caption sources are not used for YouTube, Dailymotion or Vimeo sources. - /// - [JsonPropertyName("captionSources")] - public IList? CaptionSources { get; set; } - - /// - /// The URL of the poster image to display. - /// - [JsonPropertyName("poster")] - public string? Poster { get; set; } - - /// - /// The alternate text for the media, used for accessibility purposes. - /// - [JsonPropertyName("altText")] - public string? AltText { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this Media into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Media WithId(string value) - { - this.Id = value; - return this; - } - - public Media WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public Media WithLang(string value) - { - this.Lang = value; - return this; - } - - public Media WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public Media WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public Media WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public Media WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public Media WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public Media WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public Media WithSources(params IList value) - { - this.Sources = value; - return this; - } - - public Media WithCaptionSources(params IList value) - { - this.CaptionSources = value; - return this; - } - - public Media WithPoster(string value) - { - this.Poster = value; - return this; - } - - public Media WithAltText(string value) - { - this.AltText = value; - return this; - } - - public Media WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public Media WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// Defines the source URL of a media stream. YouTube, Dailymotion, Vimeo and Microsoft Stream URLs are supported. -/// -public class MediaSource : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type MediaSource. - /// - public static MediaSource? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The MIME type of the source. - /// - [JsonPropertyName("mimeType")] - public string? MimeType { get; set; } - - /// - /// The URL of the source. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// Serializes this MediaSource into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public MediaSource WithMimeType(string value) - { - this.MimeType = value; - return this; - } - - public MediaSource WithUrl(string value) - { - this.Url = value; - return this; - } -} - -/// -/// Defines a source URL for a video captions. -/// -public class CaptionSource : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type CaptionSource. - /// - public static CaptionSource? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The MIME type of the source. - /// - [JsonPropertyName("mimeType")] - public string? MimeType { get; set; } - - /// - /// The URL of the source. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The label of this caption source. - /// - [JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Serializes this CaptionSource into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public CaptionSource WithMimeType(string value) - { - this.MimeType = value; - return this; - } - - public CaptionSource WithUrl(string value) - { - this.Url = value; - return this; - } - - public CaptionSource WithLabel(string value) - { - this.Label = value; - return this; - } -} - -/// -/// A rich text block that displays formatted text. -/// -public class RichTextBlock : CardElement -{ - /// - /// Deserializes a JSON string into an object of type RichTextBlock. - /// - public static RichTextBlock? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **RichTextBlock**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "RichTextBlock"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The inlines making up the rich text block. - /// - [JsonPropertyName("inlines")] - public IUnion, IList>? Inlines { get; set; } - - /// - /// Serializes this RichTextBlock into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public RichTextBlock WithId(string value) - { - this.Id = value; - return this; - } - - public RichTextBlock WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public RichTextBlock WithLang(string value) - { - this.Lang = value; - return this; - } - - public RichTextBlock WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public RichTextBlock WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public RichTextBlock WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public RichTextBlock WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public RichTextBlock WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public RichTextBlock WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public RichTextBlock WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public RichTextBlock WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public RichTextBlock WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } - - public RichTextBlock WithInlines(IUnion, IList> value) - { - this.Inlines = value; - return this; - } -} - -/// -/// Use tables to display data in a tabular way, with rows, columns and cells. -/// -public class Table : CardElement -{ - /// - /// Deserializes a JSON string into an object of type Table. - /// - public static Table? Deserialize(string json) - { - return JsonSerializer.Deserialize
(json); - } - - /// - /// Must be **Table**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Table"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - /// - [JsonPropertyName("style")] - public ContainerStyle? Style { get; set; } - - /// - /// Controls if a border should be displayed around the container. - /// - [JsonPropertyName("showBorder")] - public bool? ShowBorder { get; set; } - - /// - /// Controls if the container should have rounded corners. - /// - [JsonPropertyName("roundedCorners")] - public bool? RoundedCorners { get; set; } - - /// - /// The columns in the table. - /// - [JsonPropertyName("columns")] - public IList? Columns { get; set; } - - /// - /// Controls whether the first row of the table should be treated as a header. - /// - [JsonPropertyName("firstRowAsHeaders")] - public bool? FirstRowAsHeaders { get; set; } - - /// - /// Controls if grid lines should be displayed. - /// - [JsonPropertyName("showGridLines")] - public bool? ShowGridLines { get; set; } - - /// - /// The style of the grid lines between cells. - /// - [JsonPropertyName("gridStyle")] - public ContainerStyle? GridStyle { get; set; } - - /// - /// Controls how the content of every cell in the table should be horizontally aligned by default. - /// - [JsonPropertyName("horizontalCellContentAlignment")] - public HorizontalAlignment? HorizontalCellContentAlignment { get; set; } - - /// - /// Controls how the content of every cell in the table should be vertically aligned by default. - /// - [JsonPropertyName("verticalCellContentAlignment")] - public VerticalAlignment? VerticalCellContentAlignment { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The rows of the table. - /// - [JsonPropertyName("rows")] - public IList? Rows { get; set; } - - /// - /// Serializes this Table into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Table WithId(string value) - { - this.Id = value; - return this; - } - - public Table WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public Table WithLang(string value) - { - this.Lang = value; - return this; - } - - public Table WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public Table WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public Table WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public Table WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public Table WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public Table WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public Table WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public Table WithStyle(ContainerStyle value) - { - this.Style = value; - return this; - } - - public Table WithShowBorder(bool value) - { - this.ShowBorder = value; - return this; - } - - public Table WithRoundedCorners(bool value) - { - this.RoundedCorners = value; - return this; - } - - public Table WithColumns(params IList value) - { - this.Columns = value; - return this; - } - - public Table WithFirstRowAsHeaders(bool value) - { - this.FirstRowAsHeaders = value; - return this; - } - - public Table WithShowGridLines(bool value) - { - this.ShowGridLines = value; - return this; - } - - public Table WithGridStyle(ContainerStyle value) - { - this.GridStyle = value; - return this; - } - - public Table WithHorizontalCellContentAlignment(HorizontalAlignment value) - { - this.HorizontalCellContentAlignment = value; - return this; - } - - public Table WithVerticalCellContentAlignment(VerticalAlignment value) - { - this.VerticalCellContentAlignment = value; - return this; - } - - public Table WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public Table WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } - - public Table WithRows(params IList value) - { - this.Rows = value; - return this; - } -} - -/// -/// Defines a column in a Table element. -/// -public class ColumnDefinition : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type ColumnDefinition. - /// - public static ColumnDefinition? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Controls how the content of every cell in the table should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table. - /// - [JsonPropertyName("horizontalCellContentAlignment")] - public HorizontalAlignment? HorizontalCellContentAlignment { get; set; } - - /// - /// Controls how the content of every cell in the column should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table. - /// - [JsonPropertyName("verticalCellContentAlignment")] - public VerticalAlignment? VerticalCellContentAlignment { get; set; } - - /// - /// The width of the column in the table, expressed as either a percentage of the available width or in pixels, using the `px` format. - /// - [JsonPropertyName("width")] - public IUnion? Width { get; set; } - - /// - /// Serializes this ColumnDefinition into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ColumnDefinition WithHorizontalCellContentAlignment(HorizontalAlignment value) - { - this.HorizontalCellContentAlignment = value; - return this; - } - - public ColumnDefinition WithVerticalCellContentAlignment(VerticalAlignment value) - { - this.VerticalCellContentAlignment = value; - return this; - } - - public ColumnDefinition WithWidth(IUnion value) - { - this.Width = value; - return this; - } -} - -/// -/// A block of text, optionally formatted using Markdown. -/// -public class TextBlock : CardElement -{ - /// - /// Deserializes a JSON string into an object of type TextBlock. - /// - public static TextBlock? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **TextBlock**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "TextBlock"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The text to display. A subset of markdown is supported. - /// - [JsonPropertyName("text")] - public string? Text { get; set; } - - /// - /// The size of the text. - /// - [JsonPropertyName("size")] - public TextSize? Size { get; set; } - - /// - /// The weight of the text. - /// - [JsonPropertyName("weight")] - public TextWeight? Weight { get; set; } - - /// - /// The color of the text. - /// - [JsonPropertyName("color")] - public TextColor? Color { get; set; } - - /// - /// Controls whether the text should be renderer using a subtler variant of the select color. - /// - [JsonPropertyName("isSubtle")] - public bool? IsSubtle { get; set; } - - /// - /// The type of font to use for rendering. - /// - [JsonPropertyName("fontType")] - public FontType? FontType { get; set; } - - /// - /// Controls if the text should wrap. - /// - [JsonPropertyName("wrap")] - public bool? Wrap { get; set; } - - /// - /// The maximum number of lines to display. - /// - [JsonPropertyName("maxLines")] - public float? MaxLines { get; set; } - - /// - /// The style of the text. - /// - [JsonPropertyName("style")] - public StyleEnum? Style { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - public TextBlock(string text) - { - this.Text = text; - } - - /// - /// Serializes this TextBlock into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TextBlock WithId(string value) - { - this.Id = value; - return this; - } - - public TextBlock WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public TextBlock WithLang(string value) - { - this.Lang = value; - return this; - } - - public TextBlock WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public TextBlock WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public TextBlock WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public TextBlock WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public TextBlock WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public TextBlock WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public TextBlock WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public TextBlock WithText(string value) - { - this.Text = value; - return this; - } - - public TextBlock WithSize(TextSize value) - { - this.Size = value; - return this; - } - - public TextBlock WithWeight(TextWeight value) - { - this.Weight = value; - return this; - } - - public TextBlock WithColor(TextColor value) - { - this.Color = value; - return this; - } - - public TextBlock WithIsSubtle(bool value) - { - this.IsSubtle = value; - return this; - } - - public TextBlock WithFontType(FontType value) - { - this.FontType = value; - return this; - } - - public TextBlock WithWrap(bool value) - { - this.Wrap = value; - return this; - } - - public TextBlock WithMaxLines(float value) - { - this.MaxLines = value; - return this; - } - - public TextBlock WithStyle(StyleEnum value) - { - this.Style = value; - return this; - } - - public TextBlock WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public TextBlock WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// A set of facts, displayed as a table or a vertical list when horizontal space is constrained. -/// -public class FactSet : CardElement -{ - /// - /// Deserializes a JSON string into an object of type FactSet. - /// - public static FactSet? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **FactSet**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "FactSet"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The facts in the set. - /// - [JsonPropertyName("facts")] - public IList? Facts { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - public FactSet(params IList facts) - { - this.Facts = facts; - } - - /// - /// Serializes this FactSet into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public FactSet WithId(string value) - { - this.Id = value; - return this; - } - - public FactSet WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public FactSet WithLang(string value) - { - this.Lang = value; - return this; - } - - public FactSet WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public FactSet WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public FactSet WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public FactSet WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public FactSet WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public FactSet WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public FactSet WithFacts(params IList value) - { - this.Facts = value; - return this; - } - - public FactSet WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public FactSet WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// A fact in a FactSet element. -/// -public class Fact : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type Fact. - /// - public static Fact? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The fact's title. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The fact's value. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - public Fact(string title, string value) - { - this.Title = title; - this.Value = value; - } - - /// - /// Serializes this Fact into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Fact WithTitle(string value) - { - this.Title = value; - return this; - } - - public Fact WithValue(string value) - { - this.Value = value; - return this; - } -} - -/// -/// A set of images, displayed side-by-side and wrapped across multiple rows as needed. -/// -public class ImageSet : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ImageSet. - /// - public static ImageSet? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **ImageSet**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "ImageSet"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The images in the set. - /// - [JsonPropertyName("images")] - public IList? Images { get; set; } - - /// - /// The size to use to render all images in the set. - /// - [JsonPropertyName("imageSize")] - public ImageSize? ImageSize { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - public ImageSet(params IList images) - { - this.Images = images; - } - - /// - /// Serializes this ImageSet into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ImageSet WithId(string value) - { - this.Id = value; - return this; - } - - public ImageSet WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public ImageSet WithLang(string value) - { - this.Lang = value; - return this; - } - - public ImageSet WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public ImageSet WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public ImageSet WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public ImageSet WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public ImageSet WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public ImageSet WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public ImageSet WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public ImageSet WithImages(params IList value) - { - this.Images = value; - return this; - } - - public ImageSet WithImageSize(ImageSize value) - { - this.ImageSize = value; - return this; - } - - public ImageSet WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public ImageSet WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// A standalone image element. -/// -public class Image : CardElement -{ - /// - /// Deserializes a JSON string into an object of type Image. - /// - public static Image? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Image**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Image"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The alternate text for the image, used for accessibility purposes. - /// - [JsonPropertyName("altText")] - public string? AltText { get; set; } - - /// - /// The background color of the image. - /// - [JsonPropertyName("backgroundColor")] - public string? BackgroundColor { get; set; } - - /// - /// The style of the image. - /// - [JsonPropertyName("style")] - public ImageStyle? Style { get; set; } - - /// - /// The size of the image. - /// - [JsonPropertyName("size")] - public Size? Size { get; set; } - - /// - /// The width of the image. - /// - [JsonPropertyName("width")] - public string? Width { get; set; } - - /// - /// An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// Controls if the image can be expanded to full screen. - /// - [JsonPropertyName("allowExpand")] - public bool? AllowExpand { get; set; } - - [JsonPropertyName("msteams")] - public TeamsImageProperties? Msteams { get; set; } - - /// - /// The height of the image. - /// - [JsonPropertyName("height")] - public string? Height { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - public Image(string url) - { - this.Url = url; - } - - /// - /// Serializes this Image into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Image WithId(string value) - { - this.Id = value; - return this; - } - - public Image WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public Image WithLang(string value) - { - this.Lang = value; - return this; - } - - public Image WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public Image WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public Image WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public Image WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public Image WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public Image WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public Image WithUrl(string value) - { - this.Url = value; - return this; - } - - public Image WithAltText(string value) - { - this.AltText = value; - return this; - } - - public Image WithBackgroundColor(string value) - { - this.BackgroundColor = value; - return this; - } - - public Image WithStyle(ImageStyle value) - { - this.Style = value; - return this; - } - - public Image WithSize(Size value) - { - this.Size = value; - return this; - } - - public Image WithWidth(string value) - { - this.Width = value; - return this; - } - - public Image WithSelectAction(Action value) - { - this.SelectAction = value; - return this; - } - - public Image WithAllowExpand(bool value) - { - this.AllowExpand = value; - return this; - } - - public Image WithMsteams(TeamsImageProperties value) - { - this.Msteams = value; - return this; - } - - public Image WithHeight(string value) - { - this.Height = value; - return this; - } - - public Image WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public Image WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// Represents a set of Teams-specific properties on an image. -/// -public class TeamsImageProperties : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type TeamsImageProperties. - /// - public static TeamsImageProperties? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Controls if the image is expandable in Teams. This property is equivalent to the Image.allowExpand property. - /// - [JsonPropertyName("allowExpand")] - public bool? AllowExpand { get; set; } - - /// - /// Serializes this TeamsImageProperties into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TeamsImageProperties WithAllowExpand(bool value) - { - this.AllowExpand = value; - return this; - } -} - -/// -/// An input to allow the user to enter text. -/// -public class TextInput : CardElement -{ - /// - /// Deserializes a JSON string into an object of type TextInput. - /// - public static TextInput? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Input.Text**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Input.Text"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The label of the input. - /// - /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. - /// - [JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("isRequired")] - public bool? IsRequired { get; set; } - - /// - /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("errorMessage")] - public string? ErrorMessage { get; set; } - - /// - /// An Action.ResetInputs action that will be executed when the value of the input changes. - /// - [JsonPropertyName("valueChangedAction")] - public ResetInputsAction? ValueChangedAction { get; set; } - - /// - /// The default value of the input. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - /// - /// The maximum length of the text in the input. - /// - [JsonPropertyName("maxLength")] - public float? MaxLength { get; set; } - - /// - /// Controls if the input should allow multiple lines of text. - /// - [JsonPropertyName("isMultiline")] - public bool? IsMultiline { get; set; } - - /// - /// The text to display as a placeholder when the user hasn't entered a value. - /// - [JsonPropertyName("placeholder")] - public string? Placeholder { get; set; } - - /// - /// The style of the input. - /// - [JsonPropertyName("style")] - public InputTextStyle? Style { get; set; } - - /// - /// The action that should be displayed as a button alongside the input. Action.ShowCard is not supported. - /// - [JsonPropertyName("inlineAction")] - public Action? InlineAction { get; set; } - - /// - /// The regular expression to validate the input. - /// - [JsonPropertyName("regex")] - public string? Regex { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this TextInput into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TextInput WithId(string value) - { - this.Id = value; - return this; - } - - public TextInput WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public TextInput WithLang(string value) - { - this.Lang = value; - return this; - } - - public TextInput WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public TextInput WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public TextInput WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public TextInput WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public TextInput WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public TextInput WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public TextInput WithLabel(string value) - { - this.Label = value; - return this; - } - - public TextInput WithIsRequired(bool value) - { - this.IsRequired = value; - return this; - } - - public TextInput WithErrorMessage(string value) - { - this.ErrorMessage = value; - return this; - } - - public TextInput WithValueChangedAction(ResetInputsAction value) - { - this.ValueChangedAction = value; - return this; - } - - public TextInput WithValue(string value) - { - this.Value = value; - return this; - } - - public TextInput WithMaxLength(float value) - { - this.MaxLength = value; - return this; - } - - public TextInput WithIsMultiline(bool value) - { - this.IsMultiline = value; - return this; - } - - public TextInput WithPlaceholder(string value) - { - this.Placeholder = value; - return this; - } - - public TextInput WithStyle(InputTextStyle value) - { - this.Style = value; - return this; - } - - public TextInput WithInlineAction(Action value) - { - this.InlineAction = value; - return this; - } - - public TextInput WithRegex(string value) - { - this.Regex = value; - return this; - } - - public TextInput WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public TextInput WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// An input to allow the user to select a date. -/// -public class DateInput : CardElement -{ - /// - /// Deserializes a JSON string into an object of type DateInput. - /// - public static DateInput? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Input.Date**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Input.Date"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The label of the input. - /// - /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. - /// - [JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("isRequired")] - public bool? IsRequired { get; set; } - - /// - /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("errorMessage")] - public string? ErrorMessage { get; set; } - - /// - /// An Action.ResetInputs action that will be executed when the value of the input changes. - /// - [JsonPropertyName("valueChangedAction")] - public ResetInputsAction? ValueChangedAction { get; set; } - - /// - /// The default value of the input, in the `YYYY-MM-DD` format. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - /// - /// The text to display as a placeholder when the user has not selected a date. - /// - [JsonPropertyName("placeholder")] - public string? Placeholder { get; set; } - - /// - /// The minimum date that can be selected. - /// - [JsonPropertyName("min")] - public string? Min { get; set; } - - /// - /// The maximum date that can be selected. - /// - [JsonPropertyName("max")] - public string? Max { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this DateInput into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public DateInput WithId(string value) - { - this.Id = value; - return this; - } - - public DateInput WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public DateInput WithLang(string value) - { - this.Lang = value; - return this; - } - - public DateInput WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public DateInput WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public DateInput WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public DateInput WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public DateInput WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public DateInput WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public DateInput WithLabel(string value) - { - this.Label = value; - return this; - } - - public DateInput WithIsRequired(bool value) - { - this.IsRequired = value; - return this; - } - - public DateInput WithErrorMessage(string value) - { - this.ErrorMessage = value; - return this; - } - - public DateInput WithValueChangedAction(ResetInputsAction value) - { - this.ValueChangedAction = value; - return this; - } - - public DateInput WithValue(string value) - { - this.Value = value; - return this; - } - - public DateInput WithPlaceholder(string value) - { - this.Placeholder = value; - return this; - } - - public DateInput WithMin(string value) - { - this.Min = value; - return this; - } - - public DateInput WithMax(string value) - { - this.Max = value; - return this; - } - - public DateInput WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public DateInput WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// An input to allow the user to select a time. -/// -public class TimeInput : CardElement -{ - /// - /// Deserializes a JSON string into an object of type TimeInput. - /// - public static TimeInput? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Input.Time**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Input.Time"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The label of the input. - /// - /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. - /// - [JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("isRequired")] - public bool? IsRequired { get; set; } - - /// - /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("errorMessage")] - public string? ErrorMessage { get; set; } - - /// - /// An Action.ResetInputs action that will be executed when the value of the input changes. - /// - [JsonPropertyName("valueChangedAction")] - public ResetInputsAction? ValueChangedAction { get; set; } - - /// - /// The default value of the input, in the `HH:MM` format. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - /// - /// The text to display as a placeholder when the user hasn't entered a value. - /// - [JsonPropertyName("placeholder")] - public string? Placeholder { get; set; } - - /// - /// The minimum time that can be selected, in the `HH:MM` format. - /// - [JsonPropertyName("min")] - public string? Min { get; set; } - - /// - /// The maximum time that can be selected, in the `HH:MM` format. - /// - [JsonPropertyName("max")] - public string? Max { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this TimeInput into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TimeInput WithId(string value) - { - this.Id = value; - return this; - } - - public TimeInput WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public TimeInput WithLang(string value) - { - this.Lang = value; - return this; - } - - public TimeInput WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public TimeInput WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public TimeInput WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public TimeInput WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public TimeInput WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public TimeInput WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public TimeInput WithLabel(string value) - { - this.Label = value; - return this; - } - - public TimeInput WithIsRequired(bool value) - { - this.IsRequired = value; - return this; - } - - public TimeInput WithErrorMessage(string value) - { - this.ErrorMessage = value; - return this; - } - - public TimeInput WithValueChangedAction(ResetInputsAction value) - { - this.ValueChangedAction = value; - return this; - } - - public TimeInput WithValue(string value) - { - this.Value = value; - return this; - } - - public TimeInput WithPlaceholder(string value) - { - this.Placeholder = value; - return this; - } - - public TimeInput WithMin(string value) - { - this.Min = value; - return this; - } - - public TimeInput WithMax(string value) - { - this.Max = value; - return this; - } - - public TimeInput WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public TimeInput WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// An input to allow the user to enter a number. -/// -public class NumberInput : CardElement -{ - /// - /// Deserializes a JSON string into an object of type NumberInput. - /// - public static NumberInput? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Input.Number**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Input.Number"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The label of the input. - /// - /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. - /// - [JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("isRequired")] - public bool? IsRequired { get; set; } - - /// - /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("errorMessage")] - public string? ErrorMessage { get; set; } - - /// - /// An Action.ResetInputs action that will be executed when the value of the input changes. - /// - [JsonPropertyName("valueChangedAction")] - public ResetInputsAction? ValueChangedAction { get; set; } - - /// - /// The default value of the input. - /// - [JsonPropertyName("value")] - public float? Value { get; set; } - - /// - /// The text to display as a placeholder when the user hasn't entered a value. - /// - [JsonPropertyName("placeholder")] - public string? Placeholder { get; set; } - - /// - /// The minimum value that can be entered. - /// - [JsonPropertyName("min")] - public float? Min { get; set; } - - /// - /// The maximum value that can be entered. - /// - [JsonPropertyName("max")] - public float? Max { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this NumberInput into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public NumberInput WithId(string value) - { - this.Id = value; - return this; - } - - public NumberInput WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public NumberInput WithLang(string value) - { - this.Lang = value; - return this; - } - - public NumberInput WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public NumberInput WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public NumberInput WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public NumberInput WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public NumberInput WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public NumberInput WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public NumberInput WithLabel(string value) - { - this.Label = value; - return this; - } - - public NumberInput WithIsRequired(bool value) - { - this.IsRequired = value; - return this; - } - - public NumberInput WithErrorMessage(string value) - { - this.ErrorMessage = value; - return this; - } - - public NumberInput WithValueChangedAction(ResetInputsAction value) - { - this.ValueChangedAction = value; - return this; - } - - public NumberInput WithValue(float value) - { - this.Value = value; - return this; - } - - public NumberInput WithPlaceholder(string value) - { - this.Placeholder = value; - return this; - } - - public NumberInput WithMin(float value) - { - this.Min = value; - return this; - } - - public NumberInput WithMax(float value) - { - this.Max = value; - return this; - } - - public NumberInput WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public NumberInput WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// An input to allow the user to select between on/off states. -/// -public class ToggleInput : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ToggleInput. - /// - public static ToggleInput? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Input.Toggle**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Input.Toggle"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The label of the input. - /// - /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. - /// - [JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("isRequired")] - public bool? IsRequired { get; set; } - - /// - /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("errorMessage")] - public string? ErrorMessage { get; set; } - - /// - /// An Action.ResetInputs action that will be executed when the value of the input changes. - /// - [JsonPropertyName("valueChangedAction")] - public ResetInputsAction? ValueChangedAction { get; set; } - - /// - /// The default value of the input. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - /// - /// The title (caption) to display next to the toggle. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The value to send to the Bot when the toggle is on. - /// - [JsonPropertyName("valueOn")] - public string? ValueOn { get; set; } - - /// - /// The value to send to the Bot when the toggle is off. - /// - [JsonPropertyName("valueOff")] - public string? ValueOff { get; set; } - - /// - /// Controls if the title should wrap. - /// - [JsonPropertyName("wrap")] - public bool? Wrap { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - public ToggleInput(string title) - { - this.Title = title; - } - - /// - /// Serializes this ToggleInput into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ToggleInput WithId(string value) - { - this.Id = value; - return this; - } - - public ToggleInput WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public ToggleInput WithLang(string value) - { - this.Lang = value; - return this; - } - - public ToggleInput WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public ToggleInput WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public ToggleInput WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public ToggleInput WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public ToggleInput WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public ToggleInput WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public ToggleInput WithLabel(string value) - { - this.Label = value; - return this; - } - - public ToggleInput WithIsRequired(bool value) - { - this.IsRequired = value; - return this; - } - - public ToggleInput WithErrorMessage(string value) - { - this.ErrorMessage = value; - return this; - } - - public ToggleInput WithValueChangedAction(ResetInputsAction value) - { - this.ValueChangedAction = value; - return this; - } - - public ToggleInput WithValue(string value) - { - this.Value = value; - return this; - } - - public ToggleInput WithTitle(string value) - { - this.Title = value; - return this; - } - - public ToggleInput WithValueOn(string value) - { - this.ValueOn = value; - return this; - } - - public ToggleInput WithValueOff(string value) - { - this.ValueOff = value; - return this; - } - - public ToggleInput WithWrap(bool value) - { - this.Wrap = value; - return this; - } - - public ToggleInput WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public ToggleInput WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// An input to allow the user to select one or more values. -/// -public class ChoiceSetInput : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ChoiceSetInput. - /// - public static ChoiceSetInput? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Input.ChoiceSet**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Input.ChoiceSet"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The label of the input. - /// - /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. - /// - [JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("isRequired")] - public bool? IsRequired { get; set; } - - /// - /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("errorMessage")] - public string? ErrorMessage { get; set; } - - /// - /// An Action.ResetInputs action that will be executed when the value of the input changes. - /// - [JsonPropertyName("valueChangedAction")] - public ResetInputsAction? ValueChangedAction { get; set; } - - /// - /// The default value of the input. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - /// - /// The choices associated with the input. - /// - [JsonPropertyName("choices")] - public IList? Choices { get; set; } - - /// - /// A Data.Query object that defines the dataset from which to dynamically fetch the choices for the input. - /// - [JsonPropertyName("choices.data")] - public QueryData? ChoicesData { get; set; } - - /// - /// Controls whether the input should be displayed as a dropdown (compact) or a list of radio buttons or checkboxes (expanded). - /// - [JsonPropertyName("style")] - public StyleEnum? Style { get; set; } - - /// - /// Controls whether multiple choices can be selected. - /// - [JsonPropertyName("isMultiSelect")] - public bool? IsMultiSelect { get; set; } - - /// - /// The text to display as a placeholder when the user has not entered any value. - /// - [JsonPropertyName("placeholder")] - public string? Placeholder { get; set; } - - /// - /// Controls if choice titles should wrap. - /// - [JsonPropertyName("wrap")] - public bool? Wrap { get; set; } - - /// - /// Controls whether choice items are arranged in multiple columns in expanded mode, or in a single column. Default is false. - /// - [JsonPropertyName("useMultipleColumns")] - public bool? UseMultipleColumns { get; set; } - - /// - /// The minimum width, in pixels, for each column when using a multi-column layout. This ensures that choice items remain readable even when horizontal space is limited. Default is 100 pixels. - /// - [JsonPropertyName("minColumnWidth")] - public string? MinColumnWidth { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - public ChoiceSetInput(params IList choices) - { - this.Choices = choices; - } - - /// - /// Serializes this ChoiceSetInput into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ChoiceSetInput WithId(string value) - { - this.Id = value; - return this; - } - - public ChoiceSetInput WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public ChoiceSetInput WithLang(string value) - { - this.Lang = value; - return this; - } - - public ChoiceSetInput WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public ChoiceSetInput WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public ChoiceSetInput WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public ChoiceSetInput WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public ChoiceSetInput WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public ChoiceSetInput WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public ChoiceSetInput WithLabel(string value) - { - this.Label = value; - return this; - } - - public ChoiceSetInput WithIsRequired(bool value) - { - this.IsRequired = value; - return this; - } - - public ChoiceSetInput WithErrorMessage(string value) - { - this.ErrorMessage = value; - return this; - } - - public ChoiceSetInput WithValueChangedAction(ResetInputsAction value) - { - this.ValueChangedAction = value; - return this; - } - - public ChoiceSetInput WithValue(string value) - { - this.Value = value; - return this; - } - - public ChoiceSetInput WithChoices(params IList value) - { - this.Choices = value; - return this; - } - - public ChoiceSetInput WithChoicesData(QueryData value) - { - this.ChoicesData = value; - return this; - } - - public ChoiceSetInput WithStyle(StyleEnum value) - { - this.Style = value; - return this; - } - - public ChoiceSetInput WithIsMultiSelect(bool value) - { - this.IsMultiSelect = value; - return this; - } - - public ChoiceSetInput WithPlaceholder(string value) - { - this.Placeholder = value; - return this; - } - - public ChoiceSetInput WithWrap(bool value) - { - this.Wrap = value; - return this; - } - - public ChoiceSetInput WithUseMultipleColumns(bool value) - { - this.UseMultipleColumns = value; - return this; - } - - public ChoiceSetInput WithMinColumnWidth(string value) - { - this.MinColumnWidth = value; - return this; - } - - public ChoiceSetInput WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public ChoiceSetInput WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// A choice as used by the Input.ChoiceSet input. -/// -public class Choice : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type Choice. - /// - public static Choice? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The text to display for the choice. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The value associated with the choice, as sent to the Bot when an Action.Submit or Action.Execute is invoked - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - /// - /// Serializes this Choice into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Choice WithTitle(string value) - { - this.Title = value; - return this; - } - - public Choice WithValue(string value) - { - this.Value = value; - return this; - } -} - -/// -/// Defines a query to dynamically fetch data from a Bot. -/// -public class QueryData : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type QueryData. - /// - public static QueryData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Data.Query**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Data.Query"; - - /// - /// The dataset from which to fetch the data. - /// - [JsonPropertyName("dataset")] - public string? Dataset { get; set; } - - /// - /// Controls which inputs are associated with the Data.Query. When a Data.Query is executed, the values of the associated inputs are sent to the Bot, allowing it to perform filtering operations based on the user's input. - /// - [JsonPropertyName("associatedInputs")] - public AssociatedInputs? AssociatedInputs { get; set; } - - /// - /// The maximum number of data items that should be returned by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. - /// - [JsonPropertyName("count")] - public float? Count { get; set; } - - /// - /// The number of data items to be skipped by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. - /// - [JsonPropertyName("skip")] - public float? Skip { get; set; } - - /// - /// Serializes this QueryData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public QueryData WithDataset(string value) - { - this.Dataset = value; - return this; - } - - public QueryData WithAssociatedInputs(AssociatedInputs value) - { - this.AssociatedInputs = value; - return this; - } - - public QueryData WithCount(float value) - { - this.Count = value; - return this; - } - - public QueryData WithSkip(float value) - { - this.Skip = value; - return this; - } -} - -/// -/// An input to allow the user to rate something using stars. -/// -public class RatingInput : CardElement -{ - /// - /// Deserializes a JSON string into an object of type RatingInput. - /// - public static RatingInput? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Input.Rating**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Input.Rating"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The label of the input. - /// - /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. - /// - [JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("isRequired")] - public bool? IsRequired { get; set; } - - /// - /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("errorMessage")] - public string? ErrorMessage { get; set; } - - /// - /// An Action.ResetInputs action that will be executed when the value of the input changes. - /// - [JsonPropertyName("valueChangedAction")] - public ResetInputsAction? ValueChangedAction { get; set; } - - /// - /// The default value of the input. - /// - [JsonPropertyName("value")] - public float? Value { get; set; } - - /// - /// The number of stars to display. - /// - [JsonPropertyName("max")] - public float? Max { get; set; } - - /// - /// Controls if the user can select half stars. - /// - [JsonPropertyName("allowHalfSteps")] - public bool? AllowHalfSteps { get; set; } - - /// - /// The size of the stars. - /// - [JsonPropertyName("size")] - public RatingSize? Size { get; set; } - - /// - /// The color of the stars. - /// - [JsonPropertyName("color")] - public RatingColor? Color { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this RatingInput into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public RatingInput WithId(string value) - { - this.Id = value; - return this; - } - - public RatingInput WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public RatingInput WithLang(string value) - { - this.Lang = value; - return this; - } - - public RatingInput WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public RatingInput WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public RatingInput WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public RatingInput WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public RatingInput WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public RatingInput WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public RatingInput WithLabel(string value) - { - this.Label = value; - return this; - } - - public RatingInput WithIsRequired(bool value) - { - this.IsRequired = value; - return this; - } - - public RatingInput WithErrorMessage(string value) - { - this.ErrorMessage = value; - return this; - } - - public RatingInput WithValueChangedAction(ResetInputsAction value) - { - this.ValueChangedAction = value; - return this; - } - - public RatingInput WithValue(float value) - { - this.Value = value; - return this; - } - - public RatingInput WithMax(float value) - { - this.Max = value; - return this; - } - - public RatingInput WithAllowHalfSteps(bool value) - { - this.AllowHalfSteps = value; - return this; - } - - public RatingInput WithSize(RatingSize value) - { - this.Size = value; - return this; - } - - public RatingInput WithColor(RatingColor value) - { - this.Color = value; - return this; - } - - public RatingInput WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public RatingInput WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// A read-only star rating element, to display the rating of something. -/// -public class Rating : CardElement -{ - /// - /// Deserializes a JSON string into an object of type Rating. - /// - public static Rating? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Rating**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Rating"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The value of the rating. Must be between 0 and max. - /// - [JsonPropertyName("value")] - public float? Value { get; set; } - - /// - /// The number of "votes" associated with the rating. - /// - [JsonPropertyName("count")] - public float? Count { get; set; } - - /// - /// The number of stars to display. - /// - [JsonPropertyName("max")] - public float? Max { get; set; } - - /// - /// The size of the stars. - /// - [JsonPropertyName("size")] - public RatingSize? Size { get; set; } - - /// - /// The color of the stars. - /// - [JsonPropertyName("color")] - public RatingColor? Color { get; set; } - - /// - /// The style of the stars. - /// - [JsonPropertyName("style")] - public RatingStyle? Style { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this Rating into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Rating WithId(string value) - { - this.Id = value; - return this; - } - - public Rating WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public Rating WithLang(string value) - { - this.Lang = value; - return this; - } - - public Rating WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public Rating WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public Rating WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public Rating WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public Rating WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public Rating WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public Rating WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public Rating WithValue(float value) - { - this.Value = value; - return this; - } - - public Rating WithCount(float value) - { - this.Count = value; - return this; - } - - public Rating WithMax(float value) - { - this.Max = value; - return this; - } - - public Rating WithSize(RatingSize value) - { - this.Size = value; - return this; - } - - public Rating WithColor(RatingColor value) - { - this.Color = value; - return this; - } - - public Rating WithStyle(RatingStyle value) - { - this.Style = value; - return this; - } - - public Rating WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public Rating WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// A special type of button with an icon, title and description. -/// -public class CompoundButton : CardElement -{ - /// - /// Deserializes a JSON string into an object of type CompoundButton. - /// - public static CompoundButton? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **CompoundButton**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "CompoundButton"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The icon to show on the button. - /// - [JsonPropertyName("icon")] - public IconInfo? Icon { get; set; } - - /// - /// The badge to show on the button. - /// - [JsonPropertyName("badge")] - public string? Badge { get; set; } - - /// - /// The title of the button. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The description text of the button. - /// - [JsonPropertyName("description")] - public string? Description { get; set; } - - /// - /// An Action that will be invoked when the button is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this CompoundButton into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public CompoundButton WithId(string value) - { - this.Id = value; - return this; - } - - public CompoundButton WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public CompoundButton WithLang(string value) - { - this.Lang = value; - return this; - } - - public CompoundButton WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public CompoundButton WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public CompoundButton WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public CompoundButton WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public CompoundButton WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public CompoundButton WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public CompoundButton WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public CompoundButton WithIcon(IconInfo value) - { - this.Icon = value; - return this; - } - - public CompoundButton WithBadge(string value) - { - this.Badge = value; - return this; - } - - public CompoundButton WithTitle(string value) - { - this.Title = value; - return this; - } - - public CompoundButton WithDescription(string value) - { - this.Description = value; - return this; - } - - public CompoundButton WithSelectAction(Action value) - { - this.SelectAction = value; - return this; - } - - public CompoundButton WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public CompoundButton WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// Defines information about a Fluent icon and how it should be rendered. -/// -public class IconInfo : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type IconInfo. - /// - public static IconInfo? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The name of the icon to display. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// The size of the icon. - /// - [JsonPropertyName("size")] - public IconSize? Size { get; set; } - - /// - /// The style of the icon. - /// - [JsonPropertyName("style")] - public IconStyle? Style { get; set; } - - /// - /// The color of the icon. - /// - [JsonPropertyName("color")] - public TextColor? Color { get; set; } - - /// - /// Serializes this IconInfo into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public IconInfo WithName(string value) - { - this.Name = value; - return this; - } - - public IconInfo WithSize(IconSize value) - { - this.Size = value; - return this; - } - - public IconInfo WithStyle(IconStyle value) - { - this.Style = value; - return this; - } - - public IconInfo WithColor(TextColor value) - { - this.Color = value; - return this; - } -} - -/// -/// A standalone icon element. Icons can be picked from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog). -/// -public class Icon : CardElement -{ - /// - /// Deserializes a JSON string into an object of type Icon. - /// - public static Icon? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Icon**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Icon"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The name of the icon to display. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// The size of the icon. - /// - [JsonPropertyName("size")] - public IconSize? Size { get; set; } - - /// - /// The style of the icon. - /// - [JsonPropertyName("style")] - public IconStyle? Style { get; set; } - - /// - /// The color of the icon. - /// - [JsonPropertyName("color")] - public TextColor? Color { get; set; } - - /// - /// An Action that will be invoked when the icon is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - public Icon(string name) - { - this.Name = name; - } - - /// - /// Serializes this Icon into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Icon WithId(string value) - { - this.Id = value; - return this; - } - - public Icon WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public Icon WithLang(string value) - { - this.Lang = value; - return this; - } - - public Icon WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public Icon WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public Icon WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public Icon WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public Icon WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public Icon WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public Icon WithName(string value) - { - this.Name = value; - return this; - } - - public Icon WithSize(IconSize value) - { - this.Size = value; - return this; - } - - public Icon WithStyle(IconStyle value) - { - this.Style = value; - return this; - } - - public Icon WithColor(TextColor value) - { - this.Color = value; - return this; - } - - public Icon WithSelectAction(Action value) - { - this.SelectAction = value; - return this; - } - - public Icon WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public Icon WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// A carousel with sliding pages. -/// -public class Carousel : CardElement -{ - /// - /// Deserializes a JSON string into an object of type Carousel. - /// - public static Carousel? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Carousel**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Carousel"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. - /// - [JsonPropertyName("bleed")] - public bool? Bleed { get; set; } - - /// - /// The minimum height, in pixels, of the container, in the `px` format. - /// - [JsonPropertyName("minHeight")] - public string? MinHeight { get; set; } - - /// - /// Controls the type of animation to use to navigate between pages. - /// - [JsonPropertyName("pageAnimation")] - public CarouselPageAnimation? PageAnimation { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The pages in the carousel. - /// - [JsonPropertyName("pages")] - public IList? Pages { get; set; } - - /// - /// Serializes this Carousel into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Carousel WithId(string value) - { - this.Id = value; - return this; - } - - public Carousel WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public Carousel WithLang(string value) - { - this.Lang = value; - return this; - } - - public Carousel WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public Carousel WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public Carousel WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public Carousel WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public Carousel WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public Carousel WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public Carousel WithBleed(bool value) - { - this.Bleed = value; - return this; - } - - public Carousel WithMinHeight(string value) - { - this.MinHeight = value; - return this; - } - - public Carousel WithPageAnimation(CarouselPageAnimation value) - { - this.PageAnimation = value; - return this; - } - - public Carousel WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public Carousel WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } - - public Carousel WithPages(params IList value) - { - this.Pages = value; - return this; - } -} - -/// -/// A badge element to show an icon and/or text in a compact form over a colored background. -/// -public class Badge : CardElement -{ - /// - /// Deserializes a JSON string into an object of type Badge. - /// - public static Badge? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Badge**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Badge"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The text to display. - /// - [JsonPropertyName("text")] - public string? Text { get; set; } - - /// - /// The name of an icon from the [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) to display, in the `[,regular|filled]` format. If the style is not specified, the regular style is used. - /// - [JsonPropertyName("icon")] - public string? Icon { get; set; } - - /// - /// Controls the position of the icon. - /// - [JsonPropertyName("iconPosition")] - public BadgeIconPosition? IconPosition { get; set; } - - /// - /// Controls the strength of the background color. - /// - [JsonPropertyName("appearance")] - public BadgeAppearance? Appearance { get; set; } - - /// - /// The size of the badge. - /// - [JsonPropertyName("size")] - public BadgeSize? Size { get; set; } - - /// - /// Controls the shape of the badge. - /// - [JsonPropertyName("shape")] - public BadgeShape? Shape { get; set; } - - /// - /// The style of the badge. - /// - [JsonPropertyName("style")] - public BadgeStyle? Style { get; set; } - - /// - /// Controls the tooltip text to display when the badge is hovered over. - /// - [JsonPropertyName("tooltip")] - public string? Tooltip { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this Badge into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Badge WithId(string value) - { - this.Id = value; - return this; - } - - public Badge WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public Badge WithLang(string value) - { - this.Lang = value; - return this; - } - - public Badge WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public Badge WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public Badge WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public Badge WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public Badge WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public Badge WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public Badge WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public Badge WithText(string value) - { - this.Text = value; - return this; - } - - public Badge WithIcon(string value) - { - this.Icon = value; - return this; - } - - public Badge WithIconPosition(BadgeIconPosition value) - { - this.IconPosition = value; - return this; - } - - public Badge WithAppearance(BadgeAppearance value) - { - this.Appearance = value; - return this; - } - - public Badge WithSize(BadgeSize value) - { - this.Size = value; - return this; - } - - public Badge WithShape(BadgeShape value) - { - this.Shape = value; - return this; - } - - public Badge WithStyle(BadgeStyle value) - { - this.Style = value; - return this; - } - - public Badge WithTooltip(string value) - { - this.Tooltip = value; - return this; - } - - public Badge WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public Badge WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// A donut chart. -/// -public class DonutChart : CardElement -{ - /// - /// Deserializes a JSON string into an object of type DonutChart. - /// - public static DonutChart? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Chart.Donut**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Chart.Donut"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The title of the chart. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("colorSet")] - public ChartColorSet? ColorSet { get; set; } - - /// - /// The data to display in the chart. - /// - [JsonPropertyName("data")] - public IList? Data { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this DonutChart into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public DonutChart WithId(string value) - { - this.Id = value; - return this; - } - - public DonutChart WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public DonutChart WithLang(string value) - { - this.Lang = value; - return this; - } - - public DonutChart WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public DonutChart WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public DonutChart WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public DonutChart WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public DonutChart WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public DonutChart WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public DonutChart WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public DonutChart WithTitle(string value) - { - this.Title = value; - return this; - } - - public DonutChart WithColorSet(ChartColorSet value) - { - this.ColorSet = value; - return this; - } - - public DonutChart WithData(params IList value) - { - this.Data = value; - return this; - } - - public DonutChart WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public DonutChart WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// A data point in a Donut chart. -/// -public class DonutChartData : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type DonutChartData. - /// - public static DonutChartData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The legend of the chart. - /// - [JsonPropertyName("legend")] - public string? Legend { get; set; } - - /// - /// The value associated with the data point. - /// - [JsonPropertyName("value")] - public float? Value { get; set; } - - /// - /// The color to use for the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// Serializes this DonutChartData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public DonutChartData WithLegend(string value) - { - this.Legend = value; - return this; - } - - public DonutChartData WithValue(float value) - { - this.Value = value; - return this; - } - - public DonutChartData WithColor(ChartColor value) - { - this.Color = value; - return this; - } -} - -/// -/// A pie chart. -/// -public class PieChart : CardElement -{ - /// - /// Deserializes a JSON string into an object of type PieChart. - /// - public static PieChart? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Chart.Pie**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Chart.Pie"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The title of the chart. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("colorSet")] - public ChartColorSet? ColorSet { get; set; } - - /// - /// The data to display in the chart. - /// - [JsonPropertyName("data")] - public IList? Data { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this PieChart into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public PieChart WithId(string value) - { - this.Id = value; - return this; - } - - public PieChart WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public PieChart WithLang(string value) - { - this.Lang = value; - return this; - } - - public PieChart WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public PieChart WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public PieChart WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public PieChart WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public PieChart WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public PieChart WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public PieChart WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public PieChart WithTitle(string value) - { - this.Title = value; - return this; - } - - public PieChart WithColorSet(ChartColorSet value) - { - this.ColorSet = value; - return this; - } - - public PieChart WithData(params IList value) - { - this.Data = value; - return this; - } - - public PieChart WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public PieChart WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// A grouped vertical bar chart. -/// -public class GroupedVerticalBarChart : CardElement -{ - /// - /// Deserializes a JSON string into an object of type GroupedVerticalBarChart. - /// - public static GroupedVerticalBarChart? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Chart.VerticalBar.Grouped**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Chart.VerticalBar.Grouped"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The title of the chart. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("colorSet")] - public ChartColorSet? ColorSet { get; set; } - - /// - /// The title of the x axis. - /// - [JsonPropertyName("xAxisTitle")] - public string? XAxisTitle { get; set; } - - /// - /// The title of the y axis. - /// - [JsonPropertyName("yAxisTitle")] - public string? YAxisTitle { get; set; } - - /// - /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// Controls if bars in the chart should be displayed as stacks instead of groups. - /// - /// **Note:** stacked vertical bar charts do not support custom Y ranges nor negative Y values. - /// - [JsonPropertyName("stacked")] - public bool? Stacked { get; set; } - - /// - /// The data points in a series. - /// - [JsonPropertyName("data")] - public IList? Data { get; set; } - - /// - /// Controls if values should be displayed on each bar. - /// - [JsonPropertyName("showBarValues")] - public bool? ShowBarValues { get; set; } - - /// - /// The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation. - /// - /// `yMin` is ignored if `stacked` is set to `true`. - /// - [JsonPropertyName("yMin")] - public float? YMin { get; set; } - - /// - /// The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation. - /// - /// `yMax` is ignored if `stacked` is set to `true`. - /// - [JsonPropertyName("yMax")] - public float? YMax { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this GroupedVerticalBarChart into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public GroupedVerticalBarChart WithId(string value) - { - this.Id = value; - return this; - } - - public GroupedVerticalBarChart WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public GroupedVerticalBarChart WithLang(string value) - { - this.Lang = value; - return this; - } - - public GroupedVerticalBarChart WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public GroupedVerticalBarChart WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public GroupedVerticalBarChart WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public GroupedVerticalBarChart WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public GroupedVerticalBarChart WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public GroupedVerticalBarChart WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public GroupedVerticalBarChart WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public GroupedVerticalBarChart WithTitle(string value) - { - this.Title = value; - return this; - } - - public GroupedVerticalBarChart WithColorSet(ChartColorSet value) - { - this.ColorSet = value; - return this; - } - - public GroupedVerticalBarChart WithXAxisTitle(string value) - { - this.XAxisTitle = value; - return this; - } - - public GroupedVerticalBarChart WithYAxisTitle(string value) - { - this.YAxisTitle = value; - return this; - } - - public GroupedVerticalBarChart WithColor(ChartColor value) - { - this.Color = value; - return this; - } - - public GroupedVerticalBarChart WithStacked(bool value) - { - this.Stacked = value; - return this; - } - - public GroupedVerticalBarChart WithData(params IList value) - { - this.Data = value; - return this; - } - - public GroupedVerticalBarChart WithShowBarValues(bool value) - { - this.ShowBarValues = value; - return this; - } - - public GroupedVerticalBarChart WithYMin(float value) - { - this.YMin = value; - return this; - } - - public GroupedVerticalBarChart WithYMax(float value) - { - this.YMax = value; - return this; - } - - public GroupedVerticalBarChart WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public GroupedVerticalBarChart WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// Represents a series of data points. -/// -public class GroupedVerticalBarChartData : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type GroupedVerticalBarChartData. - /// - public static GroupedVerticalBarChartData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The legend of the chart. - /// - [JsonPropertyName("legend")] - public string? Legend { get; set; } - - /// - /// The data points in the series. - /// - [JsonPropertyName("values")] - public IList? Values { get; set; } - - /// - /// The color to use for all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// Serializes this GroupedVerticalBarChartData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public GroupedVerticalBarChartData WithLegend(string value) - { - this.Legend = value; - return this; - } - - public GroupedVerticalBarChartData WithValues(params IList value) - { - this.Values = value; - return this; - } - - public GroupedVerticalBarChartData WithColor(ChartColor value) - { - this.Color = value; - return this; - } -} - -/// -/// A single data point in a bar chart. -/// -public class BarChartDataValue : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type BarChartDataValue. - /// - public static BarChartDataValue? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The x axis value of the data point. - /// - [JsonPropertyName("x")] - public string? X { get; set; } - - /// - /// The y axis value of the data point. - /// - [JsonPropertyName("y")] - public float? Y { get; set; } - - /// - /// Serializes this BarChartDataValue into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public BarChartDataValue WithX(string value) - { - this.X = value; - return this; - } - - public BarChartDataValue WithY(float value) - { - this.Y = value; - return this; - } -} - -/// -/// A vertical bar chart. -/// -public class VerticalBarChart : CardElement -{ - /// - /// Deserializes a JSON string into an object of type VerticalBarChart. - /// - public static VerticalBarChart? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Chart.VerticalBar**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Chart.VerticalBar"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The title of the chart. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("colorSet")] - public ChartColorSet? ColorSet { get; set; } - - /// - /// The title of the x axis. - /// - [JsonPropertyName("xAxisTitle")] - public string? XAxisTitle { get; set; } - - /// - /// The title of the y axis. - /// - [JsonPropertyName("yAxisTitle")] - public string? YAxisTitle { get; set; } - - /// - /// The data to display in the chart. - /// - [JsonPropertyName("data")] - public IList? Data { get; set; } - - /// - /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// Controls if the bar values should be displayed. - /// - [JsonPropertyName("showBarValues")] - public bool? ShowBarValues { get; set; } - - /// - /// The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation. - /// - [JsonPropertyName("yMin")] - public float? YMin { get; set; } - - /// - /// The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation. - /// - [JsonPropertyName("yMax")] - public float? YMax { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this VerticalBarChart into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public VerticalBarChart WithId(string value) - { - this.Id = value; - return this; - } - - public VerticalBarChart WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public VerticalBarChart WithLang(string value) - { - this.Lang = value; - return this; - } - - public VerticalBarChart WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public VerticalBarChart WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public VerticalBarChart WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public VerticalBarChart WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public VerticalBarChart WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public VerticalBarChart WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public VerticalBarChart WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public VerticalBarChart WithTitle(string value) - { - this.Title = value; - return this; - } - - public VerticalBarChart WithColorSet(ChartColorSet value) - { - this.ColorSet = value; - return this; - } - - public VerticalBarChart WithXAxisTitle(string value) - { - this.XAxisTitle = value; - return this; - } - - public VerticalBarChart WithYAxisTitle(string value) - { - this.YAxisTitle = value; - return this; - } - - public VerticalBarChart WithData(params IList value) - { - this.Data = value; - return this; - } - - public VerticalBarChart WithColor(ChartColor value) - { - this.Color = value; - return this; - } - - public VerticalBarChart WithShowBarValues(bool value) - { - this.ShowBarValues = value; - return this; - } - - public VerticalBarChart WithYMin(float value) - { - this.YMin = value; - return this; - } - - public VerticalBarChart WithYMax(float value) - { - this.YMax = value; - return this; - } - - public VerticalBarChart WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public VerticalBarChart WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// Represents a data point in a vertical bar chart. -/// -public class VerticalBarChartDataValue : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type VerticalBarChartDataValue. - /// - public static VerticalBarChartDataValue? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The x axis value of the data point. - /// - [JsonPropertyName("x")] - public IUnion? X { get; set; } - - /// - /// The y axis value of the data point. - /// - [JsonPropertyName("y")] - public float? Y { get; set; } - - /// - /// The color to use for the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// Serializes this VerticalBarChartDataValue into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public VerticalBarChartDataValue WithX(IUnion value) - { - this.X = value; - return this; - } - - public VerticalBarChartDataValue WithY(float value) - { - this.Y = value; - return this; - } - - public VerticalBarChartDataValue WithColor(ChartColor value) - { - this.Color = value; - return this; - } -} - -/// -/// A horizontal bar chart. -/// -public class HorizontalBarChart : CardElement -{ - /// - /// Deserializes a JSON string into an object of type HorizontalBarChart. - /// - public static HorizontalBarChart? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Chart.HorizontalBar**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Chart.HorizontalBar"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The title of the chart. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("colorSet")] - public ChartColorSet? ColorSet { get; set; } - - /// - /// The title of the x axis. - /// - [JsonPropertyName("xAxisTitle")] - public string? XAxisTitle { get; set; } - - /// - /// The title of the y axis. - /// - [JsonPropertyName("yAxisTitle")] - public string? YAxisTitle { get; set; } - - /// - /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// The data points in the chart. - /// - [JsonPropertyName("data")] - public IList? Data { get; set; } - - /// - /// Controls how the chart should be visually laid out. - /// - [JsonPropertyName("displayMode")] - public HorizontalBarChartDisplayMode? DisplayMode { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this HorizontalBarChart into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public HorizontalBarChart WithId(string value) - { - this.Id = value; - return this; - } - - public HorizontalBarChart WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public HorizontalBarChart WithLang(string value) - { - this.Lang = value; - return this; - } - - public HorizontalBarChart WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public HorizontalBarChart WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public HorizontalBarChart WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public HorizontalBarChart WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public HorizontalBarChart WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public HorizontalBarChart WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public HorizontalBarChart WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public HorizontalBarChart WithTitle(string value) - { - this.Title = value; - return this; - } - - public HorizontalBarChart WithColorSet(ChartColorSet value) - { - this.ColorSet = value; - return this; - } - - public HorizontalBarChart WithXAxisTitle(string value) - { - this.XAxisTitle = value; - return this; - } - - public HorizontalBarChart WithYAxisTitle(string value) - { - this.YAxisTitle = value; - return this; - } - - public HorizontalBarChart WithColor(ChartColor value) - { - this.Color = value; - return this; - } - - public HorizontalBarChart WithData(params IList value) - { - this.Data = value; - return this; - } - - public HorizontalBarChart WithDisplayMode(HorizontalBarChartDisplayMode value) - { - this.DisplayMode = value; - return this; - } - - public HorizontalBarChart WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public HorizontalBarChart WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// Represents a single data point in a horizontal bar chart. -/// -public class HorizontalBarChartDataValue : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type HorizontalBarChartDataValue. - /// - public static HorizontalBarChartDataValue? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The x axis value of the data point. - /// - [JsonPropertyName("x")] - public string? X { get; set; } - - /// - /// The y axis value of the data point. - /// - [JsonPropertyName("y")] - public float? Y { get; set; } - - /// - /// The color of the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// Serializes this HorizontalBarChartDataValue into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public HorizontalBarChartDataValue WithX(string value) - { - this.X = value; - return this; - } - - public HorizontalBarChartDataValue WithY(float value) - { - this.Y = value; - return this; - } - - public HorizontalBarChartDataValue WithColor(ChartColor value) - { - this.Color = value; - return this; - } -} - -/// -/// A stacked horizontal bar chart. -/// -public class StackedHorizontalBarChart : CardElement -{ - /// - /// Deserializes a JSON string into an object of type StackedHorizontalBarChart. - /// - public static StackedHorizontalBarChart? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Chart.HorizontalBar.Stacked**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Chart.HorizontalBar.Stacked"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The title of the chart. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("colorSet")] - public ChartColorSet? ColorSet { get; set; } - - /// - /// The title of the x axis. - /// - [JsonPropertyName("xAxisTitle")] - public string? XAxisTitle { get; set; } - - /// - /// The title of the y axis. - /// - [JsonPropertyName("yAxisTitle")] - public string? YAxisTitle { get; set; } - - /// - /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// The data to display in the chart. - /// - [JsonPropertyName("data")] - public IList? Data { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this StackedHorizontalBarChart into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public StackedHorizontalBarChart WithId(string value) - { - this.Id = value; - return this; - } - - public StackedHorizontalBarChart WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public StackedHorizontalBarChart WithLang(string value) - { - this.Lang = value; - return this; - } - - public StackedHorizontalBarChart WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public StackedHorizontalBarChart WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public StackedHorizontalBarChart WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public StackedHorizontalBarChart WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public StackedHorizontalBarChart WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public StackedHorizontalBarChart WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public StackedHorizontalBarChart WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public StackedHorizontalBarChart WithTitle(string value) - { - this.Title = value; - return this; - } - - public StackedHorizontalBarChart WithColorSet(ChartColorSet value) - { - this.ColorSet = value; - return this; - } - - public StackedHorizontalBarChart WithXAxisTitle(string value) - { - this.XAxisTitle = value; - return this; - } - - public StackedHorizontalBarChart WithYAxisTitle(string value) - { - this.YAxisTitle = value; - return this; - } - - public StackedHorizontalBarChart WithColor(ChartColor value) - { - this.Color = value; - return this; - } - - public StackedHorizontalBarChart WithData(params IList value) - { - this.Data = value; - return this; - } - - public StackedHorizontalBarChart WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public StackedHorizontalBarChart WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// Defines the collection of data series to display in as a stacked horizontal bar chart. -/// -public class StackedHorizontalBarChartData : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type StackedHorizontalBarChartData. - /// - public static StackedHorizontalBarChartData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The title of the series. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The data points in the series. - /// - [JsonPropertyName("data")] - public IList? Data { get; set; } - - /// - /// Serializes this StackedHorizontalBarChartData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public StackedHorizontalBarChartData WithTitle(string value) - { - this.Title = value; - return this; - } - - public StackedHorizontalBarChartData WithData(params IList value) - { - this.Data = value; - return this; - } -} - -/// -/// A data point in a series. -/// -public class StackedHorizontalBarChartDataPoint : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type StackedHorizontalBarChartDataPoint. - /// - public static StackedHorizontalBarChartDataPoint? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The legend associated with the data point. - /// - [JsonPropertyName("legend")] - public string? Legend { get; set; } - - /// - /// The value of the data point. - /// - [JsonPropertyName("value")] - public float? Value { get; set; } - - /// - /// The color to use to render the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// Serializes this StackedHorizontalBarChartDataPoint into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public StackedHorizontalBarChartDataPoint WithLegend(string value) - { - this.Legend = value; - return this; - } - - public StackedHorizontalBarChartDataPoint WithValue(float value) - { - this.Value = value; - return this; - } - - public StackedHorizontalBarChartDataPoint WithColor(ChartColor value) - { - this.Color = value; - return this; - } -} - -/// -/// A line chart. -/// -public class LineChart : CardElement -{ - /// - /// Deserializes a JSON string into an object of type LineChart. - /// - public static LineChart? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Chart.Line**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Chart.Line"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The title of the chart. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("colorSet")] - public ChartColorSet? ColorSet { get; set; } - - /// - /// The title of the x axis. - /// - [JsonPropertyName("xAxisTitle")] - public string? XAxisTitle { get; set; } - - /// - /// The title of the y axis. - /// - [JsonPropertyName("yAxisTitle")] - public string? YAxisTitle { get; set; } - - /// - /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// The data point series in the line chart. - /// - [JsonPropertyName("data")] - public IList? Data { get; set; } - - /// - /// The maximum y range. - /// - [JsonPropertyName("yMin")] - public float? YMin { get; set; } - - /// - /// The minimum y range. - /// - [JsonPropertyName("yMax")] - public float? YMax { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this LineChart into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public LineChart WithId(string value) - { - this.Id = value; - return this; - } - - public LineChart WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public LineChart WithLang(string value) - { - this.Lang = value; - return this; - } - - public LineChart WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public LineChart WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public LineChart WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public LineChart WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public LineChart WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public LineChart WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public LineChart WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public LineChart WithTitle(string value) - { - this.Title = value; - return this; - } - - public LineChart WithColorSet(ChartColorSet value) - { - this.ColorSet = value; - return this; - } - - public LineChart WithXAxisTitle(string value) - { - this.XAxisTitle = value; - return this; - } - - public LineChart WithYAxisTitle(string value) - { - this.YAxisTitle = value; - return this; - } - - public LineChart WithColor(ChartColor value) - { - this.Color = value; - return this; - } - - public LineChart WithData(params IList value) - { - this.Data = value; - return this; - } - - public LineChart WithYMin(float value) - { - this.YMin = value; - return this; - } - - public LineChart WithYMax(float value) - { - this.YMax = value; - return this; - } - - public LineChart WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public LineChart WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// Represents a collection of data points series in a line chart. -/// -public class LineChartData : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type LineChartData. - /// - public static LineChartData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The legend of the chart. - /// - [JsonPropertyName("legend")] - public string? Legend { get; set; } - - /// - /// The data points in the series. - /// - [JsonPropertyName("values")] - public IList? Values { get; set; } - - /// - /// The color all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// Serializes this LineChartData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public LineChartData WithLegend(string value) - { - this.Legend = value; - return this; - } - - public LineChartData WithValues(params IList value) - { - this.Values = value; - return this; - } - - public LineChartData WithColor(ChartColor value) - { - this.Color = value; - return this; - } -} - -/// -/// Represents a single data point in a line chart. -/// -public class LineChartValue : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type LineChartValue. - /// - public static LineChartValue? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The x axis value of the data point. - /// - /// If all x values of the x [Chart.Line](https://adaptivecards.microsoft.com/?topic=Chart.Line) are expressed as a number, or if all x values are expressed as a date string in the `YYYY-MM-DD` format, the chart will be rendered as a time series chart, i.e. x axis values will span across the minimum x value to maximum x value range. - /// - /// Otherwise, if x values are represented as a mix of numbers and strings or if at least one x value isn't in the `YYYY-MM-DD` format, the chart will be rendered as a categorical chart, i.e. x axis values will be displayed as categories. - /// - [JsonPropertyName("x")] - public IUnion? X { get; set; } - - /// - /// The y axis value of the data point. - /// - [JsonPropertyName("y")] - public float? Y { get; set; } - - /// - /// Serializes this LineChartValue into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public LineChartValue WithX(IUnion value) - { - this.X = value; - return this; - } - - public LineChartValue WithY(float value) - { - this.Y = value; - return this; - } -} - -/// -/// A gauge chart. -/// -public class GaugeChart : CardElement -{ - /// - /// Deserializes a JSON string into an object of type GaugeChart. - /// - public static GaugeChart? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Chart.Gauge**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Chart.Gauge"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The title of the chart. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("colorSet")] - public ChartColorSet? ColorSet { get; set; } - - /// - /// The minimum value of the gauge. - /// - [JsonPropertyName("min")] - public float? Min { get; set; } - - /// - /// The maximum value of the gauge. - /// - [JsonPropertyName("max")] - public float? Max { get; set; } - - /// - /// The sub-label of the gauge. - /// - [JsonPropertyName("subLabel")] - public string? SubLabel { get; set; } - - /// - /// Controls whether the min/max values should be displayed. - /// - [JsonPropertyName("showMinMax")] - public bool? ShowMinMax { get; set; } - - /// - /// The segments to display in the gauge. - /// - [JsonPropertyName("segments")] - public IList? Segments { get; set; } - - /// - /// The value of the gauge. - /// - [JsonPropertyName("value")] - public float? Value { get; set; } - - /// - /// The format used to display the gauge's value. - /// - [JsonPropertyName("valueFormat")] - public GaugeChartValueFormat? ValueFormat { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this GaugeChart into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public GaugeChart WithId(string value) - { - this.Id = value; - return this; - } - - public GaugeChart WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public GaugeChart WithLang(string value) - { - this.Lang = value; - return this; - } - - public GaugeChart WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public GaugeChart WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public GaugeChart WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public GaugeChart WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public GaugeChart WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public GaugeChart WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public GaugeChart WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public GaugeChart WithTitle(string value) - { - this.Title = value; - return this; - } - - public GaugeChart WithColorSet(ChartColorSet value) - { - this.ColorSet = value; - return this; - } - - public GaugeChart WithMin(float value) - { - this.Min = value; - return this; - } - - public GaugeChart WithMax(float value) - { - this.Max = value; - return this; - } - - public GaugeChart WithSubLabel(string value) - { - this.SubLabel = value; - return this; - } - - public GaugeChart WithShowMinMax(bool value) - { - this.ShowMinMax = value; - return this; - } - - public GaugeChart WithSegments(params IList value) - { - this.Segments = value; - return this; - } - - public GaugeChart WithValue(float value) - { - this.Value = value; - return this; - } - - public GaugeChart WithValueFormat(GaugeChartValueFormat value) - { - this.ValueFormat = value; - return this; - } - - public GaugeChart WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public GaugeChart WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// The legend of the chart. -/// -public class GaugeChartLegend : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type GaugeChartLegend. - /// - public static GaugeChartLegend? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The size of the segment. - /// - [JsonPropertyName("size")] - public float? Size { get; set; } - - /// - /// The legend text associated with the segment. - /// - [JsonPropertyName("legend")] - public string? Legend { get; set; } - - /// - /// The color to use for the segment. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// Serializes this GaugeChartLegend into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public GaugeChartLegend WithSize(float value) - { - this.Size = value; - return this; - } - - public GaugeChartLegend WithLegend(string value) - { - this.Legend = value; - return this; - } - - public GaugeChartLegend WithColor(ChartColor value) - { - this.Color = value; - return this; - } -} - -/// -/// A formatted and syntax-colored code block. -/// -public class CodeBlock : CardElement -{ - /// - /// Deserializes a JSON string into an object of type CodeBlock. - /// - public static CodeBlock? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **CodeBlock**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "CodeBlock"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The code snippet to display. - /// - [JsonPropertyName("codeSnippet")] - public string? CodeSnippet { get; set; } - - /// - /// The language the code snippet is expressed in. - /// - [JsonPropertyName("language")] - public CodeLanguage? Language { get; set; } - - /// - /// A number that represents the line in the file from where the code snippet was extracted. - /// - [JsonPropertyName("startLineNumber")] - public float? StartLineNumber { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this CodeBlock into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public CodeBlock WithId(string value) - { - this.Id = value; - return this; - } - - public CodeBlock WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public CodeBlock WithLang(string value) - { - this.Lang = value; - return this; - } - - public CodeBlock WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public CodeBlock WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public CodeBlock WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public CodeBlock WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public CodeBlock WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public CodeBlock WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public CodeBlock WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public CodeBlock WithCodeSnippet(string value) - { - this.CodeSnippet = value; - return this; - } - - public CodeBlock WithLanguage(CodeLanguage value) - { - this.Language = value; - return this; - } - - public CodeBlock WithStartLineNumber(float value) - { - this.StartLineNumber = value; - return this; - } - - public CodeBlock WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public CodeBlock WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// Displays a user's information, including their profile picture. -/// -public class ComUserMicrosoftGraphComponent : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ComUserMicrosoftGraphComponent. - /// - public static ComUserMicrosoftGraphComponent? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Component**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Component"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// Must be **graph.microsoft.com/user**. - /// - [JsonPropertyName("name")] - public string Name { get; } = "graph.microsoft.com/user"; - - /// - /// The properties of the user. - /// - [JsonPropertyName("properties")] - public PersonaProperties? Properties { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ComUserMicrosoftGraphComponent into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ComUserMicrosoftGraphComponent WithId(string value) - { - this.Id = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithLang(string value) - { - this.Lang = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithProperties(PersonaProperties value) - { - this.Properties = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// Represents the properties of a Persona component. -/// -public class PersonaProperties : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type PersonaProperties. - /// - public static PersonaProperties? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The UPN of the persona. - /// - [JsonPropertyName("userPrincipalName")] - public string? UserPrincipalName { get; set; } - - /// - /// The display name of the persona. - /// - [JsonPropertyName("displayName")] - public string? DisplayName { get; set; } - - /// - /// Serializes this PersonaProperties into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public PersonaProperties WithUserPrincipalName(string value) - { - this.UserPrincipalName = value; - return this; - } - - public PersonaProperties WithDisplayName(string value) - { - this.DisplayName = value; - return this; - } -} - -/// -/// Displays multiple users' information, including their profile pictures. -/// -public class ComUsersMicrosoftGraphComponent : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ComUsersMicrosoftGraphComponent. - /// - public static ComUsersMicrosoftGraphComponent? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Component**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Component"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// Must be **graph.microsoft.com/users**. - /// - [JsonPropertyName("name")] - public string Name { get; } = "graph.microsoft.com/users"; - - /// - /// The properties of the set. - /// - [JsonPropertyName("properties")] - public PersonaSetProperties? Properties { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ComUsersMicrosoftGraphComponent into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ComUsersMicrosoftGraphComponent WithId(string value) - { - this.Id = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithLang(string value) - { - this.Lang = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithProperties(PersonaSetProperties value) - { - this.Properties = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// Represents the properties of a PersonaSet component. -/// -public class PersonaSetProperties : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type PersonaSetProperties. - /// - public static PersonaSetProperties? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The users a PersonaSet component should display. - /// - [JsonPropertyName("users")] - public IList? Users { get; set; } - - /// - /// Serializes this PersonaSetProperties into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public PersonaSetProperties WithUsers(params IList value) - { - this.Users = value; - return this; - } -} - -/// -/// Displays information about a generic graph resource. -/// -public class ComResourceMicrosoftGraphComponent : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ComResourceMicrosoftGraphComponent. - /// - public static ComResourceMicrosoftGraphComponent? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Component**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Component"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// Must be **graph.microsoft.com/resource**. - /// - [JsonPropertyName("name")] - public string Name { get; } = "graph.microsoft.com/resource"; - - /// - /// The properties of the resource. - /// - [JsonPropertyName("properties")] - public ResourceProperties? Properties { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ComResourceMicrosoftGraphComponent into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ComResourceMicrosoftGraphComponent WithId(string value) - { - this.Id = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithLang(string value) - { - this.Lang = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithProperties(ResourceProperties value) - { - this.Properties = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// Represents the properties of a resource component. -/// -public class ResourceProperties : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type ResourceProperties. - /// - public static ResourceProperties? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The Id of the resource. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// The reference to the resource. - /// - [JsonPropertyName("resourceReference")] - public IDictionary? ResourceReference { get; set; } - - /// - /// The visualization of the resource. - /// - [JsonPropertyName("resourceVisualization")] - public ResourceVisualization? ResourceVisualization { get; set; } - - /// - /// Serializes this ResourceProperties into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ResourceProperties WithId(string value) - { - this.Id = value; - return this; - } - - public ResourceProperties WithResourceReference(IDictionary value) - { - this.ResourceReference = value; - return this; - } - - public ResourceProperties WithResourceVisualization(ResourceVisualization value) - { - this.ResourceVisualization = value; - return this; - } -} - -/// -/// Represents a visualization of a resource. -/// -public class ResourceVisualization : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type ResourceVisualization. - /// - public static ResourceVisualization? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The media associated with the resource. - /// - [JsonPropertyName("media")] - public string? Media { get; set; } - - /// - /// Serializes this ResourceVisualization into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ResourceVisualization WithMedia(string value) - { - this.Media = value; - return this; - } -} - -/// -/// Displays information about a file resource. -/// -public class ComFileMicrosoftGraphComponent : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ComFileMicrosoftGraphComponent. - /// - public static ComFileMicrosoftGraphComponent? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Component**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Component"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// Must be **graph.microsoft.com/file**. - /// - [JsonPropertyName("name")] - public string Name { get; } = "graph.microsoft.com/file"; - - /// - /// The properties of the file. - /// - [JsonPropertyName("properties")] - public FileProperties? Properties { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ComFileMicrosoftGraphComponent into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ComFileMicrosoftGraphComponent WithId(string value) - { - this.Id = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithLang(string value) - { - this.Lang = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithProperties(FileProperties value) - { - this.Properties = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// Represents the properties of a file component. -/// -public class FileProperties : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type FileProperties. - /// - public static FileProperties? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The name of the file. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// The file extension. - /// - [JsonPropertyName("extension")] - public string? Extension { get; set; } - - /// - /// The URL of the file. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// Serializes this FileProperties into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public FileProperties WithName(string value) - { - this.Name = value; - return this; - } - - public FileProperties WithExtension(string value) - { - this.Extension = value; - return this; - } - - public FileProperties WithUrl(string value) - { - this.Url = value; - return this; - } -} - -/// -/// Displays information about a calendar event. -/// -public class ComEventMicrosoftGraphComponent : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ComEventMicrosoftGraphComponent. - /// - public static ComEventMicrosoftGraphComponent? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **Component**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Component"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// Must be **graph.microsoft.com/event**. - /// - [JsonPropertyName("name")] - public string Name { get; } = "graph.microsoft.com/event"; - - /// - /// The properties of the event. - /// - [JsonPropertyName("properties")] - public CalendarEventProperties? Properties { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ComEventMicrosoftGraphComponent into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ComEventMicrosoftGraphComponent WithId(string value) - { - this.Id = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithLang(string value) - { - this.Lang = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithProperties(CalendarEventProperties value) - { - this.Properties = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } -} - -/// -/// The properties of a calendar event. -/// -public class CalendarEventProperties : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type CalendarEventProperties. - /// - public static CalendarEventProperties? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The ID of the event. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// The title of the event. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The start date and time of the event. - /// - [JsonPropertyName("start")] - public string? Start { get; set; } - - /// - /// The end date and time of the event. - /// - [JsonPropertyName("end")] - public string? End { get; set; } - - /// - /// The status of the event. - /// - [JsonPropertyName("status")] - public string? Status { get; set; } - - /// - /// The locations of the event. - /// - [JsonPropertyName("locations")] - public IList? Locations { get; set; } - - /// - /// The URL of the online meeting. - /// - [JsonPropertyName("onlineMeetingUrl")] - public string? OnlineMeetingUrl { get; set; } - - /// - /// Indicates if the event is all day. - /// - [JsonPropertyName("isAllDay")] - public bool? IsAllDay { get; set; } - - /// - /// The extension of the event. - /// - [JsonPropertyName("extension")] - public string? Extension { get; set; } - - /// - /// The URL of the event. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The attendees of the event. - /// - [JsonPropertyName("attendees")] - public IList? Attendees { get; set; } - - /// - /// The organizer of the event. - /// - [JsonPropertyName("organizer")] - public CalendarEventAttendee? Organizer { get; set; } - - /// - /// Serializes this CalendarEventProperties into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public CalendarEventProperties WithId(string value) - { - this.Id = value; - return this; - } - - public CalendarEventProperties WithTitle(string value) - { - this.Title = value; - return this; - } - - public CalendarEventProperties WithStart(string value) - { - this.Start = value; - return this; - } - - public CalendarEventProperties WithEnd(string value) - { - this.End = value; - return this; - } - - public CalendarEventProperties WithStatus(string value) - { - this.Status = value; - return this; - } - - public CalendarEventProperties WithLocations(params IList value) - { - this.Locations = value; - return this; - } - - public CalendarEventProperties WithOnlineMeetingUrl(string value) - { - this.OnlineMeetingUrl = value; - return this; - } - - public CalendarEventProperties WithIsAllDay(bool value) - { - this.IsAllDay = value; - return this; - } - - public CalendarEventProperties WithExtension(string value) - { - this.Extension = value; - return this; - } - - public CalendarEventProperties WithUrl(string value) - { - this.Url = value; - return this; - } - - public CalendarEventProperties WithAttendees(params IList value) - { - this.Attendees = value; - return this; - } - - public CalendarEventProperties WithOrganizer(CalendarEventAttendee value) - { - this.Organizer = value; - return this; - } -} - -/// -/// Represents a calendar event attendee. -/// -public class CalendarEventAttendee : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type CalendarEventAttendee. - /// - public static CalendarEventAttendee? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The name of the attendee. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// The email address of the attendee. - /// - [JsonPropertyName("email")] - public string? Email { get; set; } - - /// - /// The title of the attendee. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The type of the attendee. - /// - [JsonPropertyName("type")] - public string? Type { get; set; } - - /// - /// The status of the attendee. - /// - [JsonPropertyName("status")] - public string? Status { get; set; } - - /// - /// Serializes this CalendarEventAttendee into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public CalendarEventAttendee WithName(string value) - { - this.Name = value; - return this; - } - - public CalendarEventAttendee WithEmail(string value) - { - this.Email = value; - return this; - } - - public CalendarEventAttendee WithTitle(string value) - { - this.Title = value; - return this; - } - - public CalendarEventAttendee WithType(string value) - { - this.Type = value; - return this; - } - - public CalendarEventAttendee WithStatus(string value) - { - this.Status = value; - return this; - } -} - -/// -/// A page inside a Carousel element. -/// -public class CarouselPage : CardElement -{ - /// - /// Deserializes a JSON string into an object of type CarouselPage. - /// - public static CarouselPage? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **CarouselPage**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "CarouselPage"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - /// - [JsonPropertyName("style")] - public ContainerStyle? Style { get; set; } - - /// - /// Controls if a border should be displayed around the container. - /// - [JsonPropertyName("showBorder")] - public bool? ShowBorder { get; set; } - - /// - /// Controls if the container should have rounded corners. - /// - [JsonPropertyName("roundedCorners")] - public bool? RoundedCorners { get; set; } - - /// - /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. - /// - [JsonPropertyName("layouts")] - public IList? Layouts { get; set; } - - /// - /// The minimum height, in pixels, of the container, in the `px` format. - /// - [JsonPropertyName("minHeight")] - public string? MinHeight { get; set; } - - /// - /// Defines the container's background image. - /// - [JsonPropertyName("backgroundImage")] - public IUnion? BackgroundImage { get; set; } - - /// - /// Controls how the container's content should be vertically aligned. - /// - [JsonPropertyName("verticalContentAlignment")] - public VerticalAlignment? VerticalContentAlignment { get; set; } - - /// - /// Controls if the content of the card is to be rendered left-to-right or right-to-left. - /// - [JsonPropertyName("rtl")] - public bool? Rtl { get; set; } - - /// - /// The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. - /// - [JsonPropertyName("maxHeight")] - public string? MaxHeight { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The elements in the page. - /// - [JsonPropertyName("items")] - public IList? Items { get; set; } - - public CarouselPage(params IList items) - { - this.Items = items; - } - - /// - /// Serializes this CarouselPage into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public CarouselPage WithId(string value) - { - this.Id = value; - return this; - } - - public CarouselPage WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public CarouselPage WithLang(string value) - { - this.Lang = value; - return this; - } - - public CarouselPage WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public CarouselPage WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public CarouselPage WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public CarouselPage WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public CarouselPage WithSelectAction(Action value) - { - this.SelectAction = value; - return this; - } - - public CarouselPage WithStyle(ContainerStyle value) - { - this.Style = value; - return this; - } - - public CarouselPage WithShowBorder(bool value) - { - this.ShowBorder = value; - return this; - } - - public CarouselPage WithRoundedCorners(bool value) - { - this.RoundedCorners = value; - return this; - } - - public CarouselPage WithLayouts(params IList value) - { - this.Layouts = value; - return this; - } - - public CarouselPage WithMinHeight(string value) - { - this.MinHeight = value; - return this; - } - - public CarouselPage WithBackgroundImage(IUnion value) - { - this.BackgroundImage = value; - return this; - } - - public CarouselPage WithVerticalContentAlignment(VerticalAlignment value) - { - this.VerticalContentAlignment = value; - return this; - } - - public CarouselPage WithRtl(bool value) - { - this.Rtl = value; - return this; - } - - public CarouselPage WithMaxHeight(string value) - { - this.MaxHeight = value; - return this; - } - - public CarouselPage WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public CarouselPage WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } - - public CarouselPage WithItems(params IList value) - { - this.Items = value; - return this; - } -} +/// +/// A line chart. +/// +public class LineChart : CardElement +{ + /// + /// Deserializes a JSON string into an object of type LineChart. + /// + public static LineChart? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Chart.Line**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Chart.Line"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The title of the chart. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Controls whether the chart's title should be displayed. Defaults to `false`. + /// + [JsonPropertyName("showTitle")] + public bool? ShowTitle { get; set; } = false; + + /// + /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("colorSet")] + public ChartColorSet? ColorSet { get; set; } + + /// + /// The maximum width, in pixels, of the chart, in the `px` format. + /// + [JsonPropertyName("maxWidth")] + public string? MaxWidth { get; set; } + + /// + /// Controls whether the chart's legend should be displayed. + /// + [JsonPropertyName("showLegend")] + public bool? ShowLegend { get; set; } = true; + + /// + /// The title of the x axis. + /// + [JsonPropertyName("xAxisTitle")] + public string? XAxisTitle { get; set; } + + /// + /// The title of the y axis. + /// + [JsonPropertyName("yAxisTitle")] + public string? YAxisTitle { get; set; } + + /// + /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// The data point series in the line chart. + /// + [JsonPropertyName("data")] + public IList? Data { get; set; } + + /// + /// The maximum y range. + /// + [JsonPropertyName("yMin")] + public float? YMin { get; set; } + + /// + /// The minimum y range. + /// + [JsonPropertyName("yMax")] + public float? YMax { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this LineChart into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public LineChart WithKey(string value) { + this.Key = value; + return this; + } + + public LineChart WithId(string value) { + this.Id = value; + return this; + } + + public LineChart WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public LineChart WithLang(string value) { + this.Lang = value; + return this; + } + + public LineChart WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public LineChart WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public LineChart WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public LineChart WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public LineChart WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public LineChart WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public LineChart WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public LineChart WithTitle(string value) { + this.Title = value; + return this; + } + + public LineChart WithShowTitle(bool value) { + this.ShowTitle = value; + return this; + } + + public LineChart WithColorSet(ChartColorSet value) { + this.ColorSet = value; + return this; + } + + public LineChart WithMaxWidth(string value) { + this.MaxWidth = value; + return this; + } + + public LineChart WithShowLegend(bool value) { + this.ShowLegend = value; + return this; + } + + public LineChart WithXAxisTitle(string value) { + this.XAxisTitle = value; + return this; + } + + public LineChart WithYAxisTitle(string value) { + this.YAxisTitle = value; + return this; + } + + public LineChart WithColor(ChartColor value) { + this.Color = value; + return this; + } + + public LineChart WithData(params IList value) { + this.Data = value; + return this; + } + + public LineChart WithYMin(float value) { + this.YMin = value; + return this; + } + + public LineChart WithYMax(float value) { + this.YMax = value; + return this; + } + + public LineChart WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public LineChart WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} /// -/// Represents a row of cells in a table. +/// Represents a collection of data points series in a line chart. /// -public class TableRow : CardElement +public class LineChartData : SerializableObject { - /// - /// Deserializes a JSON string into an object of type TableRow. - /// - public static TableRow? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **TableRow**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "TableRow"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// Controls if a border should be displayed around the container. - /// - [JsonPropertyName("showBorder")] - public bool? ShowBorder { get; set; } - - /// - /// Controls if the container should have rounded corners. - /// - [JsonPropertyName("roundedCorners")] - public bool? RoundedCorners { get; set; } - - /// - /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - /// - [JsonPropertyName("style")] - public ContainerStyle? Style { get; set; } - - /// - /// Controls how the content of every cell in the row should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table and columns. - /// - [JsonPropertyName("horizontalCellContentAlignment")] - public HorizontalAlignment? HorizontalCellContentAlignment { get; set; } - - /// - /// Controls how the content of every cell in the row should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table and columns. - /// - [JsonPropertyName("verticalCellContentAlignment")] - public VerticalAlignment? VerticalCellContentAlignment { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The cells in the row. - /// - [JsonPropertyName("cells")] - public IList? Cells { get; set; } - - /// - /// Serializes this TableRow into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TableRow WithId(string value) - { - this.Id = value; - return this; - } - - public TableRow WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public TableRow WithLang(string value) - { - this.Lang = value; - return this; - } - - public TableRow WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public TableRow WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public TableRow WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public TableRow WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } - - public TableRow WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public TableRow WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public TableRow WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public TableRow WithShowBorder(bool value) - { - this.ShowBorder = value; - return this; - } - - public TableRow WithRoundedCorners(bool value) - { - this.RoundedCorners = value; - return this; - } - - public TableRow WithStyle(ContainerStyle value) - { - this.Style = value; - return this; - } - - public TableRow WithHorizontalCellContentAlignment(HorizontalAlignment value) - { - this.HorizontalCellContentAlignment = value; - return this; - } - - public TableRow WithVerticalCellContentAlignment(VerticalAlignment value) - { - this.VerticalCellContentAlignment = value; - return this; - } - - public TableRow WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public TableRow WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } - - public TableRow WithCells(params IList value) - { - this.Cells = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type LineChartData. + /// + public static LineChartData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The legend of the chart. + /// + [JsonPropertyName("legend")] + public string? Legend { get; set; } + + /// + /// The data points in the series. + /// + [JsonPropertyName("values")] + public IList? Values { get; set; } + + /// + /// The color all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// Serializes this LineChartData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public LineChartData WithKey(string value) { + this.Key = value; + return this; + } + + public LineChartData WithLegend(string value) { + this.Legend = value; + return this; + } + + public LineChartData WithValues(params IList value) { + this.Values = value; + return this; + } + + public LineChartData WithColor(ChartColor value) { + this.Color = value; + return this; + } } /// -/// Represents a cell in a table row. -/// -public class TableCell : CardElement -{ - /// - /// Deserializes a JSON string into an object of type TableCell. - /// - public static TableCell? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **TableCell**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "TableCell"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - /// - [JsonPropertyName("style")] - public ContainerStyle? Style { get; set; } - - /// - /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. - /// - [JsonPropertyName("layouts")] - public IList? Layouts { get; set; } - - /// - /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. - /// - [JsonPropertyName("bleed")] - public bool? Bleed { get; set; } - - /// - /// The minimum height, in pixels, of the container, in the `px` format. - /// - [JsonPropertyName("minHeight")] - public string? MinHeight { get; set; } - - /// - /// Defines the container's background image. - /// - [JsonPropertyName("backgroundImage")] - public IUnion? BackgroundImage { get; set; } - - /// - /// Controls how the container's content should be vertically aligned. - /// - [JsonPropertyName("verticalContentAlignment")] - public VerticalAlignment? VerticalContentAlignment { get; set; } - - /// - /// Controls if the content of the card is to be rendered left-to-right or right-to-left. - /// - [JsonPropertyName("rtl")] - public bool? Rtl { get; set; } - - /// - /// The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. - /// - [JsonPropertyName("maxHeight")] - public string? MaxHeight { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The items (elements) in the cell. - /// - [JsonPropertyName("items")] - public IList? Items { get; set; } - - public TableCell(params IList items) - { - this.Items = items; - } - - /// - /// Serializes this TableCell into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TableCell WithId(string value) - { - this.Id = value; - return this; - } - - public TableCell WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } - - public TableCell WithLang(string value) - { - this.Lang = value; - return this; - } - - public TableCell WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public TableCell WithSeparator(bool value) - { - this.Separator = value; - return this; - } - - public TableCell WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } - - public TableCell WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } - - public TableCell WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } - - public TableCell WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public TableCell WithSelectAction(Action value) - { - this.SelectAction = value; - return this; - } - - public TableCell WithStyle(ContainerStyle value) - { - this.Style = value; - return this; - } - - public TableCell WithLayouts(params IList value) - { - this.Layouts = value; - return this; - } - - public TableCell WithBleed(bool value) - { - this.Bleed = value; - return this; - } - - public TableCell WithMinHeight(string value) - { - this.MinHeight = value; - return this; - } - - public TableCell WithBackgroundImage(IUnion value) - { - this.BackgroundImage = value; - return this; - } - - public TableCell WithVerticalContentAlignment(VerticalAlignment value) - { - this.VerticalContentAlignment = value; - return this; - } - - public TableCell WithRtl(bool value) - { - this.Rtl = value; - return this; - } - - public TableCell WithMaxHeight(string value) - { - this.MaxHeight = value; - return this; - } - - public TableCell WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public TableCell WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } - - public TableCell WithItems(params IList value) - { - this.Items = value; - return this; - } +/// Represents a single data point in a line chart. +/// +public class LineChartValue : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type LineChartValue. + /// + public static LineChartValue? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The x axis value of the data point. + /// + /// If all x values of the x [Chart.Line](https://adaptivecards.microsoft.com/?topic=Chart.Line) are expressed as a number, or if all x values are expressed as a date string in the `YYYY-MM-DD` format, the chart will be rendered as a time series chart, i.e. x axis values will span across the minimum x value to maximum x value range. + /// + /// Otherwise, if x values are represented as a mix of numbers and strings or if at least one x value isn't in the `YYYY-MM-DD` format, the chart will be rendered as a categorical chart, i.e. x axis values will be displayed as categories. + /// + [JsonPropertyName("x")] + public IUnion? X { get; set; } + + /// + /// The y axis value of the data point. + /// + [JsonPropertyName("y")] + public float? Y { get; set; } = 0; + + /// + /// Serializes this LineChartValue into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public LineChartValue WithKey(string value) { + this.Key = value; + return this; + } + + public LineChartValue WithX(IUnion value) { + this.X = value; + return this; + } + + public LineChartValue WithY(float value) { + this.Y = value; + return this; + } } /// -/// A block of text inside a RichTextBlock element. +/// A gauge chart. /// -public class TextRun : CardElement +public class GaugeChart : CardElement { - /// - /// Deserializes a JSON string into an object of type TextRun. - /// - public static TextRun? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **TextRun**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "TextRun"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The text to display. A subset of markdown is supported. - /// - [JsonPropertyName("text")] - public string? Text { get; set; } - - /// - /// The size of the text. - /// - [JsonPropertyName("size")] - public TextSize? Size { get; set; } - - /// - /// The weight of the text. - /// - [JsonPropertyName("weight")] - public TextWeight? Weight { get; set; } - - /// - /// The color of the text. - /// - [JsonPropertyName("color")] - public TextColor? Color { get; set; } - - /// - /// Controls whether the text should be renderer using a subtler variant of the select color. - /// - [JsonPropertyName("isSubtle")] - public bool? IsSubtle { get; set; } - - /// - /// The type of font to use for rendering. - /// - [JsonPropertyName("fontType")] - public FontType? FontType { get; set; } - - /// - /// Controls if the text should be italicized. - /// - [JsonPropertyName("italic")] - public bool? Italic { get; set; } - - /// - /// Controls if the text should be struck through. - /// - [JsonPropertyName("strikethrough")] - public bool? Strikethrough { get; set; } - - /// - /// Controls if the text should be highlighted. - /// - [JsonPropertyName("highlight")] - public bool? Highlight { get; set; } - - /// - /// Controls if the text should be underlined. - /// - [JsonPropertyName("underline")] - public bool? Underline { get; set; } - - /// - /// An Action that will be invoked when the text is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - public TextRun(string text) - { - this.Text = text; - } - - /// - /// Serializes this TextRun into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TextRun WithId(string value) - { - this.Id = value; - return this; - } - - public TextRun WithLang(string value) - { - this.Lang = value; - return this; - } - - public TextRun WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public TextRun WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public TextRun WithText(string value) - { - this.Text = value; - return this; - } - - public TextRun WithSize(TextSize value) - { - this.Size = value; - return this; - } - - public TextRun WithWeight(TextWeight value) - { - this.Weight = value; - return this; - } - - public TextRun WithColor(TextColor value) - { - this.Color = value; - return this; - } - - public TextRun WithIsSubtle(bool value) - { - this.IsSubtle = value; - return this; - } - - public TextRun WithFontType(FontType value) - { - this.FontType = value; - return this; - } - - public TextRun WithItalic(bool value) - { - this.Italic = value; - return this; - } - - public TextRun WithStrikethrough(bool value) - { - this.Strikethrough = value; - return this; - } - - public TextRun WithHighlight(bool value) - { - this.Highlight = value; - return this; - } - - public TextRun WithUnderline(bool value) - { - this.Underline = value; - return this; - } - - public TextRun WithSelectAction(Action value) - { - this.SelectAction = value; - return this; - } - - public TextRun WithGridArea(string value) - { - this.GridArea = value; - return this; - } - - public TextRun WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type GaugeChart. + /// + public static GaugeChart? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Chart.Gauge**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Chart.Gauge"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The title of the chart. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Controls whether the chart's title should be displayed. Defaults to `false`. + /// + [JsonPropertyName("showTitle")] + public bool? ShowTitle { get; set; } = false; + + /// + /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("colorSet")] + public ChartColorSet? ColorSet { get; set; } + + /// + /// The maximum width, in pixels, of the chart, in the `px` format. + /// + [JsonPropertyName("maxWidth")] + public string? MaxWidth { get; set; } + + /// + /// Controls whether the chart's legend should be displayed. + /// + [JsonPropertyName("showLegend")] + public bool? ShowLegend { get; set; } = true; + + /// + /// The minimum value of the gauge. + /// + [JsonPropertyName("min")] + public float? Min { get; set; } = 0; + + /// + /// The maximum value of the gauge. + /// + [JsonPropertyName("max")] + public float? Max { get; set; } + + /// + /// The sub-label of the gauge. + /// + [JsonPropertyName("subLabel")] + public string? SubLabel { get; set; } + + /// + /// Controls whether the min/max values should be displayed. + /// + [JsonPropertyName("showMinMax")] + public bool? ShowMinMax { get; set; } = true; + + /// + /// Controls whether the gauge's needle is displayed. Default is **true**. + /// + [JsonPropertyName("showNeedle")] + public bool? ShowNeedle { get; set; } = true; + + /// + /// Controls whether the outlines of the gauge segments are displayed. + /// + [JsonPropertyName("showOutlines")] + public bool? ShowOutlines { get; set; } = true; + + /// + /// The segments to display in the gauge. + /// + [JsonPropertyName("segments")] + public IList? Segments { get; set; } + + /// + /// The value of the gauge. + /// + [JsonPropertyName("value")] + public float? Value { get; set; } = 0; + + /// + /// The format used to display the gauge's value. + /// + [JsonPropertyName("valueFormat")] + public GaugeChartValueFormat? ValueFormat { get; set; } = GaugeChartValueFormat.Percentage; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this GaugeChart into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public GaugeChart WithKey(string value) { + this.Key = value; + return this; + } + + public GaugeChart WithId(string value) { + this.Id = value; + return this; + } + + public GaugeChart WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public GaugeChart WithLang(string value) { + this.Lang = value; + return this; + } + + public GaugeChart WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public GaugeChart WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public GaugeChart WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public GaugeChart WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public GaugeChart WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public GaugeChart WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public GaugeChart WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public GaugeChart WithTitle(string value) { + this.Title = value; + return this; + } + + public GaugeChart WithShowTitle(bool value) { + this.ShowTitle = value; + return this; + } + + public GaugeChart WithColorSet(ChartColorSet value) { + this.ColorSet = value; + return this; + } + + public GaugeChart WithMaxWidth(string value) { + this.MaxWidth = value; + return this; + } + + public GaugeChart WithShowLegend(bool value) { + this.ShowLegend = value; + return this; + } + + public GaugeChart WithMin(float value) { + this.Min = value; + return this; + } + + public GaugeChart WithMax(float value) { + this.Max = value; + return this; + } + + public GaugeChart WithSubLabel(string value) { + this.SubLabel = value; + return this; + } + + public GaugeChart WithShowMinMax(bool value) { + this.ShowMinMax = value; + return this; + } + + public GaugeChart WithShowNeedle(bool value) { + this.ShowNeedle = value; + return this; + } + + public GaugeChart WithShowOutlines(bool value) { + this.ShowOutlines = value; + return this; + } + + public GaugeChart WithSegments(params IList value) { + this.Segments = value; + return this; + } + + public GaugeChart WithValue(float value) { + this.Value = value; + return this; + } + + public GaugeChart WithValueFormat(GaugeChartValueFormat value) { + this.ValueFormat = value; + return this; + } + + public GaugeChart WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public GaugeChart WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// -/// An inline icon inside a RichTextBlock element. +/// The legend of the chart. /// -public class IconRun : CardElement +public class GaugeChartLegend : SerializableObject { - /// - /// Deserializes a JSON string into an object of type IconRun. - /// - public static IconRun? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **IconRun**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "IconRun"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The name of the inline icon to display. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// The size of the inline icon. - /// - [JsonPropertyName("size")] - public SizeEnum? Size { get; set; } - - /// - /// The style of the inline icon. - /// - [JsonPropertyName("style")] - public IconStyle? Style { get; set; } - - /// - /// The color of the inline icon. - /// - [JsonPropertyName("color")] - public TextColor? Color { get; set; } - - /// - /// An Action that will be invoked when the inline icon is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this IconRun into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public IconRun WithId(string value) - { - this.Id = value; - return this; - } - - public IconRun WithLang(string value) - { - this.Lang = value; - return this; - } - - public IconRun WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } - - public IconRun WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } - - public IconRun WithName(string value) - { - this.Name = value; - return this; - } - - public IconRun WithSize(SizeEnum value) - { - this.Size = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type GaugeChartLegend. + /// + public static GaugeChartLegend? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The size of the segment. + /// + [JsonPropertyName("size")] + public float? Size { get; set; } = 0; + + /// + /// The legend text associated with the segment. + /// + [JsonPropertyName("legend")] + public string? Legend { get; set; } + + /// + /// The color to use for the segment. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// Serializes this GaugeChartLegend into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public GaugeChartLegend WithKey(string value) { + this.Key = value; + return this; + } + + public GaugeChartLegend WithSize(float value) { + this.Size = value; + return this; + } + + public GaugeChartLegend WithLegend(string value) { + this.Legend = value; + return this; + } + + public GaugeChartLegend WithColor(ChartColor value) { + this.Color = value; + return this; + } +} - public IconRun WithStyle(IconStyle value) - { - this.Style = value; - return this; - } +/// +/// A formatted and syntax-colored code block. +/// +public class CodeBlock : CardElement +{ + /// + /// Deserializes a JSON string into an object of type CodeBlock. + /// + public static CodeBlock? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **CodeBlock**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "CodeBlock"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The code snippet to display. + /// + [JsonPropertyName("codeSnippet")] + public string? CodeSnippet { get; set; } + + /// + /// The language the code snippet is expressed in. + /// + [JsonPropertyName("language")] + public CodeLanguage? Language { get; set; } = CodeLanguage.PlainText; + + /// + /// A number that represents the line in the file from where the code snippet was extracted. + /// + [JsonPropertyName("startLineNumber")] + public float? StartLineNumber { get; set; } = 1; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this CodeBlock into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public CodeBlock WithKey(string value) { + this.Key = value; + return this; + } + + public CodeBlock WithId(string value) { + this.Id = value; + return this; + } + + public CodeBlock WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public CodeBlock WithLang(string value) { + this.Lang = value; + return this; + } + + public CodeBlock WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public CodeBlock WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public CodeBlock WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public CodeBlock WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public CodeBlock WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public CodeBlock WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public CodeBlock WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public CodeBlock WithCodeSnippet(string value) { + this.CodeSnippet = value; + return this; + } + + public CodeBlock WithLanguage(CodeLanguage value) { + this.Language = value; + return this; + } + + public CodeBlock WithStartLineNumber(float value) { + this.StartLineNumber = value; + return this; + } + + public CodeBlock WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public CodeBlock WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - public IconRun WithColor(TextColor value) - { - this.Color = value; - return this; - } +/// +/// Displays a user's information, including their profile picture. +/// +public class ComUserMicrosoftGraphComponent : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ComUserMicrosoftGraphComponent. + /// + public static ComUserMicrosoftGraphComponent? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Component**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Component"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// Must be **graph.microsoft.com/user**. + /// + [JsonPropertyName("name")] + public string Name { get; } = "graph.microsoft.com/user"; + + /// + /// The properties of the Persona component. + /// + [JsonPropertyName("properties")] + public PersonaProperties? Properties { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ComUserMicrosoftGraphComponent into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ComUserMicrosoftGraphComponent WithKey(string value) { + this.Key = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithId(string value) { + this.Id = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithLang(string value) { + this.Lang = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithProperties(PersonaProperties value) { + this.Properties = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - public IconRun WithSelectAction(Action value) - { - this.SelectAction = value; - return this; - } +/// +/// Represents the properties of a Persona component. +/// +public class PersonaProperties : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type PersonaProperties. + /// + public static PersonaProperties? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The Id of the persona. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// The UPN of the persona. + /// + [JsonPropertyName("userPrincipalName")] + public string? UserPrincipalName { get; set; } + + /// + /// The display name of the persona. + /// + [JsonPropertyName("displayName")] + public string? DisplayName { get; set; } + + /// + /// Defines the style of the icon for the persona. + /// + [JsonPropertyName("iconStyle")] + public PersonaIconStyle? IconStyle { get; set; } + + /// + /// Defines how the persona should be displayed. + /// + [JsonPropertyName("style")] + public PersonaDisplayStyle? Style { get; set; } + + /// + /// Serializes this PersonaProperties into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public PersonaProperties WithKey(string value) { + this.Key = value; + return this; + } + + public PersonaProperties WithId(string value) { + this.Id = value; + return this; + } + + public PersonaProperties WithUserPrincipalName(string value) { + this.UserPrincipalName = value; + return this; + } + + public PersonaProperties WithDisplayName(string value) { + this.DisplayName = value; + return this; + } + + public PersonaProperties WithIconStyle(PersonaIconStyle value) { + this.IconStyle = value; + return this; + } + + public PersonaProperties WithStyle(PersonaDisplayStyle value) { + this.Style = value; + return this; + } +} - public IconRun WithGridArea(string value) - { - this.GridArea = value; - return this; - } +/// +/// Displays multiple users' information, including their profile pictures. +/// +public class ComUsersMicrosoftGraphComponent : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ComUsersMicrosoftGraphComponent. + /// + public static ComUsersMicrosoftGraphComponent? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Component**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Component"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// Must be **graph.microsoft.com/users**. + /// + [JsonPropertyName("name")] + public string Name { get; } = "graph.microsoft.com/users"; + + /// + /// The properties of the PersonaSet component. + /// + [JsonPropertyName("properties")] + public PersonaSetProperties? Properties { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ComUsersMicrosoftGraphComponent into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ComUsersMicrosoftGraphComponent WithKey(string value) { + this.Key = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithId(string value) { + this.Id = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithLang(string value) { + this.Lang = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithProperties(PersonaSetProperties value) { + this.Properties = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - public IconRun WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } +/// +/// Represents the properties of a PersonaSet component. +/// +public class PersonaSetProperties : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type PersonaSetProperties. + /// + public static PersonaSetProperties? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The users a PersonaSet component should display. + /// + [JsonPropertyName("users")] + public IList? Users { get; set; } + + /// + /// Defines the style of the icon for the personas in the set. + /// + [JsonPropertyName("iconStyle")] + public PersonaIconStyle? IconStyle { get; set; } + + /// + /// Defines how each persona in the set should be displayed. + /// + [JsonPropertyName("style")] + public PersonaDisplayStyle? Style { get; set; } + + /// + /// Serializes this PersonaSetProperties into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public PersonaSetProperties WithKey(string value) { + this.Key = value; + return this; + } + + public PersonaSetProperties WithUsers(params IList value) { + this.Users = value; + return this; + } + + public PersonaSetProperties WithIconStyle(PersonaIconStyle value) { + this.IconStyle = value; + return this; + } + + public PersonaSetProperties WithStyle(PersonaDisplayStyle value) { + this.Style = value; + return this; + } } /// -/// An inline image inside a RichTextBlock element. +/// Displays information about a generic graph resource. /// -public class ImageRun : CardElement +public class ComResourceMicrosoftGraphComponent : CardElement { - /// - /// Deserializes a JSON string into an object of type ImageRun. - /// - public static ImageRun? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } + /// + /// Deserializes a JSON string into an object of type ComResourceMicrosoftGraphComponent. + /// + public static ComResourceMicrosoftGraphComponent? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Component**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Component"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// Must be **graph.microsoft.com/resource**. + /// + [JsonPropertyName("name")] + public string Name { get; } = "graph.microsoft.com/resource"; + + /// + /// The properties of the resource. + /// + [JsonPropertyName("properties")] + public ResourceProperties? Properties { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ComResourceMicrosoftGraphComponent into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ComResourceMicrosoftGraphComponent WithKey(string value) { + this.Key = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithId(string value) { + this.Id = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithLang(string value) { + this.Lang = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithProperties(ResourceProperties value) { + this.Properties = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - /// - /// Must be **ImageRun**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "ImageRun"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The size of the inline image. - /// - [JsonPropertyName("size")] - public SizeEnum? Size { get; set; } - - /// - /// The style of the inline image. - /// - [JsonPropertyName("style")] - public ImageStyle? Style { get; set; } - - /// - /// An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// A set of theme-specific image URLs. - /// - [JsonPropertyName("themedUrls")] - public IList? ThemedUrls { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ImageRun into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } +/// +/// Represents the properties of a resource component. +/// +public class ResourceProperties : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type ResourceProperties. + /// + public static ResourceProperties? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The Id of the resource. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// The reference to the resource. + /// + [JsonPropertyName("resourceReference")] + public IDictionary? ResourceReference { get; set; } + + /// + /// The visualization of the resource. + /// + [JsonPropertyName("resourceVisualization")] + public ResourceVisualization? ResourceVisualization { get; set; } + + /// + /// Serializes this ResourceProperties into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ResourceProperties WithKey(string value) { + this.Key = value; + return this; + } + + public ResourceProperties WithId(string value) { + this.Id = value; + return this; + } + + public ResourceProperties WithResourceReference(IDictionary value) { + this.ResourceReference = value; + return this; + } + + public ResourceProperties WithResourceVisualization(ResourceVisualization value) { + this.ResourceVisualization = value; + return this; + } +} - public ImageRun WithId(string value) - { - this.Id = value; - return this; - } +/// +/// Represents a visualization of a resource. +/// +public class ResourceVisualization : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type ResourceVisualization. + /// + public static ResourceVisualization? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The media associated with the resource. + /// + [JsonPropertyName("media")] + public string? Media { get; set; } + + /// + /// Serializes this ResourceVisualization into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ResourceVisualization WithKey(string value) { + this.Key = value; + return this; + } + + public ResourceVisualization WithMedia(string value) { + this.Media = value; + return this; + } +} - public ImageRun WithLang(string value) - { - this.Lang = value; - return this; - } +/// +/// Displays information about a file resource. +/// +public class ComFileMicrosoftGraphComponent : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ComFileMicrosoftGraphComponent. + /// + public static ComFileMicrosoftGraphComponent? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Component**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Component"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// Must be **graph.microsoft.com/file**. + /// + [JsonPropertyName("name")] + public string Name { get; } = "graph.microsoft.com/file"; + + /// + /// The properties of the file. + /// + [JsonPropertyName("properties")] + public FileProperties? Properties { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ComFileMicrosoftGraphComponent into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ComFileMicrosoftGraphComponent WithKey(string value) { + this.Key = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithId(string value) { + this.Id = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithLang(string value) { + this.Lang = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithProperties(FileProperties value) { + this.Properties = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - public ImageRun WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } +/// +/// Represents the properties of a file component. +/// +public class FileProperties : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type FileProperties. + /// + public static FileProperties? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The name of the file. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The file extension. + /// + [JsonPropertyName("extension")] + public string? Extension { get; set; } + + /// + /// The URL of the file. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// Serializes this FileProperties into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public FileProperties WithKey(string value) { + this.Key = value; + return this; + } + + public FileProperties WithName(string value) { + this.Name = value; + return this; + } + + public FileProperties WithExtension(string value) { + this.Extension = value; + return this; + } + + public FileProperties WithUrl(string value) { + this.Url = value; + return this; + } +} - public ImageRun WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } +/// +/// Displays information about a calendar event. +/// +public class ComEventMicrosoftGraphComponent : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ComEventMicrosoftGraphComponent. + /// + public static ComEventMicrosoftGraphComponent? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Component**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Component"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// Must be **graph.microsoft.com/event**. + /// + [JsonPropertyName("name")] + public string Name { get; } = "graph.microsoft.com/event"; + + /// + /// The properties of the event. + /// + [JsonPropertyName("properties")] + public CalendarEventProperties? Properties { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ComEventMicrosoftGraphComponent into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ComEventMicrosoftGraphComponent WithKey(string value) { + this.Key = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithId(string value) { + this.Id = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithLang(string value) { + this.Lang = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithProperties(CalendarEventProperties value) { + this.Properties = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - public ImageRun WithUrl(string value) - { - this.Url = value; - return this; - } +/// +/// The properties of a calendar event. +/// +public class CalendarEventProperties : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type CalendarEventProperties. + /// + public static CalendarEventProperties? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The ID of the event. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// The title of the event. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// The start date and time of the event. + /// + [JsonPropertyName("start")] + public string? Start { get; set; } + + /// + /// The end date and time of the event. + /// + [JsonPropertyName("end")] + public string? End { get; set; } + + /// + /// The status of the event. + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// The locations of the event. + /// + [JsonPropertyName("locations")] + public IList? Locations { get; set; } + + /// + /// The URL of the online meeting. + /// + [JsonPropertyName("onlineMeetingUrl")] + public string? OnlineMeetingUrl { get; set; } + + /// + /// Indicates if the event is all day. + /// + [JsonPropertyName("isAllDay")] + public bool? IsAllDay { get; set; } + + /// + /// The extension of the event. + /// + [JsonPropertyName("extension")] + public string? Extension { get; set; } + + /// + /// The URL of the event. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// The attendees of the event. + /// + [JsonPropertyName("attendees")] + public IList? Attendees { get; set; } + + /// + /// The organizer of the event. + /// + [JsonPropertyName("organizer")] + public CalendarEventAttendee? Organizer { get; set; } + + /// + /// Serializes this CalendarEventProperties into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public CalendarEventProperties WithKey(string value) { + this.Key = value; + return this; + } + + public CalendarEventProperties WithId(string value) { + this.Id = value; + return this; + } + + public CalendarEventProperties WithTitle(string value) { + this.Title = value; + return this; + } + + public CalendarEventProperties WithStart(string value) { + this.Start = value; + return this; + } + + public CalendarEventProperties WithEnd(string value) { + this.End = value; + return this; + } + + public CalendarEventProperties WithStatus(string value) { + this.Status = value; + return this; + } + + public CalendarEventProperties WithLocations(params IList value) { + this.Locations = value; + return this; + } + + public CalendarEventProperties WithOnlineMeetingUrl(string value) { + this.OnlineMeetingUrl = value; + return this; + } + + public CalendarEventProperties WithIsAllDay(bool value) { + this.IsAllDay = value; + return this; + } + + public CalendarEventProperties WithExtension(string value) { + this.Extension = value; + return this; + } + + public CalendarEventProperties WithUrl(string value) { + this.Url = value; + return this; + } + + public CalendarEventProperties WithAttendees(params IList value) { + this.Attendees = value; + return this; + } + + public CalendarEventProperties WithOrganizer(CalendarEventAttendee value) { + this.Organizer = value; + return this; + } +} - public ImageRun WithSize(SizeEnum value) - { - this.Size = value; - return this; - } +/// +/// Represents a calendar event attendee. +/// +public class CalendarEventAttendee : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type CalendarEventAttendee. + /// + public static CalendarEventAttendee? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The name of the attendee. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The email address of the attendee. + /// + [JsonPropertyName("email")] + public string? Email { get; set; } + + /// + /// The title of the attendee. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// The type of the attendee. + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// The status of the attendee. + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Serializes this CalendarEventAttendee into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public CalendarEventAttendee WithKey(string value) { + this.Key = value; + return this; + } + + public CalendarEventAttendee WithName(string value) { + this.Name = value; + return this; + } + + public CalendarEventAttendee WithEmail(string value) { + this.Email = value; + return this; + } + + public CalendarEventAttendee WithTitle(string value) { + this.Title = value; + return this; + } + + public CalendarEventAttendee WithType(string value) { + this.Type = value; + return this; + } + + public CalendarEventAttendee WithStatus(string value) { + this.Status = value; + return this; + } +} - public ImageRun WithStyle(ImageStyle value) - { - this.Style = value; - return this; - } +/// +/// A page inside a Carousel element. +/// +public class CarouselPage : CardElement +{ + /// + /// Deserializes a JSON string into an object of type CarouselPage. + /// + public static CarouselPage? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **CarouselPage**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "CarouselPage"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + /// + [JsonPropertyName("style")] + public ContainerStyle? Style { get; set; } + + /// + /// Controls if a border should be displayed around the container. + /// + [JsonPropertyName("showBorder")] + public bool? ShowBorder { get; set; } = false; + + /// + /// Controls if the container should have rounded corners. + /// + [JsonPropertyName("roundedCorners")] + public bool? RoundedCorners { get; set; } = false; + + /// + /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. + /// + [JsonPropertyName("layouts")] + public IList? Layouts { get; set; } + + /// + /// The minimum height, in pixels, of the container, in the `px` format. + /// + [JsonPropertyName("minHeight")] + public string? MinHeight { get; set; } + + /// + /// Defines the container's background image. + /// + [JsonPropertyName("backgroundImage")] + public IUnion? BackgroundImage { get; set; } + + /// + /// Controls how the container's content should be vertically aligned. + /// + [JsonPropertyName("verticalContentAlignment")] + public VerticalAlignment? VerticalContentAlignment { get; set; } + + /// + /// Controls if the content of the card is to be rendered left-to-right or right-to-left. + /// + [JsonPropertyName("rtl")] + public bool? Rtl { get; set; } + + /// + /// The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. + /// + [JsonPropertyName("maxHeight")] + public string? MaxHeight { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The elements in the page. + /// + [JsonPropertyName("items")] + public IList? Items { get; set; } + + public CarouselPage(params IList items) + { + this.Items = items; + } - public ImageRun WithSelectAction(Action value) - { - this.SelectAction = value; - return this; - } + /// + /// Serializes this CarouselPage into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public CarouselPage WithKey(string value) { + this.Key = value; + return this; + } + + public CarouselPage WithId(string value) { + this.Id = value; + return this; + } + + public CarouselPage WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public CarouselPage WithLang(string value) { + this.Lang = value; + return this; + } + + public CarouselPage WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public CarouselPage WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public CarouselPage WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public CarouselPage WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public CarouselPage WithSelectAction(Action value) { + this.SelectAction = value; + return this; + } + + public CarouselPage WithStyle(ContainerStyle value) { + this.Style = value; + return this; + } + + public CarouselPage WithShowBorder(bool value) { + this.ShowBorder = value; + return this; + } + + public CarouselPage WithRoundedCorners(bool value) { + this.RoundedCorners = value; + return this; + } + + public CarouselPage WithLayouts(params IList value) { + this.Layouts = value; + return this; + } + + public CarouselPage WithMinHeight(string value) { + this.MinHeight = value; + return this; + } + + public CarouselPage WithBackgroundImage(IUnion value) { + this.BackgroundImage = value; + return this; + } + + public CarouselPage WithVerticalContentAlignment(VerticalAlignment value) { + this.VerticalContentAlignment = value; + return this; + } + + public CarouselPage WithRtl(bool value) { + this.Rtl = value; + return this; + } + + public CarouselPage WithMaxHeight(string value) { + this.MaxHeight = value; + return this; + } + + public CarouselPage WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public CarouselPage WithFallback(IUnion value) { + this.Fallback = value; + return this; + } + + public CarouselPage WithItems(params IList value) { + this.Items = value; + return this; + } +} - public ImageRun WithThemedUrls(params IList value) - { - this.ThemedUrls = value; - return this; - } +/// +/// Represents a row of cells in a table. +/// +public class TableRow : CardElement +{ + /// + /// Deserializes a JSON string into an object of type TableRow. + /// + public static TableRow? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **TableRow**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "TableRow"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// Controls if a border should be displayed around the container. + /// + [JsonPropertyName("showBorder")] + public bool? ShowBorder { get; set; } = false; + + /// + /// Controls if the container should have rounded corners. + /// + [JsonPropertyName("roundedCorners")] + public bool? RoundedCorners { get; set; } = false; + + /// + /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + /// + [JsonPropertyName("style")] + public ContainerStyle? Style { get; set; } + + /// + /// Controls how the content of every cell in the row should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table and columns. + /// + [JsonPropertyName("horizontalCellContentAlignment")] + public HorizontalAlignment? HorizontalCellContentAlignment { get; set; } + + /// + /// Controls how the content of every cell in the row should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table and columns. + /// + [JsonPropertyName("verticalCellContentAlignment")] + public VerticalAlignment? VerticalCellContentAlignment { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The cells in the row. + /// + [JsonPropertyName("cells")] + public IList? Cells { get; set; } + + /// + /// Serializes this TableRow into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TableRow WithKey(string value) { + this.Key = value; + return this; + } + + public TableRow WithId(string value) { + this.Id = value; + return this; + } + + public TableRow WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public TableRow WithLang(string value) { + this.Lang = value; + return this; + } + + public TableRow WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public TableRow WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public TableRow WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public TableRow WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public TableRow WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public TableRow WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public TableRow WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public TableRow WithShowBorder(bool value) { + this.ShowBorder = value; + return this; + } + + public TableRow WithRoundedCorners(bool value) { + this.RoundedCorners = value; + return this; + } + + public TableRow WithStyle(ContainerStyle value) { + this.Style = value; + return this; + } + + public TableRow WithHorizontalCellContentAlignment(HorizontalAlignment value) { + this.HorizontalCellContentAlignment = value; + return this; + } + + public TableRow WithVerticalCellContentAlignment(VerticalAlignment value) { + this.VerticalCellContentAlignment = value; + return this; + } + + public TableRow WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public TableRow WithFallback(IUnion value) { + this.Fallback = value; + return this; + } + + public TableRow WithCells(params IList value) { + this.Cells = value; + return this; + } +} - public ImageRun WithGridArea(string value) - { - this.GridArea = value; - return this; - } +/// +/// Represents a cell in a table row. +/// +public class TableCell : CardElement +{ + /// + /// Deserializes a JSON string into an object of type TableCell. + /// + public static TableCell? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **TableCell**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "TableCell"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + /// + [JsonPropertyName("style")] + public ContainerStyle? Style { get; set; } + + /// + /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. + /// + [JsonPropertyName("layouts")] + public IList? Layouts { get; set; } + + /// + /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + /// + [JsonPropertyName("bleed")] + public bool? Bleed { get; set; } = false; + + /// + /// The minimum height, in pixels, of the container, in the `px` format. + /// + [JsonPropertyName("minHeight")] + public string? MinHeight { get; set; } + + /// + /// Defines the container's background image. + /// + [JsonPropertyName("backgroundImage")] + public IUnion? BackgroundImage { get; set; } + + /// + /// Controls how the container's content should be vertically aligned. + /// + [JsonPropertyName("verticalContentAlignment")] + public VerticalAlignment? VerticalContentAlignment { get; set; } + + /// + /// Controls if the content of the card is to be rendered left-to-right or right-to-left. + /// + [JsonPropertyName("rtl")] + public bool? Rtl { get; set; } + + /// + /// The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. + /// + [JsonPropertyName("maxHeight")] + public string? MaxHeight { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The items (elements) in the cell. + /// + [JsonPropertyName("items")] + public IList? Items { get; set; } + + public TableCell(params IList items) + { + this.Items = items; + } - public ImageRun WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } + /// + /// Serializes this TableCell into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TableCell WithKey(string value) { + this.Key = value; + return this; + } + + public TableCell WithId(string value) { + this.Id = value; + return this; + } + + public TableCell WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public TableCell WithLang(string value) { + this.Lang = value; + return this; + } + + public TableCell WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public TableCell WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public TableCell WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public TableCell WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public TableCell WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public TableCell WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public TableCell WithSelectAction(Action value) { + this.SelectAction = value; + return this; + } + + public TableCell WithStyle(ContainerStyle value) { + this.Style = value; + return this; + } + + public TableCell WithLayouts(params IList value) { + this.Layouts = value; + return this; + } + + public TableCell WithBleed(bool value) { + this.Bleed = value; + return this; + } + + public TableCell WithMinHeight(string value) { + this.MinHeight = value; + return this; + } + + public TableCell WithBackgroundImage(IUnion value) { + this.BackgroundImage = value; + return this; + } + + public TableCell WithVerticalContentAlignment(VerticalAlignment value) { + this.VerticalContentAlignment = value; + return this; + } + + public TableCell WithRtl(bool value) { + this.Rtl = value; + return this; + } + + public TableCell WithMaxHeight(string value) { + this.MaxHeight = value; + return this; + } + + public TableCell WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public TableCell WithFallback(IUnion value) { + this.Fallback = value; + return this; + } + + public TableCell WithItems(params IList value) { + this.Items = value; + return this; + } } /// -/// Defines a theme-specific URL. +/// A block of text inside a RichTextBlock element. /// -public class ThemedUrl : SerializableObject +public class TextRun : CardElement { - /// - /// Deserializes a JSON string into an object of type ThemedUrl. - /// - public static ThemedUrl? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } + /// + /// Deserializes a JSON string into an object of type TextRun. + /// + public static TextRun? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **TextRun**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "TextRun"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The text to display. A subset of markdown is supported. + /// + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// + /// The size of the text. + /// + [JsonPropertyName("size")] + public TextSize? Size { get; set; } + + /// + /// The weight of the text. + /// + [JsonPropertyName("weight")] + public TextWeight? Weight { get; set; } + + /// + /// The color of the text. + /// + [JsonPropertyName("color")] + public TextColor? Color { get; set; } + + /// + /// Controls whether the text should be renderer using a subtler variant of the select color. + /// + [JsonPropertyName("isSubtle")] + public bool? IsSubtle { get; set; } + + /// + /// The type of font to use for rendering. + /// + [JsonPropertyName("fontType")] + public FontType? FontType { get; set; } + + /// + /// Controls if the text should be italicized. + /// + [JsonPropertyName("italic")] + public bool? Italic { get; set; } = false; + + /// + /// Controls if the text should be struck through. + /// + [JsonPropertyName("strikethrough")] + public bool? Strikethrough { get; set; } = false; + + /// + /// Controls if the text should be highlighted. + /// + [JsonPropertyName("highlight")] + public bool? Highlight { get; set; } = false; + + /// + /// Controls if the text should be underlined. + /// + [JsonPropertyName("underline")] + public bool? Underline { get; set; } = false; + + /// + /// An Action that will be invoked when the text is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + public TextRun(string text) + { + this.Text = text; + } - /// - /// The theme this URL applies to. - /// - [JsonPropertyName("theme")] - public ThemeName? Theme { get; set; } - - /// - /// The URL to use for the associated theme. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// Serializes this ThemedUrl into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } + /// + /// Serializes this TextRun into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TextRun WithKey(string value) { + this.Key = value; + return this; + } + + public TextRun WithId(string value) { + this.Id = value; + return this; + } + + public TextRun WithLang(string value) { + this.Lang = value; + return this; + } + + public TextRun WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public TextRun WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public TextRun WithText(string value) { + this.Text = value; + return this; + } + + public TextRun WithSize(TextSize value) { + this.Size = value; + return this; + } + + public TextRun WithWeight(TextWeight value) { + this.Weight = value; + return this; + } + + public TextRun WithColor(TextColor value) { + this.Color = value; + return this; + } + + public TextRun WithIsSubtle(bool value) { + this.IsSubtle = value; + return this; + } + + public TextRun WithFontType(FontType value) { + this.FontType = value; + return this; + } + + public TextRun WithItalic(bool value) { + this.Italic = value; + return this; + } + + public TextRun WithStrikethrough(bool value) { + this.Strikethrough = value; + return this; + } + + public TextRun WithHighlight(bool value) { + this.Highlight = value; + return this; + } + + public TextRun WithUnderline(bool value) { + this.Underline = value; + return this; + } + + public TextRun WithSelectAction(Action value) { + this.SelectAction = value; + return this; + } + + public TextRun WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public TextRun WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - public ThemedUrl WithTheme(ThemeName value) - { - this.Theme = value; - return this; - } +/// +/// An inline icon inside a RichTextBlock element. +/// +public class IconRun : CardElement +{ + /// + /// Deserializes a JSON string into an object of type IconRun. + /// + public static IconRun? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **IconRun**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "IconRun"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The name of the inline icon to display. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The size of the inline icon. + /// + [JsonPropertyName("size")] + public SizeEnum? Size { get; set; } = SizeEnum.Default; + + /// + /// The style of the inline icon. + /// + [JsonPropertyName("style")] + public IconStyle? Style { get; set; } = IconStyle.Regular; + + /// + /// The color of the inline icon. + /// + [JsonPropertyName("color")] + public TextColor? Color { get; set; } = TextColor.Default; + + /// + /// An Action that will be invoked when the inline icon is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this IconRun into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public IconRun WithKey(string value) { + this.Key = value; + return this; + } + + public IconRun WithId(string value) { + this.Id = value; + return this; + } + + public IconRun WithLang(string value) { + this.Lang = value; + return this; + } + + public IconRun WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public IconRun WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public IconRun WithName(string value) { + this.Name = value; + return this; + } + + public IconRun WithSize(SizeEnum value) { + this.Size = value; + return this; + } + + public IconRun WithStyle(IconStyle value) { + this.Style = value; + return this; + } + + public IconRun WithColor(TextColor value) { + this.Color = value; + return this; + } + + public IconRun WithSelectAction(Action value) { + this.SelectAction = value; + return this; + } + + public IconRun WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public IconRun WithFallback(IUnion value) { + this.Fallback = value; + return this; + } +} - public ThemedUrl WithUrl(string value) - { - this.Url = value; - return this; - } +/// +/// An inline image inside a RichTextBlock element. +/// +public class ImageRun : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ImageRun. + /// + public static ImageRun? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **ImageRun**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "ImageRun"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// The size of the inline image. + /// + [JsonPropertyName("size")] + public SizeEnum? Size { get; set; } = SizeEnum.Default; + + /// + /// The style of the inline image. + /// + [JsonPropertyName("style")] + public ImageStyle? Style { get; set; } = ImageStyle.Default; + + /// + /// An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// A set of theme-specific image URLs. + /// + [JsonPropertyName("themedUrls")] + public IList? ThemedUrls { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ImageRun into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ImageRun WithKey(string value) { + this.Key = value; + return this; + } + + public ImageRun WithId(string value) { + this.Id = value; + return this; + } + + public ImageRun WithLang(string value) { + this.Lang = value; + return this; + } + + public ImageRun WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public ImageRun WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public ImageRun WithUrl(string value) { + this.Url = value; + return this; + } + + public ImageRun WithSize(SizeEnum value) { + this.Size = value; + return this; + } + + public ImageRun WithStyle(ImageStyle value) { + this.Style = value; + return this; + } + + public ImageRun WithSelectAction(Action value) { + this.SelectAction = value; + return this; + } + + public ImageRun WithThemedUrls(params IList value) { + this.ThemedUrls = value; + return this; + } + + public ImageRun WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public ImageRun WithFallback(IUnion value) { + this.Fallback = value; + return this; + } } /// @@ -15967,337 +16850,1591 @@ public ThemedUrl WithUrl(string value) /// public class Column : CardElement { - /// - /// Deserializes a JSON string into an object of type Column. - /// - public static Column? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Optional. If specified, must be **Column**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Column"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } - - /// - /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - /// - [JsonPropertyName("style")] - public ContainerStyle? Style { get; set; } - - /// - /// Controls if a border should be displayed around the container. - /// - [JsonPropertyName("showBorder")] - public bool? ShowBorder { get; set; } - - /// - /// Controls if the container should have rounded corners. - /// - [JsonPropertyName("roundedCorners")] - public bool? RoundedCorners { get; set; } - - /// - /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. - /// - [JsonPropertyName("layouts")] - public IList? Layouts { get; set; } - - /// - /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. - /// - [JsonPropertyName("bleed")] - public bool? Bleed { get; set; } - - /// - /// The minimum height, in pixels, of the container, in the `px` format. - /// - [JsonPropertyName("minHeight")] - public string? MinHeight { get; set; } - - /// - /// Defines the container's background image. - /// - [JsonPropertyName("backgroundImage")] - public IUnion? BackgroundImage { get; set; } - - /// - /// Controls how the container's content should be vertically aligned. - /// - [JsonPropertyName("verticalContentAlignment")] - public VerticalAlignment? VerticalContentAlignment { get; set; } - - /// - /// Controls if the content of the card is to be rendered left-to-right or right-to-left. - /// - [JsonPropertyName("rtl")] - public bool? Rtl { get; set; } - - /// - /// The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. - /// - [JsonPropertyName("maxHeight")] - public string? MaxHeight { get; set; } - - /// - /// The width of the column. If expressed as a number, represents the relative weight of the column in the set. If expressed as a string, `auto` will automatically adjust the column's width according to its content, `stretch` will make the column use the remaining horizontal space (shared with other columns with width set to `stretch`) and using the `px` format will give the column an explicit width in pixels. - /// - [JsonPropertyName("width")] - public IUnion? Width { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The elements in the column. - /// - [JsonPropertyName("items")] - public IList? Items { get; set; } - - public Column(params IList items) - { - this.Items = items; - } - - /// - /// Serializes this Column into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Column WithId(string value) - { - this.Id = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type Column. + /// + public static Column? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Optional. If specified, must be **Column**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Column"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + /// + [JsonPropertyName("style")] + public ContainerStyle? Style { get; set; } + + /// + /// Controls if a border should be displayed around the container. + /// + [JsonPropertyName("showBorder")] + public bool? ShowBorder { get; set; } = false; + + /// + /// Controls if the container should have rounded corners. + /// + [JsonPropertyName("roundedCorners")] + public bool? RoundedCorners { get; set; } = false; + + /// + /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. + /// + [JsonPropertyName("layouts")] + public IList? Layouts { get; set; } + + /// + /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + /// + [JsonPropertyName("bleed")] + public bool? Bleed { get; set; } = false; + + /// + /// The minimum height, in pixels, of the container, in the `px` format. + /// + [JsonPropertyName("minHeight")] + public string? MinHeight { get; set; } + + /// + /// Defines the container's background image. + /// + [JsonPropertyName("backgroundImage")] + public IUnion? BackgroundImage { get; set; } + + /// + /// Controls how the container's content should be vertically aligned. + /// + [JsonPropertyName("verticalContentAlignment")] + public VerticalAlignment? VerticalContentAlignment { get; set; } + + /// + /// Controls if the content of the card is to be rendered left-to-right or right-to-left. + /// + [JsonPropertyName("rtl")] + public bool? Rtl { get; set; } + + /// + /// The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. + /// + [JsonPropertyName("maxHeight")] + public string? MaxHeight { get; set; } + + /// + /// The width of the column. If expressed as a number, represents the relative weight of the column in the set. If expressed as a string, `auto` will automatically adjust the column's width according to its content, `stretch` will make the column use the remaining horizontal space (shared with other columns with width set to `stretch`) and using the `px` format will give the column an explicit width in pixels. + /// + [JsonPropertyName("width")] + public IUnion? Width { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The elements in the column. + /// + [JsonPropertyName("items")] + public IList? Items { get; set; } + + public Column(params IList items) + { + this.Items = items; + } - public Column WithRequires(HostCapabilities value) - { - this.Requires = value; - return this; - } + /// + /// Serializes this Column into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Column WithKey(string value) { + this.Key = value; + return this; + } + + public Column WithId(string value) { + this.Id = value; + return this; + } + + public Column WithRequires(HostCapabilities value) { + this.Requires = value; + return this; + } + + public Column WithLang(string value) { + this.Lang = value; + return this; + } + + public Column WithIsVisible(bool value) { + this.IsVisible = value; + return this; + } + + public Column WithSeparator(bool value) { + this.Separator = value; + return this; + } + + public Column WithHeight(ElementHeight value) { + this.Height = value; + return this; + } + + public Column WithHorizontalAlignment(HorizontalAlignment value) { + this.HorizontalAlignment = value; + return this; + } + + public Column WithSpacing(Spacing value) { + this.Spacing = value; + return this; + } + + public Column WithTargetWidth(TargetWidth value) { + this.TargetWidth = value; + return this; + } + + public Column WithIsSortKey(bool value) { + this.IsSortKey = value; + return this; + } + + public Column WithSelectAction(Action value) { + this.SelectAction = value; + return this; + } + + public Column WithStyle(ContainerStyle value) { + this.Style = value; + return this; + } + + public Column WithShowBorder(bool value) { + this.ShowBorder = value; + return this; + } + + public Column WithRoundedCorners(bool value) { + this.RoundedCorners = value; + return this; + } + + public Column WithLayouts(params IList value) { + this.Layouts = value; + return this; + } + + public Column WithBleed(bool value) { + this.Bleed = value; + return this; + } + + public Column WithMinHeight(string value) { + this.MinHeight = value; + return this; + } + + public Column WithBackgroundImage(IUnion value) { + this.BackgroundImage = value; + return this; + } + + public Column WithVerticalContentAlignment(VerticalAlignment value) { + this.VerticalContentAlignment = value; + return this; + } + + public Column WithRtl(bool value) { + this.Rtl = value; + return this; + } + + public Column WithMaxHeight(string value) { + this.MaxHeight = value; + return this; + } + + public Column WithWidth(IUnion value) { + this.Width = value; + return this; + } + + public Column WithGridArea(string value) { + this.GridArea = value; + return this; + } + + public Column WithFallback(IUnion value) { + this.Fallback = value; + return this; + } + + public Column WithItems(params IList value) { + this.Items = value; + return this; + } +} - public Column WithLang(string value) - { - this.Lang = value; - return this; - } +/// +/// Represents the data of an Action.Submit. +/// +public class SubmitActionData : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type SubmitActionData. + /// + public static SubmitActionData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Defines the optional Teams-specific portion of the action's data. + /// + [JsonPropertyName("msteams")] + public object? Msteams { get; set; } + + /// + /// Defines the optional Teams-specific portion of the action's data. Equivalent to `msteams`. + /// + [JsonPropertyName("msTeams")] + public object? MsTeams { get; set; } + + /// + /// Serializes this SubmitActionData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public SubmitActionData WithKey(string value) { + this.Key = value; + return this; + } + + public SubmitActionData WithMsteams(object value) { + this.Msteams = value; + return this; + } + + public SubmitActionData WithMsTeams(object value) { + this.MsTeams = value; + return this; + } + [JsonExtensionData] + public IDictionary NonSchemaProperties { get; set; } = new Dictionary(); +} - public Column WithIsVisible(bool value) - { - this.IsVisible = value; - return this; - } +/// +/// Represents Teams-specific data in an Action.Submit to send an Instant Message back to the Bot. +/// +public class ImBackSubmitActionData : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type ImBackSubmitActionData. + /// + public static ImBackSubmitActionData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **imBack**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "imBack"; + + /// + /// The value that will be sent to the Bot. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + public ImBackSubmitActionData(string value) + { + this.Value = value; + } - public Column WithSeparator(bool value) - { - this.Separator = value; - return this; - } + /// + /// Serializes this ImBackSubmitActionData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ImBackSubmitActionData WithKey(string value) { + this.Key = value; + return this; + } + + public ImBackSubmitActionData WithValue(string value) { + this.Value = value; + return this; + } +} - public Column WithHeight(ElementHeight value) - { - this.Height = value; - return this; - } +/// +/// Represents Teams-specific data in an Action.Submit to make an Invoke request to the Bot. +/// +public class InvokeSubmitActionData : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type InvokeSubmitActionData. + /// + public static InvokeSubmitActionData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **invoke**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "invoke"; + + /// + /// The object to send to the Bot with the Invoke request. Can be strongly typed as one of the below values to trigger a specific action in Teams. + /// + [JsonPropertyName("value")] + public IUnion? Value { get; set; } + + public InvokeSubmitActionData(IUnion value) + { + this.Value = value; + } - public Column WithHorizontalAlignment(HorizontalAlignment value) - { - this.HorizontalAlignment = value; - return this; - } + /// + /// Serializes this InvokeSubmitActionData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public InvokeSubmitActionData WithKey(string value) { + this.Key = value; + return this; + } + + public InvokeSubmitActionData WithValue(IUnion value) { + this.Value = value; + return this; + } +} - public Column WithSpacing(Spacing value) - { - this.Spacing = value; - return this; - } +/// +/// Data for invoking a collaboration stage action. +/// +public class CollabStageInvokeDataValue : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type CollabStageInvokeDataValue. + /// + public static CollabStageInvokeDataValue? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Must be **tab/tabInfoAction**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "tab/tabInfoAction"; + + /// + /// Provides information about the iFrame content, rendered in the collab stage popout window. + /// + [JsonPropertyName("tabInfo")] + public TabInfo? TabInfo { get; set; } + + /// + /// Serializes this CollabStageInvokeDataValue into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public CollabStageInvokeDataValue WithTabInfo(TabInfo value) { + this.TabInfo = value; + return this; + } +} - public Column WithTargetWidth(TargetWidth value) - { - this.TargetWidth = value; - return this; - } +/// +/// Represents information about the iFrame content, rendered in the collab stage popout window. +/// +public class TabInfo : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type TabInfo. + /// + public static TabInfo? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// The name for the content. This will be displayed as the title of the window hosting the iFrame. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The URL to open in an iFrame. + /// + [JsonPropertyName("contentUrl")] + public string? ContentUrl { get; set; } + + /// + /// The unique entity id for this content (e.g., random UUID). + /// + [JsonPropertyName("entityId")] + public string? EntityId { get; set; } + + /// + /// An optional website URL to the content, allowing users to open this content in the browser (if they prefer). + /// + [JsonPropertyName("websiteUrl")] + public string? WebsiteUrl { get; set; } + + /// + /// Serializes this TabInfo into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TabInfo WithName(string value) { + this.Name = value; + return this; + } + + public TabInfo WithContentUrl(string value) { + this.ContentUrl = value; + return this; + } + + public TabInfo WithEntityId(string value) { + this.EntityId = value; + return this; + } + + public TabInfo WithWebsiteUrl(string value) { + this.WebsiteUrl = value; + return this; + } +} - public Column WithIsSortKey(bool value) - { - this.IsSortKey = value; - return this; - } +/// +/// Represents Teams-specific data in an Action.Submit to send a message back to the Bot. +/// +public class MessageBackSubmitActionData : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type MessageBackSubmitActionData. + /// + public static MessageBackSubmitActionData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **messageBack**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "messageBack"; + + /// + /// The text that will be sent to the Bot. + /// + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// + /// The optional text that will be displayed as a new message in the conversation, as if the end-user sent it. `displayText` is not sent to the Bot. + /// + [JsonPropertyName("displayText")] + public string? DisplayText { get; set; } + + /// + /// Optional additional value that will be sent to the Bot. For instance, `value` can encode specific context for the action, such as unique identifiers or a JSON object. + /// + [JsonPropertyName("value")] + public object? Value { get; set; } + + /// + /// Serializes this MessageBackSubmitActionData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public MessageBackSubmitActionData WithKey(string value) { + this.Key = value; + return this; + } + + public MessageBackSubmitActionData WithText(string value) { + this.Text = value; + return this; + } + + public MessageBackSubmitActionData WithDisplayText(string value) { + this.DisplayText = value; + return this; + } + + public MessageBackSubmitActionData WithValue(object value) { + this.Value = value; + return this; + } +} - public Column WithSelectAction(Action value) - { - this.SelectAction = value; - return this; - } +/// +/// Represents Teams-specific data in an Action.Submit to sign in a user. +/// +public class SigninSubmitActionData : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type SigninSubmitActionData. + /// + public static SigninSubmitActionData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **signin**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "signin"; + + /// + /// The URL to redirect the end-user for signing in. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + public SigninSubmitActionData(string value) + { + this.Value = value; + } - public Column WithStyle(ContainerStyle value) - { - this.Style = value; - return this; - } + /// + /// Serializes this SigninSubmitActionData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public SigninSubmitActionData WithKey(string value) { + this.Key = value; + return this; + } + + public SigninSubmitActionData WithValue(string value) { + this.Value = value; + return this; + } +} - public Column WithShowBorder(bool value) - { - this.ShowBorder = value; - return this; - } +/// +/// Represents Teams-specific data in an Action.Submit to open a task module. +/// +public class TaskFetchSubmitActionData : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type TaskFetchSubmitActionData. + /// + public static TaskFetchSubmitActionData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **task/fetch**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "task/fetch"; + + /// + /// Serializes this TaskFetchSubmitActionData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TaskFetchSubmitActionData WithKey(string value) { + this.Key = value; + return this; + } +} - public Column WithRoundedCorners(bool value) - { - this.RoundedCorners = value; - return this; - } +/// +/// Teams-specific properties associated with the action. +/// +public class TeamsSubmitActionProperties : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type TeamsSubmitActionProperties. + /// + public static TeamsSubmitActionProperties? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Defines how feedback is provided to the end-user when the action is executed. + /// + [JsonPropertyName("feedback")] + public TeamsSubmitActionFeedback? Feedback { get; set; } + + /// + /// Serializes this TeamsSubmitActionProperties into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TeamsSubmitActionProperties WithKey(string value) { + this.Key = value; + return this; + } + + public TeamsSubmitActionProperties WithFeedback(TeamsSubmitActionFeedback value) { + this.Feedback = value; + return this; + } +} - public Column WithLayouts(params IList value) - { - this.Layouts = value; - return this; - } +/// +/// Represents feedback options for an [Action.Submit](https://adaptivecards.microsoft.com/?topic=Action.Submit). +/// +public class TeamsSubmitActionFeedback : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type TeamsSubmitActionFeedback. + /// + public static TeamsSubmitActionFeedback? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Defines if a feedback message should be displayed after the action is executed. + /// + [JsonPropertyName("hide")] + public bool? Hide { get; set; } + + /// + /// Serializes this TeamsSubmitActionFeedback into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TeamsSubmitActionFeedback WithKey(string value) { + this.Key = value; + return this; + } + + public TeamsSubmitActionFeedback WithHide(bool value) { + this.Hide = value; + return this; + } +} - public Column WithBleed(bool value) - { - this.Bleed = value; - return this; - } +/// +/// Defines how a card can be refreshed by making a request to the target Bot. +/// +public class RefreshDefinition : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type RefreshDefinition. + /// + public static RefreshDefinition? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The Action.Execute action to invoke to refresh the card. + /// + [JsonPropertyName("action")] + public ExecuteAction? Action { get; set; } + + /// + /// The list of user Ids for which the card will be automatically refreshed. In Teams, in chats or channels with more than 60 users, the card will automatically refresh only for users specified in the userIds list. Other users will have to manually click on a "refresh" button. In contexts with fewer than 60 users, the card will automatically refresh for all users. + /// + [JsonPropertyName("userIds")] + public IList? UserIds { get; set; } + + /// + /// Serializes this RefreshDefinition into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public RefreshDefinition WithKey(string value) { + this.Key = value; + return this; + } + + public RefreshDefinition WithAction(ExecuteAction value) { + this.Action = value; + return this; + } + + public RefreshDefinition WithUserIds(params IList value) { + this.UserIds = value; + return this; + } +} - public Column WithMinHeight(string value) - { - this.MinHeight = value; - return this; - } +/// +/// Defines authentication information associated with a card. For more information, refer to the [Bot Framework OAuthCard type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.oauthcard) +/// +public class Authentication : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type Authentication. + /// + public static Authentication? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The text that can be displayed to the end user when prompting them to authenticate. + /// + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// + /// The identifier for registered OAuth connection setting information. + /// + [JsonPropertyName("connectionName")] + public string? ConnectionName { get; set; } + + /// + /// The buttons that should be displayed to the user when prompting for authentication. The array MUST contain one button of type “signin”. Other button types are not currently supported. + /// + [JsonPropertyName("buttons")] + public IList? Buttons { get; set; } + + /// + /// Provides information required to enable on-behalf-of single sign-on user authentication. + /// + [JsonPropertyName("tokenExchangeResource")] + public TokenExchangeResource? TokenExchangeResource { get; set; } + + /// + /// Serializes this Authentication into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Authentication WithKey(string value) { + this.Key = value; + return this; + } + + public Authentication WithText(string value) { + this.Text = value; + return this; + } + + public Authentication WithConnectionName(string value) { + this.ConnectionName = value; + return this; + } + + public Authentication WithButtons(params IList value) { + this.Buttons = value; + return this; + } + + public Authentication WithTokenExchangeResource(TokenExchangeResource value) { + this.TokenExchangeResource = value; + return this; + } +} - public Column WithBackgroundImage(IUnion value) - { - this.BackgroundImage = value; - return this; - } +/// +/// Defines a button as displayed when prompting a user to authenticate. For more information, refer to the [Bot Framework CardAction type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.cardaction). +/// +public class AuthCardButton : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type AuthCardButton. + /// + public static AuthCardButton? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **signin**. + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// The caption of the button. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL to an image to display alongside the button’s caption. + /// + [JsonPropertyName("image")] + public string? Image { get; set; } + + /// + /// The value associated with the button. The meaning of value depends on the button’s type. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + /// + /// Serializes this AuthCardButton into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public AuthCardButton WithKey(string value) { + this.Key = value; + return this; + } + + public AuthCardButton WithType(string value) { + this.Type = value; + return this; + } + + public AuthCardButton WithTitle(string value) { + this.Title = value; + return this; + } + + public AuthCardButton WithImage(string value) { + this.Image = value; + return this; + } + + public AuthCardButton WithValue(string value) { + this.Value = value; + return this; + } +} - public Column WithVerticalContentAlignment(VerticalAlignment value) - { - this.VerticalContentAlignment = value; - return this; - } +/// +/// Defines information required to enable on-behalf-of single sign-on user authentication. For more information, refer to the [Bot Framework TokenExchangeResource type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.tokenexchangeresource) +/// +public class TokenExchangeResource : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type TokenExchangeResource. + /// + public static TokenExchangeResource? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The unique identified of this token exchange instance. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// An application ID or resource identifier with which to exchange a token on behalf of. This property is identity provider- and application-specific. + /// + [JsonPropertyName("uri")] + public string? Uri { get; set; } + + /// + /// An identifier for the identity provider with which to attempt a token exchange. + /// + [JsonPropertyName("providerId")] + public string? ProviderId { get; set; } + + /// + /// Serializes this TokenExchangeResource into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TokenExchangeResource WithKey(string value) { + this.Key = value; + return this; + } + + public TokenExchangeResource WithId(string value) { + this.Id = value; + return this; + } + + public TokenExchangeResource WithUri(string value) { + this.Uri = value; + return this; + } + + public TokenExchangeResource WithProviderId(string value) { + this.ProviderId = value; + return this; + } +} - public Column WithRtl(bool value) - { - this.Rtl = value; - return this; - } +/// +/// Represents a set of Teams-specific properties on a card. +/// +public class TeamsCardProperties : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type TeamsCardProperties. + /// + public static TeamsCardProperties? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Controls the width of the card in a Teams chat. + /// + /// Note that setting `width` to "full" will not actually stretch the card to the "full width" of the chat pane. It will only make the card wider than when the `width` property isn't set. + /// + [JsonPropertyName("width")] + public TeamsCardWidth? Width { get; set; } + + /// + /// The Teams-specific entities associated with the card. + /// + [JsonPropertyName("entities")] + public IList? Entities { get; set; } + + /// + /// Serializes this TeamsCardProperties into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TeamsCardProperties WithKey(string value) { + this.Key = value; + return this; + } + + public TeamsCardProperties WithWidth(TeamsCardWidth value) { + this.Width = value; + return this; + } + + public TeamsCardProperties WithEntities(params IList value) { + this.Entities = value; + return this; + } +} - public Column WithMaxHeight(string value) - { - this.MaxHeight = value; - return this; - } +/// +/// Represents a mention to a person. +/// +public class Mention : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type Mention. + /// + public static Mention? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **mention**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "mention"; + + /// + /// The text that will be substituted with the mention. + /// + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// + /// Defines the entity being mentioned. + /// + [JsonPropertyName("mentioned")] + public MentionedEntity? Mentioned { get; set; } + + /// + /// Serializes this Mention into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Mention WithKey(string value) { + this.Key = value; + return this; + } + + public Mention WithText(string value) { + this.Text = value; + return this; + } + + public Mention WithMentioned(MentionedEntity value) { + this.Mentioned = value; + return this; + } +} - public Column WithWidth(IUnion value) - { - this.Width = value; - return this; - } +/// +/// Represents a mentioned person or tag. +/// +public class MentionedEntity : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type MentionedEntity. + /// + public static MentionedEntity? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The Id of a person (typically a Microsoft Entra user Id) or tag. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// The name of the mentioned entity. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The type of the mentioned entity. + /// + [JsonPropertyName("mentionType")] + public MentionType? MentionType { get; set; } = MentionType.Person; + + /// + /// Serializes this MentionedEntity into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public MentionedEntity WithKey(string value) { + this.Key = value; + return this; + } + + public MentionedEntity WithId(string value) { + this.Id = value; + return this; + } + + public MentionedEntity WithName(string value) { + this.Name = value; + return this; + } + + public MentionedEntity WithMentionType(MentionType value) { + this.MentionType = value; + return this; + } +} - public Column WithGridArea(string value) - { - this.GridArea = value; - return this; - } +/// +/// Card-level metadata. +/// +public class CardMetadata : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type CardMetadata. + /// + public static CardMetadata? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The URL the card originates from. When `webUrl` is set, the card is dubbed an **Adaptive Card-based Loop Component** and, when pasted in Teams or other Loop Component-capable host applications, the URL will unfurl to the same exact card. + /// + [JsonPropertyName("webUrl")] + public string? WebUrl { get; set; } + + /// + /// Serializes this CardMetadata into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public CardMetadata WithKey(string value) { + this.Key = value; + return this; + } + + public CardMetadata WithWebUrl(string value) { + this.WebUrl = value; + return this; + } +} - public Column WithFallback(IUnion value) - { - this.Fallback = value; - return this; - } +/// +/// The resources that can be used in the body of the card. +/// +public class Resources : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type Resources. + /// + public static Resources? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// String resources that can provide translations in multiple languages. String resources make it possible to craft cards that are automatically localized according to the language settings of the application that displays the card. + /// + [JsonPropertyName("strings")] + public IDictionary? Strings { get; set; } + + /// + /// Serializes this Resources into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Resources WithKey(string value) { + this.Key = value; + return this; + } + + public Resources WithStrings(IDictionary value) { + this.Strings = value; + return this; + } +} - public Column WithItems(params IList value) - { - this.Items = value; - return this; - } +/// +/// Defines the replacement string values. +/// +public class StringResource : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type StringResource. + /// + public static StringResource? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The default value of the string, which is used when no matching localized value is found. + /// + [JsonPropertyName("defaultValue")] + public string? DefaultValue { get; set; } + + /// + /// Localized values of the string, where keys represent the locale (e.g. `en-US`) in the `(-)` format. `` is the 2-letter language code and `` is the optional 2-letter country code. + /// + [JsonPropertyName("localizedValues")] + public IDictionary? LocalizedValues { get; set; } + + /// + /// Serializes this StringResource into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public StringResource WithKey(string value) { + this.Key = value; + return this; + } + + public StringResource WithDefaultValue(string value) { + this.DefaultValue = value; + return this; + } + + public StringResource WithLocalizedValues(IDictionary value) { + this.LocalizedValues = value; + return this; + } } \ No newline at end of file From 37761ccfe8f7678da4c08cfa05d7d48769e919a1 Mon Sep 17 00:00:00 2001 From: Corina Gum <> Date: Wed, 18 Mar 2026 16:31:33 -0700 Subject: [PATCH 4/5] Fix Dialogs sample --- Samples/Samples.Dialogs/Program.cs | 39 +++++++++++++++--------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/Samples/Samples.Dialogs/Program.cs b/Samples/Samples.Dialogs/Program.cs index d78603af..41c31b65 100644 --- a/Samples/Samples.Dialogs/Program.cs +++ b/Samples/Samples.Dialogs/Program.cs @@ -151,6 +151,21 @@ static string SanitizeForLog(string? input) return input.Replace("\r", "").Replace("\n", ""); } +static Microsoft.Teams.Cards.SubmitAction CreateTaskFetchSubmitAction(string title, string openDialogType) +{ + var submitActionData = new Microsoft.Teams.Cards.SubmitActionData + { + Msteams = new Microsoft.Teams.Cards.TaskFetchSubmitActionData() + }; + submitActionData.NonSchemaProperties["opendialogtype"] = openDialogType; + + return new Microsoft.Teams.Cards.SubmitAction + { + Title = title, + Data = new Microsoft.Teams.Common.Union(submitActionData) + }; +} + static Microsoft.Teams.Cards.AdaptiveCard CreateDialogLauncherCard() { var card = new Microsoft.Teams.Cards.AdaptiveCard @@ -165,26 +180,10 @@ static Microsoft.Teams.Cards.AdaptiveCard CreateDialogLauncherCard() }, Actions = new List { - new Microsoft.Teams.Cards.TaskFetchAction( - Microsoft.Teams.Cards.TaskFetchAction.FromObject(new { opendialogtype = "simple_form" })) - { - Title = "Simple form test" - }, - new Microsoft.Teams.Cards.TaskFetchAction( - Microsoft.Teams.Cards.TaskFetchAction.FromObject(new { opendialogtype = "webpage_dialog" })) - { - Title = "Webpage Dialog" - }, - new Microsoft.Teams.Cards.TaskFetchAction( - Microsoft.Teams.Cards.TaskFetchAction.FromObject(new { opendialogtype = "multi_step_form" })) - { - Title = "Multi-step Form" - }, - new Microsoft.Teams.Cards.TaskFetchAction( - Microsoft.Teams.Cards.TaskFetchAction.FromObject(new { opendialogtype = "mixed_example" })) - { - Title = "Mixed Example" - } + CreateTaskFetchSubmitAction("Simple form test", "simple_form"), + CreateTaskFetchSubmitAction("Webpage Dialog", "webpage_dialog"), + CreateTaskFetchSubmitAction("Multi-step Form", "multi_step_form"), + CreateTaskFetchSubmitAction("Mixed Example", "mixed_example") } }; From f43ea63ca380a1282e7bf375e870f5cc9259202a Mon Sep 17 00:00:00 2001 From: Corina Gum <> Date: Thu, 19 Mar 2026 14:34:55 -0700 Subject: [PATCH 5/5] Remove MsTeams property and update tests --- Libraries/Microsoft.Teams.Cards/Core.cs | 36207 ++++++++-------- .../AdaptiveCardsTest.cs | 58 +- 2 files changed, 18720 insertions(+), 17545 deletions(-) diff --git a/Libraries/Microsoft.Teams.Cards/Core.cs b/Libraries/Microsoft.Teams.Cards/Core.cs index 54c22555..72a48996 100644 --- a/Libraries/Microsoft.Teams.Cards/Core.cs +++ b/Libraries/Microsoft.Teams.Cards/Core.cs @@ -1,4 +1,4 @@ -// This file was automatically generated by a tool on 03/18/2026, 10:44 PM UTC. DO NOT UPDATE MANUALLY. +// This file was automatically generated by a tool on 03/19/2026, 9:27 PM UTC. DO NOT UPDATE MANUALLY. // It includes declarations for Adaptive Card features available in Teams, Copilot, Outlook, Word, Excel, PowerPoint. #pragma warning disable IDE0290 @@ -13,1005 +13,1005 @@ namespace Microsoft.Teams.Cards; [JsonConverter(typeof(JsonConverter))] public class ActionStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ActionStyle Default = new("default"); - public bool IsDefault => Default.Equals(Value); + public static readonly ActionStyle Default = new("default"); + public bool IsDefault => Default.Equals(Value); - public static readonly ActionStyle Positive = new("positive"); - public bool IsPositive => Positive.Equals(Value); + public static readonly ActionStyle Positive = new("positive"); + public bool IsPositive => Positive.Equals(Value); - public static readonly ActionStyle Destructive = new("destructive"); - public bool IsDestructive => Destructive.Equals(Value); + public static readonly ActionStyle Destructive = new("destructive"); + public bool IsDestructive => Destructive.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ActionMode(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ActionMode Primary = new("primary"); - public bool IsPrimary => Primary.Equals(Value); + public static readonly ActionMode Primary = new("primary"); + public bool IsPrimary => Primary.Equals(Value); - public static readonly ActionMode Secondary = new("secondary"); - public bool IsSecondary => Secondary.Equals(Value); + public static readonly ActionMode Secondary = new("secondary"); + public bool IsSecondary => Secondary.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ThemeName(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ThemeName Light = new("Light"); - public bool IsLight => Light.Equals(Value); + public static readonly ThemeName Light = new("Light"); + public bool IsLight => Light.Equals(Value); - public static readonly ThemeName Dark = new("Dark"); - public bool IsDark => Dark.Equals(Value); + public static readonly ThemeName Dark = new("Dark"); + public bool IsDark => Dark.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ElementHeight(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ElementHeight Auto = new("auto"); - public bool IsAuto => Auto.Equals(Value); + public static readonly ElementHeight Auto = new("auto"); + public bool IsAuto => Auto.Equals(Value); - public static readonly ElementHeight Stretch = new("stretch"); - public bool IsStretch => Stretch.Equals(Value); + public static readonly ElementHeight Stretch = new("stretch"); + public bool IsStretch => Stretch.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class HorizontalAlignment(string value) : StringEnum(value, caseSensitive: false) { - public static readonly HorizontalAlignment Left = new("Left"); - public bool IsLeft => Left.Equals(Value); + public static readonly HorizontalAlignment Left = new("Left"); + public bool IsLeft => Left.Equals(Value); - public static readonly HorizontalAlignment Center = new("Center"); - public bool IsCenter => Center.Equals(Value); + public static readonly HorizontalAlignment Center = new("Center"); + public bool IsCenter => Center.Equals(Value); - public static readonly HorizontalAlignment Right = new("Right"); - public bool IsRight => Right.Equals(Value); + public static readonly HorizontalAlignment Right = new("Right"); + public bool IsRight => Right.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class Spacing(string value) : StringEnum(value, caseSensitive: false) { - public static readonly Spacing None = new("None"); - public bool IsNone => None.Equals(Value); + public static readonly Spacing None = new("None"); + public bool IsNone => None.Equals(Value); - public static readonly Spacing ExtraSmall = new("ExtraSmall"); - public bool IsExtraSmall => ExtraSmall.Equals(Value); + public static readonly Spacing ExtraSmall = new("ExtraSmall"); + public bool IsExtraSmall => ExtraSmall.Equals(Value); - public static readonly Spacing Small = new("Small"); - public bool IsSmall => Small.Equals(Value); + public static readonly Spacing Small = new("Small"); + public bool IsSmall => Small.Equals(Value); - public static readonly Spacing Default = new("Default"); - public bool IsDefault => Default.Equals(Value); + public static readonly Spacing Default = new("Default"); + public bool IsDefault => Default.Equals(Value); - public static readonly Spacing Medium = new("Medium"); - public bool IsMedium => Medium.Equals(Value); + public static readonly Spacing Medium = new("Medium"); + public bool IsMedium => Medium.Equals(Value); - public static readonly Spacing Large = new("Large"); - public bool IsLarge => Large.Equals(Value); + public static readonly Spacing Large = new("Large"); + public bool IsLarge => Large.Equals(Value); - public static readonly Spacing ExtraLarge = new("ExtraLarge"); - public bool IsExtraLarge => ExtraLarge.Equals(Value); + public static readonly Spacing ExtraLarge = new("ExtraLarge"); + public bool IsExtraLarge => ExtraLarge.Equals(Value); - public static readonly Spacing Padding = new("Padding"); - public bool IsPadding => Padding.Equals(Value); + public static readonly Spacing Padding = new("Padding"); + public bool IsPadding => Padding.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class TargetWidth(string value) : StringEnum(value, caseSensitive: false) { - public static readonly TargetWidth VeryNarrow = new("VeryNarrow"); - public bool IsVeryNarrow => VeryNarrow.Equals(Value); + public static readonly TargetWidth VeryNarrow = new("VeryNarrow"); + public bool IsVeryNarrow => VeryNarrow.Equals(Value); - public static readonly TargetWidth Narrow = new("Narrow"); - public bool IsNarrow => Narrow.Equals(Value); + public static readonly TargetWidth Narrow = new("Narrow"); + public bool IsNarrow => Narrow.Equals(Value); - public static readonly TargetWidth Standard = new("Standard"); - public bool IsStandard => Standard.Equals(Value); + public static readonly TargetWidth Standard = new("Standard"); + public bool IsStandard => Standard.Equals(Value); - public static readonly TargetWidth Wide = new("Wide"); - public bool IsWide => Wide.Equals(Value); + public static readonly TargetWidth Wide = new("Wide"); + public bool IsWide => Wide.Equals(Value); - public static readonly TargetWidth AtLeastVeryNarrow = new("atLeast:VeryNarrow"); - public bool IsAtLeastVeryNarrow => AtLeastVeryNarrow.Equals(Value); + public static readonly TargetWidth AtLeastVeryNarrow = new("atLeast:VeryNarrow"); + public bool IsAtLeastVeryNarrow => AtLeastVeryNarrow.Equals(Value); - public static readonly TargetWidth AtMostVeryNarrow = new("atMost:VeryNarrow"); - public bool IsAtMostVeryNarrow => AtMostVeryNarrow.Equals(Value); + public static readonly TargetWidth AtMostVeryNarrow = new("atMost:VeryNarrow"); + public bool IsAtMostVeryNarrow => AtMostVeryNarrow.Equals(Value); - public static readonly TargetWidth AtLeastNarrow = new("atLeast:Narrow"); - public bool IsAtLeastNarrow => AtLeastNarrow.Equals(Value); + public static readonly TargetWidth AtLeastNarrow = new("atLeast:Narrow"); + public bool IsAtLeastNarrow => AtLeastNarrow.Equals(Value); - public static readonly TargetWidth AtMostNarrow = new("atMost:Narrow"); - public bool IsAtMostNarrow => AtMostNarrow.Equals(Value); + public static readonly TargetWidth AtMostNarrow = new("atMost:Narrow"); + public bool IsAtMostNarrow => AtMostNarrow.Equals(Value); - public static readonly TargetWidth AtLeastStandard = new("atLeast:Standard"); - public bool IsAtLeastStandard => AtLeastStandard.Equals(Value); + public static readonly TargetWidth AtLeastStandard = new("atLeast:Standard"); + public bool IsAtLeastStandard => AtLeastStandard.Equals(Value); - public static readonly TargetWidth AtMostStandard = new("atMost:Standard"); - public bool IsAtMostStandard => AtMostStandard.Equals(Value); + public static readonly TargetWidth AtMostStandard = new("atMost:Standard"); + public bool IsAtMostStandard => AtMostStandard.Equals(Value); - public static readonly TargetWidth AtLeastWide = new("atLeast:Wide"); - public bool IsAtLeastWide => AtLeastWide.Equals(Value); + public static readonly TargetWidth AtLeastWide = new("atLeast:Wide"); + public bool IsAtLeastWide => AtLeastWide.Equals(Value); - public static readonly TargetWidth AtMostWide = new("atMost:Wide"); - public bool IsAtMostWide => AtMostWide.Equals(Value); + public static readonly TargetWidth AtMostWide = new("atMost:Wide"); + public bool IsAtMostWide => AtMostWide.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ContainerStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ContainerStyle Default = new("default"); - public bool IsDefault => Default.Equals(Value); + public static readonly ContainerStyle Default = new("default"); + public bool IsDefault => Default.Equals(Value); - public static readonly ContainerStyle Emphasis = new("emphasis"); - public bool IsEmphasis => Emphasis.Equals(Value); + public static readonly ContainerStyle Emphasis = new("emphasis"); + public bool IsEmphasis => Emphasis.Equals(Value); - public static readonly ContainerStyle Accent = new("accent"); - public bool IsAccent => Accent.Equals(Value); + public static readonly ContainerStyle Accent = new("accent"); + public bool IsAccent => Accent.Equals(Value); - public static readonly ContainerStyle Good = new("good"); - public bool IsGood => Good.Equals(Value); + public static readonly ContainerStyle Good = new("good"); + public bool IsGood => Good.Equals(Value); - public static readonly ContainerStyle Attention = new("attention"); - public bool IsAttention => Attention.Equals(Value); + public static readonly ContainerStyle Attention = new("attention"); + public bool IsAttention => Attention.Equals(Value); - public static readonly ContainerStyle Warning = new("warning"); - public bool IsWarning => Warning.Equals(Value); + public static readonly ContainerStyle Warning = new("warning"); + public bool IsWarning => Warning.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class VerticalAlignment(string value) : StringEnum(value, caseSensitive: false) { - public static readonly VerticalAlignment Top = new("Top"); - public bool IsTop => Top.Equals(Value); + public static readonly VerticalAlignment Top = new("Top"); + public bool IsTop => Top.Equals(Value); - public static readonly VerticalAlignment Center = new("Center"); - public bool IsCenter => Center.Equals(Value); + public static readonly VerticalAlignment Center = new("Center"); + public bool IsCenter => Center.Equals(Value); - public static readonly VerticalAlignment Bottom = new("Bottom"); - public bool IsBottom => Bottom.Equals(Value); + public static readonly VerticalAlignment Bottom = new("Bottom"); + public bool IsBottom => Bottom.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class FlowLayoutItemFit(string value) : StringEnum(value, caseSensitive: false) { - public static readonly FlowLayoutItemFit Fit = new("Fit"); - public bool IsFit => Fit.Equals(Value); + public static readonly FlowLayoutItemFit Fit = new("Fit"); + public bool IsFit => Fit.Equals(Value); - public static readonly FlowLayoutItemFit Fill = new("Fill"); - public bool IsFill => Fill.Equals(Value); + public static readonly FlowLayoutItemFit Fill = new("Fill"); + public bool IsFill => Fill.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class FillMode(string value) : StringEnum(value, caseSensitive: false) { - public static readonly FillMode Cover = new("Cover"); - public bool IsCover => Cover.Equals(Value); + public static readonly FillMode Cover = new("Cover"); + public bool IsCover => Cover.Equals(Value); - public static readonly FillMode RepeatHorizontally = new("RepeatHorizontally"); - public bool IsRepeatHorizontally => RepeatHorizontally.Equals(Value); + public static readonly FillMode RepeatHorizontally = new("RepeatHorizontally"); + public bool IsRepeatHorizontally => RepeatHorizontally.Equals(Value); - public static readonly FillMode RepeatVertically = new("RepeatVertically"); - public bool IsRepeatVertically => RepeatVertically.Equals(Value); + public static readonly FillMode RepeatVertically = new("RepeatVertically"); + public bool IsRepeatVertically => RepeatVertically.Equals(Value); - public static readonly FillMode Repeat = new("Repeat"); - public bool IsRepeat => Repeat.Equals(Value); + public static readonly FillMode Repeat = new("Repeat"); + public bool IsRepeat => Repeat.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class TextSize(string value) : StringEnum(value, caseSensitive: false) { - public static readonly TextSize Small = new("Small"); - public bool IsSmall => Small.Equals(Value); + public static readonly TextSize Small = new("Small"); + public bool IsSmall => Small.Equals(Value); - public static readonly TextSize Default = new("Default"); - public bool IsDefault => Default.Equals(Value); + public static readonly TextSize Default = new("Default"); + public bool IsDefault => Default.Equals(Value); - public static readonly TextSize Medium = new("Medium"); - public bool IsMedium => Medium.Equals(Value); + public static readonly TextSize Medium = new("Medium"); + public bool IsMedium => Medium.Equals(Value); - public static readonly TextSize Large = new("Large"); - public bool IsLarge => Large.Equals(Value); + public static readonly TextSize Large = new("Large"); + public bool IsLarge => Large.Equals(Value); - public static readonly TextSize ExtraLarge = new("ExtraLarge"); - public bool IsExtraLarge => ExtraLarge.Equals(Value); + public static readonly TextSize ExtraLarge = new("ExtraLarge"); + public bool IsExtraLarge => ExtraLarge.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class TextWeight(string value) : StringEnum(value, caseSensitive: false) { - public static readonly TextWeight Lighter = new("Lighter"); - public bool IsLighter => Lighter.Equals(Value); + public static readonly TextWeight Lighter = new("Lighter"); + public bool IsLighter => Lighter.Equals(Value); - public static readonly TextWeight Default = new("Default"); - public bool IsDefault => Default.Equals(Value); + public static readonly TextWeight Default = new("Default"); + public bool IsDefault => Default.Equals(Value); - public static readonly TextWeight Bolder = new("Bolder"); - public bool IsBolder => Bolder.Equals(Value); + public static readonly TextWeight Bolder = new("Bolder"); + public bool IsBolder => Bolder.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class TextColor(string value) : StringEnum(value, caseSensitive: false) { - public static readonly TextColor Default = new("Default"); - public bool IsDefault => Default.Equals(Value); + public static readonly TextColor Default = new("Default"); + public bool IsDefault => Default.Equals(Value); - public static readonly TextColor Dark = new("Dark"); - public bool IsDark => Dark.Equals(Value); + public static readonly TextColor Dark = new("Dark"); + public bool IsDark => Dark.Equals(Value); - public static readonly TextColor Light = new("Light"); - public bool IsLight => Light.Equals(Value); + public static readonly TextColor Light = new("Light"); + public bool IsLight => Light.Equals(Value); - public static readonly TextColor Accent = new("Accent"); - public bool IsAccent => Accent.Equals(Value); + public static readonly TextColor Accent = new("Accent"); + public bool IsAccent => Accent.Equals(Value); - public static readonly TextColor Good = new("Good"); - public bool IsGood => Good.Equals(Value); + public static readonly TextColor Good = new("Good"); + public bool IsGood => Good.Equals(Value); - public static readonly TextColor Warning = new("Warning"); - public bool IsWarning => Warning.Equals(Value); + public static readonly TextColor Warning = new("Warning"); + public bool IsWarning => Warning.Equals(Value); - public static readonly TextColor Attention = new("Attention"); - public bool IsAttention => Attention.Equals(Value); + public static readonly TextColor Attention = new("Attention"); + public bool IsAttention => Attention.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class FontType(string value) : StringEnum(value, caseSensitive: false) { - public static readonly FontType Default = new("Default"); - public bool IsDefault => Default.Equals(Value); + public static readonly FontType Default = new("Default"); + public bool IsDefault => Default.Equals(Value); - public static readonly FontType Monospace = new("Monospace"); - public bool IsMonospace => Monospace.Equals(Value); + public static readonly FontType Monospace = new("Monospace"); + public bool IsMonospace => Monospace.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class TextBlockStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly TextBlockStyle Default = new("default"); - public bool IsDefault => Default.Equals(Value); + public static readonly TextBlockStyle Default = new("default"); + public bool IsDefault => Default.Equals(Value); - public static readonly TextBlockStyle ColumnHeader = new("columnHeader"); - public bool IsColumnHeader => ColumnHeader.Equals(Value); + public static readonly TextBlockStyle ColumnHeader = new("columnHeader"); + public bool IsColumnHeader => ColumnHeader.Equals(Value); - public static readonly TextBlockStyle Heading = new("heading"); - public bool IsHeading => Heading.Equals(Value); + public static readonly TextBlockStyle Heading = new("heading"); + public bool IsHeading => Heading.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ImageStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ImageStyle Default = new("Default"); - public bool IsDefault => Default.Equals(Value); + public static readonly ImageStyle Default = new("Default"); + public bool IsDefault => Default.Equals(Value); - public static readonly ImageStyle Person = new("Person"); - public bool IsPerson => Person.Equals(Value); + public static readonly ImageStyle Person = new("Person"); + public bool IsPerson => Person.Equals(Value); - public static readonly ImageStyle RoundedCorners = new("RoundedCorners"); - public bool IsRoundedCorners => RoundedCorners.Equals(Value); + public static readonly ImageStyle RoundedCorners = new("RoundedCorners"); + public bool IsRoundedCorners => RoundedCorners.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class Size(string value) : StringEnum(value, caseSensitive: false) { - public static readonly Size Auto = new("Auto"); - public bool IsAuto => Auto.Equals(Value); + public static readonly Size Auto = new("Auto"); + public bool IsAuto => Auto.Equals(Value); - public static readonly Size Stretch = new("Stretch"); - public bool IsStretch => Stretch.Equals(Value); + public static readonly Size Stretch = new("Stretch"); + public bool IsStretch => Stretch.Equals(Value); - public static readonly Size Small = new("Small"); - public bool IsSmall => Small.Equals(Value); + public static readonly Size Small = new("Small"); + public bool IsSmall => Small.Equals(Value); - public static readonly Size Medium = new("Medium"); - public bool IsMedium => Medium.Equals(Value); + public static readonly Size Medium = new("Medium"); + public bool IsMedium => Medium.Equals(Value); - public static readonly Size Large = new("Large"); - public bool IsLarge => Large.Equals(Value); + public static readonly Size Large = new("Large"); + public bool IsLarge => Large.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ImageFitMode(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ImageFitMode Cover = new("Cover"); - public bool IsCover => Cover.Equals(Value); + public static readonly ImageFitMode Cover = new("Cover"); + public bool IsCover => Cover.Equals(Value); - public static readonly ImageFitMode Contain = new("Contain"); - public bool IsContain => Contain.Equals(Value); + public static readonly ImageFitMode Contain = new("Contain"); + public bool IsContain => Contain.Equals(Value); - public static readonly ImageFitMode Fill = new("Fill"); - public bool IsFill => Fill.Equals(Value); + public static readonly ImageFitMode Fill = new("Fill"); + public bool IsFill => Fill.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class InputTextStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly InputTextStyle Text = new("Text"); - public bool IsText => Text.Equals(Value); + public static readonly InputTextStyle Text = new("Text"); + public bool IsText => Text.Equals(Value); - public static readonly InputTextStyle Tel = new("Tel"); - public bool IsTel => Tel.Equals(Value); + public static readonly InputTextStyle Tel = new("Tel"); + public bool IsTel => Tel.Equals(Value); - public static readonly InputTextStyle Url = new("Url"); - public bool IsUrl => Url.Equals(Value); + public static readonly InputTextStyle Url = new("Url"); + public bool IsUrl => Url.Equals(Value); - public static readonly InputTextStyle Email = new("Email"); - public bool IsEmail => Email.Equals(Value); + public static readonly InputTextStyle Email = new("Email"); + public bool IsEmail => Email.Equals(Value); - public static readonly InputTextStyle Password = new("Password"); - public bool IsPassword => Password.Equals(Value); + public static readonly InputTextStyle Password = new("Password"); + public bool IsPassword => Password.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class AssociatedInputs(string value) : StringEnum(value, caseSensitive: false) { - public static readonly AssociatedInputs Auto = new("auto"); - public bool IsAuto => Auto.Equals(Value); + public static readonly AssociatedInputs Auto = new("auto"); + public bool IsAuto => Auto.Equals(Value); - public static readonly AssociatedInputs None = new("none"); - public bool IsNone => None.Equals(Value); + public static readonly AssociatedInputs None = new("none"); + public bool IsNone => None.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ChoiceSetInputStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ChoiceSetInputStyle Compact = new("compact"); - public bool IsCompact => Compact.Equals(Value); + public static readonly ChoiceSetInputStyle Compact = new("compact"); + public bool IsCompact => Compact.Equals(Value); - public static readonly ChoiceSetInputStyle Expanded = new("expanded"); - public bool IsExpanded => Expanded.Equals(Value); + public static readonly ChoiceSetInputStyle Expanded = new("expanded"); + public bool IsExpanded => Expanded.Equals(Value); - public static readonly ChoiceSetInputStyle Filtered = new("filtered"); - public bool IsFiltered => Filtered.Equals(Value); + public static readonly ChoiceSetInputStyle Filtered = new("filtered"); + public bool IsFiltered => Filtered.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class RatingSize(string value) : StringEnum(value, caseSensitive: false) { - public static readonly RatingSize Medium = new("Medium"); - public bool IsMedium => Medium.Equals(Value); + public static readonly RatingSize Medium = new("Medium"); + public bool IsMedium => Medium.Equals(Value); - public static readonly RatingSize Large = new("Large"); - public bool IsLarge => Large.Equals(Value); + public static readonly RatingSize Large = new("Large"); + public bool IsLarge => Large.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class RatingColor(string value) : StringEnum(value, caseSensitive: false) { - public static readonly RatingColor Neutral = new("Neutral"); - public bool IsNeutral => Neutral.Equals(Value); + public static readonly RatingColor Neutral = new("Neutral"); + public bool IsNeutral => Neutral.Equals(Value); - public static readonly RatingColor Marigold = new("Marigold"); - public bool IsMarigold => Marigold.Equals(Value); + public static readonly RatingColor Marigold = new("Marigold"); + public bool IsMarigold => Marigold.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class RatingStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly RatingStyle Default = new("Default"); - public bool IsDefault => Default.Equals(Value); + public static readonly RatingStyle Default = new("Default"); + public bool IsDefault => Default.Equals(Value); - public static readonly RatingStyle Compact = new("Compact"); - public bool IsCompact => Compact.Equals(Value); + public static readonly RatingStyle Compact = new("Compact"); + public bool IsCompact => Compact.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class IconSize(string value) : StringEnum(value, caseSensitive: false) { - public static readonly IconSize XxSmall = new("xxSmall"); - public bool IsXxSmall => XxSmall.Equals(Value); + public static readonly IconSize XxSmall = new("xxSmall"); + public bool IsXxSmall => XxSmall.Equals(Value); - public static readonly IconSize XSmall = new("xSmall"); - public bool IsXSmall => XSmall.Equals(Value); + public static readonly IconSize XSmall = new("xSmall"); + public bool IsXSmall => XSmall.Equals(Value); - public static readonly IconSize Small = new("Small"); - public bool IsSmall => Small.Equals(Value); + public static readonly IconSize Small = new("Small"); + public bool IsSmall => Small.Equals(Value); - public static readonly IconSize Standard = new("Standard"); - public bool IsStandard => Standard.Equals(Value); + public static readonly IconSize Standard = new("Standard"); + public bool IsStandard => Standard.Equals(Value); - public static readonly IconSize Medium = new("Medium"); - public bool IsMedium => Medium.Equals(Value); + public static readonly IconSize Medium = new("Medium"); + public bool IsMedium => Medium.Equals(Value); - public static readonly IconSize Large = new("Large"); - public bool IsLarge => Large.Equals(Value); + public static readonly IconSize Large = new("Large"); + public bool IsLarge => Large.Equals(Value); - public static readonly IconSize XLarge = new("xLarge"); - public bool IsXLarge => XLarge.Equals(Value); + public static readonly IconSize XLarge = new("xLarge"); + public bool IsXLarge => XLarge.Equals(Value); - public static readonly IconSize XxLarge = new("xxLarge"); - public bool IsXxLarge => XxLarge.Equals(Value); + public static readonly IconSize XxLarge = new("xxLarge"); + public bool IsXxLarge => XxLarge.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class IconStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly IconStyle Regular = new("Regular"); - public bool IsRegular => Regular.Equals(Value); + public static readonly IconStyle Regular = new("Regular"); + public bool IsRegular => Regular.Equals(Value); - public static readonly IconStyle Filled = new("Filled"); - public bool IsFilled => Filled.Equals(Value); + public static readonly IconStyle Filled = new("Filled"); + public bool IsFilled => Filled.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class CarouselPageAnimation(string value) : StringEnum(value, caseSensitive: false) { - public static readonly CarouselPageAnimation Slide = new("Slide"); - public bool IsSlide => Slide.Equals(Value); + public static readonly CarouselPageAnimation Slide = new("Slide"); + public bool IsSlide => Slide.Equals(Value); - public static readonly CarouselPageAnimation CrossFade = new("CrossFade"); - public bool IsCrossFade => CrossFade.Equals(Value); + public static readonly CarouselPageAnimation CrossFade = new("CrossFade"); + public bool IsCrossFade => CrossFade.Equals(Value); - public static readonly CarouselPageAnimation None = new("None"); - public bool IsNone => None.Equals(Value); + public static readonly CarouselPageAnimation None = new("None"); + public bool IsNone => None.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class BadgeIconPosition(string value) : StringEnum(value, caseSensitive: false) { - public static readonly BadgeIconPosition Before = new("Before"); - public bool IsBefore => Before.Equals(Value); + public static readonly BadgeIconPosition Before = new("Before"); + public bool IsBefore => Before.Equals(Value); - public static readonly BadgeIconPosition After = new("After"); - public bool IsAfter => After.Equals(Value); + public static readonly BadgeIconPosition After = new("After"); + public bool IsAfter => After.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class BadgeAppearance(string value) : StringEnum(value, caseSensitive: false) { - public static readonly BadgeAppearance Filled = new("Filled"); - public bool IsFilled => Filled.Equals(Value); + public static readonly BadgeAppearance Filled = new("Filled"); + public bool IsFilled => Filled.Equals(Value); - public static readonly BadgeAppearance Tint = new("Tint"); - public bool IsTint => Tint.Equals(Value); + public static readonly BadgeAppearance Tint = new("Tint"); + public bool IsTint => Tint.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class BadgeSize(string value) : StringEnum(value, caseSensitive: false) { - public static readonly BadgeSize Medium = new("Medium"); - public bool IsMedium => Medium.Equals(Value); + public static readonly BadgeSize Medium = new("Medium"); + public bool IsMedium => Medium.Equals(Value); - public static readonly BadgeSize Large = new("Large"); - public bool IsLarge => Large.Equals(Value); + public static readonly BadgeSize Large = new("Large"); + public bool IsLarge => Large.Equals(Value); - public static readonly BadgeSize ExtraLarge = new("ExtraLarge"); - public bool IsExtraLarge => ExtraLarge.Equals(Value); + public static readonly BadgeSize ExtraLarge = new("ExtraLarge"); + public bool IsExtraLarge => ExtraLarge.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class BadgeShape(string value) : StringEnum(value, caseSensitive: false) { - public static readonly BadgeShape Square = new("Square"); - public bool IsSquare => Square.Equals(Value); + public static readonly BadgeShape Square = new("Square"); + public bool IsSquare => Square.Equals(Value); - public static readonly BadgeShape Rounded = new("Rounded"); - public bool IsRounded => Rounded.Equals(Value); + public static readonly BadgeShape Rounded = new("Rounded"); + public bool IsRounded => Rounded.Equals(Value); - public static readonly BadgeShape Circular = new("Circular"); - public bool IsCircular => Circular.Equals(Value); + public static readonly BadgeShape Circular = new("Circular"); + public bool IsCircular => Circular.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class BadgeStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly BadgeStyle Default = new("Default"); - public bool IsDefault => Default.Equals(Value); + public static readonly BadgeStyle Default = new("Default"); + public bool IsDefault => Default.Equals(Value); - public static readonly BadgeStyle Subtle = new("Subtle"); - public bool IsSubtle => Subtle.Equals(Value); + public static readonly BadgeStyle Subtle = new("Subtle"); + public bool IsSubtle => Subtle.Equals(Value); - public static readonly BadgeStyle Informative = new("Informative"); - public bool IsInformative => Informative.Equals(Value); + public static readonly BadgeStyle Informative = new("Informative"); + public bool IsInformative => Informative.Equals(Value); - public static readonly BadgeStyle Accent = new("Accent"); - public bool IsAccent => Accent.Equals(Value); + public static readonly BadgeStyle Accent = new("Accent"); + public bool IsAccent => Accent.Equals(Value); - public static readonly BadgeStyle Good = new("Good"); - public bool IsGood => Good.Equals(Value); + public static readonly BadgeStyle Good = new("Good"); + public bool IsGood => Good.Equals(Value); - public static readonly BadgeStyle Attention = new("Attention"); - public bool IsAttention => Attention.Equals(Value); + public static readonly BadgeStyle Attention = new("Attention"); + public bool IsAttention => Attention.Equals(Value); - public static readonly BadgeStyle Warning = new("Warning"); - public bool IsWarning => Warning.Equals(Value); + public static readonly BadgeStyle Warning = new("Warning"); + public bool IsWarning => Warning.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ProgressRingLabelPosition(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ProgressRingLabelPosition Before = new("Before"); - public bool IsBefore => Before.Equals(Value); + public static readonly ProgressRingLabelPosition Before = new("Before"); + public bool IsBefore => Before.Equals(Value); - public static readonly ProgressRingLabelPosition After = new("After"); - public bool IsAfter => After.Equals(Value); + public static readonly ProgressRingLabelPosition After = new("After"); + public bool IsAfter => After.Equals(Value); - public static readonly ProgressRingLabelPosition Above = new("Above"); - public bool IsAbove => Above.Equals(Value); + public static readonly ProgressRingLabelPosition Above = new("Above"); + public bool IsAbove => Above.Equals(Value); - public static readonly ProgressRingLabelPosition Below = new("Below"); - public bool IsBelow => Below.Equals(Value); + public static readonly ProgressRingLabelPosition Below = new("Below"); + public bool IsBelow => Below.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ProgressRingSize(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ProgressRingSize Tiny = new("Tiny"); - public bool IsTiny => Tiny.Equals(Value); + public static readonly ProgressRingSize Tiny = new("Tiny"); + public bool IsTiny => Tiny.Equals(Value); - public static readonly ProgressRingSize Small = new("Small"); - public bool IsSmall => Small.Equals(Value); + public static readonly ProgressRingSize Small = new("Small"); + public bool IsSmall => Small.Equals(Value); - public static readonly ProgressRingSize Medium = new("Medium"); - public bool IsMedium => Medium.Equals(Value); + public static readonly ProgressRingSize Medium = new("Medium"); + public bool IsMedium => Medium.Equals(Value); - public static readonly ProgressRingSize Large = new("Large"); - public bool IsLarge => Large.Equals(Value); + public static readonly ProgressRingSize Large = new("Large"); + public bool IsLarge => Large.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ProgressBarColor(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ProgressBarColor Accent = new("Accent"); - public bool IsAccent => Accent.Equals(Value); + public static readonly ProgressBarColor Accent = new("Accent"); + public bool IsAccent => Accent.Equals(Value); - public static readonly ProgressBarColor Good = new("Good"); - public bool IsGood => Good.Equals(Value); + public static readonly ProgressBarColor Good = new("Good"); + public bool IsGood => Good.Equals(Value); - public static readonly ProgressBarColor Warning = new("Warning"); - public bool IsWarning => Warning.Equals(Value); + public static readonly ProgressBarColor Warning = new("Warning"); + public bool IsWarning => Warning.Equals(Value); - public static readonly ProgressBarColor Attention = new("Attention"); - public bool IsAttention => Attention.Equals(Value); + public static readonly ProgressBarColor Attention = new("Attention"); + public bool IsAttention => Attention.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ChartColorSet(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ChartColorSet Categorical = new("categorical"); - public bool IsCategorical => Categorical.Equals(Value); + public static readonly ChartColorSet Categorical = new("categorical"); + public bool IsCategorical => Categorical.Equals(Value); - public static readonly ChartColorSet Sequential = new("sequential"); - public bool IsSequential => Sequential.Equals(Value); + public static readonly ChartColorSet Sequential = new("sequential"); + public bool IsSequential => Sequential.Equals(Value); - public static readonly ChartColorSet Sequentialred = new("sequentialred"); - public bool IsSequentialred => Sequentialred.Equals(Value); + public static readonly ChartColorSet Sequentialred = new("sequentialred"); + public bool IsSequentialred => Sequentialred.Equals(Value); - public static readonly ChartColorSet Sequentialgreen = new("sequentialgreen"); - public bool IsSequentialgreen => Sequentialgreen.Equals(Value); + public static readonly ChartColorSet Sequentialgreen = new("sequentialgreen"); + public bool IsSequentialgreen => Sequentialgreen.Equals(Value); - public static readonly ChartColorSet Sequentialyellow = new("sequentialyellow"); - public bool IsSequentialyellow => Sequentialyellow.Equals(Value); + public static readonly ChartColorSet Sequentialyellow = new("sequentialyellow"); + public bool IsSequentialyellow => Sequentialyellow.Equals(Value); - public static readonly ChartColorSet Diverging = new("diverging"); - public bool IsDiverging => Diverging.Equals(Value); + public static readonly ChartColorSet Diverging = new("diverging"); + public bool IsDiverging => Diverging.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ChartColor(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ChartColor Good = new("good"); - public bool IsGood => Good.Equals(Value); + public static readonly ChartColor Good = new("good"); + public bool IsGood => Good.Equals(Value); - public static readonly ChartColor Warning = new("warning"); - public bool IsWarning => Warning.Equals(Value); + public static readonly ChartColor Warning = new("warning"); + public bool IsWarning => Warning.Equals(Value); - public static readonly ChartColor Attention = new("attention"); - public bool IsAttention => Attention.Equals(Value); + public static readonly ChartColor Attention = new("attention"); + public bool IsAttention => Attention.Equals(Value); - public static readonly ChartColor Neutral = new("neutral"); - public bool IsNeutral => Neutral.Equals(Value); + public static readonly ChartColor Neutral = new("neutral"); + public bool IsNeutral => Neutral.Equals(Value); - public static readonly ChartColor CategoricalRed = new("categoricalRed"); - public bool IsCategoricalRed => CategoricalRed.Equals(Value); + public static readonly ChartColor CategoricalRed = new("categoricalRed"); + public bool IsCategoricalRed => CategoricalRed.Equals(Value); - public static readonly ChartColor CategoricalPurple = new("categoricalPurple"); - public bool IsCategoricalPurple => CategoricalPurple.Equals(Value); + public static readonly ChartColor CategoricalPurple = new("categoricalPurple"); + public bool IsCategoricalPurple => CategoricalPurple.Equals(Value); - public static readonly ChartColor CategoricalLavender = new("categoricalLavender"); - public bool IsCategoricalLavender => CategoricalLavender.Equals(Value); + public static readonly ChartColor CategoricalLavender = new("categoricalLavender"); + public bool IsCategoricalLavender => CategoricalLavender.Equals(Value); - public static readonly ChartColor CategoricalBlue = new("categoricalBlue"); - public bool IsCategoricalBlue => CategoricalBlue.Equals(Value); + public static readonly ChartColor CategoricalBlue = new("categoricalBlue"); + public bool IsCategoricalBlue => CategoricalBlue.Equals(Value); - public static readonly ChartColor CategoricalLightBlue = new("categoricalLightBlue"); - public bool IsCategoricalLightBlue => CategoricalLightBlue.Equals(Value); + public static readonly ChartColor CategoricalLightBlue = new("categoricalLightBlue"); + public bool IsCategoricalLightBlue => CategoricalLightBlue.Equals(Value); - public static readonly ChartColor CategoricalTeal = new("categoricalTeal"); - public bool IsCategoricalTeal => CategoricalTeal.Equals(Value); + public static readonly ChartColor CategoricalTeal = new("categoricalTeal"); + public bool IsCategoricalTeal => CategoricalTeal.Equals(Value); - public static readonly ChartColor CategoricalGreen = new("categoricalGreen"); - public bool IsCategoricalGreen => CategoricalGreen.Equals(Value); + public static readonly ChartColor CategoricalGreen = new("categoricalGreen"); + public bool IsCategoricalGreen => CategoricalGreen.Equals(Value); - public static readonly ChartColor CategoricalLime = new("categoricalLime"); - public bool IsCategoricalLime => CategoricalLime.Equals(Value); + public static readonly ChartColor CategoricalLime = new("categoricalLime"); + public bool IsCategoricalLime => CategoricalLime.Equals(Value); - public static readonly ChartColor CategoricalMarigold = new("categoricalMarigold"); - public bool IsCategoricalMarigold => CategoricalMarigold.Equals(Value); + public static readonly ChartColor CategoricalMarigold = new("categoricalMarigold"); + public bool IsCategoricalMarigold => CategoricalMarigold.Equals(Value); - public static readonly ChartColor Sequential1 = new("sequential1"); - public bool IsSequential1 => Sequential1.Equals(Value); + public static readonly ChartColor Sequential1 = new("sequential1"); + public bool IsSequential1 => Sequential1.Equals(Value); - public static readonly ChartColor Sequential2 = new("sequential2"); - public bool IsSequential2 => Sequential2.Equals(Value); + public static readonly ChartColor Sequential2 = new("sequential2"); + public bool IsSequential2 => Sequential2.Equals(Value); - public static readonly ChartColor Sequential3 = new("sequential3"); - public bool IsSequential3 => Sequential3.Equals(Value); + public static readonly ChartColor Sequential3 = new("sequential3"); + public bool IsSequential3 => Sequential3.Equals(Value); - public static readonly ChartColor Sequential4 = new("sequential4"); - public bool IsSequential4 => Sequential4.Equals(Value); + public static readonly ChartColor Sequential4 = new("sequential4"); + public bool IsSequential4 => Sequential4.Equals(Value); - public static readonly ChartColor Sequential5 = new("sequential5"); - public bool IsSequential5 => Sequential5.Equals(Value); + public static readonly ChartColor Sequential5 = new("sequential5"); + public bool IsSequential5 => Sequential5.Equals(Value); - public static readonly ChartColor Sequential6 = new("sequential6"); - public bool IsSequential6 => Sequential6.Equals(Value); + public static readonly ChartColor Sequential6 = new("sequential6"); + public bool IsSequential6 => Sequential6.Equals(Value); - public static readonly ChartColor Sequential7 = new("sequential7"); - public bool IsSequential7 => Sequential7.Equals(Value); + public static readonly ChartColor Sequential7 = new("sequential7"); + public bool IsSequential7 => Sequential7.Equals(Value); - public static readonly ChartColor Sequential8 = new("sequential8"); - public bool IsSequential8 => Sequential8.Equals(Value); + public static readonly ChartColor Sequential8 = new("sequential8"); + public bool IsSequential8 => Sequential8.Equals(Value); - public static readonly ChartColor DivergingBlue = new("divergingBlue"); - public bool IsDivergingBlue => DivergingBlue.Equals(Value); + public static readonly ChartColor DivergingBlue = new("divergingBlue"); + public bool IsDivergingBlue => DivergingBlue.Equals(Value); - public static readonly ChartColor DivergingLightBlue = new("divergingLightBlue"); - public bool IsDivergingLightBlue => DivergingLightBlue.Equals(Value); + public static readonly ChartColor DivergingLightBlue = new("divergingLightBlue"); + public bool IsDivergingLightBlue => DivergingLightBlue.Equals(Value); - public static readonly ChartColor DivergingCyan = new("divergingCyan"); - public bool IsDivergingCyan => DivergingCyan.Equals(Value); + public static readonly ChartColor DivergingCyan = new("divergingCyan"); + public bool IsDivergingCyan => DivergingCyan.Equals(Value); - public static readonly ChartColor DivergingTeal = new("divergingTeal"); - public bool IsDivergingTeal => DivergingTeal.Equals(Value); + public static readonly ChartColor DivergingTeal = new("divergingTeal"); + public bool IsDivergingTeal => DivergingTeal.Equals(Value); - public static readonly ChartColor DivergingYellow = new("divergingYellow"); - public bool IsDivergingYellow => DivergingYellow.Equals(Value); + public static readonly ChartColor DivergingYellow = new("divergingYellow"); + public bool IsDivergingYellow => DivergingYellow.Equals(Value); - public static readonly ChartColor DivergingPeach = new("divergingPeach"); - public bool IsDivergingPeach => DivergingPeach.Equals(Value); + public static readonly ChartColor DivergingPeach = new("divergingPeach"); + public bool IsDivergingPeach => DivergingPeach.Equals(Value); - public static readonly ChartColor DivergingLightRed = new("divergingLightRed"); - public bool IsDivergingLightRed => DivergingLightRed.Equals(Value); + public static readonly ChartColor DivergingLightRed = new("divergingLightRed"); + public bool IsDivergingLightRed => DivergingLightRed.Equals(Value); - public static readonly ChartColor DivergingRed = new("divergingRed"); - public bool IsDivergingRed => DivergingRed.Equals(Value); + public static readonly ChartColor DivergingRed = new("divergingRed"); + public bool IsDivergingRed => DivergingRed.Equals(Value); - public static readonly ChartColor DivergingMaroon = new("divergingMaroon"); - public bool IsDivergingMaroon => DivergingMaroon.Equals(Value); + public static readonly ChartColor DivergingMaroon = new("divergingMaroon"); + public bool IsDivergingMaroon => DivergingMaroon.Equals(Value); - public static readonly ChartColor DivergingGray = new("divergingGray"); - public bool IsDivergingGray => DivergingGray.Equals(Value); + public static readonly ChartColor DivergingGray = new("divergingGray"); + public bool IsDivergingGray => DivergingGray.Equals(Value); - public static readonly ChartColor SequentialRed1 = new("sequentialRed1"); - public bool IsSequentialRed1 => SequentialRed1.Equals(Value); + public static readonly ChartColor SequentialRed1 = new("sequentialRed1"); + public bool IsSequentialRed1 => SequentialRed1.Equals(Value); - public static readonly ChartColor SequentialRed2 = new("sequentialRed2"); - public bool IsSequentialRed2 => SequentialRed2.Equals(Value); + public static readonly ChartColor SequentialRed2 = new("sequentialRed2"); + public bool IsSequentialRed2 => SequentialRed2.Equals(Value); - public static readonly ChartColor SequentialRed3 = new("sequentialRed3"); - public bool IsSequentialRed3 => SequentialRed3.Equals(Value); + public static readonly ChartColor SequentialRed3 = new("sequentialRed3"); + public bool IsSequentialRed3 => SequentialRed3.Equals(Value); - public static readonly ChartColor SequentialRed4 = new("sequentialRed4"); - public bool IsSequentialRed4 => SequentialRed4.Equals(Value); + public static readonly ChartColor SequentialRed4 = new("sequentialRed4"); + public bool IsSequentialRed4 => SequentialRed4.Equals(Value); - public static readonly ChartColor SequentialRed5 = new("sequentialRed5"); - public bool IsSequentialRed5 => SequentialRed5.Equals(Value); + public static readonly ChartColor SequentialRed5 = new("sequentialRed5"); + public bool IsSequentialRed5 => SequentialRed5.Equals(Value); - public static readonly ChartColor SequentialRed6 = new("sequentialRed6"); - public bool IsSequentialRed6 => SequentialRed6.Equals(Value); + public static readonly ChartColor SequentialRed6 = new("sequentialRed6"); + public bool IsSequentialRed6 => SequentialRed6.Equals(Value); - public static readonly ChartColor SequentialRed7 = new("sequentialRed7"); - public bool IsSequentialRed7 => SequentialRed7.Equals(Value); + public static readonly ChartColor SequentialRed7 = new("sequentialRed7"); + public bool IsSequentialRed7 => SequentialRed7.Equals(Value); - public static readonly ChartColor SequentialRed8 = new("sequentialRed8"); - public bool IsSequentialRed8 => SequentialRed8.Equals(Value); + public static readonly ChartColor SequentialRed8 = new("sequentialRed8"); + public bool IsSequentialRed8 => SequentialRed8.Equals(Value); - public static readonly ChartColor SequentialGreen1 = new("sequentialGreen1"); - public bool IsSequentialGreen1 => SequentialGreen1.Equals(Value); + public static readonly ChartColor SequentialGreen1 = new("sequentialGreen1"); + public bool IsSequentialGreen1 => SequentialGreen1.Equals(Value); - public static readonly ChartColor SequentialGreen2 = new("sequentialGreen2"); - public bool IsSequentialGreen2 => SequentialGreen2.Equals(Value); + public static readonly ChartColor SequentialGreen2 = new("sequentialGreen2"); + public bool IsSequentialGreen2 => SequentialGreen2.Equals(Value); - public static readonly ChartColor SequentialGreen3 = new("sequentialGreen3"); - public bool IsSequentialGreen3 => SequentialGreen3.Equals(Value); + public static readonly ChartColor SequentialGreen3 = new("sequentialGreen3"); + public bool IsSequentialGreen3 => SequentialGreen3.Equals(Value); - public static readonly ChartColor SequentialGreen4 = new("sequentialGreen4"); - public bool IsSequentialGreen4 => SequentialGreen4.Equals(Value); + public static readonly ChartColor SequentialGreen4 = new("sequentialGreen4"); + public bool IsSequentialGreen4 => SequentialGreen4.Equals(Value); - public static readonly ChartColor SequentialGreen5 = new("sequentialGreen5"); - public bool IsSequentialGreen5 => SequentialGreen5.Equals(Value); + public static readonly ChartColor SequentialGreen5 = new("sequentialGreen5"); + public bool IsSequentialGreen5 => SequentialGreen5.Equals(Value); - public static readonly ChartColor SequentialGreen6 = new("sequentialGreen6"); - public bool IsSequentialGreen6 => SequentialGreen6.Equals(Value); + public static readonly ChartColor SequentialGreen6 = new("sequentialGreen6"); + public bool IsSequentialGreen6 => SequentialGreen6.Equals(Value); - public static readonly ChartColor SequentialGreen7 = new("sequentialGreen7"); - public bool IsSequentialGreen7 => SequentialGreen7.Equals(Value); + public static readonly ChartColor SequentialGreen7 = new("sequentialGreen7"); + public bool IsSequentialGreen7 => SequentialGreen7.Equals(Value); - public static readonly ChartColor SequentialGreen8 = new("sequentialGreen8"); - public bool IsSequentialGreen8 => SequentialGreen8.Equals(Value); + public static readonly ChartColor SequentialGreen8 = new("sequentialGreen8"); + public bool IsSequentialGreen8 => SequentialGreen8.Equals(Value); - public static readonly ChartColor SequentialYellow1 = new("sequentialYellow1"); - public bool IsSequentialYellow1 => SequentialYellow1.Equals(Value); + public static readonly ChartColor SequentialYellow1 = new("sequentialYellow1"); + public bool IsSequentialYellow1 => SequentialYellow1.Equals(Value); - public static readonly ChartColor SequentialYellow2 = new("sequentialYellow2"); - public bool IsSequentialYellow2 => SequentialYellow2.Equals(Value); + public static readonly ChartColor SequentialYellow2 = new("sequentialYellow2"); + public bool IsSequentialYellow2 => SequentialYellow2.Equals(Value); - public static readonly ChartColor SequentialYellow3 = new("sequentialYellow3"); - public bool IsSequentialYellow3 => SequentialYellow3.Equals(Value); + public static readonly ChartColor SequentialYellow3 = new("sequentialYellow3"); + public bool IsSequentialYellow3 => SequentialYellow3.Equals(Value); - public static readonly ChartColor SequentialYellow4 = new("sequentialYellow4"); - public bool IsSequentialYellow4 => SequentialYellow4.Equals(Value); + public static readonly ChartColor SequentialYellow4 = new("sequentialYellow4"); + public bool IsSequentialYellow4 => SequentialYellow4.Equals(Value); - public static readonly ChartColor SequentialYellow5 = new("sequentialYellow5"); - public bool IsSequentialYellow5 => SequentialYellow5.Equals(Value); + public static readonly ChartColor SequentialYellow5 = new("sequentialYellow5"); + public bool IsSequentialYellow5 => SequentialYellow5.Equals(Value); - public static readonly ChartColor SequentialYellow6 = new("sequentialYellow6"); - public bool IsSequentialYellow6 => SequentialYellow6.Equals(Value); + public static readonly ChartColor SequentialYellow6 = new("sequentialYellow6"); + public bool IsSequentialYellow6 => SequentialYellow6.Equals(Value); - public static readonly ChartColor SequentialYellow7 = new("sequentialYellow7"); - public bool IsSequentialYellow7 => SequentialYellow7.Equals(Value); + public static readonly ChartColor SequentialYellow7 = new("sequentialYellow7"); + public bool IsSequentialYellow7 => SequentialYellow7.Equals(Value); - public static readonly ChartColor SequentialYellow8 = new("sequentialYellow8"); - public bool IsSequentialYellow8 => SequentialYellow8.Equals(Value); + public static readonly ChartColor SequentialYellow8 = new("sequentialYellow8"); + public bool IsSequentialYellow8 => SequentialYellow8.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class DonutThickness(string value) : StringEnum(value, caseSensitive: false) { - public static readonly DonutThickness Thin = new("Thin"); - public bool IsThin => Thin.Equals(Value); + public static readonly DonutThickness Thin = new("Thin"); + public bool IsThin => Thin.Equals(Value); - public static readonly DonutThickness Thick = new("Thick"); - public bool IsThick => Thick.Equals(Value); + public static readonly DonutThickness Thick = new("Thick"); + public bool IsThick => Thick.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class HorizontalBarChartDisplayMode(string value) : StringEnum(value, caseSensitive: false) { - public static readonly HorizontalBarChartDisplayMode AbsoluteWithAxis = new("AbsoluteWithAxis"); - public bool IsAbsoluteWithAxis => AbsoluteWithAxis.Equals(Value); + public static readonly HorizontalBarChartDisplayMode AbsoluteWithAxis = new("AbsoluteWithAxis"); + public bool IsAbsoluteWithAxis => AbsoluteWithAxis.Equals(Value); - public static readonly HorizontalBarChartDisplayMode AbsoluteNoAxis = new("AbsoluteNoAxis"); - public bool IsAbsoluteNoAxis => AbsoluteNoAxis.Equals(Value); + public static readonly HorizontalBarChartDisplayMode AbsoluteNoAxis = new("AbsoluteNoAxis"); + public bool IsAbsoluteNoAxis => AbsoluteNoAxis.Equals(Value); - public static readonly HorizontalBarChartDisplayMode PartToWhole = new("PartToWhole"); - public bool IsPartToWhole => PartToWhole.Equals(Value); + public static readonly HorizontalBarChartDisplayMode PartToWhole = new("PartToWhole"); + public bool IsPartToWhole => PartToWhole.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class GaugeChartValueFormat(string value) : StringEnum(value, caseSensitive: false) { - public static readonly GaugeChartValueFormat Percentage = new("Percentage"); - public bool IsPercentage => Percentage.Equals(Value); + public static readonly GaugeChartValueFormat Percentage = new("Percentage"); + public bool IsPercentage => Percentage.Equals(Value); - public static readonly GaugeChartValueFormat Fraction = new("Fraction"); - public bool IsFraction => Fraction.Equals(Value); + public static readonly GaugeChartValueFormat Fraction = new("Fraction"); + public bool IsFraction => Fraction.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class CodeLanguage(string value) : StringEnum(value, caseSensitive: false) { - public static readonly CodeLanguage Bash = new("Bash"); - public bool IsBash => Bash.Equals(Value); + public static readonly CodeLanguage Bash = new("Bash"); + public bool IsBash => Bash.Equals(Value); - public static readonly CodeLanguage C = new("C"); - public bool IsC => C.Equals(Value); + public static readonly CodeLanguage C = new("C"); + public bool IsC => C.Equals(Value); - public static readonly CodeLanguage Cpp = new("Cpp"); - public bool IsCpp => Cpp.Equals(Value); + public static readonly CodeLanguage Cpp = new("Cpp"); + public bool IsCpp => Cpp.Equals(Value); - public static readonly CodeLanguage CSharp = new("CSharp"); - public bool IsCSharp => CSharp.Equals(Value); + public static readonly CodeLanguage CSharp = new("CSharp"); + public bool IsCSharp => CSharp.Equals(Value); - public static readonly CodeLanguage Css = new("Css"); - public bool IsCss => Css.Equals(Value); + public static readonly CodeLanguage Css = new("Css"); + public bool IsCss => Css.Equals(Value); - public static readonly CodeLanguage Dos = new("Dos"); - public bool IsDos => Dos.Equals(Value); + public static readonly CodeLanguage Dos = new("Dos"); + public bool IsDos => Dos.Equals(Value); - public static readonly CodeLanguage Go = new("Go"); - public bool IsGo => Go.Equals(Value); + public static readonly CodeLanguage Go = new("Go"); + public bool IsGo => Go.Equals(Value); - public static readonly CodeLanguage Graphql = new("Graphql"); - public bool IsGraphql => Graphql.Equals(Value); + public static readonly CodeLanguage Graphql = new("Graphql"); + public bool IsGraphql => Graphql.Equals(Value); - public static readonly CodeLanguage Html = new("Html"); - public bool IsHtml => Html.Equals(Value); + public static readonly CodeLanguage Html = new("Html"); + public bool IsHtml => Html.Equals(Value); - public static readonly CodeLanguage Java = new("Java"); - public bool IsJava => Java.Equals(Value); + public static readonly CodeLanguage Java = new("Java"); + public bool IsJava => Java.Equals(Value); - public static readonly CodeLanguage JavaScript = new("JavaScript"); - public bool IsJavaScript => JavaScript.Equals(Value); + public static readonly CodeLanguage JavaScript = new("JavaScript"); + public bool IsJavaScript => JavaScript.Equals(Value); - public static readonly CodeLanguage Json = new("Json"); - public bool IsJson => Json.Equals(Value); + public static readonly CodeLanguage Json = new("Json"); + public bool IsJson => Json.Equals(Value); - public static readonly CodeLanguage ObjectiveC = new("ObjectiveC"); - public bool IsObjectiveC => ObjectiveC.Equals(Value); + public static readonly CodeLanguage ObjectiveC = new("ObjectiveC"); + public bool IsObjectiveC => ObjectiveC.Equals(Value); - public static readonly CodeLanguage Perl = new("Perl"); - public bool IsPerl => Perl.Equals(Value); + public static readonly CodeLanguage Perl = new("Perl"); + public bool IsPerl => Perl.Equals(Value); - public static readonly CodeLanguage Php = new("Php"); - public bool IsPhp => Php.Equals(Value); + public static readonly CodeLanguage Php = new("Php"); + public bool IsPhp => Php.Equals(Value); - public static readonly CodeLanguage PlainText = new("PlainText"); - public bool IsPlainText => PlainText.Equals(Value); + public static readonly CodeLanguage PlainText = new("PlainText"); + public bool IsPlainText => PlainText.Equals(Value); - public static readonly CodeLanguage PowerShell = new("PowerShell"); - public bool IsPowerShell => PowerShell.Equals(Value); + public static readonly CodeLanguage PowerShell = new("PowerShell"); + public bool IsPowerShell => PowerShell.Equals(Value); - public static readonly CodeLanguage Python = new("Python"); - public bool IsPython => Python.Equals(Value); + public static readonly CodeLanguage Python = new("Python"); + public bool IsPython => Python.Equals(Value); - public static readonly CodeLanguage Sql = new("Sql"); - public bool IsSql => Sql.Equals(Value); + public static readonly CodeLanguage Sql = new("Sql"); + public bool IsSql => Sql.Equals(Value); - public static readonly CodeLanguage TypeScript = new("TypeScript"); - public bool IsTypeScript => TypeScript.Equals(Value); + public static readonly CodeLanguage TypeScript = new("TypeScript"); + public bool IsTypeScript => TypeScript.Equals(Value); - public static readonly CodeLanguage VbNet = new("VbNet"); - public bool IsVbNet => VbNet.Equals(Value); + public static readonly CodeLanguage VbNet = new("VbNet"); + public bool IsVbNet => VbNet.Equals(Value); - public static readonly CodeLanguage Verilog = new("Verilog"); - public bool IsVerilog => Verilog.Equals(Value); + public static readonly CodeLanguage Verilog = new("Verilog"); + public bool IsVerilog => Verilog.Equals(Value); - public static readonly CodeLanguage Vhdl = new("Vhdl"); - public bool IsVhdl => Vhdl.Equals(Value); + public static readonly CodeLanguage Vhdl = new("Vhdl"); + public bool IsVhdl => Vhdl.Equals(Value); - public static readonly CodeLanguage Xml = new("Xml"); - public bool IsXml => Xml.Equals(Value); + public static readonly CodeLanguage Xml = new("Xml"); + public bool IsXml => Xml.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class PersonaIconStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly PersonaIconStyle ProfilePicture = new("profilePicture"); - public bool IsProfilePicture => ProfilePicture.Equals(Value); + public static readonly PersonaIconStyle ProfilePicture = new("profilePicture"); + public bool IsProfilePicture => ProfilePicture.Equals(Value); - public static readonly PersonaIconStyle ContactCard = new("contactCard"); - public bool IsContactCard => ContactCard.Equals(Value); + public static readonly PersonaIconStyle ContactCard = new("contactCard"); + public bool IsContactCard => ContactCard.Equals(Value); - public static readonly PersonaIconStyle None = new("none"); - public bool IsNone => None.Equals(Value); + public static readonly PersonaIconStyle None = new("none"); + public bool IsNone => None.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class PersonaDisplayStyle(string value) : StringEnum(value, caseSensitive: false) { - public static readonly PersonaDisplayStyle IconAndName = new("iconAndName"); - public bool IsIconAndName => IconAndName.Equals(Value); + public static readonly PersonaDisplayStyle IconAndName = new("iconAndName"); + public bool IsIconAndName => IconAndName.Equals(Value); - public static readonly PersonaDisplayStyle IconOnly = new("iconOnly"); - public bool IsIconOnly => IconOnly.Equals(Value); + public static readonly PersonaDisplayStyle IconOnly = new("iconOnly"); + public bool IsIconOnly => IconOnly.Equals(Value); - public static readonly PersonaDisplayStyle NameOnly = new("nameOnly"); - public bool IsNameOnly => NameOnly.Equals(Value); + public static readonly PersonaDisplayStyle NameOnly = new("nameOnly"); + public bool IsNameOnly => NameOnly.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class FallbackElement(string value) : StringEnum(value, caseSensitive: false) { - public static readonly FallbackElement Drop = new("drop"); - public bool IsDrop => Drop.Equals(Value); + public static readonly FallbackElement Drop = new("drop"); + public bool IsDrop => Drop.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ImageSize(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ImageSize Small = new("Small"); - public bool IsSmall => Small.Equals(Value); + public static readonly ImageSize Small = new("Small"); + public bool IsSmall => Small.Equals(Value); - public static readonly ImageSize Medium = new("Medium"); - public bool IsMedium => Medium.Equals(Value); + public static readonly ImageSize Medium = new("Medium"); + public bool IsMedium => Medium.Equals(Value); - public static readonly ImageSize Large = new("Large"); - public bool IsLarge => Large.Equals(Value); + public static readonly ImageSize Large = new("Large"); + public bool IsLarge => Large.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class SizeEnum(string value) : StringEnum(value, caseSensitive: false) { - public static readonly SizeEnum Small = new("Small"); - public bool IsSmall => Small.Equals(Value); + public static readonly SizeEnum Small = new("Small"); + public bool IsSmall => Small.Equals(Value); - public static readonly SizeEnum Default = new("Default"); - public bool IsDefault => Default.Equals(Value); + public static readonly SizeEnum Default = new("Default"); + public bool IsDefault => Default.Equals(Value); - public static readonly SizeEnum Medium = new("Medium"); - public bool IsMedium => Medium.Equals(Value); + public static readonly SizeEnum Medium = new("Medium"); + public bool IsMedium => Medium.Equals(Value); - public static readonly SizeEnum Large = new("Large"); - public bool IsLarge => Large.Equals(Value); + public static readonly SizeEnum Large = new("Large"); + public bool IsLarge => Large.Equals(Value); - public static readonly SizeEnum ExtraLarge = new("ExtraLarge"); - public bool IsExtraLarge => ExtraLarge.Equals(Value); + public static readonly SizeEnum ExtraLarge = new("ExtraLarge"); + public bool IsExtraLarge => ExtraLarge.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class PopoverPosition(string value) : StringEnum(value, caseSensitive: false) { - public static readonly PopoverPosition Above = new("Above"); - public bool IsAbove => Above.Equals(Value); + public static readonly PopoverPosition Above = new("Above"); + public bool IsAbove => Above.Equals(Value); - public static readonly PopoverPosition Below = new("Below"); - public bool IsBelow => Below.Equals(Value); + public static readonly PopoverPosition Below = new("Below"); + public bool IsBelow => Below.Equals(Value); - public static readonly PopoverPosition Before = new("Before"); - public bool IsBefore => Before.Equals(Value); + public static readonly PopoverPosition Before = new("Before"); + public bool IsBefore => Before.Equals(Value); - public static readonly PopoverPosition After = new("After"); - public bool IsAfter => After.Equals(Value); + public static readonly PopoverPosition After = new("After"); + public bool IsAfter => After.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class FallbackAction(string value) : StringEnum(value, caseSensitive: false) { - public static readonly FallbackAction Drop = new("drop"); - public bool IsDrop => Drop.Equals(Value); + public static readonly FallbackAction Drop = new("drop"); + public bool IsDrop => Drop.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class ImageInsertPosition(string value) : StringEnum(value, caseSensitive: false) { - public static readonly ImageInsertPosition Selection = new("Selection"); - public bool IsSelection => Selection.Equals(Value); + public static readonly ImageInsertPosition Selection = new("Selection"); + public bool IsSelection => Selection.Equals(Value); - public static readonly ImageInsertPosition Top = new("Top"); - public bool IsTop => Top.Equals(Value); + public static readonly ImageInsertPosition Top = new("Top"); + public bool IsTop => Top.Equals(Value); - public static readonly ImageInsertPosition Bottom = new("Bottom"); - public bool IsBottom => Bottom.Equals(Value); + public static readonly ImageInsertPosition Bottom = new("Bottom"); + public bool IsBottom => Bottom.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class Version(string value) : StringEnum(value, caseSensitive: false) { - public static readonly Version Version1_0 = new("1.0"); - public bool IsVersion1_0 => Version1_0.Equals(Value); + public static readonly Version Version1_0 = new("1.0"); + public bool IsVersion1_0 => Version1_0.Equals(Value); - public static readonly Version Version1_1 = new("1.1"); - public bool IsVersion1_1 => Version1_1.Equals(Value); + public static readonly Version Version1_1 = new("1.1"); + public bool IsVersion1_1 => Version1_1.Equals(Value); - public static readonly Version Version1_2 = new("1.2"); - public bool IsVersion1_2 => Version1_2.Equals(Value); + public static readonly Version Version1_2 = new("1.2"); + public bool IsVersion1_2 => Version1_2.Equals(Value); - public static readonly Version Version1_3 = new("1.3"); - public bool IsVersion1_3 => Version1_3.Equals(Value); + public static readonly Version Version1_3 = new("1.3"); + public bool IsVersion1_3 => Version1_3.Equals(Value); - public static readonly Version Version1_4 = new("1.4"); - public bool IsVersion1_4 => Version1_4.Equals(Value); + public static readonly Version Version1_4 = new("1.4"); + public bool IsVersion1_4 => Version1_4.Equals(Value); - public static readonly Version Version1_5 = new("1.5"); - public bool IsVersion1_5 => Version1_5.Equals(Value); + public static readonly Version Version1_5 = new("1.5"); + public bool IsVersion1_5 => Version1_5.Equals(Value); - public static readonly Version Version1_6 = new("1.6"); - public bool IsVersion1_6 => Version1_6.Equals(Value); + public static readonly Version Version1_6 = new("1.6"); + public bool IsVersion1_6 => Version1_6.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class TeamsCardWidth(string value) : StringEnum(value, caseSensitive: false) { - public static readonly TeamsCardWidth Full = new("full"); - public bool IsFull => Full.Equals(Value); + public static readonly TeamsCardWidth Full = new("full"); + public bool IsFull => Full.Equals(Value); } [JsonConverter(typeof(JsonConverter))] public class MentionType(string value) : StringEnum(value, caseSensitive: false) { - public static readonly MentionType Person = new("Person"); - public bool IsPerson => Person.Equals(Value); + public static readonly MentionType Person = new("Person"); + public bool IsPerson => Person.Equals(Value); - public static readonly MentionType Tag = new("Tag"); - public bool IsTag => Tag.Equals(Value); + public static readonly MentionType Tag = new("Tag"); + public bool IsTag => Tag.Equals(Value); } internal record ObjectType(string[] DiscriminatorPropertyNames, string DiscriminatorValue, Type Type) { } -public abstract class SerializableObject {} +public abstract class SerializableObject { } internal sealed class CardElementJsonConverter : JsonConverter { - private static readonly List _typeMap = new() + private static readonly List _typeMap = new() { new ObjectType(["type"], "AdaptiveCard", typeof(AdaptiveCard)), new ObjectType(["type"], "ActionSet", typeof(ActionSet)), @@ -1061,46 +1061,46 @@ internal sealed class CardElementJsonConverter : JsonConverter new ObjectType(["type"], "Column", typeof(Column)), }; - public override CardElement? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TokenType == JsonTokenType.Null) return null; - - using var doc = JsonDocument.ParseValue(ref reader); - var root = doc.RootElement; - - foreach (var type in _typeMap) + public override CardElement? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - var discriminatorPropertyValues = new List(); + if (reader.TokenType == JsonTokenType.Null) return null; + + using var doc = JsonDocument.ParseValue(ref reader); + var root = doc.RootElement; - foreach (var propName in type.DiscriminatorPropertyNames) - { - if (root.TryGetProperty(propName, out var prop) && prop.ValueKind == JsonValueKind.String) + foreach (var type in _typeMap) { - discriminatorPropertyValues.Insert(0, prop.GetString()); + var discriminatorPropertyValues = new List(); + + foreach (var propName in type.DiscriminatorPropertyNames) + { + if (root.TryGetProperty(propName, out var prop) && prop.ValueKind == JsonValueKind.String) + { + discriminatorPropertyValues.Insert(0, prop.GetString()); + } + } + + if (string.Join("", discriminatorPropertyValues) == type.DiscriminatorValue) + { + return (CardElement?)JsonSerializer.Deserialize(root.GetRawText(), type.Type, options); + } } - } - if (string.Join("", discriminatorPropertyValues) == type.DiscriminatorValue) - { - return (CardElement?)JsonSerializer.Deserialize(root.GetRawText(), type.Type, options); - } + throw new NotSupportedException($"Unable to deserialize '{root.GetRawText()}'."); } - throw new NotSupportedException($"Unable to deserialize '{root.GetRawText()}'."); - } - - public override void Write(Utf8JsonWriter writer, CardElement value, JsonSerializerOptions options) - { - JsonSerializer.Serialize(writer, (object)value, value.GetType(), options); - } + public override void Write(Utf8JsonWriter writer, CardElement value, JsonSerializerOptions options) + { + JsonSerializer.Serialize(writer, (object)value, value.GetType(), options); + } } [JsonConverter(typeof(CardElementJsonConverter))] -public abstract class CardElement : SerializableObject {} +public abstract class CardElement : SerializableObject { } internal sealed class ActionJsonConverter : JsonConverter { - private static readonly List _typeMap = new() + private static readonly List _typeMap = new() { new ObjectType(["type"], "Action.Execute", typeof(ExecuteAction)), new ObjectType(["type"], "Action.InsertImage", typeof(InsertImageAction)), @@ -1113,413 +1113,427 @@ internal sealed class ActionJsonConverter : JsonConverter new ObjectType(["type"], "Action.Popover", typeof(PopoverAction)), }; - public override Action? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TokenType == JsonTokenType.Null) return null; - - using var doc = JsonDocument.ParseValue(ref reader); - var root = doc.RootElement; - - foreach (var type in _typeMap) + public override Action? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - var discriminatorPropertyValues = new List(); + if (reader.TokenType == JsonTokenType.Null) return null; + + using var doc = JsonDocument.ParseValue(ref reader); + var root = doc.RootElement; - foreach (var propName in type.DiscriminatorPropertyNames) - { - if (root.TryGetProperty(propName, out var prop) && prop.ValueKind == JsonValueKind.String) + foreach (var type in _typeMap) { - discriminatorPropertyValues.Insert(0, prop.GetString()); + var discriminatorPropertyValues = new List(); + + foreach (var propName in type.DiscriminatorPropertyNames) + { + if (root.TryGetProperty(propName, out var prop) && prop.ValueKind == JsonValueKind.String) + { + discriminatorPropertyValues.Insert(0, prop.GetString()); + } + } + + if (string.Join("", discriminatorPropertyValues) == type.DiscriminatorValue) + { + return (Action?)JsonSerializer.Deserialize(root.GetRawText(), type.Type, options); + } } - } - if (string.Join("", discriminatorPropertyValues) == type.DiscriminatorValue) - { - return (Action?)JsonSerializer.Deserialize(root.GetRawText(), type.Type, options); - } + throw new NotSupportedException($"Unable to deserialize '{root.GetRawText()}'."); } - throw new NotSupportedException($"Unable to deserialize '{root.GetRawText()}'."); - } - - public override void Write(Utf8JsonWriter writer, Action value, JsonSerializerOptions options) - { - JsonSerializer.Serialize(writer, (object)value, value.GetType(), options); - } + public override void Write(Utf8JsonWriter writer, Action value, JsonSerializerOptions options) + { + JsonSerializer.Serialize(writer, (object)value, value.GetType(), options); + } } [JsonConverter(typeof(ActionJsonConverter))] -public abstract class Action : SerializableObject {} +public abstract class Action : SerializableObject { } internal sealed class ContainerLayoutJsonConverter : JsonConverter { - private static readonly List _typeMap = new() + private static readonly List _typeMap = new() { new ObjectType(["type"], "Layout.Stack", typeof(StackLayout)), new ObjectType(["type"], "Layout.Flow", typeof(FlowLayout)), new ObjectType(["type"], "Layout.AreaGrid", typeof(AreaGridLayout)), }; - public override ContainerLayout? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TokenType == JsonTokenType.Null) return null; - - using var doc = JsonDocument.ParseValue(ref reader); - var root = doc.RootElement; - - foreach (var type in _typeMap) + public override ContainerLayout? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - var discriminatorPropertyValues = new List(); + if (reader.TokenType == JsonTokenType.Null) return null; + + using var doc = JsonDocument.ParseValue(ref reader); + var root = doc.RootElement; - foreach (var propName in type.DiscriminatorPropertyNames) - { - if (root.TryGetProperty(propName, out var prop) && prop.ValueKind == JsonValueKind.String) + foreach (var type in _typeMap) { - discriminatorPropertyValues.Insert(0, prop.GetString()); + var discriminatorPropertyValues = new List(); + + foreach (var propName in type.DiscriminatorPropertyNames) + { + if (root.TryGetProperty(propName, out var prop) && prop.ValueKind == JsonValueKind.String) + { + discriminatorPropertyValues.Insert(0, prop.GetString()); + } + } + + if (string.Join("", discriminatorPropertyValues) == type.DiscriminatorValue) + { + return (ContainerLayout?)JsonSerializer.Deserialize(root.GetRawText(), type.Type, options); + } } - } - if (string.Join("", discriminatorPropertyValues) == type.DiscriminatorValue) - { - return (ContainerLayout?)JsonSerializer.Deserialize(root.GetRawText(), type.Type, options); - } + throw new NotSupportedException($"Unable to deserialize '{root.GetRawText()}'."); } - throw new NotSupportedException($"Unable to deserialize '{root.GetRawText()}'."); - } - - public override void Write(Utf8JsonWriter writer, ContainerLayout value, JsonSerializerOptions options) - { - JsonSerializer.Serialize(writer, (object)value, value.GetType(), options); - } + public override void Write(Utf8JsonWriter writer, ContainerLayout value, JsonSerializerOptions options) + { + JsonSerializer.Serialize(writer, (object)value, value.GetType(), options); + } } [JsonConverter(typeof(ContainerLayoutJsonConverter))] -public abstract class ContainerLayout : SerializableObject {} +public abstract class ContainerLayout : SerializableObject { } /// /// An Adaptive Card, containing a free-form body of card elements, and an optional set of actions. /// public class AdaptiveCard : CardElement { - /// - /// Deserializes a JSON string into an object of type AdaptiveCard. - /// - public static AdaptiveCard? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **AdaptiveCard**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "AdaptiveCard"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - /// - [JsonPropertyName("style")] - public ContainerStyle? Style { get; set; } - - /// - /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. - /// - [JsonPropertyName("layouts")] - public IList? Layouts { get; set; } - - /// - /// The minimum height, in pixels, of the container, in the `px` format. - /// - [JsonPropertyName("minHeight")] - public string? MinHeight { get; set; } - - /// - /// Defines the container's background image. - /// - [JsonPropertyName("backgroundImage")] - public IUnion? BackgroundImage { get; set; } - - /// - /// Controls how the container's content should be vertically aligned. - /// - [JsonPropertyName("verticalContentAlignment")] - public VerticalAlignment? VerticalContentAlignment { get; set; } - - /// - /// Controls if the content of the card is to be rendered left-to-right or right-to-left. - /// - [JsonPropertyName("rtl")] - public bool? Rtl { get; set; } - - /// - /// A URL to the Adaptive Card schema the card is authored against. - /// - [JsonPropertyName("$schema")] - public string? Schema { get; set; } - - /// - /// The Adaptive Card schema version the card is authored against. - /// - [JsonPropertyName("version")] - public Version? Version { get; set; } = Version.Version1_5; - - /// - /// The text that should be displayed if the client is not able to render the card. - /// - [JsonPropertyName("fallbackText")] - public string? FallbackText { get; set; } - - /// - /// The text that should be spoken for the entire card. - /// - [JsonPropertyName("speak")] - public string? Speak { get; set; } - - /// - /// Defines how the card can be refreshed by making a request to the target Bot. - /// - [JsonPropertyName("refresh")] - public RefreshDefinition? Refresh { get; set; } - - /// - /// Defines authentication information to enable on-behalf-of single-sign-on or just-in-time OAuth. This information is used in conjunction with the refresh property and Action.Execute in general. - /// - [JsonPropertyName("authentication")] - public Authentication? Authentication { get; set; } - - /// - /// Teams-specific metadata associated with the card. - /// - [JsonPropertyName("msteams")] - public TeamsCardProperties? Msteams { get; set; } - - /// - /// Teams-specific metadata associated with the card. Equivalent to `msteams`. - /// - [JsonPropertyName("msTeams")] - public TeamsCardProperties? MsTeams { get; set; } - - /// - /// Metadata associated with the card. - /// - [JsonPropertyName("metadata")] - public CardMetadata? Metadata { get; set; } - - /// - /// Resources card elements can reference. - /// - [JsonPropertyName("resources")] - public Resources? Resources { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The body of the card, comprised of a list of elements displayed according to the layouts property. If the layouts property is not specified, a Layout.Stack is used. - /// - [JsonPropertyName("body")] - public IList? Body { get; set; } - - /// - /// The card level actions, which always appear at the bottom of the card. - /// - [JsonPropertyName("actions")] - public IList? Actions { get; set; } - - public AdaptiveCard(params IList body) - { - this.Body = body; - } + /// + /// Deserializes a JSON string into an object of type AdaptiveCard. + /// + public static AdaptiveCard? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } - /// - /// Serializes this AdaptiveCard into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public AdaptiveCard WithKey(string value) { - this.Key = value; - return this; - } - - public AdaptiveCard WithId(string value) { - this.Id = value; - return this; - } - - public AdaptiveCard WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public AdaptiveCard WithLang(string value) { - this.Lang = value; - return this; - } - - public AdaptiveCard WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public AdaptiveCard WithSelectAction(Action value) { - this.SelectAction = value; - return this; - } - - public AdaptiveCard WithStyle(ContainerStyle value) { - this.Style = value; - return this; - } - - public AdaptiveCard WithLayouts(params IList value) { - this.Layouts = value; - return this; - } - - public AdaptiveCard WithMinHeight(string value) { - this.MinHeight = value; - return this; - } - - public AdaptiveCard WithBackgroundImage(IUnion value) { - this.BackgroundImage = value; - return this; - } - - public AdaptiveCard WithVerticalContentAlignment(VerticalAlignment value) { - this.VerticalContentAlignment = value; - return this; - } - - public AdaptiveCard WithRtl(bool value) { - this.Rtl = value; - return this; - } - - public AdaptiveCard WithSchema(string value) { - this.Schema = value; - return this; - } - - public AdaptiveCard WithVersion(Version value) { - this.Version = value; - return this; - } - - public AdaptiveCard WithFallbackText(string value) { - this.FallbackText = value; - return this; - } - - public AdaptiveCard WithSpeak(string value) { - this.Speak = value; - return this; - } - - public AdaptiveCard WithRefresh(RefreshDefinition value) { - this.Refresh = value; - return this; - } - - public AdaptiveCard WithAuthentication(Authentication value) { - this.Authentication = value; - return this; - } - - public AdaptiveCard WithMsteams(TeamsCardProperties value) { - this.Msteams = value; - return this; - } - - public AdaptiveCard WithMsTeams(TeamsCardProperties value) { - this.MsTeams = value; - return this; - } - - public AdaptiveCard WithMetadata(CardMetadata value) { - this.Metadata = value; - return this; - } - - public AdaptiveCard WithResources(Resources value) { - this.Resources = value; - return this; - } - - public AdaptiveCard WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public AdaptiveCard WithFallback(IUnion value) { - this.Fallback = value; - return this; - } - - public AdaptiveCard WithBody(params IList value) { - this.Body = value; - return this; - } - - public AdaptiveCard WithActions(params IList value) { - this.Actions = value; - return this; - } + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **AdaptiveCard**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "AdaptiveCard"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + /// + [JsonPropertyName("style")] + public ContainerStyle? Style { get; set; } + + /// + /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. + /// + [JsonPropertyName("layouts")] + public IList? Layouts { get; set; } + + /// + /// The minimum height, in pixels, of the container, in the `px` format. + /// + [JsonPropertyName("minHeight")] + public string? MinHeight { get; set; } + + /// + /// Defines the container's background image. + /// + [JsonPropertyName("backgroundImage")] + public IUnion? BackgroundImage { get; set; } + + /// + /// Controls how the container's content should be vertically aligned. + /// + [JsonPropertyName("verticalContentAlignment")] + public VerticalAlignment? VerticalContentAlignment { get; set; } + + /// + /// Controls if the content of the card is to be rendered left-to-right or right-to-left. + /// + [JsonPropertyName("rtl")] + public bool? Rtl { get; set; } + + /// + /// A URL to the Adaptive Card schema the card is authored against. + /// + [JsonPropertyName("$schema")] + public string? Schema { get; set; } + + /// + /// The Adaptive Card schema version the card is authored against. + /// + [JsonPropertyName("version")] + public Version? Version { get; set; } = Version.Version1_5; + + /// + /// The text that should be displayed if the client is not able to render the card. + /// + [JsonPropertyName("fallbackText")] + public string? FallbackText { get; set; } + + /// + /// The text that should be spoken for the entire card. + /// + [JsonPropertyName("speak")] + public string? Speak { get; set; } + + /// + /// Defines how the card can be refreshed by making a request to the target Bot. + /// + [JsonPropertyName("refresh")] + public RefreshDefinition? Refresh { get; set; } + + /// + /// Defines authentication information to enable on-behalf-of single-sign-on or just-in-time OAuth. This information is used in conjunction with the refresh property and Action.Execute in general. + /// + [JsonPropertyName("authentication")] + public Authentication? Authentication { get; set; } + + /// + /// Teams-specific metadata associated with the card. + /// + [JsonPropertyName("msteams")] + public TeamsCardProperties? Msteams { get; set; } + + /// + /// Metadata associated with the card. + /// + [JsonPropertyName("metadata")] + public CardMetadata? Metadata { get; set; } + + /// + /// Resources card elements can reference. + /// + [JsonPropertyName("resources")] + public Resources? Resources { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The body of the card, comprised of a list of elements displayed according to the layouts property. If the layouts property is not specified, a Layout.Stack is used. + /// + [JsonPropertyName("body")] + public IList? Body { get; set; } + + /// + /// The card level actions, which always appear at the bottom of the card. + /// + [JsonPropertyName("actions")] + public IList? Actions { get; set; } + + public AdaptiveCard(params IList body) + { + this.Body = body; + } + + /// + /// Serializes this AdaptiveCard into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public AdaptiveCard WithKey(string value) + { + this.Key = value; + return this; + } + + public AdaptiveCard WithId(string value) + { + this.Id = value; + return this; + } + + public AdaptiveCard WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public AdaptiveCard WithLang(string value) + { + this.Lang = value; + return this; + } + + public AdaptiveCard WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public AdaptiveCard WithSelectAction(Action value) + { + this.SelectAction = value; + return this; + } + + public AdaptiveCard WithStyle(ContainerStyle value) + { + this.Style = value; + return this; + } + + public AdaptiveCard WithLayouts(params IList value) + { + this.Layouts = value; + return this; + } + + public AdaptiveCard WithMinHeight(string value) + { + this.MinHeight = value; + return this; + } + + public AdaptiveCard WithBackgroundImage(IUnion value) + { + this.BackgroundImage = value; + return this; + } + + public AdaptiveCard WithVerticalContentAlignment(VerticalAlignment value) + { + this.VerticalContentAlignment = value; + return this; + } + + public AdaptiveCard WithRtl(bool value) + { + this.Rtl = value; + return this; + } + + public AdaptiveCard WithSchema(string value) + { + this.Schema = value; + return this; + } + + public AdaptiveCard WithVersion(Version value) + { + this.Version = value; + return this; + } + + public AdaptiveCard WithFallbackText(string value) + { + this.FallbackText = value; + return this; + } + + public AdaptiveCard WithSpeak(string value) + { + this.Speak = value; + return this; + } + + public AdaptiveCard WithRefresh(RefreshDefinition value) + { + this.Refresh = value; + return this; + } + + public AdaptiveCard WithAuthentication(Authentication value) + { + this.Authentication = value; + return this; + } + + public AdaptiveCard WithMsteams(TeamsCardProperties value) + { + this.Msteams = value; + return this; + } + + public AdaptiveCard WithMetadata(CardMetadata value) + { + this.Metadata = value; + return this; + } + + public AdaptiveCard WithResources(Resources value) + { + this.Resources = value; + return this; + } + + public AdaptiveCard WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public AdaptiveCard WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } + + public AdaptiveCard WithBody(params IList value) + { + this.Body = value; + return this; + } + + public AdaptiveCard WithActions(params IList value) + { + this.Actions = value; + return this; + } } /// @@ -1527,41 +1541,42 @@ public AdaptiveCard WithActions(params IList value) { /// public class HostCapabilities : SerializableObject { - /// - /// Deserializes a JSON string into an object of type HostCapabilities. - /// - public static HostCapabilities? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Serializes this HostCapabilities into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public HostCapabilities WithKey(string value) { - this.Key = value; - return this; - } - [JsonExtensionData] - public IDictionary NonSchemaProperties { get; set; } = new Dictionary(); + /// + /// Deserializes a JSON string into an object of type HostCapabilities. + /// + public static HostCapabilities? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Serializes this HostCapabilities into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public HostCapabilities WithKey(string value) + { + this.Key = value; + return this; + } + [JsonExtensionData] + public IDictionary NonSchemaProperties { get; set; } = new Dictionary(); } /// @@ -1569,14182 +1584,15196 @@ public HostCapabilities WithKey(string value) { /// public class ExecuteAction : Action { - /// - /// Deserializes a JSON string into an object of type ExecuteAction. - /// - public static ExecuteAction? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Action.Execute**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Action.Execute"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The title of the action, as it appears on buttons. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - /// - /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. - /// - [JsonPropertyName("iconUrl")] - public string? IconUrl { get; set; } - - /// - /// Control the style of the action, affecting its visual and spoken representations. - /// - [JsonPropertyName("style")] - public ActionStyle? Style { get; set; } = ActionStyle.Default; - - /// - /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. - /// - [JsonPropertyName("mode")] - public ActionMode? Mode { get; set; } = ActionMode.Primary; - - /// - /// The tooltip text to display when the action is hovered over. - /// - [JsonPropertyName("tooltip")] - public string? Tooltip { get; set; } - - /// - /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. - /// - [JsonPropertyName("isEnabled")] - public bool? IsEnabled { get; set; } = true; - - /// - /// The actions to display in the overflow menu of a Split action button. - /// - [JsonPropertyName("menuActions")] - public IList? MenuActions { get; set; } - - /// - /// A set of theme-specific icon URLs. - /// - [JsonPropertyName("themedIconUrls")] - public IList? ThemedIconUrls { get; set; } - - /// - /// The data to send to the Bot when the action is executed. When expressed as an object, `data` is sent back to the Bot when the action is executed, adorned with the values of the inputs expressed as key/value pairs, where the key is the Id of the input. If `data` is expressed as a string, input values are not sent to the Bot. - /// - [JsonPropertyName("data")] - public IUnion? Data { get; set; } - - /// - /// The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("associatedInputs")] - public AssociatedInputs? AssociatedInputs { get; set; } - - /// - /// Controls if the action is enabled only if at least one required input has been filled by the user. - /// - [JsonPropertyName("conditionallyEnabled")] - public bool? ConditionallyEnabled { get; set; } = false; - - /// - /// The verb of the action. - /// - [JsonPropertyName("verb")] - public string? Verb { get; set; } - - /// - /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ExecuteAction into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ExecuteAction WithKey(string value) { - this.Key = value; - return this; - } - - public ExecuteAction WithId(string value) { - this.Id = value; - return this; - } - - public ExecuteAction WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public ExecuteAction WithTitle(string value) { - this.Title = value; - return this; - } - - public ExecuteAction WithIconUrl(string value) { - this.IconUrl = value; - return this; - } - - public ExecuteAction WithStyle(ActionStyle value) { - this.Style = value; - return this; - } - - public ExecuteAction WithMode(ActionMode value) { - this.Mode = value; - return this; - } - - public ExecuteAction WithTooltip(string value) { - this.Tooltip = value; - return this; - } - - public ExecuteAction WithIsEnabled(bool value) { - this.IsEnabled = value; - return this; - } - - public ExecuteAction WithMenuActions(params IList value) { - this.MenuActions = value; - return this; - } - - public ExecuteAction WithThemedIconUrls(params IList value) { - this.ThemedIconUrls = value; - return this; - } - - public ExecuteAction WithData(IUnion value) { - this.Data = value; - return this; - } - - public ExecuteAction WithAssociatedInputs(AssociatedInputs value) { - this.AssociatedInputs = value; - return this; - } - - public ExecuteAction WithConditionallyEnabled(bool value) { - this.ConditionallyEnabled = value; - return this; - } - - public ExecuteAction WithVerb(string value) { - this.Verb = value; - return this; - } - - public ExecuteAction WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + /// + /// Deserializes a JSON string into an object of type ExecuteAction. + /// + public static ExecuteAction? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } -/// -/// Inserts an image into the host application's canvas. -/// -public class InsertImageAction : Action -{ - /// - /// Deserializes a JSON string into an object of type InsertImageAction. - /// - public static InsertImageAction? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Action.InsertImage**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Action.InsertImage"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The title of the action, as it appears on buttons. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - /// - /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. - /// - [JsonPropertyName("iconUrl")] - public string? IconUrl { get; set; } - - /// - /// Control the style of the action, affecting its visual and spoken representations. - /// - [JsonPropertyName("style")] - public ActionStyle? Style { get; set; } = ActionStyle.Default; - - /// - /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. - /// - [JsonPropertyName("mode")] - public ActionMode? Mode { get; set; } = ActionMode.Primary; - - /// - /// The tooltip text to display when the action is hovered over. - /// - [JsonPropertyName("tooltip")] - public string? Tooltip { get; set; } - - /// - /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. - /// - [JsonPropertyName("isEnabled")] - public bool? IsEnabled { get; set; } = true; - - /// - /// The actions to display in the overflow menu of a Split action button. - /// - [JsonPropertyName("menuActions")] - public IList? MenuActions { get; set; } - - /// - /// A set of theme-specific icon URLs. - /// - [JsonPropertyName("themedIconUrls")] - public IList? ThemedIconUrls { get; set; } - - /// - /// The URL of the image to insert. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The alternate text for the image. - /// - [JsonPropertyName("altText")] - public string? AltText { get; set; } - - /// - /// The position at which to insert the image. - /// - [JsonPropertyName("insertPosition")] - public ImageInsertPosition? InsertPosition { get; set; } = ImageInsertPosition.Selection; - - /// - /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this InsertImageAction into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public InsertImageAction WithKey(string value) { - this.Key = value; - return this; - } - - public InsertImageAction WithId(string value) { - this.Id = value; - return this; - } - - public InsertImageAction WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public InsertImageAction WithTitle(string value) { - this.Title = value; - return this; - } - - public InsertImageAction WithIconUrl(string value) { - this.IconUrl = value; - return this; - } - - public InsertImageAction WithStyle(ActionStyle value) { - this.Style = value; - return this; - } - - public InsertImageAction WithMode(ActionMode value) { - this.Mode = value; - return this; - } - - public InsertImageAction WithTooltip(string value) { - this.Tooltip = value; - return this; - } - - public InsertImageAction WithIsEnabled(bool value) { - this.IsEnabled = value; - return this; - } - - public InsertImageAction WithMenuActions(params IList value) { - this.MenuActions = value; - return this; - } - - public InsertImageAction WithThemedIconUrls(params IList value) { - this.ThemedIconUrls = value; - return this; - } - - public InsertImageAction WithUrl(string value) { - this.Url = value; - return this; - } - - public InsertImageAction WithAltText(string value) { - this.AltText = value; - return this; - } - - public InsertImageAction WithInsertPosition(ImageInsertPosition value) { - this.InsertPosition = value; - return this; - } - - public InsertImageAction WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Action.Execute**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Action.Execute"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The title of the action, as it appears on buttons. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + /// + /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + /// + [JsonPropertyName("iconUrl")] + public string? IconUrl { get; set; } + + /// + /// Control the style of the action, affecting its visual and spoken representations. + /// + [JsonPropertyName("style")] + public ActionStyle? Style { get; set; } = ActionStyle.Default; + + /// + /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + /// + [JsonPropertyName("mode")] + public ActionMode? Mode { get; set; } = ActionMode.Primary; + + /// + /// The tooltip text to display when the action is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + /// + [JsonPropertyName("isEnabled")] + public bool? IsEnabled { get; set; } = true; + + /// + /// The actions to display in the overflow menu of a Split action button. + /// + [JsonPropertyName("menuActions")] + public IList? MenuActions { get; set; } + + /// + /// A set of theme-specific icon URLs. + /// + [JsonPropertyName("themedIconUrls")] + public IList? ThemedIconUrls { get; set; } + + /// + /// The data to send to the Bot when the action is executed. When expressed as an object, `data` is sent back to the Bot when the action is executed, adorned with the values of the inputs expressed as key/value pairs, where the key is the Id of the input. If `data` is expressed as a string, input values are not sent to the Bot. + /// + [JsonPropertyName("data")] + public IUnion? Data { get; set; } + + /// + /// The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("associatedInputs")] + public AssociatedInputs? AssociatedInputs { get; set; } + + /// + /// Controls if the action is enabled only if at least one required input has been filled by the user. + /// + [JsonPropertyName("conditionallyEnabled")] + public bool? ConditionallyEnabled { get; set; } = false; + + /// + /// The verb of the action. + /// + [JsonPropertyName("verb")] + public string? Verb { get; set; } + + /// + /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ExecuteAction into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } -/// -/// Opens the provided URL in either a separate browser tab or within the host application. -/// -public class OpenUrlAction : Action -{ - /// - /// Deserializes a JSON string into an object of type OpenUrlAction. - /// - public static OpenUrlAction? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Action.OpenUrl**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Action.OpenUrl"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The title of the action, as it appears on buttons. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - /// - /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. - /// - [JsonPropertyName("iconUrl")] - public string? IconUrl { get; set; } - - /// - /// Control the style of the action, affecting its visual and spoken representations. - /// - [JsonPropertyName("style")] - public ActionStyle? Style { get; set; } = ActionStyle.Default; - - /// - /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. - /// - [JsonPropertyName("mode")] - public ActionMode? Mode { get; set; } = ActionMode.Primary; - - /// - /// The tooltip text to display when the action is hovered over. - /// - [JsonPropertyName("tooltip")] - public string? Tooltip { get; set; } - - /// - /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. - /// - [JsonPropertyName("isEnabled")] - public bool? IsEnabled { get; set; } = true; - - /// - /// The actions to display in the overflow menu of a Split action button. - /// - [JsonPropertyName("menuActions")] - public IList? MenuActions { get; set; } - - /// - /// A set of theme-specific icon URLs. - /// - [JsonPropertyName("themedIconUrls")] - public IList? ThemedIconUrls { get; set; } - - /// - /// The URL to open. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - public OpenUrlAction(string url) - { - this.Url = url; - } + public ExecuteAction WithKey(string value) + { + this.Key = value; + return this; + } - /// - /// Serializes this OpenUrlAction into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public OpenUrlAction WithKey(string value) { - this.Key = value; - return this; - } - - public OpenUrlAction WithId(string value) { - this.Id = value; - return this; - } - - public OpenUrlAction WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public OpenUrlAction WithTitle(string value) { - this.Title = value; - return this; - } - - public OpenUrlAction WithIconUrl(string value) { - this.IconUrl = value; - return this; - } - - public OpenUrlAction WithStyle(ActionStyle value) { - this.Style = value; - return this; - } - - public OpenUrlAction WithMode(ActionMode value) { - this.Mode = value; - return this; - } - - public OpenUrlAction WithTooltip(string value) { - this.Tooltip = value; - return this; - } - - public OpenUrlAction WithIsEnabled(bool value) { - this.IsEnabled = value; - return this; - } - - public OpenUrlAction WithMenuActions(params IList value) { - this.MenuActions = value; - return this; - } - - public OpenUrlAction WithThemedIconUrls(params IList value) { - this.ThemedIconUrls = value; - return this; - } - - public OpenUrlAction WithUrl(string value) { - this.Url = value; - return this; - } - - public OpenUrlAction WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public ExecuteAction WithId(string value) + { + this.Id = value; + return this; + } -/// -/// Opens a task module in a modal dialog hosting the content at a provided URL. -/// -public class OpenUrlDialogAction : Action -{ - /// - /// Deserializes a JSON string into an object of type OpenUrlDialogAction. - /// - public static OpenUrlDialogAction? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Action.OpenUrlDialog**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Action.OpenUrlDialog"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The title of the action, as it appears on buttons. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - /// - /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. - /// - [JsonPropertyName("iconUrl")] - public string? IconUrl { get; set; } - - /// - /// Control the style of the action, affecting its visual and spoken representations. - /// - [JsonPropertyName("style")] - public ActionStyle? Style { get; set; } = ActionStyle.Default; - - /// - /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. - /// - [JsonPropertyName("mode")] - public ActionMode? Mode { get; set; } = ActionMode.Primary; - - /// - /// The tooltip text to display when the action is hovered over. - /// - [JsonPropertyName("tooltip")] - public string? Tooltip { get; set; } - - /// - /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. - /// - [JsonPropertyName("isEnabled")] - public bool? IsEnabled { get; set; } = true; - - /// - /// The actions to display in the overflow menu of a Split action button. - /// - [JsonPropertyName("menuActions")] - public IList? MenuActions { get; set; } - - /// - /// A set of theme-specific icon URLs. - /// - [JsonPropertyName("themedIconUrls")] - public IList? ThemedIconUrls { get; set; } - - /// - /// The title of the dialog to be displayed in the dialog header. - /// - [JsonPropertyName("dialogTitle")] - public string? DialogTitle { get; set; } - - /// - /// The height of the dialog. To define height as a number of pixels, use the px format. - /// - [JsonPropertyName("dialogHeight")] - public string? DialogHeight { get; set; } - - /// - /// The width of the dialog. To define width as a number of pixels, use the px format. - /// - [JsonPropertyName("dialogWidth")] - public string? DialogWidth { get; set; } - - /// - /// The URL to open. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this OpenUrlDialogAction into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public OpenUrlDialogAction WithKey(string value) { - this.Key = value; - return this; - } - - public OpenUrlDialogAction WithId(string value) { - this.Id = value; - return this; - } - - public OpenUrlDialogAction WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public OpenUrlDialogAction WithTitle(string value) { - this.Title = value; - return this; - } - - public OpenUrlDialogAction WithIconUrl(string value) { - this.IconUrl = value; - return this; - } - - public OpenUrlDialogAction WithStyle(ActionStyle value) { - this.Style = value; - return this; - } - - public OpenUrlDialogAction WithMode(ActionMode value) { - this.Mode = value; - return this; - } - - public OpenUrlDialogAction WithTooltip(string value) { - this.Tooltip = value; - return this; - } - - public OpenUrlDialogAction WithIsEnabled(bool value) { - this.IsEnabled = value; - return this; - } - - public OpenUrlDialogAction WithMenuActions(params IList value) { - this.MenuActions = value; - return this; - } - - public OpenUrlDialogAction WithThemedIconUrls(params IList value) { - this.ThemedIconUrls = value; - return this; - } - - public OpenUrlDialogAction WithDialogTitle(string value) { - this.DialogTitle = value; - return this; - } - - public OpenUrlDialogAction WithDialogHeight(string value) { - this.DialogHeight = value; - return this; - } - - public OpenUrlDialogAction WithDialogWidth(string value) { - this.DialogWidth = value; - return this; - } - - public OpenUrlDialogAction WithUrl(string value) { - this.Url = value; - return this; - } - - public OpenUrlDialogAction WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public ExecuteAction WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } -/// -/// Resets the values of the inputs in the card. -/// -public class ResetInputsAction : Action -{ - /// - /// Deserializes a JSON string into an object of type ResetInputsAction. - /// - public static ResetInputsAction? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Action.ResetInputs**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Action.ResetInputs"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The title of the action, as it appears on buttons. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - /// - /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. - /// - [JsonPropertyName("iconUrl")] - public string? IconUrl { get; set; } - - /// - /// Control the style of the action, affecting its visual and spoken representations. - /// - [JsonPropertyName("style")] - public ActionStyle? Style { get; set; } = ActionStyle.Default; - - /// - /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. - /// - [JsonPropertyName("mode")] - public ActionMode? Mode { get; set; } = ActionMode.Primary; - - /// - /// The tooltip text to display when the action is hovered over. - /// - [JsonPropertyName("tooltip")] - public string? Tooltip { get; set; } - - /// - /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. - /// - [JsonPropertyName("isEnabled")] - public bool? IsEnabled { get; set; } = true; - - /// - /// The actions to display in the overflow menu of a Split action button. - /// - [JsonPropertyName("menuActions")] - public IList? MenuActions { get; set; } - - /// - /// A set of theme-specific icon URLs. - /// - [JsonPropertyName("themedIconUrls")] - public IList? ThemedIconUrls { get; set; } - - /// - /// The Ids of the inputs that should be reset. - /// - [JsonPropertyName("targetInputIds")] - public IList? TargetInputIds { get; set; } - - /// - /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ResetInputsAction into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ResetInputsAction WithKey(string value) { - this.Key = value; - return this; - } - - public ResetInputsAction WithId(string value) { - this.Id = value; - return this; - } - - public ResetInputsAction WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public ResetInputsAction WithTitle(string value) { - this.Title = value; - return this; - } - - public ResetInputsAction WithIconUrl(string value) { - this.IconUrl = value; - return this; - } - - public ResetInputsAction WithStyle(ActionStyle value) { - this.Style = value; - return this; - } - - public ResetInputsAction WithMode(ActionMode value) { - this.Mode = value; - return this; - } - - public ResetInputsAction WithTooltip(string value) { - this.Tooltip = value; - return this; - } - - public ResetInputsAction WithIsEnabled(bool value) { - this.IsEnabled = value; - return this; - } - - public ResetInputsAction WithMenuActions(params IList value) { - this.MenuActions = value; - return this; - } - - public ResetInputsAction WithThemedIconUrls(params IList value) { - this.ThemedIconUrls = value; - return this; - } - - public ResetInputsAction WithTargetInputIds(params IList value) { - this.TargetInputIds = value; - return this; - } - - public ResetInputsAction WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public ExecuteAction WithTitle(string value) + { + this.Title = value; + return this; + } -/// -/// Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can only acknowledge is has received the request. -/// -public class SubmitAction : Action -{ - /// - /// Deserializes a JSON string into an object of type SubmitAction. - /// - public static SubmitAction? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Action.Submit**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Action.Submit"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The title of the action, as it appears on buttons. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - /// - /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. - /// - [JsonPropertyName("iconUrl")] - public string? IconUrl { get; set; } - - /// - /// Control the style of the action, affecting its visual and spoken representations. - /// - [JsonPropertyName("style")] - public ActionStyle? Style { get; set; } = ActionStyle.Default; - - /// - /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. - /// - [JsonPropertyName("mode")] - public ActionMode? Mode { get; set; } = ActionMode.Primary; - - /// - /// The tooltip text to display when the action is hovered over. - /// - [JsonPropertyName("tooltip")] - public string? Tooltip { get; set; } - - /// - /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. - /// - [JsonPropertyName("isEnabled")] - public bool? IsEnabled { get; set; } = true; - - /// - /// The actions to display in the overflow menu of a Split action button. - /// - [JsonPropertyName("menuActions")] - public IList? MenuActions { get; set; } - - /// - /// A set of theme-specific icon URLs. - /// - [JsonPropertyName("themedIconUrls")] - public IList? ThemedIconUrls { get; set; } - - /// - /// The data to send to the Bot when the action is executed. When expressed as an object, `data` is sent back to the Bot when the action is executed, adorned with the values of the inputs expressed as key/value pairs, where the key is the Id of the input. If `data` is expressed as a string, input values are not sent to the Bot. - /// - [JsonPropertyName("data")] - public IUnion? Data { get; set; } - - /// - /// The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("associatedInputs")] - public AssociatedInputs? AssociatedInputs { get; set; } - - /// - /// Controls if the action is enabled only if at least one required input has been filled by the user. - /// - [JsonPropertyName("conditionallyEnabled")] - public bool? ConditionallyEnabled { get; set; } = false; - - /// - /// Teams-specific metadata associated with the action. - /// - [JsonPropertyName("msteams")] - public TeamsSubmitActionProperties? Msteams { get; set; } - - /// - /// Teams-specific metadata associated with the action. Equivalent to `msteams`. - /// - [JsonPropertyName("msTeams")] - public TeamsSubmitActionProperties? MsTeams { get; set; } - - /// - /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this SubmitAction into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public SubmitAction WithKey(string value) { - this.Key = value; - return this; - } - - public SubmitAction WithId(string value) { - this.Id = value; - return this; - } - - public SubmitAction WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public SubmitAction WithTitle(string value) { - this.Title = value; - return this; - } - - public SubmitAction WithIconUrl(string value) { - this.IconUrl = value; - return this; - } - - public SubmitAction WithStyle(ActionStyle value) { - this.Style = value; - return this; - } - - public SubmitAction WithMode(ActionMode value) { - this.Mode = value; - return this; - } - - public SubmitAction WithTooltip(string value) { - this.Tooltip = value; - return this; - } - - public SubmitAction WithIsEnabled(bool value) { - this.IsEnabled = value; - return this; - } - - public SubmitAction WithMenuActions(params IList value) { - this.MenuActions = value; - return this; - } - - public SubmitAction WithThemedIconUrls(params IList value) { - this.ThemedIconUrls = value; - return this; - } - - public SubmitAction WithData(IUnion value) { - this.Data = value; - return this; - } - - public SubmitAction WithAssociatedInputs(AssociatedInputs value) { - this.AssociatedInputs = value; - return this; - } - - public SubmitAction WithConditionallyEnabled(bool value) { - this.ConditionallyEnabled = value; - return this; - } - - public SubmitAction WithMsteams(TeamsSubmitActionProperties value) { - this.Msteams = value; - return this; - } - - public SubmitAction WithMsTeams(TeamsSubmitActionProperties value) { - this.MsTeams = value; - return this; - } - - public SubmitAction WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public ExecuteAction WithIconUrl(string value) + { + this.IconUrl = value; + return this; + } -/// -/// Toggles the visibility of a set of elements. Action.ToggleVisibility is useful for creating "Show more" type UI patterns. -/// -public class ToggleVisibilityAction : Action -{ - /// - /// Deserializes a JSON string into an object of type ToggleVisibilityAction. - /// - public static ToggleVisibilityAction? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Action.ToggleVisibility**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Action.ToggleVisibility"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The title of the action, as it appears on buttons. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - /// - /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. - /// - [JsonPropertyName("iconUrl")] - public string? IconUrl { get; set; } - - /// - /// Control the style of the action, affecting its visual and spoken representations. - /// - [JsonPropertyName("style")] - public ActionStyle? Style { get; set; } = ActionStyle.Default; - - /// - /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. - /// - [JsonPropertyName("mode")] - public ActionMode? Mode { get; set; } = ActionMode.Primary; - - /// - /// The tooltip text to display when the action is hovered over. - /// - [JsonPropertyName("tooltip")] - public string? Tooltip { get; set; } - - /// - /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. - /// - [JsonPropertyName("isEnabled")] - public bool? IsEnabled { get; set; } = true; - - /// - /// The actions to display in the overflow menu of a Split action button. - /// - [JsonPropertyName("menuActions")] - public IList? MenuActions { get; set; } - - /// - /// A set of theme-specific icon URLs. - /// - [JsonPropertyName("themedIconUrls")] - public IList? ThemedIconUrls { get; set; } - - /// - /// The Ids of the elements to toggle the visibility of. - /// - [JsonPropertyName("targetElements")] - public IUnion, IList>? TargetElements { get; set; } - - /// - /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ToggleVisibilityAction into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ToggleVisibilityAction WithKey(string value) { - this.Key = value; - return this; - } - - public ToggleVisibilityAction WithId(string value) { - this.Id = value; - return this; - } - - public ToggleVisibilityAction WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public ToggleVisibilityAction WithTitle(string value) { - this.Title = value; - return this; - } - - public ToggleVisibilityAction WithIconUrl(string value) { - this.IconUrl = value; - return this; - } - - public ToggleVisibilityAction WithStyle(ActionStyle value) { - this.Style = value; - return this; - } - - public ToggleVisibilityAction WithMode(ActionMode value) { - this.Mode = value; - return this; - } - - public ToggleVisibilityAction WithTooltip(string value) { - this.Tooltip = value; - return this; - } - - public ToggleVisibilityAction WithIsEnabled(bool value) { - this.IsEnabled = value; - return this; - } - - public ToggleVisibilityAction WithMenuActions(params IList value) { - this.MenuActions = value; - return this; - } - - public ToggleVisibilityAction WithThemedIconUrls(params IList value) { - this.ThemedIconUrls = value; - return this; - } - - public ToggleVisibilityAction WithTargetElements(IUnion, IList> value) { - this.TargetElements = value; - return this; - } - - public ToggleVisibilityAction WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public ExecuteAction WithStyle(ActionStyle value) + { + this.Style = value; + return this; + } -/// -/// Defines a theme-specific URL. -/// -public class ThemedUrl : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type ThemedUrl. - /// - public static ThemedUrl? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The theme this URL applies to. - /// - [JsonPropertyName("theme")] - public ThemeName? Theme { get; set; } = ThemeName.Light; - - /// - /// The URL to use for the associated theme. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// Serializes this ThemedUrl into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ThemedUrl WithKey(string value) { - this.Key = value; - return this; - } - - public ThemedUrl WithTheme(ThemeName value) { - this.Theme = value; - return this; - } - - public ThemedUrl WithUrl(string value) { - this.Url = value; - return this; - } -} + public ExecuteAction WithMode(ActionMode value) + { + this.Mode = value; + return this; + } -/// -/// Defines a target element in an Action.ToggleVisibility. -/// -public class TargetElement : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type TargetElement. - /// - public static TargetElement? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The Id of the element to change the visibility of. - /// - [JsonPropertyName("elementId")] - public string? ElementId { get; set; } - - /// - /// The new visibility state of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Serializes this TargetElement into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TargetElement WithElementId(string value) { - this.ElementId = value; - return this; - } - - public TargetElement WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } -} + public ExecuteAction WithTooltip(string value) + { + this.Tooltip = value; + return this; + } -/// -/// Expands or collapses an embedded card within the main card. -/// -public class ShowCardAction : Action -{ - /// - /// Deserializes a JSON string into an object of type ShowCardAction. - /// - public static ShowCardAction? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Action.ShowCard**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Action.ShowCard"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The title of the action, as it appears on buttons. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - /// - /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. - /// - [JsonPropertyName("iconUrl")] - public string? IconUrl { get; set; } - - /// - /// Control the style of the action, affecting its visual and spoken representations. - /// - [JsonPropertyName("style")] - public ActionStyle? Style { get; set; } = ActionStyle.Default; - - /// - /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. - /// - [JsonPropertyName("mode")] - public ActionMode? Mode { get; set; } = ActionMode.Primary; - - /// - /// The tooltip text to display when the action is hovered over. - /// - [JsonPropertyName("tooltip")] - public string? Tooltip { get; set; } - - /// - /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. - /// - [JsonPropertyName("isEnabled")] - public bool? IsEnabled { get; set; } = true; - - /// - /// The actions to display in the overflow menu of a Split action button. - /// - [JsonPropertyName("menuActions")] - public IList? MenuActions { get; set; } - - /// - /// A set of theme-specific icon URLs. - /// - [JsonPropertyName("themedIconUrls")] - public IList? ThemedIconUrls { get; set; } - - /// - /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The card that should be displayed when the action is executed. - /// - [JsonPropertyName("card")] - public AdaptiveCard? Card { get; set; } - - /// - /// Serializes this ShowCardAction into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ShowCardAction WithKey(string value) { - this.Key = value; - return this; - } - - public ShowCardAction WithId(string value) { - this.Id = value; - return this; - } - - public ShowCardAction WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public ShowCardAction WithTitle(string value) { - this.Title = value; - return this; - } - - public ShowCardAction WithIconUrl(string value) { - this.IconUrl = value; - return this; - } - - public ShowCardAction WithStyle(ActionStyle value) { - this.Style = value; - return this; - } - - public ShowCardAction WithMode(ActionMode value) { - this.Mode = value; - return this; - } - - public ShowCardAction WithTooltip(string value) { - this.Tooltip = value; - return this; - } - - public ShowCardAction WithIsEnabled(bool value) { - this.IsEnabled = value; - return this; - } - - public ShowCardAction WithMenuActions(params IList value) { - this.MenuActions = value; - return this; - } - - public ShowCardAction WithThemedIconUrls(params IList value) { - this.ThemedIconUrls = value; - return this; - } - - public ShowCardAction WithFallback(IUnion value) { - this.Fallback = value; - return this; - } - - public ShowCardAction WithCard(AdaptiveCard value) { - this.Card = value; - return this; - } -} + public ExecuteAction WithIsEnabled(bool value) + { + this.IsEnabled = value; + return this; + } -/// -/// Shows a popover to display more information to the user. -/// -public class PopoverAction : Action -{ - /// - /// Deserializes a JSON string into an object of type PopoverAction. - /// - public static PopoverAction? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Action.Popover**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Action.Popover"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The title of the action, as it appears on buttons. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - /// - /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. - /// - [JsonPropertyName("iconUrl")] - public string? IconUrl { get; set; } - - /// - /// Control the style of the action, affecting its visual and spoken representations. - /// - [JsonPropertyName("style")] - public ActionStyle? Style { get; set; } = ActionStyle.Default; - - /// - /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. - /// - [JsonPropertyName("mode")] - public ActionMode? Mode { get; set; } = ActionMode.Primary; - - /// - /// The tooltip text to display when the action is hovered over. - /// - [JsonPropertyName("tooltip")] - public string? Tooltip { get; set; } - - /// - /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. - /// - [JsonPropertyName("isEnabled")] - public bool? IsEnabled { get; set; } = true; - - /// - /// A set of theme-specific icon URLs. - /// - [JsonPropertyName("themedIconUrls")] - public IList? ThemedIconUrls { get; set; } - - /// - /// The content of the popover, which can be any element. - /// - [JsonPropertyName("content")] - public CardElement? Content { get; set; } - - /// - /// Controls if an arrow should be displayed towards the element that triggered the popover. - /// - [JsonPropertyName("displayArrow")] - public bool? DisplayArrow { get; set; } = true; - - /// - /// Controls where the popover should be displayed with regards to the element that triggered it. - /// - [JsonPropertyName("position")] - public PopoverPosition? Position { get; set; } = PopoverPosition.Above; - - /// - /// The maximum width of the popover in pixels, in the `px` format - /// - [JsonPropertyName("maxPopoverWidth")] - public string? MaxPopoverWidth { get; set; } - - /// - /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this PopoverAction into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public PopoverAction WithKey(string value) { - this.Key = value; - return this; - } - - public PopoverAction WithId(string value) { - this.Id = value; - return this; - } - - public PopoverAction WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public PopoverAction WithTitle(string value) { - this.Title = value; - return this; - } - - public PopoverAction WithIconUrl(string value) { - this.IconUrl = value; - return this; - } - - public PopoverAction WithStyle(ActionStyle value) { - this.Style = value; - return this; - } - - public PopoverAction WithMode(ActionMode value) { - this.Mode = value; - return this; - } - - public PopoverAction WithTooltip(string value) { - this.Tooltip = value; - return this; - } - - public PopoverAction WithIsEnabled(bool value) { - this.IsEnabled = value; - return this; - } - - public PopoverAction WithThemedIconUrls(params IList value) { - this.ThemedIconUrls = value; - return this; - } - - public PopoverAction WithContent(CardElement value) { - this.Content = value; - return this; - } - - public PopoverAction WithDisplayArrow(bool value) { - this.DisplayArrow = value; - return this; - } - - public PopoverAction WithPosition(PopoverPosition value) { - this.Position = value; - return this; - } - - public PopoverAction WithMaxPopoverWidth(string value) { - this.MaxPopoverWidth = value; - return this; - } - - public PopoverAction WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public ExecuteAction WithMenuActions(params IList value) + { + this.MenuActions = value; + return this; + } -/// -/// Displays a set of action, which can be placed anywhere in the card. -/// -public class ActionSet : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ActionSet. - /// - public static ActionSet? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **ActionSet**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "ActionSet"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The actions in the set. - /// - [JsonPropertyName("actions")] - public IList? Actions { get; set; } - - public ActionSet(params IList actions) - { - this.Actions = actions; - } + public ExecuteAction WithThemedIconUrls(params IList value) + { + this.ThemedIconUrls = value; + return this; + } - /// - /// Serializes this ActionSet into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ActionSet WithKey(string value) { - this.Key = value; - return this; - } - - public ActionSet WithId(string value) { - this.Id = value; - return this; - } - - public ActionSet WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public ActionSet WithLang(string value) { - this.Lang = value; - return this; - } - - public ActionSet WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public ActionSet WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public ActionSet WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public ActionSet WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public ActionSet WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public ActionSet WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public ActionSet WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public ActionSet WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public ActionSet WithFallback(IUnion value) { - this.Fallback = value; - return this; - } - - public ActionSet WithActions(params IList value) { - this.Actions = value; - return this; - } + public ExecuteAction WithData(IUnion value) + { + this.Data = value; + return this; + } + + public ExecuteAction WithAssociatedInputs(AssociatedInputs value) + { + this.AssociatedInputs = value; + return this; + } + + public ExecuteAction WithConditionallyEnabled(bool value) + { + this.ConditionallyEnabled = value; + return this; + } + + public ExecuteAction WithVerb(string value) + { + this.Verb = value; + return this; + } + + public ExecuteAction WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } } /// -/// A container for other elements. Use containers for styling purposes and/or to logically group a set of elements together, which can be especially useful when used with Action.ToggleVisibility. +/// Inserts an image into the host application's canvas. /// -public class Container : CardElement +public class InsertImageAction : Action { - /// - /// Deserializes a JSON string into an object of type Container. - /// - public static Container? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Container**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Container"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - /// - [JsonPropertyName("style")] - public ContainerStyle? Style { get; set; } - - /// - /// Controls if a border should be displayed around the container. - /// - [JsonPropertyName("showBorder")] - public bool? ShowBorder { get; set; } = false; - - /// - /// Controls if the container should have rounded corners. - /// - [JsonPropertyName("roundedCorners")] - public bool? RoundedCorners { get; set; } = false; - - /// - /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. - /// - [JsonPropertyName("layouts")] - public IList? Layouts { get; set; } - - /// - /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. - /// - [JsonPropertyName("bleed")] - public bool? Bleed { get; set; } = false; - - /// - /// The minimum height, in pixels, of the container, in the `px` format. - /// - [JsonPropertyName("minHeight")] - public string? MinHeight { get; set; } - - /// - /// Defines the container's background image. - /// - [JsonPropertyName("backgroundImage")] - public IUnion? BackgroundImage { get; set; } - - /// - /// Controls how the container's content should be vertically aligned. - /// - [JsonPropertyName("verticalContentAlignment")] - public VerticalAlignment? VerticalContentAlignment { get; set; } - - /// - /// Controls if the content of the card is to be rendered left-to-right or right-to-left. - /// - [JsonPropertyName("rtl")] - public bool? Rtl { get; set; } - - /// - /// The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. - /// - [JsonPropertyName("maxHeight")] - public string? MaxHeight { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The elements in the container. - /// - [JsonPropertyName("items")] - public IList? Items { get; set; } - - public Container(params IList items) - { - this.Items = items; - } + /// + /// Deserializes a JSON string into an object of type InsertImageAction. + /// + public static InsertImageAction? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } - /// - /// Serializes this Container into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Container WithKey(string value) { - this.Key = value; - return this; - } - - public Container WithId(string value) { - this.Id = value; - return this; - } - - public Container WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public Container WithLang(string value) { - this.Lang = value; - return this; - } - - public Container WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public Container WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public Container WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public Container WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public Container WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public Container WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public Container WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public Container WithSelectAction(Action value) { - this.SelectAction = value; - return this; - } - - public Container WithStyle(ContainerStyle value) { - this.Style = value; - return this; - } - - public Container WithShowBorder(bool value) { - this.ShowBorder = value; - return this; - } - - public Container WithRoundedCorners(bool value) { - this.RoundedCorners = value; - return this; - } - - public Container WithLayouts(params IList value) { - this.Layouts = value; - return this; - } - - public Container WithBleed(bool value) { - this.Bleed = value; - return this; - } - - public Container WithMinHeight(string value) { - this.MinHeight = value; - return this; - } - - public Container WithBackgroundImage(IUnion value) { - this.BackgroundImage = value; - return this; - } - - public Container WithVerticalContentAlignment(VerticalAlignment value) { - this.VerticalContentAlignment = value; - return this; - } - - public Container WithRtl(bool value) { - this.Rtl = value; - return this; - } - - public Container WithMaxHeight(string value) { - this.MaxHeight = value; - return this; - } - - public Container WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public Container WithFallback(IUnion value) { - this.Fallback = value; - return this; - } - - public Container WithItems(params IList value) { - this.Items = value; - return this; - } -} + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Action.InsertImage**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Action.InsertImage"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The title of the action, as it appears on buttons. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + /// + /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + /// + [JsonPropertyName("iconUrl")] + public string? IconUrl { get; set; } + + /// + /// Control the style of the action, affecting its visual and spoken representations. + /// + [JsonPropertyName("style")] + public ActionStyle? Style { get; set; } = ActionStyle.Default; + + /// + /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + /// + [JsonPropertyName("mode")] + public ActionMode? Mode { get; set; } = ActionMode.Primary; + + /// + /// The tooltip text to display when the action is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + /// + [JsonPropertyName("isEnabled")] + public bool? IsEnabled { get; set; } = true; + + /// + /// The actions to display in the overflow menu of a Split action button. + /// + [JsonPropertyName("menuActions")] + public IList? MenuActions { get; set; } + + /// + /// A set of theme-specific icon URLs. + /// + [JsonPropertyName("themedIconUrls")] + public IList? ThemedIconUrls { get; set; } + + /// + /// The URL of the image to insert. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// The alternate text for the image. + /// + [JsonPropertyName("altText")] + public string? AltText { get; set; } + + /// + /// The position at which to insert the image. + /// + [JsonPropertyName("insertPosition")] + public ImageInsertPosition? InsertPosition { get; set; } = ImageInsertPosition.Selection; + + /// + /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this InsertImageAction into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } -/// -/// A layout that stacks elements on top of each other. Layout.Stack is the default layout used by AdaptiveCard and all containers. -/// -public class StackLayout : ContainerLayout -{ - /// - /// Deserializes a JSON string into an object of type StackLayout. - /// - public static StackLayout? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Layout.Stack**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Layout.Stack"; - - /// - /// Controls for which card width the layout should be used. - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Serializes this StackLayout into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public StackLayout WithKey(string value) { - this.Key = value; - return this; - } - - public StackLayout WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } -} + public InsertImageAction WithKey(string value) + { + this.Key = value; + return this; + } -/// -/// A layout that spreads elements horizontally and wraps them across multiple rows, as needed. -/// -public class FlowLayout : ContainerLayout -{ - /// - /// Deserializes a JSON string into an object of type FlowLayout. - /// - public static FlowLayout? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Layout.Flow**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Layout.Flow"; - - /// - /// Controls for which card width the layout should be used. - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls how the content of the container should be horizontally aligned. - /// - [JsonPropertyName("horizontalItemsAlignment")] - public HorizontalAlignment? HorizontalItemsAlignment { get; set; } = HorizontalAlignment.Center; - - /// - /// Controls how the content of the container should be vertically aligned. - /// - [JsonPropertyName("verticalItemsAlignment")] - public VerticalAlignment? VerticalItemsAlignment { get; set; } = VerticalAlignment.Top; - - /// - /// Controls how item should fit inside the container. - /// - [JsonPropertyName("itemFit")] - public FlowLayoutItemFit? ItemFit { get; set; } = FlowLayoutItemFit.Fit; - - /// - /// The minimum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. - /// - [JsonPropertyName("minItemWidth")] - public string? MinItemWidth { get; set; } - - /// - /// The maximum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. - /// - [JsonPropertyName("maxItemWidth")] - public string? MaxItemWidth { get; set; } - - /// - /// The width, in pixels, of each item, in the `px` format. Should not be used if maxItemWidth and/or minItemWidth are set. - /// - [JsonPropertyName("itemWidth")] - public string? ItemWidth { get; set; } - - /// - /// The space between items. - /// - [JsonPropertyName("columnSpacing")] - public Spacing? ColumnSpacing { get; set; } = Spacing.Default; - - /// - /// The space between rows of items. - /// - [JsonPropertyName("rowSpacing")] - public Spacing? RowSpacing { get; set; } = Spacing.Default; - - /// - /// Serializes this FlowLayout into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public FlowLayout WithKey(string value) { - this.Key = value; - return this; - } - - public FlowLayout WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public FlowLayout WithHorizontalItemsAlignment(HorizontalAlignment value) { - this.HorizontalItemsAlignment = value; - return this; - } - - public FlowLayout WithVerticalItemsAlignment(VerticalAlignment value) { - this.VerticalItemsAlignment = value; - return this; - } - - public FlowLayout WithItemFit(FlowLayoutItemFit value) { - this.ItemFit = value; - return this; - } - - public FlowLayout WithMinItemWidth(string value) { - this.MinItemWidth = value; - return this; - } - - public FlowLayout WithMaxItemWidth(string value) { - this.MaxItemWidth = value; - return this; - } - - public FlowLayout WithItemWidth(string value) { - this.ItemWidth = value; - return this; - } - - public FlowLayout WithColumnSpacing(Spacing value) { - this.ColumnSpacing = value; - return this; - } - - public FlowLayout WithRowSpacing(Spacing value) { - this.RowSpacing = value; - return this; - } -} + public InsertImageAction WithId(string value) + { + this.Id = value; + return this; + } -/// -/// A layout that divides a container into named areas into which elements can be placed. -/// -public class AreaGridLayout : ContainerLayout -{ - /// - /// Deserializes a JSON string into an object of type AreaGridLayout. - /// - public static AreaGridLayout? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Layout.AreaGrid**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Layout.AreaGrid"; - - /// - /// Controls for which card width the layout should be used. - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// The columns in the grid layout, defined as a percentage of the available width or in pixels using the `px` format. - /// - [JsonPropertyName("columns")] - public IUnion, IList>? Columns { get; set; } - - /// - /// The areas in the grid layout. - /// - [JsonPropertyName("areas")] - public IList? Areas { get; set; } - - /// - /// The space between columns. - /// - [JsonPropertyName("columnSpacing")] - public Spacing? ColumnSpacing { get; set; } = Spacing.Default; - - /// - /// The space between rows. - /// - [JsonPropertyName("rowSpacing")] - public Spacing? RowSpacing { get; set; } = Spacing.Default; - - /// - /// Serializes this AreaGridLayout into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public AreaGridLayout WithKey(string value) { - this.Key = value; - return this; - } - - public AreaGridLayout WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public AreaGridLayout WithColumns(IUnion, IList> value) { - this.Columns = value; - return this; - } - - public AreaGridLayout WithAreas(params IList value) { - this.Areas = value; - return this; - } - - public AreaGridLayout WithColumnSpacing(Spacing value) { - this.ColumnSpacing = value; - return this; - } - - public AreaGridLayout WithRowSpacing(Spacing value) { - this.RowSpacing = value; - return this; - } -} + public InsertImageAction WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } -/// -/// Defines an area in a Layout.AreaGrid layout. -/// -public class GridArea : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type GridArea. - /// - public static GridArea? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The name of the area. To place an element in this area, set its `grid.area` property to match the name of the area. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// The start column index of the area. Column indices start at 1. - /// - [JsonPropertyName("column")] - public float? Column { get; set; } = 1; - - /// - /// Defines how many columns the area should span. - /// - [JsonPropertyName("columnSpan")] - public float? ColumnSpan { get; set; } = 1; - - /// - /// The start row index of the area. Row indices start at 1. - /// - [JsonPropertyName("row")] - public float? Row { get; set; } = 1; - - /// - /// Defines how many rows the area should span. - /// - [JsonPropertyName("rowSpan")] - public float? RowSpan { get; set; } = 1; - - /// - /// Serializes this GridArea into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public GridArea WithKey(string value) { - this.Key = value; - return this; - } - - public GridArea WithName(string value) { - this.Name = value; - return this; - } - - public GridArea WithColumn(float value) { - this.Column = value; - return this; - } - - public GridArea WithColumnSpan(float value) { - this.ColumnSpan = value; - return this; - } - - public GridArea WithRow(float value) { - this.Row = value; - return this; - } - - public GridArea WithRowSpan(float value) { - this.RowSpan = value; - return this; - } -} + public InsertImageAction WithTitle(string value) + { + this.Title = value; + return this; + } -/// -/// Defines a container's background image and the way it should be rendered. -/// -public class BackgroundImage : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type BackgroundImage. - /// - public static BackgroundImage? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// Controls how the image should fill the area. - /// - [JsonPropertyName("fillMode")] - public FillMode? FillMode { get; set; } = FillMode.Cover; - - /// - /// Controls how the image should be aligned if it must be cropped or if using repeat fill mode. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } = HorizontalAlignment.Left; - - /// - /// Controls how the image should be aligned if it must be cropped or if using repeat fill mode. - /// - [JsonPropertyName("verticalAlignment")] - public VerticalAlignment? VerticalAlignment { get; set; } = VerticalAlignment.Top; - - /// - /// A set of theme-specific image URLs. - /// - [JsonPropertyName("themedUrls")] - public IList? ThemedUrls { get; set; } - - /// - /// Serializes this BackgroundImage into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public BackgroundImage WithKey(string value) { - this.Key = value; - return this; - } - - public BackgroundImage WithUrl(string value) { - this.Url = value; - return this; - } - - public BackgroundImage WithFillMode(FillMode value) { - this.FillMode = value; - return this; - } - - public BackgroundImage WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public BackgroundImage WithVerticalAlignment(VerticalAlignment value) { - this.VerticalAlignment = value; - return this; - } - - public BackgroundImage WithThemedUrls(params IList value) { - this.ThemedUrls = value; - return this; - } -} + public InsertImageAction WithIconUrl(string value) + { + this.IconUrl = value; + return this; + } -/// -/// Splits the available horizontal space into separate columns, so elements can be organized in a row. -/// -public class ColumnSet : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ColumnSet. - /// - public static ColumnSet? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **ColumnSet**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "ColumnSet"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - /// - [JsonPropertyName("style")] - public ContainerStyle? Style { get; set; } - - /// - /// Controls if a border should be displayed around the container. - /// - [JsonPropertyName("showBorder")] - public bool? ShowBorder { get; set; } = false; - - /// - /// Controls if the container should have rounded corners. - /// - [JsonPropertyName("roundedCorners")] - public bool? RoundedCorners { get; set; } = false; - - /// - /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. - /// - [JsonPropertyName("bleed")] - public bool? Bleed { get; set; } = false; - - /// - /// The minimum height, in pixels, of the container, in the `px` format. - /// - [JsonPropertyName("minHeight")] - public string? MinHeight { get; set; } - - /// - /// The minimum width of the column set. `auto` will automatically adjust the column set's minimum width according to its content and using the `px` format will give the column set an explicit minimum width in pixels. A scrollbar will be displayed if the available width is less than the specified minimum width. - /// - [JsonPropertyName("minWidth")] - public string? MinWidth { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The columns in the set. - /// - [JsonPropertyName("columns")] - public IList? Columns { get; set; } - - /// - /// Serializes this ColumnSet into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ColumnSet WithKey(string value) { - this.Key = value; - return this; - } - - public ColumnSet WithId(string value) { - this.Id = value; - return this; - } - - public ColumnSet WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public ColumnSet WithLang(string value) { - this.Lang = value; - return this; - } - - public ColumnSet WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public ColumnSet WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public ColumnSet WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public ColumnSet WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public ColumnSet WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public ColumnSet WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public ColumnSet WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public ColumnSet WithSelectAction(Action value) { - this.SelectAction = value; - return this; - } - - public ColumnSet WithStyle(ContainerStyle value) { - this.Style = value; - return this; - } - - public ColumnSet WithShowBorder(bool value) { - this.ShowBorder = value; - return this; - } - - public ColumnSet WithRoundedCorners(bool value) { - this.RoundedCorners = value; - return this; - } - - public ColumnSet WithBleed(bool value) { - this.Bleed = value; - return this; - } - - public ColumnSet WithMinHeight(string value) { - this.MinHeight = value; - return this; - } - - public ColumnSet WithMinWidth(string value) { - this.MinWidth = value; - return this; - } - - public ColumnSet WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public ColumnSet WithFallback(IUnion value) { - this.Fallback = value; - return this; - } - - public ColumnSet WithColumns(params IList value) { - this.Columns = value; - return this; - } -} + public InsertImageAction WithStyle(ActionStyle value) + { + this.Style = value; + return this; + } -/// -/// A media element, that makes it possible to embed videos inside a card. -/// -public class Media : CardElement -{ - /// - /// Deserializes a JSON string into an object of type Media. - /// - public static Media? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Media**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Media"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The sources for the media. For YouTube, Dailymotion and Vimeo, only one source can be specified. - /// - [JsonPropertyName("sources")] - public IList? Sources { get; set; } - - /// - /// The caption sources for the media. Caption sources are not used for YouTube, Dailymotion or Vimeo sources. - /// - [JsonPropertyName("captionSources")] - public IList? CaptionSources { get; set; } - - /// - /// The URL of the poster image to display. - /// - [JsonPropertyName("poster")] - public string? Poster { get; set; } - - /// - /// The alternate text for the media, used for accessibility purposes. - /// - [JsonPropertyName("altText")] - public string? AltText { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this Media into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Media WithKey(string value) { - this.Key = value; - return this; - } - - public Media WithId(string value) { - this.Id = value; - return this; - } - - public Media WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public Media WithLang(string value) { - this.Lang = value; - return this; - } - - public Media WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public Media WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public Media WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public Media WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public Media WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public Media WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public Media WithSources(params IList value) { - this.Sources = value; - return this; - } - - public Media WithCaptionSources(params IList value) { - this.CaptionSources = value; - return this; - } - - public Media WithPoster(string value) { - this.Poster = value; - return this; - } - - public Media WithAltText(string value) { - this.AltText = value; - return this; - } - - public Media WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public Media WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public InsertImageAction WithMode(ActionMode value) + { + this.Mode = value; + return this; + } -/// -/// Defines the source URL of a media stream. YouTube, Dailymotion, Vimeo and Microsoft Stream URLs are supported. -/// -public class MediaSource : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type MediaSource. - /// - public static MediaSource? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The MIME type of the source. - /// - [JsonPropertyName("mimeType")] - public string? MimeType { get; set; } - - /// - /// The URL of the source. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// Serializes this MediaSource into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public MediaSource WithKey(string value) { - this.Key = value; - return this; - } - - public MediaSource WithMimeType(string value) { - this.MimeType = value; - return this; - } - - public MediaSource WithUrl(string value) { - this.Url = value; - return this; - } -} + public InsertImageAction WithTooltip(string value) + { + this.Tooltip = value; + return this; + } -/// -/// Defines a source URL for a video captions. -/// -public class CaptionSource : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type CaptionSource. - /// - public static CaptionSource? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The MIME type of the source. - /// - [JsonPropertyName("mimeType")] - public string? MimeType { get; set; } - - /// - /// The URL of the source. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The label of this caption source. - /// - [JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Serializes this CaptionSource into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public CaptionSource WithKey(string value) { - this.Key = value; - return this; - } - - public CaptionSource WithMimeType(string value) { - this.MimeType = value; - return this; - } - - public CaptionSource WithUrl(string value) { - this.Url = value; - return this; - } - - public CaptionSource WithLabel(string value) { - this.Label = value; - return this; - } -} + public InsertImageAction WithIsEnabled(bool value) + { + this.IsEnabled = value; + return this; + } -/// -/// A rich text block that displays formatted text. -/// -public class RichTextBlock : CardElement -{ - /// - /// Deserializes a JSON string into an object of type RichTextBlock. - /// - public static RichTextBlock? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **RichTextBlock**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "RichTextBlock"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The Id of the input the RichTextBlock should act as the label of. - /// - [JsonPropertyName("labelFor")] - public string? LabelFor { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The inlines making up the rich text block. - /// - [JsonPropertyName("inlines")] - public IUnion, IList>? Inlines { get; set; } - - /// - /// Serializes this RichTextBlock into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public RichTextBlock WithKey(string value) { - this.Key = value; - return this; - } - - public RichTextBlock WithId(string value) { - this.Id = value; - return this; - } - - public RichTextBlock WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public RichTextBlock WithLang(string value) { - this.Lang = value; - return this; - } - - public RichTextBlock WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public RichTextBlock WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public RichTextBlock WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public RichTextBlock WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public RichTextBlock WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public RichTextBlock WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public RichTextBlock WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public RichTextBlock WithLabelFor(string value) { - this.LabelFor = value; - return this; - } - - public RichTextBlock WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public RichTextBlock WithFallback(IUnion value) { - this.Fallback = value; - return this; - } - - public RichTextBlock WithInlines(IUnion, IList> value) { - this.Inlines = value; - return this; - } -} + public InsertImageAction WithMenuActions(params IList value) + { + this.MenuActions = value; + return this; + } -/// -/// Use tables to display data in a tabular way, with rows, columns and cells. -/// -public class Table : CardElement -{ - /// - /// Deserializes a JSON string into an object of type Table. - /// - public static Table? Deserialize(string json) - { - return JsonSerializer.Deserialize
(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Table**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Table"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - /// - [JsonPropertyName("style")] - public ContainerStyle? Style { get; set; } - - /// - /// Controls if a border should be displayed around the container. - /// - [JsonPropertyName("showBorder")] - public bool? ShowBorder { get; set; } = false; - - /// - /// Controls if the container should have rounded corners. - /// - [JsonPropertyName("roundedCorners")] - public bool? RoundedCorners { get; set; } = false; - - /// - /// The columns in the table. - /// - [JsonPropertyName("columns")] - public IList? Columns { get; set; } - - /// - /// The minimum width of the table in pixels. `auto` will automatically adjust the table's minimum width according to its content and using the `px` format will give the table an explicit minimum width in pixels. A scrollbar will be displayed if the available width is less than the specified minimum width. - /// - [JsonPropertyName("minWidth")] - public string? MinWidth { get; set; } - - /// - /// Controls whether the first row of the table should be treated as a header. - /// - [JsonPropertyName("firstRowAsHeaders")] - public bool? FirstRowAsHeaders { get; set; } = true; - - /// - /// Controls if grid lines should be displayed. - /// - [JsonPropertyName("showGridLines")] - public bool? ShowGridLines { get; set; } = true; - - /// - /// The style of the grid lines between cells. - /// - [JsonPropertyName("gridStyle")] - public ContainerStyle? GridStyle { get; set; } - - /// - /// Controls how the content of every cell in the table should be horizontally aligned by default. - /// - [JsonPropertyName("horizontalCellContentAlignment")] - public HorizontalAlignment? HorizontalCellContentAlignment { get; set; } - - /// - /// Controls how the content of every cell in the table should be vertically aligned by default. - /// - [JsonPropertyName("verticalCellContentAlignment")] - public VerticalAlignment? VerticalCellContentAlignment { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The rows of the table. - /// - [JsonPropertyName("rows")] - public IList? Rows { get; set; } - - /// - /// Serializes this Table into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Table WithKey(string value) { - this.Key = value; - return this; - } - - public Table WithId(string value) { - this.Id = value; - return this; - } - - public Table WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public Table WithLang(string value) { - this.Lang = value; - return this; - } - - public Table WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public Table WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public Table WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public Table WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public Table WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public Table WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public Table WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public Table WithStyle(ContainerStyle value) { - this.Style = value; - return this; - } - - public Table WithShowBorder(bool value) { - this.ShowBorder = value; - return this; - } - - public Table WithRoundedCorners(bool value) { - this.RoundedCorners = value; - return this; - } - - public Table WithColumns(params IList value) { - this.Columns = value; - return this; - } - - public Table WithMinWidth(string value) { - this.MinWidth = value; - return this; - } - - public Table WithFirstRowAsHeaders(bool value) { - this.FirstRowAsHeaders = value; - return this; - } - - public Table WithShowGridLines(bool value) { - this.ShowGridLines = value; - return this; - } - - public Table WithGridStyle(ContainerStyle value) { - this.GridStyle = value; - return this; - } - - public Table WithHorizontalCellContentAlignment(HorizontalAlignment value) { - this.HorizontalCellContentAlignment = value; - return this; - } - - public Table WithVerticalCellContentAlignment(VerticalAlignment value) { - this.VerticalCellContentAlignment = value; - return this; - } - - public Table WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public Table WithFallback(IUnion value) { - this.Fallback = value; - return this; - } - - public Table WithRows(params IList value) { - this.Rows = value; - return this; - } -} + public InsertImageAction WithThemedIconUrls(params IList value) + { + this.ThemedIconUrls = value; + return this; + } -/// -/// Defines a column in a Table element. -/// -public class ColumnDefinition : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type ColumnDefinition. - /// - public static ColumnDefinition? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Controls how the content of every cell in the table should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table. - /// - [JsonPropertyName("horizontalCellContentAlignment")] - public HorizontalAlignment? HorizontalCellContentAlignment { get; set; } - - /// - /// Controls how the content of every cell in the column should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table. - /// - [JsonPropertyName("verticalCellContentAlignment")] - public VerticalAlignment? VerticalCellContentAlignment { get; set; } - - /// - /// The width of the column in the table. If expressed as a number, represents the relative weight of the column in the table. If expressed as a string, `auto` will automatically adjust the column's width according to its content and using the `px` format will give the column an explicit width in pixels. - /// - [JsonPropertyName("width")] - public IUnion? Width { get; set; } - - /// - /// Serializes this ColumnDefinition into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ColumnDefinition WithKey(string value) { - this.Key = value; - return this; - } - - public ColumnDefinition WithHorizontalCellContentAlignment(HorizontalAlignment value) { - this.HorizontalCellContentAlignment = value; - return this; - } - - public ColumnDefinition WithVerticalCellContentAlignment(VerticalAlignment value) { - this.VerticalCellContentAlignment = value; - return this; - } - - public ColumnDefinition WithWidth(IUnion value) { - this.Width = value; - return this; - } -} + public InsertImageAction WithUrl(string value) + { + this.Url = value; + return this; + } -/// -/// A block of text, optionally formatted using Markdown. -/// -public class TextBlock : CardElement -{ - /// - /// Deserializes a JSON string into an object of type TextBlock. - /// - public static TextBlock? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **TextBlock**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "TextBlock"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The text to display. A subset of markdown is supported. - /// - [JsonPropertyName("text")] - public string? Text { get; set; } - - /// - /// The size of the text. - /// - [JsonPropertyName("size")] - public TextSize? Size { get; set; } - - /// - /// The weight of the text. - /// - [JsonPropertyName("weight")] - public TextWeight? Weight { get; set; } - - /// - /// The color of the text. - /// - [JsonPropertyName("color")] - public TextColor? Color { get; set; } - - /// - /// Controls whether the text should be renderer using a subtler variant of the select color. - /// - [JsonPropertyName("isSubtle")] - public bool? IsSubtle { get; set; } - - /// - /// The type of font to use for rendering. - /// - [JsonPropertyName("fontType")] - public FontType? FontType { get; set; } - - /// - /// Controls if the text should wrap. - /// - [JsonPropertyName("wrap")] - public bool? Wrap { get; set; } = false; - - /// - /// The maximum number of lines to display. - /// - [JsonPropertyName("maxLines")] - public float? MaxLines { get; set; } - - /// - /// The style of the text. - /// - [JsonPropertyName("style")] - public TextBlockStyle? Style { get; set; } - - /// - /// The Id of the input the TextBlock should act as the label of. - /// - [JsonPropertyName("labelFor")] - public string? LabelFor { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - public TextBlock(string text) - { - this.Text = text; - } + public InsertImageAction WithAltText(string value) + { + this.AltText = value; + return this; + } - /// - /// Serializes this TextBlock into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TextBlock WithKey(string value) { - this.Key = value; - return this; - } - - public TextBlock WithId(string value) { - this.Id = value; - return this; - } - - public TextBlock WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public TextBlock WithLang(string value) { - this.Lang = value; - return this; - } - - public TextBlock WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public TextBlock WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public TextBlock WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public TextBlock WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public TextBlock WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public TextBlock WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public TextBlock WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public TextBlock WithText(string value) { - this.Text = value; - return this; - } - - public TextBlock WithSize(TextSize value) { - this.Size = value; - return this; - } - - public TextBlock WithWeight(TextWeight value) { - this.Weight = value; - return this; - } - - public TextBlock WithColor(TextColor value) { - this.Color = value; - return this; - } - - public TextBlock WithIsSubtle(bool value) { - this.IsSubtle = value; - return this; - } - - public TextBlock WithFontType(FontType value) { - this.FontType = value; - return this; - } - - public TextBlock WithWrap(bool value) { - this.Wrap = value; - return this; - } - - public TextBlock WithMaxLines(float value) { - this.MaxLines = value; - return this; - } - - public TextBlock WithStyle(TextBlockStyle value) { - this.Style = value; - return this; - } - - public TextBlock WithLabelFor(string value) { - this.LabelFor = value; - return this; - } - - public TextBlock WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public TextBlock WithFallback(IUnion value) { - this.Fallback = value; - return this; - } + public InsertImageAction WithInsertPosition(ImageInsertPosition value) + { + this.InsertPosition = value; + return this; + } + + public InsertImageAction WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } } /// -/// A set of facts, displayed as a table or a vertical list when horizontal space is constrained. +/// Opens the provided URL in either a separate browser tab or within the host application. /// -public class FactSet : CardElement +public class OpenUrlAction : Action { - /// - /// Deserializes a JSON string into an object of type FactSet. - /// - public static FactSet? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **FactSet**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "FactSet"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The facts in the set. - /// - [JsonPropertyName("facts")] - public IList? Facts { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - public FactSet(params IList facts) - { - this.Facts = facts; - } + /// + /// Deserializes a JSON string into an object of type OpenUrlAction. + /// + public static OpenUrlAction? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } - /// - /// Serializes this FactSet into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public FactSet WithKey(string value) { - this.Key = value; - return this; - } - - public FactSet WithId(string value) { - this.Id = value; - return this; - } - - public FactSet WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public FactSet WithLang(string value) { - this.Lang = value; - return this; - } - - public FactSet WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public FactSet WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public FactSet WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public FactSet WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public FactSet WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public FactSet WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public FactSet WithFacts(params IList value) { - this.Facts = value; - return this; - } - - public FactSet WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public FactSet WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Action.OpenUrl**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Action.OpenUrl"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The title of the action, as it appears on buttons. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + /// + /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + /// + [JsonPropertyName("iconUrl")] + public string? IconUrl { get; set; } + + /// + /// Control the style of the action, affecting its visual and spoken representations. + /// + [JsonPropertyName("style")] + public ActionStyle? Style { get; set; } = ActionStyle.Default; + + /// + /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + /// + [JsonPropertyName("mode")] + public ActionMode? Mode { get; set; } = ActionMode.Primary; + + /// + /// The tooltip text to display when the action is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + /// + [JsonPropertyName("isEnabled")] + public bool? IsEnabled { get; set; } = true; + + /// + /// The actions to display in the overflow menu of a Split action button. + /// + [JsonPropertyName("menuActions")] + public IList? MenuActions { get; set; } + + /// + /// A set of theme-specific icon URLs. + /// + [JsonPropertyName("themedIconUrls")] + public IList? ThemedIconUrls { get; set; } + + /// + /// The URL to open. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + public OpenUrlAction(string url) + { + this.Url = url; + } -/// -/// A fact in a FactSet element. -/// -public class Fact : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type Fact. - /// - public static Fact? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The fact's title. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The fact's value. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - public Fact(string title, string value) - { - this.Title = title; - this.Value = value; - } - - /// - /// Serializes this Fact into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Fact WithKey(string value) { - this.Key = value; - return this; - } - - public Fact WithTitle(string value) { - this.Title = value; - return this; - } - - public Fact WithValue(string value) { - this.Value = value; - return this; - } -} + /// + /// Serializes this OpenUrlAction into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } -/// -/// A set of images, displayed side-by-side and wrapped across multiple rows as needed. -/// -public class ImageSet : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ImageSet. - /// - public static ImageSet? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **ImageSet**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "ImageSet"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The images in the set. - /// - [JsonPropertyName("images")] - public IList? Images { get; set; } - - /// - /// The size to use to render all images in the set. - /// - [JsonPropertyName("imageSize")] - public ImageSize? ImageSize { get; set; } = ImageSize.Medium; - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - public ImageSet(params IList images) - { - this.Images = images; - } + public OpenUrlAction WithKey(string value) + { + this.Key = value; + return this; + } - /// - /// Serializes this ImageSet into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ImageSet WithKey(string value) { - this.Key = value; - return this; - } - - public ImageSet WithId(string value) { - this.Id = value; - return this; - } - - public ImageSet WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public ImageSet WithLang(string value) { - this.Lang = value; - return this; - } - - public ImageSet WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public ImageSet WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public ImageSet WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public ImageSet WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public ImageSet WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public ImageSet WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public ImageSet WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public ImageSet WithImages(params IList value) { - this.Images = value; - return this; - } - - public ImageSet WithImageSize(ImageSize value) { - this.ImageSize = value; - return this; - } - - public ImageSet WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public ImageSet WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public OpenUrlAction WithId(string value) + { + this.Id = value; + return this; + } -/// -/// A standalone image element. -/// -public class Image : CardElement -{ - /// - /// Deserializes a JSON string into an object of type Image. - /// - public static Image? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Image**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Image"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The alternate text for the image, used for accessibility purposes. - /// - [JsonPropertyName("altText")] - public string? AltText { get; set; } - - /// - /// The background color of the image. - /// - [JsonPropertyName("backgroundColor")] - public string? BackgroundColor { get; set; } - - /// - /// The style of the image. - /// - [JsonPropertyName("style")] - public ImageStyle? Style { get; set; } = ImageStyle.Default; - - /// - /// The size of the image. - /// - [JsonPropertyName("size")] - public Size? Size { get; set; } = Size.Auto; - - /// - /// The width of the image. - /// - [JsonPropertyName("width")] - public string? Width { get; set; } = "auto"; - - /// - /// An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// Controls if the image can be expanded to full screen. - /// - [JsonPropertyName("allowExpand")] - public bool? AllowExpand { get; set; } = false; - - /// - /// Teams-specific metadata associated with the image. - /// - [JsonPropertyName("msteams")] - public TeamsImageProperties? Msteams { get; set; } - - /// - /// Teams-specific metadata associated with the image. Equivalent to `msteams`. - /// - [JsonPropertyName("msTeams")] - public TeamsImageProperties? MsTeams { get; set; } - - /// - /// A set of theme-specific image URLs. - /// - [JsonPropertyName("themedUrls")] - public IList? ThemedUrls { get; set; } - - /// - /// Controls how the image should be fitted inside its bounding box. imageFit is only meaningful when both the width and height properties are set. When fitMode is set to contain, the default style is always used. - /// - [JsonPropertyName("fitMode")] - public ImageFitMode? FitMode { get; set; } = ImageFitMode.Fill; - - /// - /// Controls the horizontal position of the image within its bounding box. horizontalContentAlignment is only meaningful when both the width and height properties are set and fitMode is set to either cover or contain. - /// - [JsonPropertyName("horizontalContentAlignment")] - public HorizontalAlignment? HorizontalContentAlignment { get; set; } = HorizontalAlignment.Left; - - /// - /// Controls the vertical position of the image within its bounding box. verticalContentAlignment is only meaningful when both the width and height properties are set and fitMode is set to either cover or contain. - /// - [JsonPropertyName("verticalContentAlignment")] - public VerticalAlignment? VerticalContentAlignment { get; set; } = VerticalAlignment.Top; - - /// - /// The height of the image. - /// - [JsonPropertyName("height")] - public string? Height { get; set; } = "auto"; - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - public Image(string url) - { - this.Url = url; - } + public OpenUrlAction WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } - /// - /// Serializes this Image into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Image WithKey(string value) { - this.Key = value; - return this; - } - - public Image WithId(string value) { - this.Id = value; - return this; - } - - public Image WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public Image WithLang(string value) { - this.Lang = value; - return this; - } - - public Image WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public Image WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public Image WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public Image WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public Image WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public Image WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public Image WithUrl(string value) { - this.Url = value; - return this; - } - - public Image WithAltText(string value) { - this.AltText = value; - return this; - } - - public Image WithBackgroundColor(string value) { - this.BackgroundColor = value; - return this; - } - - public Image WithStyle(ImageStyle value) { - this.Style = value; - return this; - } - - public Image WithSize(Size value) { - this.Size = value; - return this; - } - - public Image WithWidth(string value) { - this.Width = value; - return this; - } - - public Image WithSelectAction(Action value) { - this.SelectAction = value; - return this; - } - - public Image WithAllowExpand(bool value) { - this.AllowExpand = value; - return this; - } - - public Image WithMsteams(TeamsImageProperties value) { - this.Msteams = value; - return this; - } - - public Image WithMsTeams(TeamsImageProperties value) { - this.MsTeams = value; - return this; - } - - public Image WithThemedUrls(params IList value) { - this.ThemedUrls = value; - return this; - } - - public Image WithFitMode(ImageFitMode value) { - this.FitMode = value; - return this; - } - - public Image WithHorizontalContentAlignment(HorizontalAlignment value) { - this.HorizontalContentAlignment = value; - return this; - } - - public Image WithVerticalContentAlignment(VerticalAlignment value) { - this.VerticalContentAlignment = value; - return this; - } - - public Image WithHeight(string value) { - this.Height = value; - return this; - } - - public Image WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public Image WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public OpenUrlAction WithTitle(string value) + { + this.Title = value; + return this; + } -/// -/// Represents a set of Teams-specific properties on an image. -/// -public class TeamsImageProperties : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type TeamsImageProperties. - /// - public static TeamsImageProperties? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Controls if the image is expandable in Teams. This property is equivalent to the Image.allowExpand property. - /// - [JsonPropertyName("allowExpand")] - public bool? AllowExpand { get; set; } - - /// - /// Serializes this TeamsImageProperties into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TeamsImageProperties WithKey(string value) { - this.Key = value; - return this; - } - - public TeamsImageProperties WithAllowExpand(bool value) { - this.AllowExpand = value; - return this; - } -} + public OpenUrlAction WithIconUrl(string value) + { + this.IconUrl = value; + return this; + } -/// -/// An input to allow the user to enter text. -/// -public class TextInput : CardElement -{ - /// - /// Deserializes a JSON string into an object of type TextInput. - /// - public static TextInput? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Input.Text**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Input.Text"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The label of the input. - /// - /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. - /// - [JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("isRequired")] - public bool? IsRequired { get; set; } = false; - - /// - /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("errorMessage")] - public string? ErrorMessage { get; set; } - - /// - /// An Action.ResetInputs action that will be executed when the value of the input changes. - /// - [JsonPropertyName("valueChangedAction")] - public Action? ValueChangedAction { get; set; } - - /// - /// The default value of the input. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - /// - /// The maximum length of the text in the input. - /// - [JsonPropertyName("maxLength")] - public float? MaxLength { get; set; } - - /// - /// Controls if the input should allow multiple lines of text. - /// - [JsonPropertyName("isMultiline")] - public bool? IsMultiline { get; set; } = false; - - /// - /// The text to display as a placeholder when the user hasn't entered a value. - /// - [JsonPropertyName("placeholder")] - public string? Placeholder { get; set; } - - /// - /// The style of the input. - /// - [JsonPropertyName("style")] - public InputTextStyle? Style { get; set; } = InputTextStyle.Text; - - /// - /// The action that should be displayed as a button alongside the input. Action.ShowCard is not supported. - /// - [JsonPropertyName("inlineAction")] - public Action? InlineAction { get; set; } - - /// - /// The regular expression to validate the input. - /// - [JsonPropertyName("regex")] - public string? Regex { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this TextInput into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TextInput WithKey(string value) { - this.Key = value; - return this; - } - - public TextInput WithId(string value) { - this.Id = value; - return this; - } - - public TextInput WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public TextInput WithLang(string value) { - this.Lang = value; - return this; - } - - public TextInput WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public TextInput WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public TextInput WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public TextInput WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public TextInput WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public TextInput WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public TextInput WithLabel(string value) { - this.Label = value; - return this; - } - - public TextInput WithIsRequired(bool value) { - this.IsRequired = value; - return this; - } - - public TextInput WithErrorMessage(string value) { - this.ErrorMessage = value; - return this; - } - - public TextInput WithValueChangedAction(Action value) { - this.ValueChangedAction = value; - return this; - } - - public TextInput WithValue(string value) { - this.Value = value; - return this; - } - - public TextInput WithMaxLength(float value) { - this.MaxLength = value; - return this; - } - - public TextInput WithIsMultiline(bool value) { - this.IsMultiline = value; - return this; - } - - public TextInput WithPlaceholder(string value) { - this.Placeholder = value; - return this; - } - - public TextInput WithStyle(InputTextStyle value) { - this.Style = value; - return this; - } - - public TextInput WithInlineAction(Action value) { - this.InlineAction = value; - return this; - } - - public TextInput WithRegex(string value) { - this.Regex = value; - return this; - } - - public TextInput WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public TextInput WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public OpenUrlAction WithStyle(ActionStyle value) + { + this.Style = value; + return this; + } -/// -/// An input to allow the user to select a date. -/// -public class DateInput : CardElement -{ - /// - /// Deserializes a JSON string into an object of type DateInput. - /// - public static DateInput? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Input.Date**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Input.Date"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The label of the input. - /// - /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. - /// - [JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("isRequired")] - public bool? IsRequired { get; set; } = false; - - /// - /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("errorMessage")] - public string? ErrorMessage { get; set; } - - /// - /// An Action.ResetInputs action that will be executed when the value of the input changes. - /// - [JsonPropertyName("valueChangedAction")] - public Action? ValueChangedAction { get; set; } - - /// - /// The default value of the input, in the `YYYY-MM-DD` format. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - /// - /// The text to display as a placeholder when the user has not selected a date. - /// - [JsonPropertyName("placeholder")] - public string? Placeholder { get; set; } - - /// - /// The minimum date that can be selected. - /// - [JsonPropertyName("min")] - public string? Min { get; set; } - - /// - /// The maximum date that can be selected. - /// - [JsonPropertyName("max")] - public string? Max { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this DateInput into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public DateInput WithKey(string value) { - this.Key = value; - return this; - } - - public DateInput WithId(string value) { - this.Id = value; - return this; - } - - public DateInput WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public DateInput WithLang(string value) { - this.Lang = value; - return this; - } - - public DateInput WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public DateInput WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public DateInput WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public DateInput WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public DateInput WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public DateInput WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public DateInput WithLabel(string value) { - this.Label = value; - return this; - } - - public DateInput WithIsRequired(bool value) { - this.IsRequired = value; - return this; - } - - public DateInput WithErrorMessage(string value) { - this.ErrorMessage = value; - return this; - } - - public DateInput WithValueChangedAction(Action value) { - this.ValueChangedAction = value; - return this; - } - - public DateInput WithValue(string value) { - this.Value = value; - return this; - } - - public DateInput WithPlaceholder(string value) { - this.Placeholder = value; - return this; - } - - public DateInput WithMin(string value) { - this.Min = value; - return this; - } - - public DateInput WithMax(string value) { - this.Max = value; - return this; - } - - public DateInput WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public DateInput WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public OpenUrlAction WithMode(ActionMode value) + { + this.Mode = value; + return this; + } -/// -/// An input to allow the user to select a time. -/// -public class TimeInput : CardElement -{ - /// - /// Deserializes a JSON string into an object of type TimeInput. - /// - public static TimeInput? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Input.Time**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Input.Time"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The label of the input. - /// - /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. - /// - [JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("isRequired")] - public bool? IsRequired { get; set; } = false; - - /// - /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("errorMessage")] - public string? ErrorMessage { get; set; } - - /// - /// An Action.ResetInputs action that will be executed when the value of the input changes. - /// - [JsonPropertyName("valueChangedAction")] - public Action? ValueChangedAction { get; set; } - - /// - /// The default value of the input, in the `HH:MM` format. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - /// - /// The text to display as a placeholder when the user hasn't entered a value. - /// - [JsonPropertyName("placeholder")] - public string? Placeholder { get; set; } - - /// - /// The minimum time that can be selected, in the `HH:MM` format. - /// - [JsonPropertyName("min")] - public string? Min { get; set; } - - /// - /// The maximum time that can be selected, in the `HH:MM` format. - /// - [JsonPropertyName("max")] - public string? Max { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this TimeInput into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TimeInput WithKey(string value) { - this.Key = value; - return this; - } - - public TimeInput WithId(string value) { - this.Id = value; - return this; - } - - public TimeInput WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public TimeInput WithLang(string value) { - this.Lang = value; - return this; - } - - public TimeInput WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public TimeInput WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public TimeInput WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public TimeInput WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public TimeInput WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public TimeInput WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public TimeInput WithLabel(string value) { - this.Label = value; - return this; - } - - public TimeInput WithIsRequired(bool value) { - this.IsRequired = value; - return this; - } - - public TimeInput WithErrorMessage(string value) { - this.ErrorMessage = value; - return this; - } - - public TimeInput WithValueChangedAction(Action value) { - this.ValueChangedAction = value; - return this; - } - - public TimeInput WithValue(string value) { - this.Value = value; - return this; - } - - public TimeInput WithPlaceholder(string value) { - this.Placeholder = value; - return this; - } - - public TimeInput WithMin(string value) { - this.Min = value; - return this; - } - - public TimeInput WithMax(string value) { - this.Max = value; - return this; - } - - public TimeInput WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public TimeInput WithFallback(IUnion value) { - this.Fallback = value; - return this; - } + public OpenUrlAction WithTooltip(string value) + { + this.Tooltip = value; + return this; + } + + public OpenUrlAction WithIsEnabled(bool value) + { + this.IsEnabled = value; + return this; + } + + public OpenUrlAction WithMenuActions(params IList value) + { + this.MenuActions = value; + return this; + } + + public OpenUrlAction WithThemedIconUrls(params IList value) + { + this.ThemedIconUrls = value; + return this; + } + + public OpenUrlAction WithUrl(string value) + { + this.Url = value; + return this; + } + + public OpenUrlAction WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } } /// -/// An input to allow the user to enter a number. +/// Opens a task module in a modal dialog hosting the content at a provided URL. /// -public class NumberInput : CardElement +public class OpenUrlDialogAction : Action { - /// - /// Deserializes a JSON string into an object of type NumberInput. - /// - public static NumberInput? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Input.Number**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Input.Number"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The label of the input. - /// - /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. - /// - [JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("isRequired")] - public bool? IsRequired { get; set; } = false; - - /// - /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("errorMessage")] - public string? ErrorMessage { get; set; } - - /// - /// An Action.ResetInputs action that will be executed when the value of the input changes. - /// - [JsonPropertyName("valueChangedAction")] - public Action? ValueChangedAction { get; set; } - - /// - /// The default value of the input. - /// - [JsonPropertyName("value")] - public float? Value { get; set; } - - /// - /// The text to display as a placeholder when the user hasn't entered a value. - /// - [JsonPropertyName("placeholder")] - public string? Placeholder { get; set; } - - /// - /// The minimum value that can be entered. - /// - [JsonPropertyName("min")] - public float? Min { get; set; } - - /// - /// The maximum value that can be entered. - /// - [JsonPropertyName("max")] - public float? Max { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this NumberInput into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public NumberInput WithKey(string value) { - this.Key = value; - return this; - } - - public NumberInput WithId(string value) { - this.Id = value; - return this; - } - - public NumberInput WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public NumberInput WithLang(string value) { - this.Lang = value; - return this; - } - - public NumberInput WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public NumberInput WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public NumberInput WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public NumberInput WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public NumberInput WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public NumberInput WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public NumberInput WithLabel(string value) { - this.Label = value; - return this; - } - - public NumberInput WithIsRequired(bool value) { - this.IsRequired = value; - return this; - } - - public NumberInput WithErrorMessage(string value) { - this.ErrorMessage = value; - return this; - } - - public NumberInput WithValueChangedAction(Action value) { - this.ValueChangedAction = value; - return this; - } - - public NumberInput WithValue(float value) { - this.Value = value; - return this; - } - - public NumberInput WithPlaceholder(string value) { - this.Placeholder = value; - return this; - } - - public NumberInput WithMin(float value) { - this.Min = value; - return this; - } - - public NumberInput WithMax(float value) { - this.Max = value; - return this; - } - - public NumberInput WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public NumberInput WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + /// + /// Deserializes a JSON string into an object of type OpenUrlDialogAction. + /// + public static OpenUrlDialogAction? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } -/// -/// An input to allow the user to select between on/off states. -/// -public class ToggleInput : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ToggleInput. - /// - public static ToggleInput? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Input.Toggle**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Input.Toggle"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The label of the input. - /// - /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. - /// - [JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("isRequired")] - public bool? IsRequired { get; set; } = false; - - /// - /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("errorMessage")] - public string? ErrorMessage { get; set; } - - /// - /// An Action.ResetInputs action that will be executed when the value of the input changes. - /// - [JsonPropertyName("valueChangedAction")] - public Action? ValueChangedAction { get; set; } - - /// - /// The default value of the input. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } = "false"; - - /// - /// The title (caption) to display next to the toggle. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The value to send to the Bot when the toggle is on. - /// - [JsonPropertyName("valueOn")] - public string? ValueOn { get; set; } = "true"; - - /// - /// The value to send to the Bot when the toggle is off. - /// - [JsonPropertyName("valueOff")] - public string? ValueOff { get; set; } = "false"; - - /// - /// Controls if the title should wrap. - /// - [JsonPropertyName("wrap")] - public bool? Wrap { get; set; } = true; - - /// - /// Controls whether the title is visually displayed. When set to false, the title is hidden from view but remains accessible to screen readers for accessibility purposes. - /// - [JsonPropertyName("showTitle")] - public bool? ShowTitle { get; set; } = true; - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - public ToggleInput(string title) - { - this.Title = title; - } + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Action.OpenUrlDialog**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Action.OpenUrlDialog"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The title of the action, as it appears on buttons. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + /// + /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + /// + [JsonPropertyName("iconUrl")] + public string? IconUrl { get; set; } + + /// + /// Control the style of the action, affecting its visual and spoken representations. + /// + [JsonPropertyName("style")] + public ActionStyle? Style { get; set; } = ActionStyle.Default; + + /// + /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + /// + [JsonPropertyName("mode")] + public ActionMode? Mode { get; set; } = ActionMode.Primary; + + /// + /// The tooltip text to display when the action is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + /// + [JsonPropertyName("isEnabled")] + public bool? IsEnabled { get; set; } = true; + + /// + /// The actions to display in the overflow menu of a Split action button. + /// + [JsonPropertyName("menuActions")] + public IList? MenuActions { get; set; } + + /// + /// A set of theme-specific icon URLs. + /// + [JsonPropertyName("themedIconUrls")] + public IList? ThemedIconUrls { get; set; } + + /// + /// The title of the dialog to be displayed in the dialog header. + /// + [JsonPropertyName("dialogTitle")] + public string? DialogTitle { get; set; } + + /// + /// The height of the dialog. To define height as a number of pixels, use the px format. + /// + [JsonPropertyName("dialogHeight")] + public string? DialogHeight { get; set; } + + /// + /// The width of the dialog. To define width as a number of pixels, use the px format. + /// + [JsonPropertyName("dialogWidth")] + public string? DialogWidth { get; set; } + + /// + /// The URL to open. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this OpenUrlDialogAction into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } - /// - /// Serializes this ToggleInput into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ToggleInput WithKey(string value) { - this.Key = value; - return this; - } - - public ToggleInput WithId(string value) { - this.Id = value; - return this; - } - - public ToggleInput WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public ToggleInput WithLang(string value) { - this.Lang = value; - return this; - } - - public ToggleInput WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public ToggleInput WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public ToggleInput WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public ToggleInput WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public ToggleInput WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public ToggleInput WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public ToggleInput WithLabel(string value) { - this.Label = value; - return this; - } - - public ToggleInput WithIsRequired(bool value) { - this.IsRequired = value; - return this; - } - - public ToggleInput WithErrorMessage(string value) { - this.ErrorMessage = value; - return this; - } - - public ToggleInput WithValueChangedAction(Action value) { - this.ValueChangedAction = value; - return this; - } - - public ToggleInput WithValue(string value) { - this.Value = value; - return this; - } - - public ToggleInput WithTitle(string value) { - this.Title = value; - return this; - } - - public ToggleInput WithValueOn(string value) { - this.ValueOn = value; - return this; - } - - public ToggleInput WithValueOff(string value) { - this.ValueOff = value; - return this; - } - - public ToggleInput WithWrap(bool value) { - this.Wrap = value; - return this; - } - - public ToggleInput WithShowTitle(bool value) { - this.ShowTitle = value; - return this; - } - - public ToggleInput WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public ToggleInput WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public OpenUrlDialogAction WithKey(string value) + { + this.Key = value; + return this; + } -/// -/// An input to allow the user to select one or more values. -/// -public class ChoiceSetInput : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ChoiceSetInput. - /// - public static ChoiceSetInput? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Input.ChoiceSet**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Input.ChoiceSet"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The label of the input. - /// - /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. - /// - [JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("isRequired")] - public bool? IsRequired { get; set; } = false; - - /// - /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("errorMessage")] - public string? ErrorMessage { get; set; } - - /// - /// An Action.ResetInputs action that will be executed when the value of the input changes. - /// - [JsonPropertyName("valueChangedAction")] - public Action? ValueChangedAction { get; set; } - - /// - /// The default value of the input. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - /// - /// The choices associated with the input. - /// - [JsonPropertyName("choices")] - public IList? Choices { get; set; } - - /// - /// A Data.Query object that defines the dataset from which to dynamically fetch the choices for the input. - /// - [JsonPropertyName("choices.data")] - public QueryData? ChoicesData { get; set; } - - /// - /// Controls whether the input should be displayed as a dropdown (compact) or a list of radio buttons or checkboxes (expanded). - /// - [JsonPropertyName("style")] - public ChoiceSetInputStyle? Style { get; set; } = ChoiceSetInputStyle.Compact; - - /// - /// Controls whether multiple choices can be selected. - /// - [JsonPropertyName("isMultiSelect")] - public bool? IsMultiSelect { get; set; } = false; - - /// - /// The text to display as a placeholder when the user has not entered any value. - /// - [JsonPropertyName("placeholder")] - public string? Placeholder { get; set; } - - /// - /// Controls if choice titles should wrap. - /// - [JsonPropertyName("wrap")] - public bool? Wrap { get; set; } = true; - - /// - /// Controls whether choice items are arranged in multiple columns in expanded mode, or in a single column. Default is false. - /// - [JsonPropertyName("useMultipleColumns")] - public bool? UseMultipleColumns { get; set; } = false; - - /// - /// The minimum width, in pixels, for each column when using a multi-column layout. This ensures that choice items remain readable even when horizontal space is limited. Default is 100 pixels. - /// - [JsonPropertyName("minColumnWidth")] - public string? MinColumnWidth { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - public ChoiceSetInput(params IList choices) - { - this.Choices = choices; - } + public OpenUrlDialogAction WithId(string value) + { + this.Id = value; + return this; + } - /// - /// Serializes this ChoiceSetInput into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ChoiceSetInput WithKey(string value) { - this.Key = value; - return this; - } - - public ChoiceSetInput WithId(string value) { - this.Id = value; - return this; - } - - public ChoiceSetInput WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public ChoiceSetInput WithLang(string value) { - this.Lang = value; - return this; - } - - public ChoiceSetInput WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public ChoiceSetInput WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public ChoiceSetInput WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public ChoiceSetInput WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public ChoiceSetInput WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public ChoiceSetInput WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public ChoiceSetInput WithLabel(string value) { - this.Label = value; - return this; - } - - public ChoiceSetInput WithIsRequired(bool value) { - this.IsRequired = value; - return this; - } - - public ChoiceSetInput WithErrorMessage(string value) { - this.ErrorMessage = value; - return this; - } - - public ChoiceSetInput WithValueChangedAction(Action value) { - this.ValueChangedAction = value; - return this; - } - - public ChoiceSetInput WithValue(string value) { - this.Value = value; - return this; - } - - public ChoiceSetInput WithChoices(params IList value) { - this.Choices = value; - return this; - } - - public ChoiceSetInput WithChoicesData(QueryData value) { - this.ChoicesData = value; - return this; - } - - public ChoiceSetInput WithStyle(ChoiceSetInputStyle value) { - this.Style = value; - return this; - } - - public ChoiceSetInput WithIsMultiSelect(bool value) { - this.IsMultiSelect = value; - return this; - } - - public ChoiceSetInput WithPlaceholder(string value) { - this.Placeholder = value; - return this; - } - - public ChoiceSetInput WithWrap(bool value) { - this.Wrap = value; - return this; - } - - public ChoiceSetInput WithUseMultipleColumns(bool value) { - this.UseMultipleColumns = value; - return this; - } - - public ChoiceSetInput WithMinColumnWidth(string value) { - this.MinColumnWidth = value; - return this; - } - - public ChoiceSetInput WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public ChoiceSetInput WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public OpenUrlDialogAction WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } -/// -/// A choice as used by the Input.ChoiceSet input. -/// -public class Choice : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type Choice. - /// - public static Choice? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The text to display for the choice. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The value associated with the choice, as sent to the Bot when an Action.Submit or Action.Execute is invoked - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - /// - /// Serializes this Choice into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Choice WithKey(string value) { - this.Key = value; - return this; - } - - public Choice WithTitle(string value) { - this.Title = value; - return this; - } - - public Choice WithValue(string value) { - this.Value = value; - return this; - } -} + public OpenUrlDialogAction WithTitle(string value) + { + this.Title = value; + return this; + } -/// -/// Defines a query to dynamically fetch data from a Bot. -/// -public class QueryData : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type QueryData. - /// - public static QueryData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Data.Query**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Data.Query"; - - /// - /// The dataset from which to fetch the data. - /// - [JsonPropertyName("dataset")] - public string? Dataset { get; set; } - - /// - /// Controls which inputs are associated with the Data.Query. When a Data.Query is executed, the values of the associated inputs are sent to the Bot, allowing it to perform filtering operations based on the user's input. - /// - [JsonPropertyName("associatedInputs")] - public AssociatedInputs? AssociatedInputs { get; set; } - - /// - /// The maximum number of data items that should be returned by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. - /// - [JsonPropertyName("count")] - public float? Count { get; set; } - - /// - /// The number of data items to be skipped by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. - /// - [JsonPropertyName("skip")] - public float? Skip { get; set; } - - /// - /// Serializes this QueryData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public QueryData WithKey(string value) { - this.Key = value; - return this; - } - - public QueryData WithDataset(string value) { - this.Dataset = value; - return this; - } - - public QueryData WithAssociatedInputs(AssociatedInputs value) { - this.AssociatedInputs = value; - return this; - } - - public QueryData WithCount(float value) { - this.Count = value; - return this; - } - - public QueryData WithSkip(float value) { - this.Skip = value; - return this; - } -} + public OpenUrlDialogAction WithIconUrl(string value) + { + this.IconUrl = value; + return this; + } -/// -/// An input to allow the user to rate something using stars. -/// -public class RatingInput : CardElement -{ - /// - /// Deserializes a JSON string into an object of type RatingInput. - /// - public static RatingInput? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Input.Rating**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Input.Rating"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The label of the input. - /// - /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. - /// - [JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("isRequired")] - public bool? IsRequired { get; set; } = false; - - /// - /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. - /// - [JsonPropertyName("errorMessage")] - public string? ErrorMessage { get; set; } - - /// - /// An Action.ResetInputs action that will be executed when the value of the input changes. - /// - [JsonPropertyName("valueChangedAction")] - public Action? ValueChangedAction { get; set; } - - /// - /// The default value of the input. - /// - [JsonPropertyName("value")] - public float? Value { get; set; } - - /// - /// The number of stars to display. - /// - [JsonPropertyName("max")] - public float? Max { get; set; } = 5; - - /// - /// Controls if the user can select half stars. - /// - [JsonPropertyName("allowHalfSteps")] - public bool? AllowHalfSteps { get; set; } = false; - - /// - /// The size of the stars. - /// - [JsonPropertyName("size")] - public RatingSize? Size { get; set; } = RatingSize.Large; - - /// - /// The color of the stars. - /// - [JsonPropertyName("color")] - public RatingColor? Color { get; set; } = RatingColor.Neutral; - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this RatingInput into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public RatingInput WithKey(string value) { - this.Key = value; - return this; - } - - public RatingInput WithId(string value) { - this.Id = value; - return this; - } - - public RatingInput WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public RatingInput WithLang(string value) { - this.Lang = value; - return this; - } - - public RatingInput WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public RatingInput WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public RatingInput WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public RatingInput WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public RatingInput WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public RatingInput WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public RatingInput WithLabel(string value) { - this.Label = value; - return this; - } - - public RatingInput WithIsRequired(bool value) { - this.IsRequired = value; - return this; - } - - public RatingInput WithErrorMessage(string value) { - this.ErrorMessage = value; - return this; - } - - public RatingInput WithValueChangedAction(Action value) { - this.ValueChangedAction = value; - return this; - } - - public RatingInput WithValue(float value) { - this.Value = value; - return this; - } - - public RatingInput WithMax(float value) { - this.Max = value; - return this; - } - - public RatingInput WithAllowHalfSteps(bool value) { - this.AllowHalfSteps = value; - return this; - } - - public RatingInput WithSize(RatingSize value) { - this.Size = value; - return this; - } - - public RatingInput WithColor(RatingColor value) { - this.Color = value; - return this; - } - - public RatingInput WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public RatingInput WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public OpenUrlDialogAction WithStyle(ActionStyle value) + { + this.Style = value; + return this; + } -/// -/// A read-only star rating element, to display the rating of something. -/// -public class Rating : CardElement -{ - /// - /// Deserializes a JSON string into an object of type Rating. - /// - public static Rating? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Rating**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Rating"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The value of the rating. Must be between 0 and max. - /// - [JsonPropertyName("value")] - public float? Value { get; set; } - - /// - /// The number of "votes" associated with the rating. - /// - [JsonPropertyName("count")] - public float? Count { get; set; } - - /// - /// The number of stars to display. - /// - [JsonPropertyName("max")] - public float? Max { get; set; } = 5; - - /// - /// The size of the stars. - /// - [JsonPropertyName("size")] - public RatingSize? Size { get; set; } = RatingSize.Large; - - /// - /// The color of the stars. - /// - [JsonPropertyName("color")] - public RatingColor? Color { get; set; } = RatingColor.Neutral; - - /// - /// The style of the stars. - /// - [JsonPropertyName("style")] - public RatingStyle? Style { get; set; } = RatingStyle.Default; - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this Rating into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Rating WithKey(string value) { - this.Key = value; - return this; - } - - public Rating WithId(string value) { - this.Id = value; - return this; - } - - public Rating WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public Rating WithLang(string value) { - this.Lang = value; - return this; - } - - public Rating WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public Rating WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public Rating WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public Rating WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public Rating WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public Rating WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public Rating WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public Rating WithValue(float value) { - this.Value = value; - return this; - } - - public Rating WithCount(float value) { - this.Count = value; - return this; - } - - public Rating WithMax(float value) { - this.Max = value; - return this; - } - - public Rating WithSize(RatingSize value) { - this.Size = value; - return this; - } - - public Rating WithColor(RatingColor value) { - this.Color = value; - return this; - } - - public Rating WithStyle(RatingStyle value) { - this.Style = value; - return this; - } - - public Rating WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public Rating WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public OpenUrlDialogAction WithMode(ActionMode value) + { + this.Mode = value; + return this; + } -/// -/// A special type of button with an icon, title and description. -/// -public class CompoundButton : CardElement -{ - /// - /// Deserializes a JSON string into an object of type CompoundButton. - /// - public static CompoundButton? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **CompoundButton**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "CompoundButton"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The icon to show on the button. - /// - [JsonPropertyName("icon")] - public IconInfo? Icon { get; set; } - - /// - /// The badge to show on the button. - /// - [JsonPropertyName("badge")] - public string? Badge { get; set; } - - /// - /// The title of the button. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The description text of the button. - /// - [JsonPropertyName("description")] - public string? Description { get; set; } - - /// - /// An Action that will be invoked when the button is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this CompoundButton into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public CompoundButton WithKey(string value) { - this.Key = value; - return this; - } - - public CompoundButton WithId(string value) { - this.Id = value; - return this; - } - - public CompoundButton WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public CompoundButton WithLang(string value) { - this.Lang = value; - return this; - } - - public CompoundButton WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public CompoundButton WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public CompoundButton WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public CompoundButton WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public CompoundButton WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public CompoundButton WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public CompoundButton WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public CompoundButton WithIcon(IconInfo value) { - this.Icon = value; - return this; - } - - public CompoundButton WithBadge(string value) { - this.Badge = value; - return this; - } - - public CompoundButton WithTitle(string value) { - this.Title = value; - return this; - } - - public CompoundButton WithDescription(string value) { - this.Description = value; - return this; - } - - public CompoundButton WithSelectAction(Action value) { - this.SelectAction = value; - return this; - } - - public CompoundButton WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public CompoundButton WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public OpenUrlDialogAction WithTooltip(string value) + { + this.Tooltip = value; + return this; + } -/// -/// Defines information about a Fluent icon and how it should be rendered. -/// -public class IconInfo : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type IconInfo. - /// - public static IconInfo? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The name of the icon to display. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// The size of the icon. - /// - [JsonPropertyName("size")] - public IconSize? Size { get; set; } = IconSize.XSmall; - - /// - /// The style of the icon. - /// - [JsonPropertyName("style")] - public IconStyle? Style { get; set; } = IconStyle.Regular; - - /// - /// The color of the icon. - /// - [JsonPropertyName("color")] - public TextColor? Color { get; set; } = TextColor.Default; - - /// - /// Serializes this IconInfo into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public IconInfo WithKey(string value) { - this.Key = value; - return this; - } - - public IconInfo WithName(string value) { - this.Name = value; - return this; - } - - public IconInfo WithSize(IconSize value) { - this.Size = value; - return this; - } - - public IconInfo WithStyle(IconStyle value) { - this.Style = value; - return this; - } - - public IconInfo WithColor(TextColor value) { - this.Color = value; - return this; - } -} + public OpenUrlDialogAction WithIsEnabled(bool value) + { + this.IsEnabled = value; + return this; + } -/// -/// A standalone icon element. Icons can be picked from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog). -/// -public class Icon : CardElement -{ - /// - /// Deserializes a JSON string into an object of type Icon. - /// - public static Icon? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Icon**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Icon"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The name of the icon to display. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// The size of the icon. - /// - [JsonPropertyName("size")] - public IconSize? Size { get; set; } = IconSize.Standard; - - /// - /// The style of the icon. - /// - [JsonPropertyName("style")] - public IconStyle? Style { get; set; } = IconStyle.Regular; - - /// - /// The color of the icon. - /// - [JsonPropertyName("color")] - public TextColor? Color { get; set; } = TextColor.Default; - - /// - /// An Action that will be invoked when the icon is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - public Icon(string name) - { - this.Name = name; - } + public OpenUrlDialogAction WithMenuActions(params IList value) + { + this.MenuActions = value; + return this; + } - /// - /// Serializes this Icon into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Icon WithKey(string value) { - this.Key = value; - return this; - } - - public Icon WithId(string value) { - this.Id = value; - return this; - } - - public Icon WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public Icon WithLang(string value) { - this.Lang = value; - return this; - } - - public Icon WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public Icon WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public Icon WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public Icon WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public Icon WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public Icon WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public Icon WithName(string value) { - this.Name = value; - return this; - } - - public Icon WithSize(IconSize value) { - this.Size = value; - return this; - } - - public Icon WithStyle(IconStyle value) { - this.Style = value; - return this; - } - - public Icon WithColor(TextColor value) { - this.Color = value; - return this; - } - - public Icon WithSelectAction(Action value) { - this.SelectAction = value; - return this; - } - - public Icon WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public Icon WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public OpenUrlDialogAction WithThemedIconUrls(params IList value) + { + this.ThemedIconUrls = value; + return this; + } -/// -/// A carousel with sliding pages. -/// -public class Carousel : CardElement -{ - /// - /// Deserializes a JSON string into an object of type Carousel. - /// - public static Carousel? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Carousel**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Carousel"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. - /// - [JsonPropertyName("bleed")] - public bool? Bleed { get; set; } = false; - - /// - /// The minimum height, in pixels, of the container, in the `px` format. - /// - [JsonPropertyName("minHeight")] - public string? MinHeight { get; set; } - - /// - /// Controls the type of animation to use to navigate between pages. - /// - [JsonPropertyName("pageAnimation")] - public CarouselPageAnimation? PageAnimation { get; set; } = CarouselPageAnimation.Slide; - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The pages in the carousel. - /// - [JsonPropertyName("pages")] - public IList? Pages { get; set; } - - /// - /// Serializes this Carousel into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Carousel WithKey(string value) { - this.Key = value; - return this; - } - - public Carousel WithId(string value) { - this.Id = value; - return this; - } - - public Carousel WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public Carousel WithLang(string value) { - this.Lang = value; - return this; - } - - public Carousel WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public Carousel WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public Carousel WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public Carousel WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public Carousel WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public Carousel WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public Carousel WithBleed(bool value) { - this.Bleed = value; - return this; - } - - public Carousel WithMinHeight(string value) { - this.MinHeight = value; - return this; - } - - public Carousel WithPageAnimation(CarouselPageAnimation value) { - this.PageAnimation = value; - return this; - } - - public Carousel WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public Carousel WithFallback(IUnion value) { - this.Fallback = value; - return this; - } - - public Carousel WithPages(params IList value) { - this.Pages = value; - return this; - } -} + public OpenUrlDialogAction WithDialogTitle(string value) + { + this.DialogTitle = value; + return this; + } -/// -/// A badge element to show an icon and/or text in a compact form over a colored background. -/// -public class Badge : CardElement -{ - /// - /// Deserializes a JSON string into an object of type Badge. - /// - public static Badge? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Badge**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Badge"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The text to display. - /// - [JsonPropertyName("text")] - public string? Text { get; set; } - - /// - /// The name of an icon from the [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) to display, in the `[,regular|filled]` format. If the style is not specified, the regular style is used. - /// - [JsonPropertyName("icon")] - public string? Icon { get; set; } - - /// - /// Controls the position of the icon. - /// - [JsonPropertyName("iconPosition")] - public BadgeIconPosition? IconPosition { get; set; } = BadgeIconPosition.Before; - - /// - /// Controls the strength of the background color. - /// - [JsonPropertyName("appearance")] - public BadgeAppearance? Appearance { get; set; } = BadgeAppearance.Filled; - - /// - /// The size of the badge. - /// - [JsonPropertyName("size")] - public BadgeSize? Size { get; set; } = BadgeSize.Medium; - - /// - /// Controls the shape of the badge. - /// - [JsonPropertyName("shape")] - public BadgeShape? Shape { get; set; } = BadgeShape.Circular; - - /// - /// The style of the badge. - /// - [JsonPropertyName("style")] - public BadgeStyle? Style { get; set; } = BadgeStyle.Default; - - /// - /// Controls the tooltip text to display when the badge is hovered over. - /// - [JsonPropertyName("tooltip")] - public string? Tooltip { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this Badge into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Badge WithKey(string value) { - this.Key = value; - return this; - } - - public Badge WithId(string value) { - this.Id = value; - return this; - } - - public Badge WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public Badge WithLang(string value) { - this.Lang = value; - return this; - } - - public Badge WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public Badge WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public Badge WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public Badge WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public Badge WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public Badge WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public Badge WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public Badge WithText(string value) { - this.Text = value; - return this; - } - - public Badge WithIcon(string value) { - this.Icon = value; - return this; - } - - public Badge WithIconPosition(BadgeIconPosition value) { - this.IconPosition = value; - return this; - } - - public Badge WithAppearance(BadgeAppearance value) { - this.Appearance = value; - return this; - } - - public Badge WithSize(BadgeSize value) { - this.Size = value; - return this; - } - - public Badge WithShape(BadgeShape value) { - this.Shape = value; - return this; - } - - public Badge WithStyle(BadgeStyle value) { - this.Style = value; - return this; - } - - public Badge WithTooltip(string value) { - this.Tooltip = value; - return this; - } - - public Badge WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public Badge WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public OpenUrlDialogAction WithDialogHeight(string value) + { + this.DialogHeight = value; + return this; + } -/// -/// A spinning ring element, to indicate progress. -/// -public class ProgressRing : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ProgressRing. - /// - public static ProgressRing? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **ProgressRing**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "ProgressRing"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The label of the progress ring. - /// - [JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Controls the relative position of the label to the progress ring. - /// - [JsonPropertyName("labelPosition")] - public ProgressRingLabelPosition? LabelPosition { get; set; } = ProgressRingLabelPosition.Below; - - /// - /// The size of the progress ring. - /// - [JsonPropertyName("size")] - public ProgressRingSize? Size { get; set; } = ProgressRingSize.Medium; - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ProgressRing into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ProgressRing WithKey(string value) { - this.Key = value; - return this; - } - - public ProgressRing WithId(string value) { - this.Id = value; - return this; - } - - public ProgressRing WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public ProgressRing WithLang(string value) { - this.Lang = value; - return this; - } - - public ProgressRing WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public ProgressRing WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public ProgressRing WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public ProgressRing WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public ProgressRing WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public ProgressRing WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public ProgressRing WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public ProgressRing WithLabel(string value) { - this.Label = value; - return this; - } - - public ProgressRing WithLabelPosition(ProgressRingLabelPosition value) { - this.LabelPosition = value; - return this; - } - - public ProgressRing WithSize(ProgressRingSize value) { - this.Size = value; - return this; - } - - public ProgressRing WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public ProgressRing WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public OpenUrlDialogAction WithDialogWidth(string value) + { + this.DialogWidth = value; + return this; + } -/// -/// A progress bar element, to represent a value within a range. -/// -public class ProgressBar : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ProgressBar. - /// - public static ProgressBar? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **ProgressBar**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "ProgressBar"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The value of the progress bar. Must be between 0 and max. - /// - [JsonPropertyName("value")] - public float? Value { get; set; } - - /// - /// The maximum value of the progress bar. - /// - [JsonPropertyName("max")] - public float? Max { get; set; } = 100; - - /// - /// The color of the progress bar. `color` has no effect when the `ProgressBar` is in indeterminate mode, in which case the "accent" color is always used. - /// - [JsonPropertyName("color")] - public ProgressBarColor? Color { get; set; } = ProgressBarColor.Accent; - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ProgressBar into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ProgressBar WithKey(string value) { - this.Key = value; - return this; - } - - public ProgressBar WithId(string value) { - this.Id = value; - return this; - } - - public ProgressBar WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public ProgressBar WithLang(string value) { - this.Lang = value; - return this; - } - - public ProgressBar WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public ProgressBar WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public ProgressBar WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public ProgressBar WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public ProgressBar WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public ProgressBar WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public ProgressBar WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public ProgressBar WithValue(float value) { - this.Value = value; - return this; - } - - public ProgressBar WithMax(float value) { - this.Max = value; - return this; - } - - public ProgressBar WithColor(ProgressBarColor value) { - this.Color = value; - return this; - } - - public ProgressBar WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public ProgressBar WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public OpenUrlDialogAction WithUrl(string value) + { + this.Url = value; + return this; + } -/// -/// A donut chart. -/// -public class DonutChart : CardElement -{ - /// - /// Deserializes a JSON string into an object of type DonutChart. - /// - public static DonutChart? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Chart.Donut**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Chart.Donut"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The title of the chart. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// Controls whether the chart's title should be displayed. Defaults to `false`. - /// - [JsonPropertyName("showTitle")] - public bool? ShowTitle { get; set; } = false; - - /// - /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("colorSet")] - public ChartColorSet? ColorSet { get; set; } - - /// - /// The maximum width, in pixels, of the chart, in the `px` format. - /// - [JsonPropertyName("maxWidth")] - public string? MaxWidth { get; set; } - - /// - /// Controls whether the chart's legend should be displayed. - /// - [JsonPropertyName("showLegend")] - public bool? ShowLegend { get; set; } = true; - - /// - /// The data to display in the chart. - /// - [JsonPropertyName("data")] - public IList? Data { get; set; } - - /// - /// The value that should be displayed in the center of a Donut chart. `value` is ignored for Pie charts. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - /// - /// Controls the color of the value displayed in the center of a Donut chart. - /// - [JsonPropertyName("valueColor")] - public ChartColor? ValueColor { get; set; } - - /// - /// Controls the thickness of the donut segments. Default is **Thick**. - /// - [JsonPropertyName("thickness")] - public DonutThickness? Thickness { get; set; } - - /// - /// Controls whether the outlines of the donut segments are displayed. - /// - [JsonPropertyName("showOutlines")] - public bool? ShowOutlines { get; set; } = true; - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this DonutChart into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public DonutChart WithKey(string value) { - this.Key = value; - return this; - } - - public DonutChart WithId(string value) { - this.Id = value; - return this; - } - - public DonutChart WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public DonutChart WithLang(string value) { - this.Lang = value; - return this; - } - - public DonutChart WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public DonutChart WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public DonutChart WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public DonutChart WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public DonutChart WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public DonutChart WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public DonutChart WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public DonutChart WithTitle(string value) { - this.Title = value; - return this; - } - - public DonutChart WithShowTitle(bool value) { - this.ShowTitle = value; - return this; - } - - public DonutChart WithColorSet(ChartColorSet value) { - this.ColorSet = value; - return this; - } - - public DonutChart WithMaxWidth(string value) { - this.MaxWidth = value; - return this; - } - - public DonutChart WithShowLegend(bool value) { - this.ShowLegend = value; - return this; - } - - public DonutChart WithData(params IList value) { - this.Data = value; - return this; - } - - public DonutChart WithValue(string value) { - this.Value = value; - return this; - } - - public DonutChart WithValueColor(ChartColor value) { - this.ValueColor = value; - return this; - } - - public DonutChart WithThickness(DonutThickness value) { - this.Thickness = value; - return this; - } - - public DonutChart WithShowOutlines(bool value) { - this.ShowOutlines = value; - return this; - } - - public DonutChart WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public DonutChart WithFallback(IUnion value) { - this.Fallback = value; - return this; - } + public OpenUrlDialogAction WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } } /// -/// A data point in a Donut chart. +/// Resets the values of the inputs in the card. /// -public class DonutChartData : SerializableObject +public class ResetInputsAction : Action { - /// - /// Deserializes a JSON string into an object of type DonutChartData. - /// - public static DonutChartData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The legend of the chart. - /// - [JsonPropertyName("legend")] - public string? Legend { get; set; } - - /// - /// The value associated with the data point. - /// - [JsonPropertyName("value")] - public float? Value { get; set; } = 0; - - /// - /// The color to use for the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// Serializes this DonutChartData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public DonutChartData WithKey(string value) { - this.Key = value; - return this; - } - - public DonutChartData WithLegend(string value) { - this.Legend = value; - return this; - } - - public DonutChartData WithValue(float value) { - this.Value = value; - return this; - } - - public DonutChartData WithColor(ChartColor value) { - this.Color = value; - return this; - } -} + /// + /// Deserializes a JSON string into an object of type ResetInputsAction. + /// + public static ResetInputsAction? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } -/// -/// A pie chart. -/// -public class PieChart : CardElement -{ - /// - /// Deserializes a JSON string into an object of type PieChart. - /// - public static PieChart? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Chart.Pie**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Chart.Pie"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The title of the chart. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// Controls whether the chart's title should be displayed. Defaults to `false`. - /// - [JsonPropertyName("showTitle")] - public bool? ShowTitle { get; set; } = false; - - /// - /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("colorSet")] - public ChartColorSet? ColorSet { get; set; } - - /// - /// The maximum width, in pixels, of the chart, in the `px` format. - /// - [JsonPropertyName("maxWidth")] - public string? MaxWidth { get; set; } - - /// - /// Controls whether the chart's legend should be displayed. - /// - [JsonPropertyName("showLegend")] - public bool? ShowLegend { get; set; } = true; - - /// - /// The data to display in the chart. - /// - [JsonPropertyName("data")] - public IList? Data { get; set; } - - /// - /// The value that should be displayed in the center of a Donut chart. `value` is ignored for Pie charts. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - /// - /// Controls the color of the value displayed in the center of a Donut chart. - /// - [JsonPropertyName("valueColor")] - public ChartColor? ValueColor { get; set; } - - /// - /// Controls the thickness of the donut segments. Default is **Thick**. - /// - [JsonPropertyName("thickness")] - public DonutThickness? Thickness { get; set; } - - /// - /// Controls whether the outlines of the donut segments are displayed. - /// - [JsonPropertyName("showOutlines")] - public bool? ShowOutlines { get; set; } = true; - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this PieChart into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public PieChart WithKey(string value) { - this.Key = value; - return this; - } - - public PieChart WithId(string value) { - this.Id = value; - return this; - } - - public PieChart WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public PieChart WithLang(string value) { - this.Lang = value; - return this; - } - - public PieChart WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public PieChart WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public PieChart WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public PieChart WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public PieChart WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public PieChart WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public PieChart WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public PieChart WithTitle(string value) { - this.Title = value; - return this; - } - - public PieChart WithShowTitle(bool value) { - this.ShowTitle = value; - return this; - } - - public PieChart WithColorSet(ChartColorSet value) { - this.ColorSet = value; - return this; - } - - public PieChart WithMaxWidth(string value) { - this.MaxWidth = value; - return this; - } - - public PieChart WithShowLegend(bool value) { - this.ShowLegend = value; - return this; - } - - public PieChart WithData(params IList value) { - this.Data = value; - return this; - } - - public PieChart WithValue(string value) { - this.Value = value; - return this; - } - - public PieChart WithValueColor(ChartColor value) { - this.ValueColor = value; - return this; - } - - public PieChart WithThickness(DonutThickness value) { - this.Thickness = value; - return this; - } - - public PieChart WithShowOutlines(bool value) { - this.ShowOutlines = value; - return this; - } - - public PieChart WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public PieChart WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Action.ResetInputs**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Action.ResetInputs"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The title of the action, as it appears on buttons. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + /// + /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + /// + [JsonPropertyName("iconUrl")] + public string? IconUrl { get; set; } + + /// + /// Control the style of the action, affecting its visual and spoken representations. + /// + [JsonPropertyName("style")] + public ActionStyle? Style { get; set; } = ActionStyle.Default; + + /// + /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + /// + [JsonPropertyName("mode")] + public ActionMode? Mode { get; set; } = ActionMode.Primary; + + /// + /// The tooltip text to display when the action is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + /// + [JsonPropertyName("isEnabled")] + public bool? IsEnabled { get; set; } = true; + + /// + /// The actions to display in the overflow menu of a Split action button. + /// + [JsonPropertyName("menuActions")] + public IList? MenuActions { get; set; } + + /// + /// A set of theme-specific icon URLs. + /// + [JsonPropertyName("themedIconUrls")] + public IList? ThemedIconUrls { get; set; } + + /// + /// The Ids of the inputs that should be reset. + /// + [JsonPropertyName("targetInputIds")] + public IList? TargetInputIds { get; set; } + + /// + /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ResetInputsAction into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } -/// -/// A grouped vertical bar chart. -/// -public class GroupedVerticalBarChart : CardElement -{ - /// - /// Deserializes a JSON string into an object of type GroupedVerticalBarChart. - /// - public static GroupedVerticalBarChart? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Chart.VerticalBar.Grouped**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Chart.VerticalBar.Grouped"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The title of the chart. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// Controls whether the chart's title should be displayed. Defaults to `false`. - /// - [JsonPropertyName("showTitle")] - public bool? ShowTitle { get; set; } = false; - - /// - /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("colorSet")] - public ChartColorSet? ColorSet { get; set; } - - /// - /// The maximum width, in pixels, of the chart, in the `px` format. - /// - [JsonPropertyName("maxWidth")] - public string? MaxWidth { get; set; } - - /// - /// Controls whether the chart's legend should be displayed. - /// - [JsonPropertyName("showLegend")] - public bool? ShowLegend { get; set; } = true; - - /// - /// The title of the x axis. - /// - [JsonPropertyName("xAxisTitle")] - public string? XAxisTitle { get; set; } - - /// - /// The title of the y axis. - /// - [JsonPropertyName("yAxisTitle")] - public string? YAxisTitle { get; set; } - - /// - /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// Controls if bars in the chart should be displayed as stacks instead of groups. - /// - /// **Note:** stacked vertical bar charts do not support custom Y ranges nor negative Y values. - /// - [JsonPropertyName("stacked")] - public bool? Stacked { get; set; } = false; - - /// - /// The data points in a series. - /// - [JsonPropertyName("data")] - public IList? Data { get; set; } - - /// - /// Controls if values should be displayed on each bar. - /// - [JsonPropertyName("showBarValues")] - public bool? ShowBarValues { get; set; } = false; - - /// - /// The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation. - /// - /// `yMin` is ignored if `stacked` is set to `true`. - /// - [JsonPropertyName("yMin")] - public float? YMin { get; set; } - - /// - /// The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation. - /// - /// `yMax` is ignored if `stacked` is set to `true`. - /// - [JsonPropertyName("yMax")] - public float? YMax { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this GroupedVerticalBarChart into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public GroupedVerticalBarChart WithKey(string value) { - this.Key = value; - return this; - } - - public GroupedVerticalBarChart WithId(string value) { - this.Id = value; - return this; - } - - public GroupedVerticalBarChart WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public GroupedVerticalBarChart WithLang(string value) { - this.Lang = value; - return this; - } - - public GroupedVerticalBarChart WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public GroupedVerticalBarChart WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public GroupedVerticalBarChart WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public GroupedVerticalBarChart WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public GroupedVerticalBarChart WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public GroupedVerticalBarChart WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public GroupedVerticalBarChart WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public GroupedVerticalBarChart WithTitle(string value) { - this.Title = value; - return this; - } - - public GroupedVerticalBarChart WithShowTitle(bool value) { - this.ShowTitle = value; - return this; - } - - public GroupedVerticalBarChart WithColorSet(ChartColorSet value) { - this.ColorSet = value; - return this; - } - - public GroupedVerticalBarChart WithMaxWidth(string value) { - this.MaxWidth = value; - return this; - } - - public GroupedVerticalBarChart WithShowLegend(bool value) { - this.ShowLegend = value; - return this; - } - - public GroupedVerticalBarChart WithXAxisTitle(string value) { - this.XAxisTitle = value; - return this; - } - - public GroupedVerticalBarChart WithYAxisTitle(string value) { - this.YAxisTitle = value; - return this; - } - - public GroupedVerticalBarChart WithColor(ChartColor value) { - this.Color = value; - return this; - } - - public GroupedVerticalBarChart WithStacked(bool value) { - this.Stacked = value; - return this; - } - - public GroupedVerticalBarChart WithData(params IList value) { - this.Data = value; - return this; - } - - public GroupedVerticalBarChart WithShowBarValues(bool value) { - this.ShowBarValues = value; - return this; - } - - public GroupedVerticalBarChart WithYMin(float value) { - this.YMin = value; - return this; - } - - public GroupedVerticalBarChart WithYMax(float value) { - this.YMax = value; - return this; - } - - public GroupedVerticalBarChart WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public GroupedVerticalBarChart WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public ResetInputsAction WithKey(string value) + { + this.Key = value; + return this; + } -/// -/// Represents a series of data points. -/// -public class GroupedVerticalBarChartData : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type GroupedVerticalBarChartData. - /// - public static GroupedVerticalBarChartData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The legend of the chart. - /// - [JsonPropertyName("legend")] - public string? Legend { get; set; } - - /// - /// The data points in the series. - /// - [JsonPropertyName("values")] - public IList? Values { get; set; } - - /// - /// The color to use for all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// Serializes this GroupedVerticalBarChartData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public GroupedVerticalBarChartData WithKey(string value) { - this.Key = value; - return this; - } - - public GroupedVerticalBarChartData WithLegend(string value) { - this.Legend = value; - return this; - } - - public GroupedVerticalBarChartData WithValues(params IList value) { - this.Values = value; - return this; - } - - public GroupedVerticalBarChartData WithColor(ChartColor value) { - this.Color = value; - return this; - } -} + public ResetInputsAction WithId(string value) + { + this.Id = value; + return this; + } -/// -/// A single data point in a bar chart. -/// -public class BarChartDataValue : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type BarChartDataValue. - /// - public static BarChartDataValue? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The x axis value of the data point. - /// - [JsonPropertyName("x")] - public string? X { get; set; } - - /// - /// The y axis value of the data point. - /// - [JsonPropertyName("y")] - public float? Y { get; set; } = 0; - - /// - /// Serializes this BarChartDataValue into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public BarChartDataValue WithKey(string value) { - this.Key = value; - return this; - } - - public BarChartDataValue WithX(string value) { - this.X = value; - return this; - } - - public BarChartDataValue WithY(float value) { - this.Y = value; - return this; - } -} + public ResetInputsAction WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } -/// -/// A vertical bar chart. -/// -public class VerticalBarChart : CardElement -{ - /// - /// Deserializes a JSON string into an object of type VerticalBarChart. - /// - public static VerticalBarChart? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Chart.VerticalBar**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Chart.VerticalBar"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The title of the chart. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// Controls whether the chart's title should be displayed. Defaults to `false`. - /// - [JsonPropertyName("showTitle")] - public bool? ShowTitle { get; set; } = false; - - /// - /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("colorSet")] - public ChartColorSet? ColorSet { get; set; } - - /// - /// The maximum width, in pixels, of the chart, in the `px` format. - /// - [JsonPropertyName("maxWidth")] - public string? MaxWidth { get; set; } - - /// - /// Controls whether the chart's legend should be displayed. - /// - [JsonPropertyName("showLegend")] - public bool? ShowLegend { get; set; } = true; - - /// - /// The title of the x axis. - /// - [JsonPropertyName("xAxisTitle")] - public string? XAxisTitle { get; set; } - - /// - /// The title of the y axis. - /// - [JsonPropertyName("yAxisTitle")] - public string? YAxisTitle { get; set; } - - /// - /// The data to display in the chart. - /// - [JsonPropertyName("data")] - public IList? Data { get; set; } - - /// - /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// Controls if the bar values should be displayed. - /// - [JsonPropertyName("showBarValues")] - public bool? ShowBarValues { get; set; } = false; - - /// - /// The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation. - /// - [JsonPropertyName("yMin")] - public float? YMin { get; set; } - - /// - /// The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation. - /// - [JsonPropertyName("yMax")] - public float? YMax { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this VerticalBarChart into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public VerticalBarChart WithKey(string value) { - this.Key = value; - return this; - } - - public VerticalBarChart WithId(string value) { - this.Id = value; - return this; - } - - public VerticalBarChart WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public VerticalBarChart WithLang(string value) { - this.Lang = value; - return this; - } - - public VerticalBarChart WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public VerticalBarChart WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public VerticalBarChart WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public VerticalBarChart WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public VerticalBarChart WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public VerticalBarChart WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public VerticalBarChart WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public VerticalBarChart WithTitle(string value) { - this.Title = value; - return this; - } - - public VerticalBarChart WithShowTitle(bool value) { - this.ShowTitle = value; - return this; - } - - public VerticalBarChart WithColorSet(ChartColorSet value) { - this.ColorSet = value; - return this; - } - - public VerticalBarChart WithMaxWidth(string value) { - this.MaxWidth = value; - return this; - } - - public VerticalBarChart WithShowLegend(bool value) { - this.ShowLegend = value; - return this; - } - - public VerticalBarChart WithXAxisTitle(string value) { - this.XAxisTitle = value; - return this; - } - - public VerticalBarChart WithYAxisTitle(string value) { - this.YAxisTitle = value; - return this; - } - - public VerticalBarChart WithData(params IList value) { - this.Data = value; - return this; - } - - public VerticalBarChart WithColor(ChartColor value) { - this.Color = value; - return this; - } - - public VerticalBarChart WithShowBarValues(bool value) { - this.ShowBarValues = value; - return this; - } - - public VerticalBarChart WithYMin(float value) { - this.YMin = value; - return this; - } - - public VerticalBarChart WithYMax(float value) { - this.YMax = value; - return this; - } - - public VerticalBarChart WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public VerticalBarChart WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public ResetInputsAction WithTitle(string value) + { + this.Title = value; + return this; + } -/// -/// Represents a data point in a vertical bar chart. -/// -public class VerticalBarChartDataValue : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type VerticalBarChartDataValue. - /// - public static VerticalBarChartDataValue? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The x axis value of the data point. - /// - [JsonPropertyName("x")] - public IUnion? X { get; set; } - - /// - /// The y axis value of the data point. - /// - [JsonPropertyName("y")] - public float? Y { get; set; } = 0; - - /// - /// The color to use for the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// Serializes this VerticalBarChartDataValue into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public VerticalBarChartDataValue WithKey(string value) { - this.Key = value; - return this; - } - - public VerticalBarChartDataValue WithX(IUnion value) { - this.X = value; - return this; - } - - public VerticalBarChartDataValue WithY(float value) { - this.Y = value; - return this; - } - - public VerticalBarChartDataValue WithColor(ChartColor value) { - this.Color = value; - return this; - } -} + public ResetInputsAction WithIconUrl(string value) + { + this.IconUrl = value; + return this; + } -/// -/// A horizontal bar chart. -/// -public class HorizontalBarChart : CardElement -{ - /// - /// Deserializes a JSON string into an object of type HorizontalBarChart. - /// - public static HorizontalBarChart? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Chart.HorizontalBar**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Chart.HorizontalBar"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The title of the chart. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// Controls whether the chart's title should be displayed. Defaults to `false`. - /// - [JsonPropertyName("showTitle")] - public bool? ShowTitle { get; set; } = false; - - /// - /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("colorSet")] - public ChartColorSet? ColorSet { get; set; } - - /// - /// The maximum width, in pixels, of the chart, in the `px` format. - /// - [JsonPropertyName("maxWidth")] - public string? MaxWidth { get; set; } - - /// - /// Controls whether the chart's legend should be displayed. - /// - [JsonPropertyName("showLegend")] - public bool? ShowLegend { get; set; } = true; - - /// - /// The title of the x axis. - /// - [JsonPropertyName("xAxisTitle")] - public string? XAxisTitle { get; set; } - - /// - /// The title of the y axis. - /// - [JsonPropertyName("yAxisTitle")] - public string? YAxisTitle { get; set; } - - /// - /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// The data points in the chart. - /// - [JsonPropertyName("data")] - public IList? Data { get; set; } - - /// - /// Controls how the chart should be visually laid out. - /// - [JsonPropertyName("displayMode")] - public HorizontalBarChartDisplayMode? DisplayMode { get; set; } = HorizontalBarChartDisplayMode.AbsoluteWithAxis; - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this HorizontalBarChart into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public HorizontalBarChart WithKey(string value) { - this.Key = value; - return this; - } - - public HorizontalBarChart WithId(string value) { - this.Id = value; - return this; - } - - public HorizontalBarChart WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public HorizontalBarChart WithLang(string value) { - this.Lang = value; - return this; - } - - public HorizontalBarChart WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public HorizontalBarChart WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public HorizontalBarChart WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public HorizontalBarChart WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public HorizontalBarChart WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public HorizontalBarChart WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public HorizontalBarChart WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public HorizontalBarChart WithTitle(string value) { - this.Title = value; - return this; - } - - public HorizontalBarChart WithShowTitle(bool value) { - this.ShowTitle = value; - return this; - } - - public HorizontalBarChart WithColorSet(ChartColorSet value) { - this.ColorSet = value; - return this; - } - - public HorizontalBarChart WithMaxWidth(string value) { - this.MaxWidth = value; - return this; - } - - public HorizontalBarChart WithShowLegend(bool value) { - this.ShowLegend = value; - return this; - } - - public HorizontalBarChart WithXAxisTitle(string value) { - this.XAxisTitle = value; - return this; - } - - public HorizontalBarChart WithYAxisTitle(string value) { - this.YAxisTitle = value; - return this; - } - - public HorizontalBarChart WithColor(ChartColor value) { - this.Color = value; - return this; - } - - public HorizontalBarChart WithData(params IList value) { - this.Data = value; - return this; - } - - public HorizontalBarChart WithDisplayMode(HorizontalBarChartDisplayMode value) { - this.DisplayMode = value; - return this; - } - - public HorizontalBarChart WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public HorizontalBarChart WithFallback(IUnion value) { - this.Fallback = value; - return this; - } + public ResetInputsAction WithStyle(ActionStyle value) + { + this.Style = value; + return this; + } + + public ResetInputsAction WithMode(ActionMode value) + { + this.Mode = value; + return this; + } + + public ResetInputsAction WithTooltip(string value) + { + this.Tooltip = value; + return this; + } + + public ResetInputsAction WithIsEnabled(bool value) + { + this.IsEnabled = value; + return this; + } + + public ResetInputsAction WithMenuActions(params IList value) + { + this.MenuActions = value; + return this; + } + + public ResetInputsAction WithThemedIconUrls(params IList value) + { + this.ThemedIconUrls = value; + return this; + } + + public ResetInputsAction WithTargetInputIds(params IList value) + { + this.TargetInputIds = value; + return this; + } + + public ResetInputsAction WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } } /// -/// Represents a single data point in a horizontal bar chart. +/// Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can only acknowledge is has received the request. /// -public class HorizontalBarChartDataValue : SerializableObject +public class SubmitAction : Action { - /// - /// Deserializes a JSON string into an object of type HorizontalBarChartDataValue. - /// - public static HorizontalBarChartDataValue? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The x axis value of the data point. - /// - [JsonPropertyName("x")] - public string? X { get; set; } - - /// - /// The y axis value of the data point. - /// - [JsonPropertyName("y")] - public float? Y { get; set; } = 0; - - /// - /// The color of the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// Serializes this HorizontalBarChartDataValue into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public HorizontalBarChartDataValue WithKey(string value) { - this.Key = value; - return this; - } - - public HorizontalBarChartDataValue WithX(string value) { - this.X = value; - return this; - } - - public HorizontalBarChartDataValue WithY(float value) { - this.Y = value; - return this; - } - - public HorizontalBarChartDataValue WithColor(ChartColor value) { - this.Color = value; - return this; - } -} + /// + /// Deserializes a JSON string into an object of type SubmitAction. + /// + public static SubmitAction? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } -/// -/// A stacked horizontal bar chart. -/// -public class StackedHorizontalBarChart : CardElement -{ - /// - /// Deserializes a JSON string into an object of type StackedHorizontalBarChart. - /// - public static StackedHorizontalBarChart? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Chart.HorizontalBar.Stacked**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Chart.HorizontalBar.Stacked"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The title of the chart. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// Controls whether the chart's title should be displayed. Defaults to `false`. - /// - [JsonPropertyName("showTitle")] - public bool? ShowTitle { get; set; } = false; - - /// - /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("colorSet")] - public ChartColorSet? ColorSet { get; set; } - - /// - /// The maximum width, in pixels, of the chart, in the `px` format. - /// - [JsonPropertyName("maxWidth")] - public string? MaxWidth { get; set; } - - /// - /// Controls whether the chart's legend should be displayed. - /// - [JsonPropertyName("showLegend")] - public bool? ShowLegend { get; set; } = true; - - /// - /// The title of the x axis. - /// - [JsonPropertyName("xAxisTitle")] - public string? XAxisTitle { get; set; } - - /// - /// The title of the y axis. - /// - [JsonPropertyName("yAxisTitle")] - public string? YAxisTitle { get; set; } - - /// - /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// The data to display in the chart. - /// - [JsonPropertyName("data")] - public IList? Data { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this StackedHorizontalBarChart into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public StackedHorizontalBarChart WithKey(string value) { - this.Key = value; - return this; - } - - public StackedHorizontalBarChart WithId(string value) { - this.Id = value; - return this; - } - - public StackedHorizontalBarChart WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public StackedHorizontalBarChart WithLang(string value) { - this.Lang = value; - return this; - } - - public StackedHorizontalBarChart WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public StackedHorizontalBarChart WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public StackedHorizontalBarChart WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public StackedHorizontalBarChart WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public StackedHorizontalBarChart WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public StackedHorizontalBarChart WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public StackedHorizontalBarChart WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public StackedHorizontalBarChart WithTitle(string value) { - this.Title = value; - return this; - } - - public StackedHorizontalBarChart WithShowTitle(bool value) { - this.ShowTitle = value; - return this; - } - - public StackedHorizontalBarChart WithColorSet(ChartColorSet value) { - this.ColorSet = value; - return this; - } - - public StackedHorizontalBarChart WithMaxWidth(string value) { - this.MaxWidth = value; - return this; - } - - public StackedHorizontalBarChart WithShowLegend(bool value) { - this.ShowLegend = value; - return this; - } - - public StackedHorizontalBarChart WithXAxisTitle(string value) { - this.XAxisTitle = value; - return this; - } - - public StackedHorizontalBarChart WithYAxisTitle(string value) { - this.YAxisTitle = value; - return this; - } - - public StackedHorizontalBarChart WithColor(ChartColor value) { - this.Color = value; - return this; - } - - public StackedHorizontalBarChart WithData(params IList value) { - this.Data = value; - return this; - } - - public StackedHorizontalBarChart WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public StackedHorizontalBarChart WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Action.Submit**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Action.Submit"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The title of the action, as it appears on buttons. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + /// + /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + /// + [JsonPropertyName("iconUrl")] + public string? IconUrl { get; set; } + + /// + /// Control the style of the action, affecting its visual and spoken representations. + /// + [JsonPropertyName("style")] + public ActionStyle? Style { get; set; } = ActionStyle.Default; + + /// + /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + /// + [JsonPropertyName("mode")] + public ActionMode? Mode { get; set; } = ActionMode.Primary; + + /// + /// The tooltip text to display when the action is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + /// + [JsonPropertyName("isEnabled")] + public bool? IsEnabled { get; set; } = true; + + /// + /// The actions to display in the overflow menu of a Split action button. + /// + [JsonPropertyName("menuActions")] + public IList? MenuActions { get; set; } + + /// + /// A set of theme-specific icon URLs. + /// + [JsonPropertyName("themedIconUrls")] + public IList? ThemedIconUrls { get; set; } + + /// + /// The data to send to the Bot when the action is executed. When expressed as an object, `data` is sent back to the Bot when the action is executed, adorned with the values of the inputs expressed as key/value pairs, where the key is the Id of the input. If `data` is expressed as a string, input values are not sent to the Bot. + /// + [JsonPropertyName("data")] + public IUnion? Data { get; set; } + + /// + /// The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("associatedInputs")] + public AssociatedInputs? AssociatedInputs { get; set; } + + /// + /// Controls if the action is enabled only if at least one required input has been filled by the user. + /// + [JsonPropertyName("conditionallyEnabled")] + public bool? ConditionallyEnabled { get; set; } = false; + + /// + /// Teams-specific metadata associated with the action. + /// + [JsonPropertyName("msteams")] + public TeamsSubmitActionProperties? Msteams { get; set; } + + /// + /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this SubmitAction into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } -/// -/// Defines the collection of data series to display in as a stacked horizontal bar chart. -/// -public class StackedHorizontalBarChartData : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type StackedHorizontalBarChartData. - /// - public static StackedHorizontalBarChartData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The title of the series. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The data points in the series. - /// - [JsonPropertyName("data")] - public IList? Data { get; set; } - - /// - /// Serializes this StackedHorizontalBarChartData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public StackedHorizontalBarChartData WithKey(string value) { - this.Key = value; - return this; - } - - public StackedHorizontalBarChartData WithTitle(string value) { - this.Title = value; - return this; - } - - public StackedHorizontalBarChartData WithData(params IList value) { - this.Data = value; - return this; - } -} + public SubmitAction WithKey(string value) + { + this.Key = value; + return this; + } -/// -/// A data point in a series. -/// -public class StackedHorizontalBarChartDataPoint : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type StackedHorizontalBarChartDataPoint. - /// - public static StackedHorizontalBarChartDataPoint? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The legend associated with the data point. - /// - [JsonPropertyName("legend")] - public string? Legend { get; set; } - - /// - /// The value of the data point. - /// - [JsonPropertyName("value")] - public float? Value { get; set; } = 0; - - /// - /// The color to use to render the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// Serializes this StackedHorizontalBarChartDataPoint into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public StackedHorizontalBarChartDataPoint WithKey(string value) { - this.Key = value; - return this; - } - - public StackedHorizontalBarChartDataPoint WithLegend(string value) { - this.Legend = value; - return this; - } - - public StackedHorizontalBarChartDataPoint WithValue(float value) { - this.Value = value; - return this; - } - - public StackedHorizontalBarChartDataPoint WithColor(ChartColor value) { - this.Color = value; - return this; - } -} + public SubmitAction WithId(string value) + { + this.Id = value; + return this; + } -/// -/// A line chart. -/// -public class LineChart : CardElement -{ - /// - /// Deserializes a JSON string into an object of type LineChart. - /// - public static LineChart? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Chart.Line**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Chart.Line"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The title of the chart. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// Controls whether the chart's title should be displayed. Defaults to `false`. - /// - [JsonPropertyName("showTitle")] - public bool? ShowTitle { get; set; } = false; - - /// - /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("colorSet")] - public ChartColorSet? ColorSet { get; set; } - - /// - /// The maximum width, in pixels, of the chart, in the `px` format. - /// - [JsonPropertyName("maxWidth")] - public string? MaxWidth { get; set; } - - /// - /// Controls whether the chart's legend should be displayed. - /// - [JsonPropertyName("showLegend")] - public bool? ShowLegend { get; set; } = true; - - /// - /// The title of the x axis. - /// - [JsonPropertyName("xAxisTitle")] - public string? XAxisTitle { get; set; } - - /// - /// The title of the y axis. - /// - [JsonPropertyName("yAxisTitle")] - public string? YAxisTitle { get; set; } - - /// - /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// The data point series in the line chart. - /// - [JsonPropertyName("data")] - public IList? Data { get; set; } - - /// - /// The maximum y range. - /// - [JsonPropertyName("yMin")] - public float? YMin { get; set; } - - /// - /// The minimum y range. - /// - [JsonPropertyName("yMax")] - public float? YMax { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this LineChart into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public LineChart WithKey(string value) { - this.Key = value; - return this; - } - - public LineChart WithId(string value) { - this.Id = value; - return this; - } - - public LineChart WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public LineChart WithLang(string value) { - this.Lang = value; - return this; - } - - public LineChart WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public LineChart WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public LineChart WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public LineChart WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public LineChart WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public LineChart WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public LineChart WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public LineChart WithTitle(string value) { - this.Title = value; - return this; - } - - public LineChart WithShowTitle(bool value) { - this.ShowTitle = value; - return this; - } - - public LineChart WithColorSet(ChartColorSet value) { - this.ColorSet = value; - return this; - } - - public LineChart WithMaxWidth(string value) { - this.MaxWidth = value; - return this; - } - - public LineChart WithShowLegend(bool value) { - this.ShowLegend = value; - return this; - } - - public LineChart WithXAxisTitle(string value) { - this.XAxisTitle = value; - return this; - } - - public LineChart WithYAxisTitle(string value) { - this.YAxisTitle = value; - return this; - } - - public LineChart WithColor(ChartColor value) { - this.Color = value; - return this; - } - - public LineChart WithData(params IList value) { - this.Data = value; - return this; - } - - public LineChart WithYMin(float value) { - this.YMin = value; - return this; - } - - public LineChart WithYMax(float value) { - this.YMax = value; - return this; - } - - public LineChart WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public LineChart WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public SubmitAction WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } -/// -/// Represents a collection of data points series in a line chart. -/// -public class LineChartData : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type LineChartData. - /// - public static LineChartData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The legend of the chart. - /// - [JsonPropertyName("legend")] - public string? Legend { get; set; } - - /// - /// The data points in the series. - /// - [JsonPropertyName("values")] - public IList? Values { get; set; } - - /// - /// The color all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// Serializes this LineChartData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public LineChartData WithKey(string value) { - this.Key = value; - return this; - } - - public LineChartData WithLegend(string value) { - this.Legend = value; - return this; - } - - public LineChartData WithValues(params IList value) { - this.Values = value; - return this; - } - - public LineChartData WithColor(ChartColor value) { - this.Color = value; - return this; - } -} + public SubmitAction WithTitle(string value) + { + this.Title = value; + return this; + } -/// -/// Represents a single data point in a line chart. -/// -public class LineChartValue : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type LineChartValue. - /// - public static LineChartValue? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The x axis value of the data point. - /// - /// If all x values of the x [Chart.Line](https://adaptivecards.microsoft.com/?topic=Chart.Line) are expressed as a number, or if all x values are expressed as a date string in the `YYYY-MM-DD` format, the chart will be rendered as a time series chart, i.e. x axis values will span across the minimum x value to maximum x value range. - /// - /// Otherwise, if x values are represented as a mix of numbers and strings or if at least one x value isn't in the `YYYY-MM-DD` format, the chart will be rendered as a categorical chart, i.e. x axis values will be displayed as categories. - /// - [JsonPropertyName("x")] - public IUnion? X { get; set; } - - /// - /// The y axis value of the data point. - /// - [JsonPropertyName("y")] - public float? Y { get; set; } = 0; - - /// - /// Serializes this LineChartValue into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public LineChartValue WithKey(string value) { - this.Key = value; - return this; - } - - public LineChartValue WithX(IUnion value) { - this.X = value; - return this; - } - - public LineChartValue WithY(float value) { - this.Y = value; - return this; - } -} + public SubmitAction WithIconUrl(string value) + { + this.IconUrl = value; + return this; + } -/// -/// A gauge chart. -/// -public class GaugeChart : CardElement -{ - /// - /// Deserializes a JSON string into an object of type GaugeChart. - /// - public static GaugeChart? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Chart.Gauge**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Chart.Gauge"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The title of the chart. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// Controls whether the chart's title should be displayed. Defaults to `false`. - /// - [JsonPropertyName("showTitle")] - public bool? ShowTitle { get; set; } = false; - - /// - /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("colorSet")] - public ChartColorSet? ColorSet { get; set; } - - /// - /// The maximum width, in pixels, of the chart, in the `px` format. - /// - [JsonPropertyName("maxWidth")] - public string? MaxWidth { get; set; } - - /// - /// Controls whether the chart's legend should be displayed. - /// - [JsonPropertyName("showLegend")] - public bool? ShowLegend { get; set; } = true; - - /// - /// The minimum value of the gauge. - /// - [JsonPropertyName("min")] - public float? Min { get; set; } = 0; - - /// - /// The maximum value of the gauge. - /// - [JsonPropertyName("max")] - public float? Max { get; set; } - - /// - /// The sub-label of the gauge. - /// - [JsonPropertyName("subLabel")] - public string? SubLabel { get; set; } - - /// - /// Controls whether the min/max values should be displayed. - /// - [JsonPropertyName("showMinMax")] - public bool? ShowMinMax { get; set; } = true; - - /// - /// Controls whether the gauge's needle is displayed. Default is **true**. - /// - [JsonPropertyName("showNeedle")] - public bool? ShowNeedle { get; set; } = true; - - /// - /// Controls whether the outlines of the gauge segments are displayed. - /// - [JsonPropertyName("showOutlines")] - public bool? ShowOutlines { get; set; } = true; - - /// - /// The segments to display in the gauge. - /// - [JsonPropertyName("segments")] - public IList? Segments { get; set; } - - /// - /// The value of the gauge. - /// - [JsonPropertyName("value")] - public float? Value { get; set; } = 0; - - /// - /// The format used to display the gauge's value. - /// - [JsonPropertyName("valueFormat")] - public GaugeChartValueFormat? ValueFormat { get; set; } = GaugeChartValueFormat.Percentage; - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this GaugeChart into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public GaugeChart WithKey(string value) { - this.Key = value; - return this; - } - - public GaugeChart WithId(string value) { - this.Id = value; - return this; - } - - public GaugeChart WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public GaugeChart WithLang(string value) { - this.Lang = value; - return this; - } - - public GaugeChart WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public GaugeChart WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public GaugeChart WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public GaugeChart WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public GaugeChart WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public GaugeChart WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public GaugeChart WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public GaugeChart WithTitle(string value) { - this.Title = value; - return this; - } - - public GaugeChart WithShowTitle(bool value) { - this.ShowTitle = value; - return this; - } - - public GaugeChart WithColorSet(ChartColorSet value) { - this.ColorSet = value; - return this; - } - - public GaugeChart WithMaxWidth(string value) { - this.MaxWidth = value; - return this; - } - - public GaugeChart WithShowLegend(bool value) { - this.ShowLegend = value; - return this; - } - - public GaugeChart WithMin(float value) { - this.Min = value; - return this; - } - - public GaugeChart WithMax(float value) { - this.Max = value; - return this; - } - - public GaugeChart WithSubLabel(string value) { - this.SubLabel = value; - return this; - } - - public GaugeChart WithShowMinMax(bool value) { - this.ShowMinMax = value; - return this; - } - - public GaugeChart WithShowNeedle(bool value) { - this.ShowNeedle = value; - return this; - } - - public GaugeChart WithShowOutlines(bool value) { - this.ShowOutlines = value; - return this; - } - - public GaugeChart WithSegments(params IList value) { - this.Segments = value; - return this; - } - - public GaugeChart WithValue(float value) { - this.Value = value; - return this; - } - - public GaugeChart WithValueFormat(GaugeChartValueFormat value) { - this.ValueFormat = value; - return this; - } - - public GaugeChart WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public GaugeChart WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public SubmitAction WithStyle(ActionStyle value) + { + this.Style = value; + return this; + } -/// -/// The legend of the chart. -/// -public class GaugeChartLegend : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type GaugeChartLegend. - /// - public static GaugeChartLegend? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The size of the segment. - /// - [JsonPropertyName("size")] - public float? Size { get; set; } = 0; - - /// - /// The legend text associated with the segment. - /// - [JsonPropertyName("legend")] - public string? Legend { get; set; } - - /// - /// The color to use for the segment. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - /// - [JsonPropertyName("color")] - public ChartColor? Color { get; set; } - - /// - /// Serializes this GaugeChartLegend into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public GaugeChartLegend WithKey(string value) { - this.Key = value; - return this; - } - - public GaugeChartLegend WithSize(float value) { - this.Size = value; - return this; - } - - public GaugeChartLegend WithLegend(string value) { - this.Legend = value; - return this; - } - - public GaugeChartLegend WithColor(ChartColor value) { - this.Color = value; - return this; - } -} + public SubmitAction WithMode(ActionMode value) + { + this.Mode = value; + return this; + } -/// -/// A formatted and syntax-colored code block. -/// -public class CodeBlock : CardElement -{ - /// - /// Deserializes a JSON string into an object of type CodeBlock. - /// - public static CodeBlock? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **CodeBlock**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "CodeBlock"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The code snippet to display. - /// - [JsonPropertyName("codeSnippet")] - public string? CodeSnippet { get; set; } - - /// - /// The language the code snippet is expressed in. - /// - [JsonPropertyName("language")] - public CodeLanguage? Language { get; set; } = CodeLanguage.PlainText; - - /// - /// A number that represents the line in the file from where the code snippet was extracted. - /// - [JsonPropertyName("startLineNumber")] - public float? StartLineNumber { get; set; } = 1; - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this CodeBlock into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public CodeBlock WithKey(string value) { - this.Key = value; - return this; - } - - public CodeBlock WithId(string value) { - this.Id = value; - return this; - } - - public CodeBlock WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public CodeBlock WithLang(string value) { - this.Lang = value; - return this; - } - - public CodeBlock WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public CodeBlock WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public CodeBlock WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public CodeBlock WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public CodeBlock WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public CodeBlock WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public CodeBlock WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public CodeBlock WithCodeSnippet(string value) { - this.CodeSnippet = value; - return this; - } - - public CodeBlock WithLanguage(CodeLanguage value) { - this.Language = value; - return this; - } - - public CodeBlock WithStartLineNumber(float value) { - this.StartLineNumber = value; - return this; - } - - public CodeBlock WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public CodeBlock WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public SubmitAction WithTooltip(string value) + { + this.Tooltip = value; + return this; + } -/// -/// Displays a user's information, including their profile picture. -/// -public class ComUserMicrosoftGraphComponent : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ComUserMicrosoftGraphComponent. - /// - public static ComUserMicrosoftGraphComponent? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Component**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Component"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// Must be **graph.microsoft.com/user**. - /// - [JsonPropertyName("name")] - public string Name { get; } = "graph.microsoft.com/user"; - - /// - /// The properties of the Persona component. - /// - [JsonPropertyName("properties")] - public PersonaProperties? Properties { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ComUserMicrosoftGraphComponent into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ComUserMicrosoftGraphComponent WithKey(string value) { - this.Key = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithId(string value) { - this.Id = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithLang(string value) { - this.Lang = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithProperties(PersonaProperties value) { - this.Properties = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public ComUserMicrosoftGraphComponent WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public SubmitAction WithIsEnabled(bool value) + { + this.IsEnabled = value; + return this; + } -/// -/// Represents the properties of a Persona component. -/// -public class PersonaProperties : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type PersonaProperties. - /// - public static PersonaProperties? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The Id of the persona. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// The UPN of the persona. - /// - [JsonPropertyName("userPrincipalName")] - public string? UserPrincipalName { get; set; } - - /// - /// The display name of the persona. - /// - [JsonPropertyName("displayName")] - public string? DisplayName { get; set; } - - /// - /// Defines the style of the icon for the persona. - /// - [JsonPropertyName("iconStyle")] - public PersonaIconStyle? IconStyle { get; set; } - - /// - /// Defines how the persona should be displayed. - /// - [JsonPropertyName("style")] - public PersonaDisplayStyle? Style { get; set; } - - /// - /// Serializes this PersonaProperties into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public PersonaProperties WithKey(string value) { - this.Key = value; - return this; - } - - public PersonaProperties WithId(string value) { - this.Id = value; - return this; - } - - public PersonaProperties WithUserPrincipalName(string value) { - this.UserPrincipalName = value; - return this; - } - - public PersonaProperties WithDisplayName(string value) { - this.DisplayName = value; - return this; - } - - public PersonaProperties WithIconStyle(PersonaIconStyle value) { - this.IconStyle = value; - return this; - } - - public PersonaProperties WithStyle(PersonaDisplayStyle value) { - this.Style = value; - return this; - } -} + public SubmitAction WithMenuActions(params IList value) + { + this.MenuActions = value; + return this; + } -/// -/// Displays multiple users' information, including their profile pictures. -/// -public class ComUsersMicrosoftGraphComponent : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ComUsersMicrosoftGraphComponent. - /// - public static ComUsersMicrosoftGraphComponent? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Component**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Component"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// Must be **graph.microsoft.com/users**. - /// - [JsonPropertyName("name")] - public string Name { get; } = "graph.microsoft.com/users"; - - /// - /// The properties of the PersonaSet component. - /// - [JsonPropertyName("properties")] - public PersonaSetProperties? Properties { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ComUsersMicrosoftGraphComponent into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ComUsersMicrosoftGraphComponent WithKey(string value) { - this.Key = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithId(string value) { - this.Id = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithLang(string value) { - this.Lang = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithProperties(PersonaSetProperties value) { - this.Properties = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public ComUsersMicrosoftGraphComponent WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public SubmitAction WithThemedIconUrls(params IList value) + { + this.ThemedIconUrls = value; + return this; + } -/// -/// Represents the properties of a PersonaSet component. -/// -public class PersonaSetProperties : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type PersonaSetProperties. - /// - public static PersonaSetProperties? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The users a PersonaSet component should display. - /// - [JsonPropertyName("users")] - public IList? Users { get; set; } - - /// - /// Defines the style of the icon for the personas in the set. - /// - [JsonPropertyName("iconStyle")] - public PersonaIconStyle? IconStyle { get; set; } - - /// - /// Defines how each persona in the set should be displayed. - /// - [JsonPropertyName("style")] - public PersonaDisplayStyle? Style { get; set; } - - /// - /// Serializes this PersonaSetProperties into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public PersonaSetProperties WithKey(string value) { - this.Key = value; - return this; - } - - public PersonaSetProperties WithUsers(params IList value) { - this.Users = value; - return this; - } - - public PersonaSetProperties WithIconStyle(PersonaIconStyle value) { - this.IconStyle = value; - return this; - } - - public PersonaSetProperties WithStyle(PersonaDisplayStyle value) { - this.Style = value; - return this; - } -} + public SubmitAction WithData(IUnion value) + { + this.Data = value; + return this; + } -/// -/// Displays information about a generic graph resource. -/// -public class ComResourceMicrosoftGraphComponent : CardElement -{ - /// - /// Deserializes a JSON string into an object of type ComResourceMicrosoftGraphComponent. - /// - public static ComResourceMicrosoftGraphComponent? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Component**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Component"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// Must be **graph.microsoft.com/resource**. - /// - [JsonPropertyName("name")] - public string Name { get; } = "graph.microsoft.com/resource"; - - /// - /// The properties of the resource. - /// - [JsonPropertyName("properties")] - public ResourceProperties? Properties { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ComResourceMicrosoftGraphComponent into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ComResourceMicrosoftGraphComponent WithKey(string value) { - this.Key = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithId(string value) { - this.Id = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithLang(string value) { - this.Lang = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithProperties(ResourceProperties value) { - this.Properties = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public ComResourceMicrosoftGraphComponent WithFallback(IUnion value) { - this.Fallback = value; - return this; - } -} + public SubmitAction WithAssociatedInputs(AssociatedInputs value) + { + this.AssociatedInputs = value; + return this; + } -/// -/// Represents the properties of a resource component. -/// -public class ResourceProperties : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type ResourceProperties. - /// - public static ResourceProperties? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The Id of the resource. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// The reference to the resource. - /// - [JsonPropertyName("resourceReference")] - public IDictionary? ResourceReference { get; set; } - - /// - /// The visualization of the resource. - /// - [JsonPropertyName("resourceVisualization")] - public ResourceVisualization? ResourceVisualization { get; set; } - - /// - /// Serializes this ResourceProperties into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ResourceProperties WithKey(string value) { - this.Key = value; - return this; - } - - public ResourceProperties WithId(string value) { - this.Id = value; - return this; - } - - public ResourceProperties WithResourceReference(IDictionary value) { - this.ResourceReference = value; - return this; - } - - public ResourceProperties WithResourceVisualization(ResourceVisualization value) { - this.ResourceVisualization = value; - return this; - } -} + public SubmitAction WithConditionallyEnabled(bool value) + { + this.ConditionallyEnabled = value; + return this; + } -/// -/// Represents a visualization of a resource. -/// -public class ResourceVisualization : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type ResourceVisualization. - /// - public static ResourceVisualization? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The media associated with the resource. - /// - [JsonPropertyName("media")] - public string? Media { get; set; } - - /// - /// Serializes this ResourceVisualization into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ResourceVisualization WithKey(string value) { - this.Key = value; - return this; - } - - public ResourceVisualization WithMedia(string value) { - this.Media = value; - return this; - } + public SubmitAction WithMsteams(TeamsSubmitActionProperties value) + { + this.Msteams = value; + return this; + } + + public SubmitAction WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } } /// -/// Displays information about a file resource. +/// Toggles the visibility of a set of elements. Action.ToggleVisibility is useful for creating "Show more" type UI patterns. /// -public class ComFileMicrosoftGraphComponent : CardElement +public class ToggleVisibilityAction : Action { - /// - /// Deserializes a JSON string into an object of type ComFileMicrosoftGraphComponent. - /// - public static ComFileMicrosoftGraphComponent? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Component**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Component"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// Must be **graph.microsoft.com/file**. - /// - [JsonPropertyName("name")] - public string Name { get; } = "graph.microsoft.com/file"; - - /// - /// The properties of the file. - /// - [JsonPropertyName("properties")] - public FileProperties? Properties { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ComFileMicrosoftGraphComponent into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ComFileMicrosoftGraphComponent WithKey(string value) { - this.Key = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithId(string value) { - this.Id = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithLang(string value) { - this.Lang = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithProperties(FileProperties value) { - this.Properties = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public ComFileMicrosoftGraphComponent WithFallback(IUnion value) { - this.Fallback = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type ToggleVisibilityAction. + /// + public static ToggleVisibilityAction? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Action.ToggleVisibility**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Action.ToggleVisibility"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The title of the action, as it appears on buttons. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + /// + /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + /// + [JsonPropertyName("iconUrl")] + public string? IconUrl { get; set; } + + /// + /// Control the style of the action, affecting its visual and spoken representations. + /// + [JsonPropertyName("style")] + public ActionStyle? Style { get; set; } = ActionStyle.Default; + + /// + /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + /// + [JsonPropertyName("mode")] + public ActionMode? Mode { get; set; } = ActionMode.Primary; + + /// + /// The tooltip text to display when the action is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + /// + [JsonPropertyName("isEnabled")] + public bool? IsEnabled { get; set; } = true; + + /// + /// The actions to display in the overflow menu of a Split action button. + /// + [JsonPropertyName("menuActions")] + public IList? MenuActions { get; set; } + + /// + /// A set of theme-specific icon URLs. + /// + [JsonPropertyName("themedIconUrls")] + public IList? ThemedIconUrls { get; set; } + + /// + /// The Ids of the elements to toggle the visibility of. + /// + [JsonPropertyName("targetElements")] + public IUnion, IList>? TargetElements { get; set; } + + /// + /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ToggleVisibilityAction into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ToggleVisibilityAction WithKey(string value) + { + this.Key = value; + return this; + } + + public ToggleVisibilityAction WithId(string value) + { + this.Id = value; + return this; + } + + public ToggleVisibilityAction WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public ToggleVisibilityAction WithTitle(string value) + { + this.Title = value; + return this; + } + + public ToggleVisibilityAction WithIconUrl(string value) + { + this.IconUrl = value; + return this; + } + + public ToggleVisibilityAction WithStyle(ActionStyle value) + { + this.Style = value; + return this; + } + + public ToggleVisibilityAction WithMode(ActionMode value) + { + this.Mode = value; + return this; + } + + public ToggleVisibilityAction WithTooltip(string value) + { + this.Tooltip = value; + return this; + } + + public ToggleVisibilityAction WithIsEnabled(bool value) + { + this.IsEnabled = value; + return this; + } + + public ToggleVisibilityAction WithMenuActions(params IList value) + { + this.MenuActions = value; + return this; + } + + public ToggleVisibilityAction WithThemedIconUrls(params IList value) + { + this.ThemedIconUrls = value; + return this; + } + + public ToggleVisibilityAction WithTargetElements(IUnion, IList> value) + { + this.TargetElements = value; + return this; + } + + public ToggleVisibilityAction WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } } /// -/// Represents the properties of a file component. +/// Defines a theme-specific URL. /// -public class FileProperties : SerializableObject +public class ThemedUrl : SerializableObject { - /// - /// Deserializes a JSON string into an object of type FileProperties. - /// - public static FileProperties? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The name of the file. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// The file extension. - /// - [JsonPropertyName("extension")] - public string? Extension { get; set; } - - /// - /// The URL of the file. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// Serializes this FileProperties into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public FileProperties WithKey(string value) { - this.Key = value; - return this; - } - - public FileProperties WithName(string value) { - this.Name = value; - return this; - } - - public FileProperties WithExtension(string value) { - this.Extension = value; - return this; - } - - public FileProperties WithUrl(string value) { - this.Url = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type ThemedUrl. + /// + public static ThemedUrl? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The theme this URL applies to. + /// + [JsonPropertyName("theme")] + public ThemeName? Theme { get; set; } = ThemeName.Light; + + /// + /// The URL to use for the associated theme. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// Serializes this ThemedUrl into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ThemedUrl WithKey(string value) + { + this.Key = value; + return this; + } + + public ThemedUrl WithTheme(ThemeName value) + { + this.Theme = value; + return this; + } + + public ThemedUrl WithUrl(string value) + { + this.Url = value; + return this; + } } /// -/// Displays information about a calendar event. +/// Defines a target element in an Action.ToggleVisibility. /// -public class ComEventMicrosoftGraphComponent : CardElement +public class TargetElement : SerializableObject { - /// - /// Deserializes a JSON string into an object of type ComEventMicrosoftGraphComponent. - /// - public static ComEventMicrosoftGraphComponent? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **Component**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Component"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// Must be **graph.microsoft.com/event**. - /// - [JsonPropertyName("name")] - public string Name { get; } = "graph.microsoft.com/event"; - - /// - /// The properties of the event. - /// - [JsonPropertyName("properties")] - public CalendarEventProperties? Properties { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ComEventMicrosoftGraphComponent into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ComEventMicrosoftGraphComponent WithKey(string value) { - this.Key = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithId(string value) { - this.Id = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithLang(string value) { - this.Lang = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithProperties(CalendarEventProperties value) { - this.Properties = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public ComEventMicrosoftGraphComponent WithFallback(IUnion value) { - this.Fallback = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type TargetElement. + /// + public static TargetElement? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// The Id of the element to change the visibility of. + /// + [JsonPropertyName("elementId")] + public string? ElementId { get; set; } + + /// + /// The new visibility state of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } + + /// + /// Serializes this TargetElement into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TargetElement WithElementId(string value) + { + this.ElementId = value; + return this; + } + + public TargetElement WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } } /// -/// The properties of a calendar event. +/// Expands or collapses an embedded card within the main card. /// -public class CalendarEventProperties : SerializableObject +public class ShowCardAction : Action { - /// - /// Deserializes a JSON string into an object of type CalendarEventProperties. - /// - public static CalendarEventProperties? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The ID of the event. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// The title of the event. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The start date and time of the event. - /// - [JsonPropertyName("start")] - public string? Start { get; set; } - - /// - /// The end date and time of the event. - /// - [JsonPropertyName("end")] - public string? End { get; set; } - - /// - /// The status of the event. - /// - [JsonPropertyName("status")] - public string? Status { get; set; } - - /// - /// The locations of the event. - /// - [JsonPropertyName("locations")] - public IList? Locations { get; set; } - - /// - /// The URL of the online meeting. - /// - [JsonPropertyName("onlineMeetingUrl")] - public string? OnlineMeetingUrl { get; set; } - - /// - /// Indicates if the event is all day. - /// - [JsonPropertyName("isAllDay")] - public bool? IsAllDay { get; set; } - - /// - /// The extension of the event. - /// - [JsonPropertyName("extension")] - public string? Extension { get; set; } - - /// - /// The URL of the event. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The attendees of the event. - /// - [JsonPropertyName("attendees")] - public IList? Attendees { get; set; } - - /// - /// The organizer of the event. - /// - [JsonPropertyName("organizer")] - public CalendarEventAttendee? Organizer { get; set; } - - /// - /// Serializes this CalendarEventProperties into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public CalendarEventProperties WithKey(string value) { - this.Key = value; - return this; - } - - public CalendarEventProperties WithId(string value) { - this.Id = value; - return this; - } - - public CalendarEventProperties WithTitle(string value) { - this.Title = value; - return this; - } - - public CalendarEventProperties WithStart(string value) { - this.Start = value; - return this; - } - - public CalendarEventProperties WithEnd(string value) { - this.End = value; - return this; - } - - public CalendarEventProperties WithStatus(string value) { - this.Status = value; - return this; - } - - public CalendarEventProperties WithLocations(params IList value) { - this.Locations = value; - return this; - } - - public CalendarEventProperties WithOnlineMeetingUrl(string value) { - this.OnlineMeetingUrl = value; - return this; - } - - public CalendarEventProperties WithIsAllDay(bool value) { - this.IsAllDay = value; - return this; - } - - public CalendarEventProperties WithExtension(string value) { - this.Extension = value; - return this; - } - - public CalendarEventProperties WithUrl(string value) { - this.Url = value; - return this; - } - - public CalendarEventProperties WithAttendees(params IList value) { - this.Attendees = value; - return this; - } - - public CalendarEventProperties WithOrganizer(CalendarEventAttendee value) { - this.Organizer = value; - return this; - } -} - + /// + /// Deserializes a JSON string into an object of type ShowCardAction. + /// + public static ShowCardAction? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Action.ShowCard**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Action.ShowCard"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The title of the action, as it appears on buttons. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + /// + /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + /// + [JsonPropertyName("iconUrl")] + public string? IconUrl { get; set; } + + /// + /// Control the style of the action, affecting its visual and spoken representations. + /// + [JsonPropertyName("style")] + public ActionStyle? Style { get; set; } = ActionStyle.Default; + + /// + /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + /// + [JsonPropertyName("mode")] + public ActionMode? Mode { get; set; } = ActionMode.Primary; + + /// + /// The tooltip text to display when the action is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + /// + [JsonPropertyName("isEnabled")] + public bool? IsEnabled { get; set; } = true; + + /// + /// The actions to display in the overflow menu of a Split action button. + /// + [JsonPropertyName("menuActions")] + public IList? MenuActions { get; set; } + + /// + /// A set of theme-specific icon URLs. + /// + [JsonPropertyName("themedIconUrls")] + public IList? ThemedIconUrls { get; set; } + + /// + /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The card that should be displayed when the action is executed. + /// + [JsonPropertyName("card")] + public AdaptiveCard? Card { get; set; } + + /// + /// Serializes this ShowCardAction into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ShowCardAction WithKey(string value) + { + this.Key = value; + return this; + } + + public ShowCardAction WithId(string value) + { + this.Id = value; + return this; + } + + public ShowCardAction WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public ShowCardAction WithTitle(string value) + { + this.Title = value; + return this; + } + + public ShowCardAction WithIconUrl(string value) + { + this.IconUrl = value; + return this; + } + + public ShowCardAction WithStyle(ActionStyle value) + { + this.Style = value; + return this; + } + + public ShowCardAction WithMode(ActionMode value) + { + this.Mode = value; + return this; + } + + public ShowCardAction WithTooltip(string value) + { + this.Tooltip = value; + return this; + } + + public ShowCardAction WithIsEnabled(bool value) + { + this.IsEnabled = value; + return this; + } + + public ShowCardAction WithMenuActions(params IList value) + { + this.MenuActions = value; + return this; + } + + public ShowCardAction WithThemedIconUrls(params IList value) + { + this.ThemedIconUrls = value; + return this; + } + + public ShowCardAction WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } + + public ShowCardAction WithCard(AdaptiveCard value) + { + this.Card = value; + return this; + } +} + +/// +/// Shows a popover to display more information to the user. +/// +public class PopoverAction : Action +{ + /// + /// Deserializes a JSON string into an object of type PopoverAction. + /// + public static PopoverAction? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Action.Popover**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Action.Popover"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The title of the action, as it appears on buttons. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + /// + /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + /// + [JsonPropertyName("iconUrl")] + public string? IconUrl { get; set; } + + /// + /// Control the style of the action, affecting its visual and spoken representations. + /// + [JsonPropertyName("style")] + public ActionStyle? Style { get; set; } = ActionStyle.Default; + + /// + /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + /// + [JsonPropertyName("mode")] + public ActionMode? Mode { get; set; } = ActionMode.Primary; + + /// + /// The tooltip text to display when the action is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + /// + [JsonPropertyName("isEnabled")] + public bool? IsEnabled { get; set; } = true; + + /// + /// A set of theme-specific icon URLs. + /// + [JsonPropertyName("themedIconUrls")] + public IList? ThemedIconUrls { get; set; } + + /// + /// The content of the popover, which can be any element. + /// + [JsonPropertyName("content")] + public CardElement? Content { get; set; } + + /// + /// Controls if an arrow should be displayed towards the element that triggered the popover. + /// + [JsonPropertyName("displayArrow")] + public bool? DisplayArrow { get; set; } = true; + + /// + /// Controls where the popover should be displayed with regards to the element that triggered it. + /// + [JsonPropertyName("position")] + public PopoverPosition? Position { get; set; } = PopoverPosition.Above; + + /// + /// The maximum width of the popover in pixels, in the `px` format + /// + [JsonPropertyName("maxPopoverWidth")] + public string? MaxPopoverWidth { get; set; } + + /// + /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this PopoverAction into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public PopoverAction WithKey(string value) + { + this.Key = value; + return this; + } + + public PopoverAction WithId(string value) + { + this.Id = value; + return this; + } + + public PopoverAction WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public PopoverAction WithTitle(string value) + { + this.Title = value; + return this; + } + + public PopoverAction WithIconUrl(string value) + { + this.IconUrl = value; + return this; + } + + public PopoverAction WithStyle(ActionStyle value) + { + this.Style = value; + return this; + } + + public PopoverAction WithMode(ActionMode value) + { + this.Mode = value; + return this; + } + + public PopoverAction WithTooltip(string value) + { + this.Tooltip = value; + return this; + } + + public PopoverAction WithIsEnabled(bool value) + { + this.IsEnabled = value; + return this; + } + + public PopoverAction WithThemedIconUrls(params IList value) + { + this.ThemedIconUrls = value; + return this; + } + + public PopoverAction WithContent(CardElement value) + { + this.Content = value; + return this; + } + + public PopoverAction WithDisplayArrow(bool value) + { + this.DisplayArrow = value; + return this; + } + + public PopoverAction WithPosition(PopoverPosition value) + { + this.Position = value; + return this; + } + + public PopoverAction WithMaxPopoverWidth(string value) + { + this.MaxPopoverWidth = value; + return this; + } + + public PopoverAction WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// Displays a set of action, which can be placed anywhere in the card. +/// +public class ActionSet : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ActionSet. + /// + public static ActionSet? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **ActionSet**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "ActionSet"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The actions in the set. + /// + [JsonPropertyName("actions")] + public IList? Actions { get; set; } + + public ActionSet(params IList actions) + { + this.Actions = actions; + } + + /// + /// Serializes this ActionSet into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ActionSet WithKey(string value) + { + this.Key = value; + return this; + } + + public ActionSet WithId(string value) + { + this.Id = value; + return this; + } + + public ActionSet WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public ActionSet WithLang(string value) + { + this.Lang = value; + return this; + } + + public ActionSet WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public ActionSet WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public ActionSet WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public ActionSet WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public ActionSet WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public ActionSet WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public ActionSet WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public ActionSet WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public ActionSet WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } + + public ActionSet WithActions(params IList value) + { + this.Actions = value; + return this; + } +} + +/// +/// A container for other elements. Use containers for styling purposes and/or to logically group a set of elements together, which can be especially useful when used with Action.ToggleVisibility. +/// +public class Container : CardElement +{ + /// + /// Deserializes a JSON string into an object of type Container. + /// + public static Container? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Container**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Container"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + /// + [JsonPropertyName("style")] + public ContainerStyle? Style { get; set; } + + /// + /// Controls if a border should be displayed around the container. + /// + [JsonPropertyName("showBorder")] + public bool? ShowBorder { get; set; } = false; + + /// + /// Controls if the container should have rounded corners. + /// + [JsonPropertyName("roundedCorners")] + public bool? RoundedCorners { get; set; } = false; + + /// + /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. + /// + [JsonPropertyName("layouts")] + public IList? Layouts { get; set; } + + /// + /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + /// + [JsonPropertyName("bleed")] + public bool? Bleed { get; set; } = false; + + /// + /// The minimum height, in pixels, of the container, in the `px` format. + /// + [JsonPropertyName("minHeight")] + public string? MinHeight { get; set; } + + /// + /// Defines the container's background image. + /// + [JsonPropertyName("backgroundImage")] + public IUnion? BackgroundImage { get; set; } + + /// + /// Controls how the container's content should be vertically aligned. + /// + [JsonPropertyName("verticalContentAlignment")] + public VerticalAlignment? VerticalContentAlignment { get; set; } + + /// + /// Controls if the content of the card is to be rendered left-to-right or right-to-left. + /// + [JsonPropertyName("rtl")] + public bool? Rtl { get; set; } + + /// + /// The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. + /// + [JsonPropertyName("maxHeight")] + public string? MaxHeight { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The elements in the container. + /// + [JsonPropertyName("items")] + public IList? Items { get; set; } + + public Container(params IList items) + { + this.Items = items; + } + + /// + /// Serializes this Container into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Container WithKey(string value) + { + this.Key = value; + return this; + } + + public Container WithId(string value) + { + this.Id = value; + return this; + } + + public Container WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public Container WithLang(string value) + { + this.Lang = value; + return this; + } + + public Container WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public Container WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public Container WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public Container WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public Container WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public Container WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public Container WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public Container WithSelectAction(Action value) + { + this.SelectAction = value; + return this; + } + + public Container WithStyle(ContainerStyle value) + { + this.Style = value; + return this; + } + + public Container WithShowBorder(bool value) + { + this.ShowBorder = value; + return this; + } + + public Container WithRoundedCorners(bool value) + { + this.RoundedCorners = value; + return this; + } + + public Container WithLayouts(params IList value) + { + this.Layouts = value; + return this; + } + + public Container WithBleed(bool value) + { + this.Bleed = value; + return this; + } + + public Container WithMinHeight(string value) + { + this.MinHeight = value; + return this; + } + + public Container WithBackgroundImage(IUnion value) + { + this.BackgroundImage = value; + return this; + } + + public Container WithVerticalContentAlignment(VerticalAlignment value) + { + this.VerticalContentAlignment = value; + return this; + } + + public Container WithRtl(bool value) + { + this.Rtl = value; + return this; + } + + public Container WithMaxHeight(string value) + { + this.MaxHeight = value; + return this; + } + + public Container WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public Container WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } + + public Container WithItems(params IList value) + { + this.Items = value; + return this; + } +} + +/// +/// A layout that stacks elements on top of each other. Layout.Stack is the default layout used by AdaptiveCard and all containers. +/// +public class StackLayout : ContainerLayout +{ + /// + /// Deserializes a JSON string into an object of type StackLayout. + /// + public static StackLayout? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Layout.Stack**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Layout.Stack"; + + /// + /// Controls for which card width the layout should be used. + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Serializes this StackLayout into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public StackLayout WithKey(string value) + { + this.Key = value; + return this; + } + + public StackLayout WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } +} + +/// +/// A layout that spreads elements horizontally and wraps them across multiple rows, as needed. +/// +public class FlowLayout : ContainerLayout +{ + /// + /// Deserializes a JSON string into an object of type FlowLayout. + /// + public static FlowLayout? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Layout.Flow**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Layout.Flow"; + + /// + /// Controls for which card width the layout should be used. + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls how the content of the container should be horizontally aligned. + /// + [JsonPropertyName("horizontalItemsAlignment")] + public HorizontalAlignment? HorizontalItemsAlignment { get; set; } = HorizontalAlignment.Center; + + /// + /// Controls how the content of the container should be vertically aligned. + /// + [JsonPropertyName("verticalItemsAlignment")] + public VerticalAlignment? VerticalItemsAlignment { get; set; } = VerticalAlignment.Top; + + /// + /// Controls how item should fit inside the container. + /// + [JsonPropertyName("itemFit")] + public FlowLayoutItemFit? ItemFit { get; set; } = FlowLayoutItemFit.Fit; + + /// + /// The minimum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. + /// + [JsonPropertyName("minItemWidth")] + public string? MinItemWidth { get; set; } + + /// + /// The maximum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. + /// + [JsonPropertyName("maxItemWidth")] + public string? MaxItemWidth { get; set; } + + /// + /// The width, in pixels, of each item, in the `px` format. Should not be used if maxItemWidth and/or minItemWidth are set. + /// + [JsonPropertyName("itemWidth")] + public string? ItemWidth { get; set; } + + /// + /// The space between items. + /// + [JsonPropertyName("columnSpacing")] + public Spacing? ColumnSpacing { get; set; } = Spacing.Default; + + /// + /// The space between rows of items. + /// + [JsonPropertyName("rowSpacing")] + public Spacing? RowSpacing { get; set; } = Spacing.Default; + + /// + /// Serializes this FlowLayout into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public FlowLayout WithKey(string value) + { + this.Key = value; + return this; + } + + public FlowLayout WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public FlowLayout WithHorizontalItemsAlignment(HorizontalAlignment value) + { + this.HorizontalItemsAlignment = value; + return this; + } + + public FlowLayout WithVerticalItemsAlignment(VerticalAlignment value) + { + this.VerticalItemsAlignment = value; + return this; + } + + public FlowLayout WithItemFit(FlowLayoutItemFit value) + { + this.ItemFit = value; + return this; + } + + public FlowLayout WithMinItemWidth(string value) + { + this.MinItemWidth = value; + return this; + } + + public FlowLayout WithMaxItemWidth(string value) + { + this.MaxItemWidth = value; + return this; + } + + public FlowLayout WithItemWidth(string value) + { + this.ItemWidth = value; + return this; + } + + public FlowLayout WithColumnSpacing(Spacing value) + { + this.ColumnSpacing = value; + return this; + } + + public FlowLayout WithRowSpacing(Spacing value) + { + this.RowSpacing = value; + return this; + } +} + +/// +/// A layout that divides a container into named areas into which elements can be placed. +/// +public class AreaGridLayout : ContainerLayout +{ + /// + /// Deserializes a JSON string into an object of type AreaGridLayout. + /// + public static AreaGridLayout? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Layout.AreaGrid**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Layout.AreaGrid"; + + /// + /// Controls for which card width the layout should be used. + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// The columns in the grid layout, defined as a percentage of the available width or in pixels using the `px` format. + /// + [JsonPropertyName("columns")] + public IUnion, IList>? Columns { get; set; } + + /// + /// The areas in the grid layout. + /// + [JsonPropertyName("areas")] + public IList? Areas { get; set; } + + /// + /// The space between columns. + /// + [JsonPropertyName("columnSpacing")] + public Spacing? ColumnSpacing { get; set; } = Spacing.Default; + + /// + /// The space between rows. + /// + [JsonPropertyName("rowSpacing")] + public Spacing? RowSpacing { get; set; } = Spacing.Default; + + /// + /// Serializes this AreaGridLayout into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public AreaGridLayout WithKey(string value) + { + this.Key = value; + return this; + } + + public AreaGridLayout WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public AreaGridLayout WithColumns(IUnion, IList> value) + { + this.Columns = value; + return this; + } + + public AreaGridLayout WithAreas(params IList value) + { + this.Areas = value; + return this; + } + + public AreaGridLayout WithColumnSpacing(Spacing value) + { + this.ColumnSpacing = value; + return this; + } + + public AreaGridLayout WithRowSpacing(Spacing value) + { + this.RowSpacing = value; + return this; + } +} + +/// +/// Defines an area in a Layout.AreaGrid layout. +/// +public class GridArea : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type GridArea. + /// + public static GridArea? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The name of the area. To place an element in this area, set its `grid.area` property to match the name of the area. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The start column index of the area. Column indices start at 1. + /// + [JsonPropertyName("column")] + public float? Column { get; set; } = 1; + + /// + /// Defines how many columns the area should span. + /// + [JsonPropertyName("columnSpan")] + public float? ColumnSpan { get; set; } = 1; + + /// + /// The start row index of the area. Row indices start at 1. + /// + [JsonPropertyName("row")] + public float? Row { get; set; } = 1; + + /// + /// Defines how many rows the area should span. + /// + [JsonPropertyName("rowSpan")] + public float? RowSpan { get; set; } = 1; + + /// + /// Serializes this GridArea into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public GridArea WithKey(string value) + { + this.Key = value; + return this; + } + + public GridArea WithName(string value) + { + this.Name = value; + return this; + } + + public GridArea WithColumn(float value) + { + this.Column = value; + return this; + } + + public GridArea WithColumnSpan(float value) + { + this.ColumnSpan = value; + return this; + } + + public GridArea WithRow(float value) + { + this.Row = value; + return this; + } + + public GridArea WithRowSpan(float value) + { + this.RowSpan = value; + return this; + } +} + +/// +/// Defines a container's background image and the way it should be rendered. +/// +public class BackgroundImage : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type BackgroundImage. + /// + public static BackgroundImage? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// Controls how the image should fill the area. + /// + [JsonPropertyName("fillMode")] + public FillMode? FillMode { get; set; } = FillMode.Cover; + + /// + /// Controls how the image should be aligned if it must be cropped or if using repeat fill mode. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } = HorizontalAlignment.Left; + + /// + /// Controls how the image should be aligned if it must be cropped or if using repeat fill mode. + /// + [JsonPropertyName("verticalAlignment")] + public VerticalAlignment? VerticalAlignment { get; set; } = VerticalAlignment.Top; + + /// + /// A set of theme-specific image URLs. + /// + [JsonPropertyName("themedUrls")] + public IList? ThemedUrls { get; set; } + + /// + /// Serializes this BackgroundImage into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public BackgroundImage WithKey(string value) + { + this.Key = value; + return this; + } + + public BackgroundImage WithUrl(string value) + { + this.Url = value; + return this; + } + + public BackgroundImage WithFillMode(FillMode value) + { + this.FillMode = value; + return this; + } + + public BackgroundImage WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public BackgroundImage WithVerticalAlignment(VerticalAlignment value) + { + this.VerticalAlignment = value; + return this; + } + + public BackgroundImage WithThemedUrls(params IList value) + { + this.ThemedUrls = value; + return this; + } +} + +/// +/// Splits the available horizontal space into separate columns, so elements can be organized in a row. +/// +public class ColumnSet : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ColumnSet. + /// + public static ColumnSet? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **ColumnSet**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "ColumnSet"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + /// + [JsonPropertyName("style")] + public ContainerStyle? Style { get; set; } + + /// + /// Controls if a border should be displayed around the container. + /// + [JsonPropertyName("showBorder")] + public bool? ShowBorder { get; set; } = false; + + /// + /// Controls if the container should have rounded corners. + /// + [JsonPropertyName("roundedCorners")] + public bool? RoundedCorners { get; set; } = false; + + /// + /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + /// + [JsonPropertyName("bleed")] + public bool? Bleed { get; set; } = false; + + /// + /// The minimum height, in pixels, of the container, in the `px` format. + /// + [JsonPropertyName("minHeight")] + public string? MinHeight { get; set; } + + /// + /// The minimum width of the column set. `auto` will automatically adjust the column set's minimum width according to its content and using the `px` format will give the column set an explicit minimum width in pixels. A scrollbar will be displayed if the available width is less than the specified minimum width. + /// + [JsonPropertyName("minWidth")] + public string? MinWidth { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The columns in the set. + /// + [JsonPropertyName("columns")] + public IList? Columns { get; set; } + + /// + /// Serializes this ColumnSet into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ColumnSet WithKey(string value) + { + this.Key = value; + return this; + } + + public ColumnSet WithId(string value) + { + this.Id = value; + return this; + } + + public ColumnSet WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public ColumnSet WithLang(string value) + { + this.Lang = value; + return this; + } + + public ColumnSet WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public ColumnSet WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public ColumnSet WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public ColumnSet WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public ColumnSet WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public ColumnSet WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public ColumnSet WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public ColumnSet WithSelectAction(Action value) + { + this.SelectAction = value; + return this; + } + + public ColumnSet WithStyle(ContainerStyle value) + { + this.Style = value; + return this; + } + + public ColumnSet WithShowBorder(bool value) + { + this.ShowBorder = value; + return this; + } + + public ColumnSet WithRoundedCorners(bool value) + { + this.RoundedCorners = value; + return this; + } + + public ColumnSet WithBleed(bool value) + { + this.Bleed = value; + return this; + } + + public ColumnSet WithMinHeight(string value) + { + this.MinHeight = value; + return this; + } + + public ColumnSet WithMinWidth(string value) + { + this.MinWidth = value; + return this; + } + + public ColumnSet WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public ColumnSet WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } + + public ColumnSet WithColumns(params IList value) + { + this.Columns = value; + return this; + } +} + +/// +/// A media element, that makes it possible to embed videos inside a card. +/// +public class Media : CardElement +{ + /// + /// Deserializes a JSON string into an object of type Media. + /// + public static Media? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Media**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Media"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The sources for the media. For YouTube, Dailymotion and Vimeo, only one source can be specified. + /// + [JsonPropertyName("sources")] + public IList? Sources { get; set; } + + /// + /// The caption sources for the media. Caption sources are not used for YouTube, Dailymotion or Vimeo sources. + /// + [JsonPropertyName("captionSources")] + public IList? CaptionSources { get; set; } + + /// + /// The URL of the poster image to display. + /// + [JsonPropertyName("poster")] + public string? Poster { get; set; } + + /// + /// The alternate text for the media, used for accessibility purposes. + /// + [JsonPropertyName("altText")] + public string? AltText { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this Media into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Media WithKey(string value) + { + this.Key = value; + return this; + } + + public Media WithId(string value) + { + this.Id = value; + return this; + } + + public Media WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public Media WithLang(string value) + { + this.Lang = value; + return this; + } + + public Media WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public Media WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public Media WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public Media WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public Media WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public Media WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public Media WithSources(params IList value) + { + this.Sources = value; + return this; + } + + public Media WithCaptionSources(params IList value) + { + this.CaptionSources = value; + return this; + } + + public Media WithPoster(string value) + { + this.Poster = value; + return this; + } + + public Media WithAltText(string value) + { + this.AltText = value; + return this; + } + + public Media WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public Media WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// Defines the source URL of a media stream. YouTube, Dailymotion, Vimeo and Microsoft Stream URLs are supported. +/// +public class MediaSource : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type MediaSource. + /// + public static MediaSource? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The MIME type of the source. + /// + [JsonPropertyName("mimeType")] + public string? MimeType { get; set; } + + /// + /// The URL of the source. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// Serializes this MediaSource into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public MediaSource WithKey(string value) + { + this.Key = value; + return this; + } + + public MediaSource WithMimeType(string value) + { + this.MimeType = value; + return this; + } + + public MediaSource WithUrl(string value) + { + this.Url = value; + return this; + } +} + +/// +/// Defines a source URL for a video captions. +/// +public class CaptionSource : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type CaptionSource. + /// + public static CaptionSource? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The MIME type of the source. + /// + [JsonPropertyName("mimeType")] + public string? MimeType { get; set; } + + /// + /// The URL of the source. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// The label of this caption source. + /// + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// + /// Serializes this CaptionSource into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public CaptionSource WithKey(string value) + { + this.Key = value; + return this; + } + + public CaptionSource WithMimeType(string value) + { + this.MimeType = value; + return this; + } + + public CaptionSource WithUrl(string value) + { + this.Url = value; + return this; + } + + public CaptionSource WithLabel(string value) + { + this.Label = value; + return this; + } +} + +/// +/// A rich text block that displays formatted text. +/// +public class RichTextBlock : CardElement +{ + /// + /// Deserializes a JSON string into an object of type RichTextBlock. + /// + public static RichTextBlock? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **RichTextBlock**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "RichTextBlock"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The Id of the input the RichTextBlock should act as the label of. + /// + [JsonPropertyName("labelFor")] + public string? LabelFor { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The inlines making up the rich text block. + /// + [JsonPropertyName("inlines")] + public IUnion, IList>? Inlines { get; set; } + + /// + /// Serializes this RichTextBlock into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public RichTextBlock WithKey(string value) + { + this.Key = value; + return this; + } + + public RichTextBlock WithId(string value) + { + this.Id = value; + return this; + } + + public RichTextBlock WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public RichTextBlock WithLang(string value) + { + this.Lang = value; + return this; + } + + public RichTextBlock WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public RichTextBlock WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public RichTextBlock WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public RichTextBlock WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public RichTextBlock WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public RichTextBlock WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public RichTextBlock WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public RichTextBlock WithLabelFor(string value) + { + this.LabelFor = value; + return this; + } + + public RichTextBlock WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public RichTextBlock WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } + + public RichTextBlock WithInlines(IUnion, IList> value) + { + this.Inlines = value; + return this; + } +} + +/// +/// Use tables to display data in a tabular way, with rows, columns and cells. +/// +public class Table : CardElement +{ + /// + /// Deserializes a JSON string into an object of type Table. + /// + public static Table? Deserialize(string json) + { + return JsonSerializer.Deserialize
(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Table**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Table"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + /// + [JsonPropertyName("style")] + public ContainerStyle? Style { get; set; } + + /// + /// Controls if a border should be displayed around the container. + /// + [JsonPropertyName("showBorder")] + public bool? ShowBorder { get; set; } = false; + + /// + /// Controls if the container should have rounded corners. + /// + [JsonPropertyName("roundedCorners")] + public bool? RoundedCorners { get; set; } = false; + + /// + /// The columns in the table. + /// + [JsonPropertyName("columns")] + public IList? Columns { get; set; } + + /// + /// The minimum width of the table in pixels. `auto` will automatically adjust the table's minimum width according to its content and using the `px` format will give the table an explicit minimum width in pixels. A scrollbar will be displayed if the available width is less than the specified minimum width. + /// + [JsonPropertyName("minWidth")] + public string? MinWidth { get; set; } + + /// + /// Controls whether the first row of the table should be treated as a header. + /// + [JsonPropertyName("firstRowAsHeaders")] + public bool? FirstRowAsHeaders { get; set; } = true; + + /// + /// Controls if grid lines should be displayed. + /// + [JsonPropertyName("showGridLines")] + public bool? ShowGridLines { get; set; } = true; + + /// + /// The style of the grid lines between cells. + /// + [JsonPropertyName("gridStyle")] + public ContainerStyle? GridStyle { get; set; } + + /// + /// Controls how the content of every cell in the table should be horizontally aligned by default. + /// + [JsonPropertyName("horizontalCellContentAlignment")] + public HorizontalAlignment? HorizontalCellContentAlignment { get; set; } + + /// + /// Controls how the content of every cell in the table should be vertically aligned by default. + /// + [JsonPropertyName("verticalCellContentAlignment")] + public VerticalAlignment? VerticalCellContentAlignment { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The rows of the table. + /// + [JsonPropertyName("rows")] + public IList? Rows { get; set; } + + /// + /// Serializes this Table into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Table WithKey(string value) + { + this.Key = value; + return this; + } + + public Table WithId(string value) + { + this.Id = value; + return this; + } + + public Table WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public Table WithLang(string value) + { + this.Lang = value; + return this; + } + + public Table WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public Table WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public Table WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public Table WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public Table WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public Table WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public Table WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public Table WithStyle(ContainerStyle value) + { + this.Style = value; + return this; + } + + public Table WithShowBorder(bool value) + { + this.ShowBorder = value; + return this; + } + + public Table WithRoundedCorners(bool value) + { + this.RoundedCorners = value; + return this; + } + + public Table WithColumns(params IList value) + { + this.Columns = value; + return this; + } + + public Table WithMinWidth(string value) + { + this.MinWidth = value; + return this; + } + + public Table WithFirstRowAsHeaders(bool value) + { + this.FirstRowAsHeaders = value; + return this; + } + + public Table WithShowGridLines(bool value) + { + this.ShowGridLines = value; + return this; + } + + public Table WithGridStyle(ContainerStyle value) + { + this.GridStyle = value; + return this; + } + + public Table WithHorizontalCellContentAlignment(HorizontalAlignment value) + { + this.HorizontalCellContentAlignment = value; + return this; + } + + public Table WithVerticalCellContentAlignment(VerticalAlignment value) + { + this.VerticalCellContentAlignment = value; + return this; + } + + public Table WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public Table WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } + + public Table WithRows(params IList value) + { + this.Rows = value; + return this; + } +} + +/// +/// Defines a column in a Table element. +/// +public class ColumnDefinition : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type ColumnDefinition. + /// + public static ColumnDefinition? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Controls how the content of every cell in the table should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table. + /// + [JsonPropertyName("horizontalCellContentAlignment")] + public HorizontalAlignment? HorizontalCellContentAlignment { get; set; } + + /// + /// Controls how the content of every cell in the column should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table. + /// + [JsonPropertyName("verticalCellContentAlignment")] + public VerticalAlignment? VerticalCellContentAlignment { get; set; } + + /// + /// The width of the column in the table. If expressed as a number, represents the relative weight of the column in the table. If expressed as a string, `auto` will automatically adjust the column's width according to its content and using the `px` format will give the column an explicit width in pixels. + /// + [JsonPropertyName("width")] + public IUnion? Width { get; set; } + + /// + /// Serializes this ColumnDefinition into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ColumnDefinition WithKey(string value) + { + this.Key = value; + return this; + } + + public ColumnDefinition WithHorizontalCellContentAlignment(HorizontalAlignment value) + { + this.HorizontalCellContentAlignment = value; + return this; + } + + public ColumnDefinition WithVerticalCellContentAlignment(VerticalAlignment value) + { + this.VerticalCellContentAlignment = value; + return this; + } + + public ColumnDefinition WithWidth(IUnion value) + { + this.Width = value; + return this; + } +} + +/// +/// A block of text, optionally formatted using Markdown. +/// +public class TextBlock : CardElement +{ + /// + /// Deserializes a JSON string into an object of type TextBlock. + /// + public static TextBlock? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **TextBlock**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "TextBlock"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The text to display. A subset of markdown is supported. + /// + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// + /// The size of the text. + /// + [JsonPropertyName("size")] + public TextSize? Size { get; set; } + + /// + /// The weight of the text. + /// + [JsonPropertyName("weight")] + public TextWeight? Weight { get; set; } + + /// + /// The color of the text. + /// + [JsonPropertyName("color")] + public TextColor? Color { get; set; } + + /// + /// Controls whether the text should be renderer using a subtler variant of the select color. + /// + [JsonPropertyName("isSubtle")] + public bool? IsSubtle { get; set; } + + /// + /// The type of font to use for rendering. + /// + [JsonPropertyName("fontType")] + public FontType? FontType { get; set; } + + /// + /// Controls if the text should wrap. + /// + [JsonPropertyName("wrap")] + public bool? Wrap { get; set; } = false; + + /// + /// The maximum number of lines to display. + /// + [JsonPropertyName("maxLines")] + public float? MaxLines { get; set; } + + /// + /// The style of the text. + /// + [JsonPropertyName("style")] + public TextBlockStyle? Style { get; set; } + + /// + /// The Id of the input the TextBlock should act as the label of. + /// + [JsonPropertyName("labelFor")] + public string? LabelFor { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + public TextBlock(string text) + { + this.Text = text; + } + + /// + /// Serializes this TextBlock into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TextBlock WithKey(string value) + { + this.Key = value; + return this; + } + + public TextBlock WithId(string value) + { + this.Id = value; + return this; + } + + public TextBlock WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public TextBlock WithLang(string value) + { + this.Lang = value; + return this; + } + + public TextBlock WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public TextBlock WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public TextBlock WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public TextBlock WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public TextBlock WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public TextBlock WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public TextBlock WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public TextBlock WithText(string value) + { + this.Text = value; + return this; + } + + public TextBlock WithSize(TextSize value) + { + this.Size = value; + return this; + } + + public TextBlock WithWeight(TextWeight value) + { + this.Weight = value; + return this; + } + + public TextBlock WithColor(TextColor value) + { + this.Color = value; + return this; + } + + public TextBlock WithIsSubtle(bool value) + { + this.IsSubtle = value; + return this; + } + + public TextBlock WithFontType(FontType value) + { + this.FontType = value; + return this; + } + + public TextBlock WithWrap(bool value) + { + this.Wrap = value; + return this; + } + + public TextBlock WithMaxLines(float value) + { + this.MaxLines = value; + return this; + } + + public TextBlock WithStyle(TextBlockStyle value) + { + this.Style = value; + return this; + } + + public TextBlock WithLabelFor(string value) + { + this.LabelFor = value; + return this; + } + + public TextBlock WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public TextBlock WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// A set of facts, displayed as a table or a vertical list when horizontal space is constrained. +/// +public class FactSet : CardElement +{ + /// + /// Deserializes a JSON string into an object of type FactSet. + /// + public static FactSet? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **FactSet**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "FactSet"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The facts in the set. + /// + [JsonPropertyName("facts")] + public IList? Facts { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + public FactSet(params IList facts) + { + this.Facts = facts; + } + + /// + /// Serializes this FactSet into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public FactSet WithKey(string value) + { + this.Key = value; + return this; + } + + public FactSet WithId(string value) + { + this.Id = value; + return this; + } + + public FactSet WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public FactSet WithLang(string value) + { + this.Lang = value; + return this; + } + + public FactSet WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public FactSet WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public FactSet WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public FactSet WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public FactSet WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public FactSet WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public FactSet WithFacts(params IList value) + { + this.Facts = value; + return this; + } + + public FactSet WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public FactSet WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// A fact in a FactSet element. +/// +public class Fact : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type Fact. + /// + public static Fact? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The fact's title. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// The fact's value. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + public Fact(string title, string value) + { + this.Title = title; + this.Value = value; + } + + /// + /// Serializes this Fact into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Fact WithKey(string value) + { + this.Key = value; + return this; + } + + public Fact WithTitle(string value) + { + this.Title = value; + return this; + } + + public Fact WithValue(string value) + { + this.Value = value; + return this; + } +} + +/// +/// A set of images, displayed side-by-side and wrapped across multiple rows as needed. +/// +public class ImageSet : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ImageSet. + /// + public static ImageSet? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **ImageSet**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "ImageSet"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The images in the set. + /// + [JsonPropertyName("images")] + public IList? Images { get; set; } + + /// + /// The size to use to render all images in the set. + /// + [JsonPropertyName("imageSize")] + public ImageSize? ImageSize { get; set; } = ImageSize.Medium; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + public ImageSet(params IList images) + { + this.Images = images; + } + + /// + /// Serializes this ImageSet into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ImageSet WithKey(string value) + { + this.Key = value; + return this; + } + + public ImageSet WithId(string value) + { + this.Id = value; + return this; + } + + public ImageSet WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public ImageSet WithLang(string value) + { + this.Lang = value; + return this; + } + + public ImageSet WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public ImageSet WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public ImageSet WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public ImageSet WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public ImageSet WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public ImageSet WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public ImageSet WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public ImageSet WithImages(params IList value) + { + this.Images = value; + return this; + } + + public ImageSet WithImageSize(ImageSize value) + { + this.ImageSize = value; + return this; + } + + public ImageSet WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public ImageSet WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// A standalone image element. +/// +public class Image : CardElement +{ + /// + /// Deserializes a JSON string into an object of type Image. + /// + public static Image? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Image**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Image"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// The alternate text for the image, used for accessibility purposes. + /// + [JsonPropertyName("altText")] + public string? AltText { get; set; } + + /// + /// The background color of the image. + /// + [JsonPropertyName("backgroundColor")] + public string? BackgroundColor { get; set; } + + /// + /// The style of the image. + /// + [JsonPropertyName("style")] + public ImageStyle? Style { get; set; } = ImageStyle.Default; + + /// + /// The size of the image. + /// + [JsonPropertyName("size")] + public Size? Size { get; set; } = Size.Auto; + + /// + /// The width of the image. + /// + [JsonPropertyName("width")] + public string? Width { get; set; } = "auto"; + + /// + /// An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// Controls if the image can be expanded to full screen. + /// + [JsonPropertyName("allowExpand")] + public bool? AllowExpand { get; set; } = false; + + /// + /// Teams-specific metadata associated with the image. + /// + [JsonPropertyName("msteams")] + public TeamsImageProperties? Msteams { get; set; } + + /// + /// A set of theme-specific image URLs. + /// + [JsonPropertyName("themedUrls")] + public IList? ThemedUrls { get; set; } + + /// + /// Controls how the image should be fitted inside its bounding box. imageFit is only meaningful when both the width and height properties are set. When fitMode is set to contain, the default style is always used. + /// + [JsonPropertyName("fitMode")] + public ImageFitMode? FitMode { get; set; } = ImageFitMode.Fill; + + /// + /// Controls the horizontal position of the image within its bounding box. horizontalContentAlignment is only meaningful when both the width and height properties are set and fitMode is set to either cover or contain. + /// + [JsonPropertyName("horizontalContentAlignment")] + public HorizontalAlignment? HorizontalContentAlignment { get; set; } = HorizontalAlignment.Left; + + /// + /// Controls the vertical position of the image within its bounding box. verticalContentAlignment is only meaningful when both the width and height properties are set and fitMode is set to either cover or contain. + /// + [JsonPropertyName("verticalContentAlignment")] + public VerticalAlignment? VerticalContentAlignment { get; set; } = VerticalAlignment.Top; + + /// + /// The height of the image. + /// + [JsonPropertyName("height")] + public string? Height { get; set; } = "auto"; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + public Image(string url) + { + this.Url = url; + } + + /// + /// Serializes this Image into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Image WithKey(string value) + { + this.Key = value; + return this; + } + + public Image WithId(string value) + { + this.Id = value; + return this; + } + + public Image WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public Image WithLang(string value) + { + this.Lang = value; + return this; + } + + public Image WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public Image WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public Image WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public Image WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public Image WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public Image WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public Image WithUrl(string value) + { + this.Url = value; + return this; + } + + public Image WithAltText(string value) + { + this.AltText = value; + return this; + } + + public Image WithBackgroundColor(string value) + { + this.BackgroundColor = value; + return this; + } + + public Image WithStyle(ImageStyle value) + { + this.Style = value; + return this; + } + + public Image WithSize(Size value) + { + this.Size = value; + return this; + } + + public Image WithWidth(string value) + { + this.Width = value; + return this; + } + + public Image WithSelectAction(Action value) + { + this.SelectAction = value; + return this; + } + + public Image WithAllowExpand(bool value) + { + this.AllowExpand = value; + return this; + } + + public Image WithMsteams(TeamsImageProperties value) + { + this.Msteams = value; + return this; + } + + public Image WithThemedUrls(params IList value) + { + this.ThemedUrls = value; + return this; + } + + public Image WithFitMode(ImageFitMode value) + { + this.FitMode = value; + return this; + } + + public Image WithHorizontalContentAlignment(HorizontalAlignment value) + { + this.HorizontalContentAlignment = value; + return this; + } + + public Image WithVerticalContentAlignment(VerticalAlignment value) + { + this.VerticalContentAlignment = value; + return this; + } + + public Image WithHeight(string value) + { + this.Height = value; + return this; + } + + public Image WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public Image WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// Represents a set of Teams-specific properties on an image. +/// +public class TeamsImageProperties : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type TeamsImageProperties. + /// + public static TeamsImageProperties? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Controls if the image is expandable in Teams. This property is equivalent to the Image.allowExpand property. + /// + [JsonPropertyName("allowExpand")] + public bool? AllowExpand { get; set; } + + /// + /// Serializes this TeamsImageProperties into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TeamsImageProperties WithKey(string value) + { + this.Key = value; + return this; + } + + public TeamsImageProperties WithAllowExpand(bool value) + { + this.AllowExpand = value; + return this; + } +} + +/// +/// An input to allow the user to enter text. +/// +public class TextInput : CardElement +{ + /// + /// Deserializes a JSON string into an object of type TextInput. + /// + public static TextInput? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Input.Text**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Input.Text"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The label of the input. + /// + /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + /// + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// + /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("isRequired")] + public bool? IsRequired { get; set; } = false; + + /// + /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("errorMessage")] + public string? ErrorMessage { get; set; } + + /// + /// An Action.ResetInputs action that will be executed when the value of the input changes. + /// + [JsonPropertyName("valueChangedAction")] + public Action? ValueChangedAction { get; set; } + + /// + /// The default value of the input. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + /// + /// The maximum length of the text in the input. + /// + [JsonPropertyName("maxLength")] + public float? MaxLength { get; set; } + + /// + /// Controls if the input should allow multiple lines of text. + /// + [JsonPropertyName("isMultiline")] + public bool? IsMultiline { get; set; } = false; + + /// + /// The text to display as a placeholder when the user hasn't entered a value. + /// + [JsonPropertyName("placeholder")] + public string? Placeholder { get; set; } + + /// + /// The style of the input. + /// + [JsonPropertyName("style")] + public InputTextStyle? Style { get; set; } = InputTextStyle.Text; + + /// + /// The action that should be displayed as a button alongside the input. Action.ShowCard is not supported. + /// + [JsonPropertyName("inlineAction")] + public Action? InlineAction { get; set; } + + /// + /// The regular expression to validate the input. + /// + [JsonPropertyName("regex")] + public string? Regex { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this TextInput into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TextInput WithKey(string value) + { + this.Key = value; + return this; + } + + public TextInput WithId(string value) + { + this.Id = value; + return this; + } + + public TextInput WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public TextInput WithLang(string value) + { + this.Lang = value; + return this; + } + + public TextInput WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public TextInput WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public TextInput WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public TextInput WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public TextInput WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public TextInput WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public TextInput WithLabel(string value) + { + this.Label = value; + return this; + } + + public TextInput WithIsRequired(bool value) + { + this.IsRequired = value; + return this; + } + + public TextInput WithErrorMessage(string value) + { + this.ErrorMessage = value; + return this; + } + + public TextInput WithValueChangedAction(Action value) + { + this.ValueChangedAction = value; + return this; + } + + public TextInput WithValue(string value) + { + this.Value = value; + return this; + } + + public TextInput WithMaxLength(float value) + { + this.MaxLength = value; + return this; + } + + public TextInput WithIsMultiline(bool value) + { + this.IsMultiline = value; + return this; + } + + public TextInput WithPlaceholder(string value) + { + this.Placeholder = value; + return this; + } + + public TextInput WithStyle(InputTextStyle value) + { + this.Style = value; + return this; + } + + public TextInput WithInlineAction(Action value) + { + this.InlineAction = value; + return this; + } + + public TextInput WithRegex(string value) + { + this.Regex = value; + return this; + } + + public TextInput WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public TextInput WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// An input to allow the user to select a date. +/// +public class DateInput : CardElement +{ + /// + /// Deserializes a JSON string into an object of type DateInput. + /// + public static DateInput? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Input.Date**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Input.Date"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The label of the input. + /// + /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + /// + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// + /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("isRequired")] + public bool? IsRequired { get; set; } = false; + + /// + /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("errorMessage")] + public string? ErrorMessage { get; set; } + + /// + /// An Action.ResetInputs action that will be executed when the value of the input changes. + /// + [JsonPropertyName("valueChangedAction")] + public Action? ValueChangedAction { get; set; } + + /// + /// The default value of the input, in the `YYYY-MM-DD` format. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + /// + /// The text to display as a placeholder when the user has not selected a date. + /// + [JsonPropertyName("placeholder")] + public string? Placeholder { get; set; } + + /// + /// The minimum date that can be selected. + /// + [JsonPropertyName("min")] + public string? Min { get; set; } + + /// + /// The maximum date that can be selected. + /// + [JsonPropertyName("max")] + public string? Max { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this DateInput into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public DateInput WithKey(string value) + { + this.Key = value; + return this; + } + + public DateInput WithId(string value) + { + this.Id = value; + return this; + } + + public DateInput WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public DateInput WithLang(string value) + { + this.Lang = value; + return this; + } + + public DateInput WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public DateInput WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public DateInput WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public DateInput WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public DateInput WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public DateInput WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public DateInput WithLabel(string value) + { + this.Label = value; + return this; + } + + public DateInput WithIsRequired(bool value) + { + this.IsRequired = value; + return this; + } + + public DateInput WithErrorMessage(string value) + { + this.ErrorMessage = value; + return this; + } + + public DateInput WithValueChangedAction(Action value) + { + this.ValueChangedAction = value; + return this; + } + + public DateInput WithValue(string value) + { + this.Value = value; + return this; + } + + public DateInput WithPlaceholder(string value) + { + this.Placeholder = value; + return this; + } + + public DateInput WithMin(string value) + { + this.Min = value; + return this; + } + + public DateInput WithMax(string value) + { + this.Max = value; + return this; + } + + public DateInput WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public DateInput WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// An input to allow the user to select a time. +/// +public class TimeInput : CardElement +{ + /// + /// Deserializes a JSON string into an object of type TimeInput. + /// + public static TimeInput? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Input.Time**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Input.Time"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The label of the input. + /// + /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + /// + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// + /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("isRequired")] + public bool? IsRequired { get; set; } = false; + + /// + /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("errorMessage")] + public string? ErrorMessage { get; set; } + + /// + /// An Action.ResetInputs action that will be executed when the value of the input changes. + /// + [JsonPropertyName("valueChangedAction")] + public Action? ValueChangedAction { get; set; } + + /// + /// The default value of the input, in the `HH:MM` format. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + /// + /// The text to display as a placeholder when the user hasn't entered a value. + /// + [JsonPropertyName("placeholder")] + public string? Placeholder { get; set; } + + /// + /// The minimum time that can be selected, in the `HH:MM` format. + /// + [JsonPropertyName("min")] + public string? Min { get; set; } + + /// + /// The maximum time that can be selected, in the `HH:MM` format. + /// + [JsonPropertyName("max")] + public string? Max { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this TimeInput into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TimeInput WithKey(string value) + { + this.Key = value; + return this; + } + + public TimeInput WithId(string value) + { + this.Id = value; + return this; + } + + public TimeInput WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public TimeInput WithLang(string value) + { + this.Lang = value; + return this; + } + + public TimeInput WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public TimeInput WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public TimeInput WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public TimeInput WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public TimeInput WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public TimeInput WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public TimeInput WithLabel(string value) + { + this.Label = value; + return this; + } + + public TimeInput WithIsRequired(bool value) + { + this.IsRequired = value; + return this; + } + + public TimeInput WithErrorMessage(string value) + { + this.ErrorMessage = value; + return this; + } + + public TimeInput WithValueChangedAction(Action value) + { + this.ValueChangedAction = value; + return this; + } + + public TimeInput WithValue(string value) + { + this.Value = value; + return this; + } + + public TimeInput WithPlaceholder(string value) + { + this.Placeholder = value; + return this; + } + + public TimeInput WithMin(string value) + { + this.Min = value; + return this; + } + + public TimeInput WithMax(string value) + { + this.Max = value; + return this; + } + + public TimeInput WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public TimeInput WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// An input to allow the user to enter a number. +/// +public class NumberInput : CardElement +{ + /// + /// Deserializes a JSON string into an object of type NumberInput. + /// + public static NumberInput? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Input.Number**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Input.Number"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The label of the input. + /// + /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + /// + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// + /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("isRequired")] + public bool? IsRequired { get; set; } = false; + + /// + /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("errorMessage")] + public string? ErrorMessage { get; set; } + + /// + /// An Action.ResetInputs action that will be executed when the value of the input changes. + /// + [JsonPropertyName("valueChangedAction")] + public Action? ValueChangedAction { get; set; } + + /// + /// The default value of the input. + /// + [JsonPropertyName("value")] + public float? Value { get; set; } + + /// + /// The text to display as a placeholder when the user hasn't entered a value. + /// + [JsonPropertyName("placeholder")] + public string? Placeholder { get; set; } + + /// + /// The minimum value that can be entered. + /// + [JsonPropertyName("min")] + public float? Min { get; set; } + + /// + /// The maximum value that can be entered. + /// + [JsonPropertyName("max")] + public float? Max { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this NumberInput into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public NumberInput WithKey(string value) + { + this.Key = value; + return this; + } + + public NumberInput WithId(string value) + { + this.Id = value; + return this; + } + + public NumberInput WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public NumberInput WithLang(string value) + { + this.Lang = value; + return this; + } + + public NumberInput WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public NumberInput WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public NumberInput WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public NumberInput WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public NumberInput WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public NumberInput WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public NumberInput WithLabel(string value) + { + this.Label = value; + return this; + } + + public NumberInput WithIsRequired(bool value) + { + this.IsRequired = value; + return this; + } + + public NumberInput WithErrorMessage(string value) + { + this.ErrorMessage = value; + return this; + } + + public NumberInput WithValueChangedAction(Action value) + { + this.ValueChangedAction = value; + return this; + } + + public NumberInput WithValue(float value) + { + this.Value = value; + return this; + } + + public NumberInput WithPlaceholder(string value) + { + this.Placeholder = value; + return this; + } + + public NumberInput WithMin(float value) + { + this.Min = value; + return this; + } + + public NumberInput WithMax(float value) + { + this.Max = value; + return this; + } + + public NumberInput WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public NumberInput WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// An input to allow the user to select between on/off states. +/// +public class ToggleInput : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ToggleInput. + /// + public static ToggleInput? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Input.Toggle**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Input.Toggle"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The label of the input. + /// + /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + /// + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// + /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("isRequired")] + public bool? IsRequired { get; set; } = false; + + /// + /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("errorMessage")] + public string? ErrorMessage { get; set; } + + /// + /// An Action.ResetInputs action that will be executed when the value of the input changes. + /// + [JsonPropertyName("valueChangedAction")] + public Action? ValueChangedAction { get; set; } + + /// + /// The default value of the input. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } = "false"; + + /// + /// The title (caption) to display next to the toggle. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// The value to send to the Bot when the toggle is on. + /// + [JsonPropertyName("valueOn")] + public string? ValueOn { get; set; } = "true"; + + /// + /// The value to send to the Bot when the toggle is off. + /// + [JsonPropertyName("valueOff")] + public string? ValueOff { get; set; } = "false"; + + /// + /// Controls if the title should wrap. + /// + [JsonPropertyName("wrap")] + public bool? Wrap { get; set; } = true; + + /// + /// Controls whether the title is visually displayed. When set to false, the title is hidden from view but remains accessible to screen readers for accessibility purposes. + /// + [JsonPropertyName("showTitle")] + public bool? ShowTitle { get; set; } = true; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + public ToggleInput(string title) + { + this.Title = title; + } + + /// + /// Serializes this ToggleInput into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ToggleInput WithKey(string value) + { + this.Key = value; + return this; + } + + public ToggleInput WithId(string value) + { + this.Id = value; + return this; + } + + public ToggleInput WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public ToggleInput WithLang(string value) + { + this.Lang = value; + return this; + } + + public ToggleInput WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public ToggleInput WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public ToggleInput WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public ToggleInput WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public ToggleInput WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public ToggleInput WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public ToggleInput WithLabel(string value) + { + this.Label = value; + return this; + } + + public ToggleInput WithIsRequired(bool value) + { + this.IsRequired = value; + return this; + } + + public ToggleInput WithErrorMessage(string value) + { + this.ErrorMessage = value; + return this; + } + + public ToggleInput WithValueChangedAction(Action value) + { + this.ValueChangedAction = value; + return this; + } + + public ToggleInput WithValue(string value) + { + this.Value = value; + return this; + } + + public ToggleInput WithTitle(string value) + { + this.Title = value; + return this; + } + + public ToggleInput WithValueOn(string value) + { + this.ValueOn = value; + return this; + } + + public ToggleInput WithValueOff(string value) + { + this.ValueOff = value; + return this; + } + + public ToggleInput WithWrap(bool value) + { + this.Wrap = value; + return this; + } + + public ToggleInput WithShowTitle(bool value) + { + this.ShowTitle = value; + return this; + } + + public ToggleInput WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public ToggleInput WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// An input to allow the user to select one or more values. +/// +public class ChoiceSetInput : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ChoiceSetInput. + /// + public static ChoiceSetInput? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Input.ChoiceSet**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Input.ChoiceSet"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The label of the input. + /// + /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + /// + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// + /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("isRequired")] + public bool? IsRequired { get; set; } = false; + + /// + /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("errorMessage")] + public string? ErrorMessage { get; set; } + + /// + /// An Action.ResetInputs action that will be executed when the value of the input changes. + /// + [JsonPropertyName("valueChangedAction")] + public Action? ValueChangedAction { get; set; } + + /// + /// The default value of the input. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + /// + /// The choices associated with the input. + /// + [JsonPropertyName("choices")] + public IList? Choices { get; set; } + + /// + /// A Data.Query object that defines the dataset from which to dynamically fetch the choices for the input. + /// + [JsonPropertyName("choices.data")] + public QueryData? ChoicesData { get; set; } + + /// + /// Controls whether the input should be displayed as a dropdown (compact) or a list of radio buttons or checkboxes (expanded). + /// + [JsonPropertyName("style")] + public ChoiceSetInputStyle? Style { get; set; } = ChoiceSetInputStyle.Compact; + + /// + /// Controls whether multiple choices can be selected. + /// + [JsonPropertyName("isMultiSelect")] + public bool? IsMultiSelect { get; set; } = false; + + /// + /// The text to display as a placeholder when the user has not entered any value. + /// + [JsonPropertyName("placeholder")] + public string? Placeholder { get; set; } + + /// + /// Controls if choice titles should wrap. + /// + [JsonPropertyName("wrap")] + public bool? Wrap { get; set; } = true; + + /// + /// Controls whether choice items are arranged in multiple columns in expanded mode, or in a single column. Default is false. + /// + [JsonPropertyName("useMultipleColumns")] + public bool? UseMultipleColumns { get; set; } = false; + + /// + /// The minimum width, in pixels, for each column when using a multi-column layout. This ensures that choice items remain readable even when horizontal space is limited. Default is 100 pixels. + /// + [JsonPropertyName("minColumnWidth")] + public string? MinColumnWidth { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + public ChoiceSetInput(params IList choices) + { + this.Choices = choices; + } + + /// + /// Serializes this ChoiceSetInput into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ChoiceSetInput WithKey(string value) + { + this.Key = value; + return this; + } + + public ChoiceSetInput WithId(string value) + { + this.Id = value; + return this; + } + + public ChoiceSetInput WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public ChoiceSetInput WithLang(string value) + { + this.Lang = value; + return this; + } + + public ChoiceSetInput WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public ChoiceSetInput WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public ChoiceSetInput WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public ChoiceSetInput WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public ChoiceSetInput WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public ChoiceSetInput WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public ChoiceSetInput WithLabel(string value) + { + this.Label = value; + return this; + } + + public ChoiceSetInput WithIsRequired(bool value) + { + this.IsRequired = value; + return this; + } + + public ChoiceSetInput WithErrorMessage(string value) + { + this.ErrorMessage = value; + return this; + } + + public ChoiceSetInput WithValueChangedAction(Action value) + { + this.ValueChangedAction = value; + return this; + } + + public ChoiceSetInput WithValue(string value) + { + this.Value = value; + return this; + } + + public ChoiceSetInput WithChoices(params IList value) + { + this.Choices = value; + return this; + } + + public ChoiceSetInput WithChoicesData(QueryData value) + { + this.ChoicesData = value; + return this; + } + + public ChoiceSetInput WithStyle(ChoiceSetInputStyle value) + { + this.Style = value; + return this; + } + + public ChoiceSetInput WithIsMultiSelect(bool value) + { + this.IsMultiSelect = value; + return this; + } + + public ChoiceSetInput WithPlaceholder(string value) + { + this.Placeholder = value; + return this; + } + + public ChoiceSetInput WithWrap(bool value) + { + this.Wrap = value; + return this; + } + + public ChoiceSetInput WithUseMultipleColumns(bool value) + { + this.UseMultipleColumns = value; + return this; + } + + public ChoiceSetInput WithMinColumnWidth(string value) + { + this.MinColumnWidth = value; + return this; + } + + public ChoiceSetInput WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public ChoiceSetInput WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// A choice as used by the Input.ChoiceSet input. +/// +public class Choice : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type Choice. + /// + public static Choice? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The text to display for the choice. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// The value associated with the choice, as sent to the Bot when an Action.Submit or Action.Execute is invoked + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + /// + /// Serializes this Choice into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Choice WithKey(string value) + { + this.Key = value; + return this; + } + + public Choice WithTitle(string value) + { + this.Title = value; + return this; + } + + public Choice WithValue(string value) + { + this.Value = value; + return this; + } +} + +/// +/// Defines a query to dynamically fetch data from a Bot. +/// +public class QueryData : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type QueryData. + /// + public static QueryData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Data.Query**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Data.Query"; + + /// + /// The dataset from which to fetch the data. + /// + [JsonPropertyName("dataset")] + public string? Dataset { get; set; } + + /// + /// Controls which inputs are associated with the Data.Query. When a Data.Query is executed, the values of the associated inputs are sent to the Bot, allowing it to perform filtering operations based on the user's input. + /// + [JsonPropertyName("associatedInputs")] + public AssociatedInputs? AssociatedInputs { get; set; } + + /// + /// The maximum number of data items that should be returned by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. + /// + [JsonPropertyName("count")] + public float? Count { get; set; } + + /// + /// The number of data items to be skipped by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. + /// + [JsonPropertyName("skip")] + public float? Skip { get; set; } + + /// + /// Serializes this QueryData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public QueryData WithKey(string value) + { + this.Key = value; + return this; + } + + public QueryData WithDataset(string value) + { + this.Dataset = value; + return this; + } + + public QueryData WithAssociatedInputs(AssociatedInputs value) + { + this.AssociatedInputs = value; + return this; + } + + public QueryData WithCount(float value) + { + this.Count = value; + return this; + } + + public QueryData WithSkip(float value) + { + this.Skip = value; + return this; + } +} + +/// +/// An input to allow the user to rate something using stars. +/// +public class RatingInput : CardElement +{ + /// + /// Deserializes a JSON string into an object of type RatingInput. + /// + public static RatingInput? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Input.Rating**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Input.Rating"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The label of the input. + /// + /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + /// + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// + /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("isRequired")] + public bool? IsRequired { get; set; } = false; + + /// + /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + /// + [JsonPropertyName("errorMessage")] + public string? ErrorMessage { get; set; } + + /// + /// An Action.ResetInputs action that will be executed when the value of the input changes. + /// + [JsonPropertyName("valueChangedAction")] + public Action? ValueChangedAction { get; set; } + + /// + /// The default value of the input. + /// + [JsonPropertyName("value")] + public float? Value { get; set; } + + /// + /// The number of stars to display. + /// + [JsonPropertyName("max")] + public float? Max { get; set; } = 5; + + /// + /// Controls if the user can select half stars. + /// + [JsonPropertyName("allowHalfSteps")] + public bool? AllowHalfSteps { get; set; } = false; + + /// + /// The size of the stars. + /// + [JsonPropertyName("size")] + public RatingSize? Size { get; set; } = RatingSize.Large; + + /// + /// The color of the stars. + /// + [JsonPropertyName("color")] + public RatingColor? Color { get; set; } = RatingColor.Neutral; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this RatingInput into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public RatingInput WithKey(string value) + { + this.Key = value; + return this; + } + + public RatingInput WithId(string value) + { + this.Id = value; + return this; + } + + public RatingInput WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public RatingInput WithLang(string value) + { + this.Lang = value; + return this; + } + + public RatingInput WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public RatingInput WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public RatingInput WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public RatingInput WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public RatingInput WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public RatingInput WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public RatingInput WithLabel(string value) + { + this.Label = value; + return this; + } + + public RatingInput WithIsRequired(bool value) + { + this.IsRequired = value; + return this; + } + + public RatingInput WithErrorMessage(string value) + { + this.ErrorMessage = value; + return this; + } + + public RatingInput WithValueChangedAction(Action value) + { + this.ValueChangedAction = value; + return this; + } + + public RatingInput WithValue(float value) + { + this.Value = value; + return this; + } + + public RatingInput WithMax(float value) + { + this.Max = value; + return this; + } + + public RatingInput WithAllowHalfSteps(bool value) + { + this.AllowHalfSteps = value; + return this; + } + + public RatingInput WithSize(RatingSize value) + { + this.Size = value; + return this; + } + + public RatingInput WithColor(RatingColor value) + { + this.Color = value; + return this; + } + + public RatingInput WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public RatingInput WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// A read-only star rating element, to display the rating of something. +/// +public class Rating : CardElement +{ + /// + /// Deserializes a JSON string into an object of type Rating. + /// + public static Rating? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Rating**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Rating"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The value of the rating. Must be between 0 and max. + /// + [JsonPropertyName("value")] + public float? Value { get; set; } + + /// + /// The number of "votes" associated with the rating. + /// + [JsonPropertyName("count")] + public float? Count { get; set; } + + /// + /// The number of stars to display. + /// + [JsonPropertyName("max")] + public float? Max { get; set; } = 5; + + /// + /// The size of the stars. + /// + [JsonPropertyName("size")] + public RatingSize? Size { get; set; } = RatingSize.Large; + + /// + /// The color of the stars. + /// + [JsonPropertyName("color")] + public RatingColor? Color { get; set; } = RatingColor.Neutral; + + /// + /// The style of the stars. + /// + [JsonPropertyName("style")] + public RatingStyle? Style { get; set; } = RatingStyle.Default; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this Rating into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Rating WithKey(string value) + { + this.Key = value; + return this; + } + + public Rating WithId(string value) + { + this.Id = value; + return this; + } + + public Rating WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public Rating WithLang(string value) + { + this.Lang = value; + return this; + } + + public Rating WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public Rating WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public Rating WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public Rating WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public Rating WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public Rating WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public Rating WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public Rating WithValue(float value) + { + this.Value = value; + return this; + } + + public Rating WithCount(float value) + { + this.Count = value; + return this; + } + + public Rating WithMax(float value) + { + this.Max = value; + return this; + } + + public Rating WithSize(RatingSize value) + { + this.Size = value; + return this; + } + + public Rating WithColor(RatingColor value) + { + this.Color = value; + return this; + } + + public Rating WithStyle(RatingStyle value) + { + this.Style = value; + return this; + } + + public Rating WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public Rating WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// A special type of button with an icon, title and description. +/// +public class CompoundButton : CardElement +{ + /// + /// Deserializes a JSON string into an object of type CompoundButton. + /// + public static CompoundButton? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **CompoundButton**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "CompoundButton"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The icon to show on the button. + /// + [JsonPropertyName("icon")] + public IconInfo? Icon { get; set; } + + /// + /// The badge to show on the button. + /// + [JsonPropertyName("badge")] + public string? Badge { get; set; } + + /// + /// The title of the button. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// The description text of the button. + /// + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// An Action that will be invoked when the button is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this CompoundButton into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public CompoundButton WithKey(string value) + { + this.Key = value; + return this; + } + + public CompoundButton WithId(string value) + { + this.Id = value; + return this; + } + + public CompoundButton WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public CompoundButton WithLang(string value) + { + this.Lang = value; + return this; + } + + public CompoundButton WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public CompoundButton WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public CompoundButton WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public CompoundButton WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public CompoundButton WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public CompoundButton WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public CompoundButton WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public CompoundButton WithIcon(IconInfo value) + { + this.Icon = value; + return this; + } + + public CompoundButton WithBadge(string value) + { + this.Badge = value; + return this; + } + + public CompoundButton WithTitle(string value) + { + this.Title = value; + return this; + } + + public CompoundButton WithDescription(string value) + { + this.Description = value; + return this; + } + + public CompoundButton WithSelectAction(Action value) + { + this.SelectAction = value; + return this; + } + + public CompoundButton WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public CompoundButton WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// Defines information about a Fluent icon and how it should be rendered. +/// +public class IconInfo : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type IconInfo. + /// + public static IconInfo? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The name of the icon to display. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The size of the icon. + /// + [JsonPropertyName("size")] + public IconSize? Size { get; set; } = IconSize.XSmall; + + /// + /// The style of the icon. + /// + [JsonPropertyName("style")] + public IconStyle? Style { get; set; } = IconStyle.Regular; + + /// + /// The color of the icon. + /// + [JsonPropertyName("color")] + public TextColor? Color { get; set; } = TextColor.Default; + + /// + /// Serializes this IconInfo into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public IconInfo WithKey(string value) + { + this.Key = value; + return this; + } + + public IconInfo WithName(string value) + { + this.Name = value; + return this; + } + + public IconInfo WithSize(IconSize value) + { + this.Size = value; + return this; + } + + public IconInfo WithStyle(IconStyle value) + { + this.Style = value; + return this; + } + + public IconInfo WithColor(TextColor value) + { + this.Color = value; + return this; + } +} + +/// +/// A standalone icon element. Icons can be picked from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog). +/// +public class Icon : CardElement +{ + /// + /// Deserializes a JSON string into an object of type Icon. + /// + public static Icon? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Icon**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Icon"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The name of the icon to display. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The size of the icon. + /// + [JsonPropertyName("size")] + public IconSize? Size { get; set; } = IconSize.Standard; + + /// + /// The style of the icon. + /// + [JsonPropertyName("style")] + public IconStyle? Style { get; set; } = IconStyle.Regular; + + /// + /// The color of the icon. + /// + [JsonPropertyName("color")] + public TextColor? Color { get; set; } = TextColor.Default; + + /// + /// An Action that will be invoked when the icon is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + public Icon(string name) + { + this.Name = name; + } + + /// + /// Serializes this Icon into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Icon WithKey(string value) + { + this.Key = value; + return this; + } + + public Icon WithId(string value) + { + this.Id = value; + return this; + } + + public Icon WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public Icon WithLang(string value) + { + this.Lang = value; + return this; + } + + public Icon WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public Icon WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public Icon WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public Icon WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public Icon WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public Icon WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public Icon WithName(string value) + { + this.Name = value; + return this; + } + + public Icon WithSize(IconSize value) + { + this.Size = value; + return this; + } + + public Icon WithStyle(IconStyle value) + { + this.Style = value; + return this; + } + + public Icon WithColor(TextColor value) + { + this.Color = value; + return this; + } + + public Icon WithSelectAction(Action value) + { + this.SelectAction = value; + return this; + } + + public Icon WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public Icon WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// A carousel with sliding pages. +/// +public class Carousel : CardElement +{ + /// + /// Deserializes a JSON string into an object of type Carousel. + /// + public static Carousel? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Carousel**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Carousel"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + /// + [JsonPropertyName("bleed")] + public bool? Bleed { get; set; } = false; + + /// + /// The minimum height, in pixels, of the container, in the `px` format. + /// + [JsonPropertyName("minHeight")] + public string? MinHeight { get; set; } + + /// + /// Controls the type of animation to use to navigate between pages. + /// + [JsonPropertyName("pageAnimation")] + public CarouselPageAnimation? PageAnimation { get; set; } = CarouselPageAnimation.Slide; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The pages in the carousel. + /// + [JsonPropertyName("pages")] + public IList? Pages { get; set; } + + /// + /// Serializes this Carousel into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Carousel WithKey(string value) + { + this.Key = value; + return this; + } + + public Carousel WithId(string value) + { + this.Id = value; + return this; + } + + public Carousel WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public Carousel WithLang(string value) + { + this.Lang = value; + return this; + } + + public Carousel WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public Carousel WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public Carousel WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public Carousel WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public Carousel WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public Carousel WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public Carousel WithBleed(bool value) + { + this.Bleed = value; + return this; + } + + public Carousel WithMinHeight(string value) + { + this.MinHeight = value; + return this; + } + + public Carousel WithPageAnimation(CarouselPageAnimation value) + { + this.PageAnimation = value; + return this; + } + + public Carousel WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public Carousel WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } + + public Carousel WithPages(params IList value) + { + this.Pages = value; + return this; + } +} + +/// +/// A badge element to show an icon and/or text in a compact form over a colored background. +/// +public class Badge : CardElement +{ + /// + /// Deserializes a JSON string into an object of type Badge. + /// + public static Badge? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Badge**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Badge"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The text to display. + /// + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// + /// The name of an icon from the [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) to display, in the `[,regular|filled]` format. If the style is not specified, the regular style is used. + /// + [JsonPropertyName("icon")] + public string? Icon { get; set; } + + /// + /// Controls the position of the icon. + /// + [JsonPropertyName("iconPosition")] + public BadgeIconPosition? IconPosition { get; set; } = BadgeIconPosition.Before; + + /// + /// Controls the strength of the background color. + /// + [JsonPropertyName("appearance")] + public BadgeAppearance? Appearance { get; set; } = BadgeAppearance.Filled; + + /// + /// The size of the badge. + /// + [JsonPropertyName("size")] + public BadgeSize? Size { get; set; } = BadgeSize.Medium; + + /// + /// Controls the shape of the badge. + /// + [JsonPropertyName("shape")] + public BadgeShape? Shape { get; set; } = BadgeShape.Circular; + + /// + /// The style of the badge. + /// + [JsonPropertyName("style")] + public BadgeStyle? Style { get; set; } = BadgeStyle.Default; + + /// + /// Controls the tooltip text to display when the badge is hovered over. + /// + [JsonPropertyName("tooltip")] + public string? Tooltip { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this Badge into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Badge WithKey(string value) + { + this.Key = value; + return this; + } + + public Badge WithId(string value) + { + this.Id = value; + return this; + } + + public Badge WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public Badge WithLang(string value) + { + this.Lang = value; + return this; + } + + public Badge WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public Badge WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public Badge WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public Badge WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public Badge WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public Badge WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public Badge WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public Badge WithText(string value) + { + this.Text = value; + return this; + } + + public Badge WithIcon(string value) + { + this.Icon = value; + return this; + } + + public Badge WithIconPosition(BadgeIconPosition value) + { + this.IconPosition = value; + return this; + } + + public Badge WithAppearance(BadgeAppearance value) + { + this.Appearance = value; + return this; + } + + public Badge WithSize(BadgeSize value) + { + this.Size = value; + return this; + } + + public Badge WithShape(BadgeShape value) + { + this.Shape = value; + return this; + } + + public Badge WithStyle(BadgeStyle value) + { + this.Style = value; + return this; + } + + public Badge WithTooltip(string value) + { + this.Tooltip = value; + return this; + } + + public Badge WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public Badge WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// A spinning ring element, to indicate progress. +/// +public class ProgressRing : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ProgressRing. + /// + public static ProgressRing? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **ProgressRing**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "ProgressRing"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The label of the progress ring. + /// + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// + /// Controls the relative position of the label to the progress ring. + /// + [JsonPropertyName("labelPosition")] + public ProgressRingLabelPosition? LabelPosition { get; set; } = ProgressRingLabelPosition.Below; + + /// + /// The size of the progress ring. + /// + [JsonPropertyName("size")] + public ProgressRingSize? Size { get; set; } = ProgressRingSize.Medium; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ProgressRing into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ProgressRing WithKey(string value) + { + this.Key = value; + return this; + } + + public ProgressRing WithId(string value) + { + this.Id = value; + return this; + } + + public ProgressRing WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public ProgressRing WithLang(string value) + { + this.Lang = value; + return this; + } + + public ProgressRing WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public ProgressRing WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public ProgressRing WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public ProgressRing WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public ProgressRing WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public ProgressRing WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public ProgressRing WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public ProgressRing WithLabel(string value) + { + this.Label = value; + return this; + } + + public ProgressRing WithLabelPosition(ProgressRingLabelPosition value) + { + this.LabelPosition = value; + return this; + } + + public ProgressRing WithSize(ProgressRingSize value) + { + this.Size = value; + return this; + } + + public ProgressRing WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public ProgressRing WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// A progress bar element, to represent a value within a range. +/// +public class ProgressBar : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ProgressBar. + /// + public static ProgressBar? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **ProgressBar**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "ProgressBar"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The value of the progress bar. Must be between 0 and max. + /// + [JsonPropertyName("value")] + public float? Value { get; set; } + + /// + /// The maximum value of the progress bar. + /// + [JsonPropertyName("max")] + public float? Max { get; set; } = 100; + + /// + /// The color of the progress bar. `color` has no effect when the `ProgressBar` is in indeterminate mode, in which case the "accent" color is always used. + /// + [JsonPropertyName("color")] + public ProgressBarColor? Color { get; set; } = ProgressBarColor.Accent; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ProgressBar into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ProgressBar WithKey(string value) + { + this.Key = value; + return this; + } + + public ProgressBar WithId(string value) + { + this.Id = value; + return this; + } + + public ProgressBar WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public ProgressBar WithLang(string value) + { + this.Lang = value; + return this; + } + + public ProgressBar WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public ProgressBar WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public ProgressBar WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public ProgressBar WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public ProgressBar WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public ProgressBar WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public ProgressBar WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public ProgressBar WithValue(float value) + { + this.Value = value; + return this; + } + + public ProgressBar WithMax(float value) + { + this.Max = value; + return this; + } + + public ProgressBar WithColor(ProgressBarColor value) + { + this.Color = value; + return this; + } + + public ProgressBar WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public ProgressBar WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// A donut chart. +/// +public class DonutChart : CardElement +{ + /// + /// Deserializes a JSON string into an object of type DonutChart. + /// + public static DonutChart? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Chart.Donut**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Chart.Donut"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The title of the chart. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Controls whether the chart's title should be displayed. Defaults to `false`. + /// + [JsonPropertyName("showTitle")] + public bool? ShowTitle { get; set; } = false; + + /// + /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("colorSet")] + public ChartColorSet? ColorSet { get; set; } + + /// + /// The maximum width, in pixels, of the chart, in the `px` format. + /// + [JsonPropertyName("maxWidth")] + public string? MaxWidth { get; set; } + + /// + /// Controls whether the chart's legend should be displayed. + /// + [JsonPropertyName("showLegend")] + public bool? ShowLegend { get; set; } = true; + + /// + /// The data to display in the chart. + /// + [JsonPropertyName("data")] + public IList? Data { get; set; } + + /// + /// The value that should be displayed in the center of a Donut chart. `value` is ignored for Pie charts. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + /// + /// Controls the color of the value displayed in the center of a Donut chart. + /// + [JsonPropertyName("valueColor")] + public ChartColor? ValueColor { get; set; } + + /// + /// Controls the thickness of the donut segments. Default is **Thick**. + /// + [JsonPropertyName("thickness")] + public DonutThickness? Thickness { get; set; } + + /// + /// Controls whether the outlines of the donut segments are displayed. + /// + [JsonPropertyName("showOutlines")] + public bool? ShowOutlines { get; set; } = true; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this DonutChart into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public DonutChart WithKey(string value) + { + this.Key = value; + return this; + } + + public DonutChart WithId(string value) + { + this.Id = value; + return this; + } + + public DonutChart WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public DonutChart WithLang(string value) + { + this.Lang = value; + return this; + } + + public DonutChart WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public DonutChart WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public DonutChart WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public DonutChart WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public DonutChart WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public DonutChart WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public DonutChart WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public DonutChart WithTitle(string value) + { + this.Title = value; + return this; + } + + public DonutChart WithShowTitle(bool value) + { + this.ShowTitle = value; + return this; + } + + public DonutChart WithColorSet(ChartColorSet value) + { + this.ColorSet = value; + return this; + } + + public DonutChart WithMaxWidth(string value) + { + this.MaxWidth = value; + return this; + } + + public DonutChart WithShowLegend(bool value) + { + this.ShowLegend = value; + return this; + } + + public DonutChart WithData(params IList value) + { + this.Data = value; + return this; + } + + public DonutChart WithValue(string value) + { + this.Value = value; + return this; + } + + public DonutChart WithValueColor(ChartColor value) + { + this.ValueColor = value; + return this; + } + + public DonutChart WithThickness(DonutThickness value) + { + this.Thickness = value; + return this; + } + + public DonutChart WithShowOutlines(bool value) + { + this.ShowOutlines = value; + return this; + } + + public DonutChart WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public DonutChart WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// A data point in a Donut chart. +/// +public class DonutChartData : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type DonutChartData. + /// + public static DonutChartData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The legend of the chart. + /// + [JsonPropertyName("legend")] + public string? Legend { get; set; } + + /// + /// The value associated with the data point. + /// + [JsonPropertyName("value")] + public float? Value { get; set; } = 0; + + /// + /// The color to use for the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// Serializes this DonutChartData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public DonutChartData WithKey(string value) + { + this.Key = value; + return this; + } + + public DonutChartData WithLegend(string value) + { + this.Legend = value; + return this; + } + + public DonutChartData WithValue(float value) + { + this.Value = value; + return this; + } + + public DonutChartData WithColor(ChartColor value) + { + this.Color = value; + return this; + } +} + +/// +/// A pie chart. +/// +public class PieChart : CardElement +{ + /// + /// Deserializes a JSON string into an object of type PieChart. + /// + public static PieChart? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Chart.Pie**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Chart.Pie"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The title of the chart. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Controls whether the chart's title should be displayed. Defaults to `false`. + /// + [JsonPropertyName("showTitle")] + public bool? ShowTitle { get; set; } = false; + + /// + /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("colorSet")] + public ChartColorSet? ColorSet { get; set; } + + /// + /// The maximum width, in pixels, of the chart, in the `px` format. + /// + [JsonPropertyName("maxWidth")] + public string? MaxWidth { get; set; } + + /// + /// Controls whether the chart's legend should be displayed. + /// + [JsonPropertyName("showLegend")] + public bool? ShowLegend { get; set; } = true; + + /// + /// The data to display in the chart. + /// + [JsonPropertyName("data")] + public IList? Data { get; set; } + + /// + /// The value that should be displayed in the center of a Donut chart. `value` is ignored for Pie charts. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + /// + /// Controls the color of the value displayed in the center of a Donut chart. + /// + [JsonPropertyName("valueColor")] + public ChartColor? ValueColor { get; set; } + + /// + /// Controls the thickness of the donut segments. Default is **Thick**. + /// + [JsonPropertyName("thickness")] + public DonutThickness? Thickness { get; set; } + + /// + /// Controls whether the outlines of the donut segments are displayed. + /// + [JsonPropertyName("showOutlines")] + public bool? ShowOutlines { get; set; } = true; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this PieChart into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public PieChart WithKey(string value) + { + this.Key = value; + return this; + } + + public PieChart WithId(string value) + { + this.Id = value; + return this; + } + + public PieChart WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public PieChart WithLang(string value) + { + this.Lang = value; + return this; + } + + public PieChart WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public PieChart WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public PieChart WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public PieChart WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public PieChart WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public PieChart WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public PieChart WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public PieChart WithTitle(string value) + { + this.Title = value; + return this; + } + + public PieChart WithShowTitle(bool value) + { + this.ShowTitle = value; + return this; + } + + public PieChart WithColorSet(ChartColorSet value) + { + this.ColorSet = value; + return this; + } + + public PieChart WithMaxWidth(string value) + { + this.MaxWidth = value; + return this; + } + + public PieChart WithShowLegend(bool value) + { + this.ShowLegend = value; + return this; + } + + public PieChart WithData(params IList value) + { + this.Data = value; + return this; + } + + public PieChart WithValue(string value) + { + this.Value = value; + return this; + } + + public PieChart WithValueColor(ChartColor value) + { + this.ValueColor = value; + return this; + } + + public PieChart WithThickness(DonutThickness value) + { + this.Thickness = value; + return this; + } + + public PieChart WithShowOutlines(bool value) + { + this.ShowOutlines = value; + return this; + } + + public PieChart WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public PieChart WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// A grouped vertical bar chart. +/// +public class GroupedVerticalBarChart : CardElement +{ + /// + /// Deserializes a JSON string into an object of type GroupedVerticalBarChart. + /// + public static GroupedVerticalBarChart? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Chart.VerticalBar.Grouped**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Chart.VerticalBar.Grouped"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The title of the chart. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Controls whether the chart's title should be displayed. Defaults to `false`. + /// + [JsonPropertyName("showTitle")] + public bool? ShowTitle { get; set; } = false; + + /// + /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("colorSet")] + public ChartColorSet? ColorSet { get; set; } + + /// + /// The maximum width, in pixels, of the chart, in the `px` format. + /// + [JsonPropertyName("maxWidth")] + public string? MaxWidth { get; set; } + + /// + /// Controls whether the chart's legend should be displayed. + /// + [JsonPropertyName("showLegend")] + public bool? ShowLegend { get; set; } = true; + + /// + /// The title of the x axis. + /// + [JsonPropertyName("xAxisTitle")] + public string? XAxisTitle { get; set; } + + /// + /// The title of the y axis. + /// + [JsonPropertyName("yAxisTitle")] + public string? YAxisTitle { get; set; } + + /// + /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// Controls if bars in the chart should be displayed as stacks instead of groups. + /// + /// **Note:** stacked vertical bar charts do not support custom Y ranges nor negative Y values. + /// + [JsonPropertyName("stacked")] + public bool? Stacked { get; set; } = false; + + /// + /// The data points in a series. + /// + [JsonPropertyName("data")] + public IList? Data { get; set; } + + /// + /// Controls if values should be displayed on each bar. + /// + [JsonPropertyName("showBarValues")] + public bool? ShowBarValues { get; set; } = false; + + /// + /// The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation. + /// + /// `yMin` is ignored if `stacked` is set to `true`. + /// + [JsonPropertyName("yMin")] + public float? YMin { get; set; } + + /// + /// The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation. + /// + /// `yMax` is ignored if `stacked` is set to `true`. + /// + [JsonPropertyName("yMax")] + public float? YMax { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this GroupedVerticalBarChart into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public GroupedVerticalBarChart WithKey(string value) + { + this.Key = value; + return this; + } + + public GroupedVerticalBarChart WithId(string value) + { + this.Id = value; + return this; + } + + public GroupedVerticalBarChart WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public GroupedVerticalBarChart WithLang(string value) + { + this.Lang = value; + return this; + } + + public GroupedVerticalBarChart WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public GroupedVerticalBarChart WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public GroupedVerticalBarChart WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public GroupedVerticalBarChart WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public GroupedVerticalBarChart WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public GroupedVerticalBarChart WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public GroupedVerticalBarChart WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public GroupedVerticalBarChart WithTitle(string value) + { + this.Title = value; + return this; + } + + public GroupedVerticalBarChart WithShowTitle(bool value) + { + this.ShowTitle = value; + return this; + } + + public GroupedVerticalBarChart WithColorSet(ChartColorSet value) + { + this.ColorSet = value; + return this; + } + + public GroupedVerticalBarChart WithMaxWidth(string value) + { + this.MaxWidth = value; + return this; + } + + public GroupedVerticalBarChart WithShowLegend(bool value) + { + this.ShowLegend = value; + return this; + } + + public GroupedVerticalBarChart WithXAxisTitle(string value) + { + this.XAxisTitle = value; + return this; + } + + public GroupedVerticalBarChart WithYAxisTitle(string value) + { + this.YAxisTitle = value; + return this; + } + + public GroupedVerticalBarChart WithColor(ChartColor value) + { + this.Color = value; + return this; + } + + public GroupedVerticalBarChart WithStacked(bool value) + { + this.Stacked = value; + return this; + } + + public GroupedVerticalBarChart WithData(params IList value) + { + this.Data = value; + return this; + } + + public GroupedVerticalBarChart WithShowBarValues(bool value) + { + this.ShowBarValues = value; + return this; + } + + public GroupedVerticalBarChart WithYMin(float value) + { + this.YMin = value; + return this; + } + + public GroupedVerticalBarChart WithYMax(float value) + { + this.YMax = value; + return this; + } + + public GroupedVerticalBarChart WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public GroupedVerticalBarChart WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// Represents a series of data points. +/// +public class GroupedVerticalBarChartData : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type GroupedVerticalBarChartData. + /// + public static GroupedVerticalBarChartData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The legend of the chart. + /// + [JsonPropertyName("legend")] + public string? Legend { get; set; } + + /// + /// The data points in the series. + /// + [JsonPropertyName("values")] + public IList? Values { get; set; } + + /// + /// The color to use for all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// Serializes this GroupedVerticalBarChartData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public GroupedVerticalBarChartData WithKey(string value) + { + this.Key = value; + return this; + } + + public GroupedVerticalBarChartData WithLegend(string value) + { + this.Legend = value; + return this; + } + + public GroupedVerticalBarChartData WithValues(params IList value) + { + this.Values = value; + return this; + } + + public GroupedVerticalBarChartData WithColor(ChartColor value) + { + this.Color = value; + return this; + } +} + +/// +/// A single data point in a bar chart. +/// +public class BarChartDataValue : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type BarChartDataValue. + /// + public static BarChartDataValue? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The x axis value of the data point. + /// + [JsonPropertyName("x")] + public string? X { get; set; } + + /// + /// The y axis value of the data point. + /// + [JsonPropertyName("y")] + public float? Y { get; set; } = 0; + + /// + /// Serializes this BarChartDataValue into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public BarChartDataValue WithKey(string value) + { + this.Key = value; + return this; + } + + public BarChartDataValue WithX(string value) + { + this.X = value; + return this; + } + + public BarChartDataValue WithY(float value) + { + this.Y = value; + return this; + } +} + +/// +/// A vertical bar chart. +/// +public class VerticalBarChart : CardElement +{ + /// + /// Deserializes a JSON string into an object of type VerticalBarChart. + /// + public static VerticalBarChart? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Chart.VerticalBar**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Chart.VerticalBar"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The title of the chart. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Controls whether the chart's title should be displayed. Defaults to `false`. + /// + [JsonPropertyName("showTitle")] + public bool? ShowTitle { get; set; } = false; + + /// + /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("colorSet")] + public ChartColorSet? ColorSet { get; set; } + + /// + /// The maximum width, in pixels, of the chart, in the `px` format. + /// + [JsonPropertyName("maxWidth")] + public string? MaxWidth { get; set; } + + /// + /// Controls whether the chart's legend should be displayed. + /// + [JsonPropertyName("showLegend")] + public bool? ShowLegend { get; set; } = true; + + /// + /// The title of the x axis. + /// + [JsonPropertyName("xAxisTitle")] + public string? XAxisTitle { get; set; } + + /// + /// The title of the y axis. + /// + [JsonPropertyName("yAxisTitle")] + public string? YAxisTitle { get; set; } + + /// + /// The data to display in the chart. + /// + [JsonPropertyName("data")] + public IList? Data { get; set; } + + /// + /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// Controls if the bar values should be displayed. + /// + [JsonPropertyName("showBarValues")] + public bool? ShowBarValues { get; set; } = false; + + /// + /// The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation. + /// + [JsonPropertyName("yMin")] + public float? YMin { get; set; } + + /// + /// The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation. + /// + [JsonPropertyName("yMax")] + public float? YMax { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this VerticalBarChart into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public VerticalBarChart WithKey(string value) + { + this.Key = value; + return this; + } + + public VerticalBarChart WithId(string value) + { + this.Id = value; + return this; + } + + public VerticalBarChart WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public VerticalBarChart WithLang(string value) + { + this.Lang = value; + return this; + } + + public VerticalBarChart WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public VerticalBarChart WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public VerticalBarChart WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public VerticalBarChart WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public VerticalBarChart WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public VerticalBarChart WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public VerticalBarChart WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public VerticalBarChart WithTitle(string value) + { + this.Title = value; + return this; + } + + public VerticalBarChart WithShowTitle(bool value) + { + this.ShowTitle = value; + return this; + } + + public VerticalBarChart WithColorSet(ChartColorSet value) + { + this.ColorSet = value; + return this; + } + + public VerticalBarChart WithMaxWidth(string value) + { + this.MaxWidth = value; + return this; + } + + public VerticalBarChart WithShowLegend(bool value) + { + this.ShowLegend = value; + return this; + } + + public VerticalBarChart WithXAxisTitle(string value) + { + this.XAxisTitle = value; + return this; + } + + public VerticalBarChart WithYAxisTitle(string value) + { + this.YAxisTitle = value; + return this; + } + + public VerticalBarChart WithData(params IList value) + { + this.Data = value; + return this; + } + + public VerticalBarChart WithColor(ChartColor value) + { + this.Color = value; + return this; + } + + public VerticalBarChart WithShowBarValues(bool value) + { + this.ShowBarValues = value; + return this; + } + + public VerticalBarChart WithYMin(float value) + { + this.YMin = value; + return this; + } + + public VerticalBarChart WithYMax(float value) + { + this.YMax = value; + return this; + } + + public VerticalBarChart WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public VerticalBarChart WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// Represents a data point in a vertical bar chart. +/// +public class VerticalBarChartDataValue : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type VerticalBarChartDataValue. + /// + public static VerticalBarChartDataValue? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The x axis value of the data point. + /// + [JsonPropertyName("x")] + public IUnion? X { get; set; } + + /// + /// The y axis value of the data point. + /// + [JsonPropertyName("y")] + public float? Y { get; set; } = 0; + + /// + /// The color to use for the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// Serializes this VerticalBarChartDataValue into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public VerticalBarChartDataValue WithKey(string value) + { + this.Key = value; + return this; + } + + public VerticalBarChartDataValue WithX(IUnion value) + { + this.X = value; + return this; + } + + public VerticalBarChartDataValue WithY(float value) + { + this.Y = value; + return this; + } + + public VerticalBarChartDataValue WithColor(ChartColor value) + { + this.Color = value; + return this; + } +} + +/// +/// A horizontal bar chart. +/// +public class HorizontalBarChart : CardElement +{ + /// + /// Deserializes a JSON string into an object of type HorizontalBarChart. + /// + public static HorizontalBarChart? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Chart.HorizontalBar**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Chart.HorizontalBar"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The title of the chart. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Controls whether the chart's title should be displayed. Defaults to `false`. + /// + [JsonPropertyName("showTitle")] + public bool? ShowTitle { get; set; } = false; + + /// + /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("colorSet")] + public ChartColorSet? ColorSet { get; set; } + + /// + /// The maximum width, in pixels, of the chart, in the `px` format. + /// + [JsonPropertyName("maxWidth")] + public string? MaxWidth { get; set; } + + /// + /// Controls whether the chart's legend should be displayed. + /// + [JsonPropertyName("showLegend")] + public bool? ShowLegend { get; set; } = true; + + /// + /// The title of the x axis. + /// + [JsonPropertyName("xAxisTitle")] + public string? XAxisTitle { get; set; } + + /// + /// The title of the y axis. + /// + [JsonPropertyName("yAxisTitle")] + public string? YAxisTitle { get; set; } + + /// + /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// The data points in the chart. + /// + [JsonPropertyName("data")] + public IList? Data { get; set; } + + /// + /// Controls how the chart should be visually laid out. + /// + [JsonPropertyName("displayMode")] + public HorizontalBarChartDisplayMode? DisplayMode { get; set; } = HorizontalBarChartDisplayMode.AbsoluteWithAxis; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this HorizontalBarChart into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public HorizontalBarChart WithKey(string value) + { + this.Key = value; + return this; + } + + public HorizontalBarChart WithId(string value) + { + this.Id = value; + return this; + } + + public HorizontalBarChart WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public HorizontalBarChart WithLang(string value) + { + this.Lang = value; + return this; + } + + public HorizontalBarChart WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public HorizontalBarChart WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public HorizontalBarChart WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public HorizontalBarChart WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public HorizontalBarChart WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public HorizontalBarChart WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public HorizontalBarChart WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public HorizontalBarChart WithTitle(string value) + { + this.Title = value; + return this; + } + + public HorizontalBarChart WithShowTitle(bool value) + { + this.ShowTitle = value; + return this; + } + + public HorizontalBarChart WithColorSet(ChartColorSet value) + { + this.ColorSet = value; + return this; + } + + public HorizontalBarChart WithMaxWidth(string value) + { + this.MaxWidth = value; + return this; + } + + public HorizontalBarChart WithShowLegend(bool value) + { + this.ShowLegend = value; + return this; + } + + public HorizontalBarChart WithXAxisTitle(string value) + { + this.XAxisTitle = value; + return this; + } + + public HorizontalBarChart WithYAxisTitle(string value) + { + this.YAxisTitle = value; + return this; + } + + public HorizontalBarChart WithColor(ChartColor value) + { + this.Color = value; + return this; + } + + public HorizontalBarChart WithData(params IList value) + { + this.Data = value; + return this; + } + + public HorizontalBarChart WithDisplayMode(HorizontalBarChartDisplayMode value) + { + this.DisplayMode = value; + return this; + } + + public HorizontalBarChart WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public HorizontalBarChart WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// Represents a single data point in a horizontal bar chart. +/// +public class HorizontalBarChartDataValue : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type HorizontalBarChartDataValue. + /// + public static HorizontalBarChartDataValue? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The x axis value of the data point. + /// + [JsonPropertyName("x")] + public string? X { get; set; } + + /// + /// The y axis value of the data point. + /// + [JsonPropertyName("y")] + public float? Y { get; set; } = 0; + + /// + /// The color of the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// Serializes this HorizontalBarChartDataValue into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public HorizontalBarChartDataValue WithKey(string value) + { + this.Key = value; + return this; + } + + public HorizontalBarChartDataValue WithX(string value) + { + this.X = value; + return this; + } + + public HorizontalBarChartDataValue WithY(float value) + { + this.Y = value; + return this; + } + + public HorizontalBarChartDataValue WithColor(ChartColor value) + { + this.Color = value; + return this; + } +} + +/// +/// A stacked horizontal bar chart. +/// +public class StackedHorizontalBarChart : CardElement +{ + /// + /// Deserializes a JSON string into an object of type StackedHorizontalBarChart. + /// + public static StackedHorizontalBarChart? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Chart.HorizontalBar.Stacked**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Chart.HorizontalBar.Stacked"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The title of the chart. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Controls whether the chart's title should be displayed. Defaults to `false`. + /// + [JsonPropertyName("showTitle")] + public bool? ShowTitle { get; set; } = false; + + /// + /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("colorSet")] + public ChartColorSet? ColorSet { get; set; } + + /// + /// The maximum width, in pixels, of the chart, in the `px` format. + /// + [JsonPropertyName("maxWidth")] + public string? MaxWidth { get; set; } + + /// + /// Controls whether the chart's legend should be displayed. + /// + [JsonPropertyName("showLegend")] + public bool? ShowLegend { get; set; } = true; + + /// + /// The title of the x axis. + /// + [JsonPropertyName("xAxisTitle")] + public string? XAxisTitle { get; set; } + + /// + /// The title of the y axis. + /// + [JsonPropertyName("yAxisTitle")] + public string? YAxisTitle { get; set; } + + /// + /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// The data to display in the chart. + /// + [JsonPropertyName("data")] + public IList? Data { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this StackedHorizontalBarChart into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public StackedHorizontalBarChart WithKey(string value) + { + this.Key = value; + return this; + } + + public StackedHorizontalBarChart WithId(string value) + { + this.Id = value; + return this; + } + + public StackedHorizontalBarChart WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public StackedHorizontalBarChart WithLang(string value) + { + this.Lang = value; + return this; + } + + public StackedHorizontalBarChart WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public StackedHorizontalBarChart WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public StackedHorizontalBarChart WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public StackedHorizontalBarChart WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public StackedHorizontalBarChart WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public StackedHorizontalBarChart WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public StackedHorizontalBarChart WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public StackedHorizontalBarChart WithTitle(string value) + { + this.Title = value; + return this; + } + + public StackedHorizontalBarChart WithShowTitle(bool value) + { + this.ShowTitle = value; + return this; + } + + public StackedHorizontalBarChart WithColorSet(ChartColorSet value) + { + this.ColorSet = value; + return this; + } + + public StackedHorizontalBarChart WithMaxWidth(string value) + { + this.MaxWidth = value; + return this; + } + + public StackedHorizontalBarChart WithShowLegend(bool value) + { + this.ShowLegend = value; + return this; + } + + public StackedHorizontalBarChart WithXAxisTitle(string value) + { + this.XAxisTitle = value; + return this; + } + + public StackedHorizontalBarChart WithYAxisTitle(string value) + { + this.YAxisTitle = value; + return this; + } + + public StackedHorizontalBarChart WithColor(ChartColor value) + { + this.Color = value; + return this; + } + + public StackedHorizontalBarChart WithData(params IList value) + { + this.Data = value; + return this; + } + + public StackedHorizontalBarChart WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public StackedHorizontalBarChart WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// Defines the collection of data series to display in as a stacked horizontal bar chart. +/// +public class StackedHorizontalBarChartData : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type StackedHorizontalBarChartData. + /// + public static StackedHorizontalBarChartData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The title of the series. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// The data points in the series. + /// + [JsonPropertyName("data")] + public IList? Data { get; set; } + + /// + /// Serializes this StackedHorizontalBarChartData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public StackedHorizontalBarChartData WithKey(string value) + { + this.Key = value; + return this; + } + + public StackedHorizontalBarChartData WithTitle(string value) + { + this.Title = value; + return this; + } + + public StackedHorizontalBarChartData WithData(params IList value) + { + this.Data = value; + return this; + } +} + +/// +/// A data point in a series. +/// +public class StackedHorizontalBarChartDataPoint : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type StackedHorizontalBarChartDataPoint. + /// + public static StackedHorizontalBarChartDataPoint? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The legend associated with the data point. + /// + [JsonPropertyName("legend")] + public string? Legend { get; set; } + + /// + /// The value of the data point. + /// + [JsonPropertyName("value")] + public float? Value { get; set; } = 0; + + /// + /// The color to use to render the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// Serializes this StackedHorizontalBarChartDataPoint into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public StackedHorizontalBarChartDataPoint WithKey(string value) + { + this.Key = value; + return this; + } + + public StackedHorizontalBarChartDataPoint WithLegend(string value) + { + this.Legend = value; + return this; + } + + public StackedHorizontalBarChartDataPoint WithValue(float value) + { + this.Value = value; + return this; + } + + public StackedHorizontalBarChartDataPoint WithColor(ChartColor value) + { + this.Color = value; + return this; + } +} + +/// +/// A line chart. +/// +public class LineChart : CardElement +{ + /// + /// Deserializes a JSON string into an object of type LineChart. + /// + public static LineChart? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Chart.Line**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Chart.Line"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The title of the chart. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Controls whether the chart's title should be displayed. Defaults to `false`. + /// + [JsonPropertyName("showTitle")] + public bool? ShowTitle { get; set; } = false; + + /// + /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("colorSet")] + public ChartColorSet? ColorSet { get; set; } + + /// + /// The maximum width, in pixels, of the chart, in the `px` format. + /// + [JsonPropertyName("maxWidth")] + public string? MaxWidth { get; set; } + + /// + /// Controls whether the chart's legend should be displayed. + /// + [JsonPropertyName("showLegend")] + public bool? ShowLegend { get; set; } = true; + + /// + /// The title of the x axis. + /// + [JsonPropertyName("xAxisTitle")] + public string? XAxisTitle { get; set; } + + /// + /// The title of the y axis. + /// + [JsonPropertyName("yAxisTitle")] + public string? YAxisTitle { get; set; } + + /// + /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// The data point series in the line chart. + /// + [JsonPropertyName("data")] + public IList? Data { get; set; } + + /// + /// The maximum y range. + /// + [JsonPropertyName("yMin")] + public float? YMin { get; set; } + + /// + /// The minimum y range. + /// + [JsonPropertyName("yMax")] + public float? YMax { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this LineChart into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public LineChart WithKey(string value) + { + this.Key = value; + return this; + } + + public LineChart WithId(string value) + { + this.Id = value; + return this; + } + + public LineChart WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public LineChart WithLang(string value) + { + this.Lang = value; + return this; + } + + public LineChart WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public LineChart WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public LineChart WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public LineChart WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public LineChart WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public LineChart WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public LineChart WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public LineChart WithTitle(string value) + { + this.Title = value; + return this; + } + + public LineChart WithShowTitle(bool value) + { + this.ShowTitle = value; + return this; + } + + public LineChart WithColorSet(ChartColorSet value) + { + this.ColorSet = value; + return this; + } + + public LineChart WithMaxWidth(string value) + { + this.MaxWidth = value; + return this; + } + + public LineChart WithShowLegend(bool value) + { + this.ShowLegend = value; + return this; + } + + public LineChart WithXAxisTitle(string value) + { + this.XAxisTitle = value; + return this; + } + + public LineChart WithYAxisTitle(string value) + { + this.YAxisTitle = value; + return this; + } + + public LineChart WithColor(ChartColor value) + { + this.Color = value; + return this; + } + + public LineChart WithData(params IList value) + { + this.Data = value; + return this; + } + + public LineChart WithYMin(float value) + { + this.YMin = value; + return this; + } + + public LineChart WithYMax(float value) + { + this.YMax = value; + return this; + } + + public LineChart WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public LineChart WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// Represents a collection of data points series in a line chart. +/// +public class LineChartData : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type LineChartData. + /// + public static LineChartData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The legend of the chart. + /// + [JsonPropertyName("legend")] + public string? Legend { get; set; } + + /// + /// The data points in the series. + /// + [JsonPropertyName("values")] + public IList? Values { get; set; } + + /// + /// The color all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// Serializes this LineChartData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public LineChartData WithKey(string value) + { + this.Key = value; + return this; + } + + public LineChartData WithLegend(string value) + { + this.Legend = value; + return this; + } + + public LineChartData WithValues(params IList value) + { + this.Values = value; + return this; + } + + public LineChartData WithColor(ChartColor value) + { + this.Color = value; + return this; + } +} + +/// +/// Represents a single data point in a line chart. +/// +public class LineChartValue : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type LineChartValue. + /// + public static LineChartValue? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The x axis value of the data point. + /// + /// If all x values of the x [Chart.Line](https://adaptivecards.microsoft.com/?topic=Chart.Line) are expressed as a number, or if all x values are expressed as a date string in the `YYYY-MM-DD` format, the chart will be rendered as a time series chart, i.e. x axis values will span across the minimum x value to maximum x value range. + /// + /// Otherwise, if x values are represented as a mix of numbers and strings or if at least one x value isn't in the `YYYY-MM-DD` format, the chart will be rendered as a categorical chart, i.e. x axis values will be displayed as categories. + /// + [JsonPropertyName("x")] + public IUnion? X { get; set; } + + /// + /// The y axis value of the data point. + /// + [JsonPropertyName("y")] + public float? Y { get; set; } = 0; + + /// + /// Serializes this LineChartValue into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public LineChartValue WithKey(string value) + { + this.Key = value; + return this; + } + + public LineChartValue WithX(IUnion value) + { + this.X = value; + return this; + } + + public LineChartValue WithY(float value) + { + this.Y = value; + return this; + } +} + +/// +/// A gauge chart. +/// +public class GaugeChart : CardElement +{ + /// + /// Deserializes a JSON string into an object of type GaugeChart. + /// + public static GaugeChart? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Chart.Gauge**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Chart.Gauge"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The title of the chart. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Controls whether the chart's title should be displayed. Defaults to `false`. + /// + [JsonPropertyName("showTitle")] + public bool? ShowTitle { get; set; } = false; + + /// + /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("colorSet")] + public ChartColorSet? ColorSet { get; set; } + + /// + /// The maximum width, in pixels, of the chart, in the `px` format. + /// + [JsonPropertyName("maxWidth")] + public string? MaxWidth { get; set; } + + /// + /// Controls whether the chart's legend should be displayed. + /// + [JsonPropertyName("showLegend")] + public bool? ShowLegend { get; set; } = true; + + /// + /// The minimum value of the gauge. + /// + [JsonPropertyName("min")] + public float? Min { get; set; } = 0; + + /// + /// The maximum value of the gauge. + /// + [JsonPropertyName("max")] + public float? Max { get; set; } + + /// + /// The sub-label of the gauge. + /// + [JsonPropertyName("subLabel")] + public string? SubLabel { get; set; } + + /// + /// Controls whether the min/max values should be displayed. + /// + [JsonPropertyName("showMinMax")] + public bool? ShowMinMax { get; set; } = true; + + /// + /// Controls whether the gauge's needle is displayed. Default is **true**. + /// + [JsonPropertyName("showNeedle")] + public bool? ShowNeedle { get; set; } = true; + + /// + /// Controls whether the outlines of the gauge segments are displayed. + /// + [JsonPropertyName("showOutlines")] + public bool? ShowOutlines { get; set; } = true; + + /// + /// The segments to display in the gauge. + /// + [JsonPropertyName("segments")] + public IList? Segments { get; set; } + + /// + /// The value of the gauge. + /// + [JsonPropertyName("value")] + public float? Value { get; set; } = 0; + + /// + /// The format used to display the gauge's value. + /// + [JsonPropertyName("valueFormat")] + public GaugeChartValueFormat? ValueFormat { get; set; } = GaugeChartValueFormat.Percentage; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this GaugeChart into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public GaugeChart WithKey(string value) + { + this.Key = value; + return this; + } + + public GaugeChart WithId(string value) + { + this.Id = value; + return this; + } + + public GaugeChart WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public GaugeChart WithLang(string value) + { + this.Lang = value; + return this; + } + + public GaugeChart WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public GaugeChart WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public GaugeChart WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public GaugeChart WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public GaugeChart WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public GaugeChart WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public GaugeChart WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public GaugeChart WithTitle(string value) + { + this.Title = value; + return this; + } + + public GaugeChart WithShowTitle(bool value) + { + this.ShowTitle = value; + return this; + } + + public GaugeChart WithColorSet(ChartColorSet value) + { + this.ColorSet = value; + return this; + } + + public GaugeChart WithMaxWidth(string value) + { + this.MaxWidth = value; + return this; + } + + public GaugeChart WithShowLegend(bool value) + { + this.ShowLegend = value; + return this; + } + + public GaugeChart WithMin(float value) + { + this.Min = value; + return this; + } + + public GaugeChart WithMax(float value) + { + this.Max = value; + return this; + } + + public GaugeChart WithSubLabel(string value) + { + this.SubLabel = value; + return this; + } + + public GaugeChart WithShowMinMax(bool value) + { + this.ShowMinMax = value; + return this; + } + + public GaugeChart WithShowNeedle(bool value) + { + this.ShowNeedle = value; + return this; + } + + public GaugeChart WithShowOutlines(bool value) + { + this.ShowOutlines = value; + return this; + } + + public GaugeChart WithSegments(params IList value) + { + this.Segments = value; + return this; + } + + public GaugeChart WithValue(float value) + { + this.Value = value; + return this; + } + + public GaugeChart WithValueFormat(GaugeChartValueFormat value) + { + this.ValueFormat = value; + return this; + } + + public GaugeChart WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public GaugeChart WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// The legend of the chart. +/// +public class GaugeChartLegend : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type GaugeChartLegend. + /// + public static GaugeChartLegend? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The size of the segment. + /// + [JsonPropertyName("size")] + public float? Size { get; set; } = 0; + + /// + /// The legend text associated with the segment. + /// + [JsonPropertyName("legend")] + public string? Legend { get; set; } + + /// + /// The color to use for the segment. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + /// + [JsonPropertyName("color")] + public ChartColor? Color { get; set; } + + /// + /// Serializes this GaugeChartLegend into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public GaugeChartLegend WithKey(string value) + { + this.Key = value; + return this; + } + + public GaugeChartLegend WithSize(float value) + { + this.Size = value; + return this; + } + + public GaugeChartLegend WithLegend(string value) + { + this.Legend = value; + return this; + } + + public GaugeChartLegend WithColor(ChartColor value) + { + this.Color = value; + return this; + } +} + +/// +/// A formatted and syntax-colored code block. +/// +public class CodeBlock : CardElement +{ + /// + /// Deserializes a JSON string into an object of type CodeBlock. + /// + public static CodeBlock? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **CodeBlock**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "CodeBlock"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The code snippet to display. + /// + [JsonPropertyName("codeSnippet")] + public string? CodeSnippet { get; set; } + + /// + /// The language the code snippet is expressed in. + /// + [JsonPropertyName("language")] + public CodeLanguage? Language { get; set; } = CodeLanguage.PlainText; + + /// + /// A number that represents the line in the file from where the code snippet was extracted. + /// + [JsonPropertyName("startLineNumber")] + public float? StartLineNumber { get; set; } = 1; + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this CodeBlock into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public CodeBlock WithKey(string value) + { + this.Key = value; + return this; + } + + public CodeBlock WithId(string value) + { + this.Id = value; + return this; + } + + public CodeBlock WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public CodeBlock WithLang(string value) + { + this.Lang = value; + return this; + } + + public CodeBlock WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public CodeBlock WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public CodeBlock WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public CodeBlock WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public CodeBlock WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public CodeBlock WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public CodeBlock WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public CodeBlock WithCodeSnippet(string value) + { + this.CodeSnippet = value; + return this; + } + + public CodeBlock WithLanguage(CodeLanguage value) + { + this.Language = value; + return this; + } + + public CodeBlock WithStartLineNumber(float value) + { + this.StartLineNumber = value; + return this; + } + + public CodeBlock WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public CodeBlock WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// Displays a user's information, including their profile picture. +/// +public class ComUserMicrosoftGraphComponent : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ComUserMicrosoftGraphComponent. + /// + public static ComUserMicrosoftGraphComponent? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Component**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Component"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// Must be **graph.microsoft.com/user**. + /// + [JsonPropertyName("name")] + public string Name { get; } = "graph.microsoft.com/user"; + + /// + /// The properties of the Persona component. + /// + [JsonPropertyName("properties")] + public PersonaProperties? Properties { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ComUserMicrosoftGraphComponent into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ComUserMicrosoftGraphComponent WithKey(string value) + { + this.Key = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithId(string value) + { + this.Id = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithLang(string value) + { + this.Lang = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithProperties(PersonaProperties value) + { + this.Properties = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public ComUserMicrosoftGraphComponent WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// Represents the properties of a Persona component. +/// +public class PersonaProperties : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type PersonaProperties. + /// + public static PersonaProperties? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The Id of the persona. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// The UPN of the persona. + /// + [JsonPropertyName("userPrincipalName")] + public string? UserPrincipalName { get; set; } + + /// + /// The display name of the persona. + /// + [JsonPropertyName("displayName")] + public string? DisplayName { get; set; } + + /// + /// Defines the style of the icon for the persona. + /// + [JsonPropertyName("iconStyle")] + public PersonaIconStyle? IconStyle { get; set; } + + /// + /// Defines how the persona should be displayed. + /// + [JsonPropertyName("style")] + public PersonaDisplayStyle? Style { get; set; } + + /// + /// Serializes this PersonaProperties into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public PersonaProperties WithKey(string value) + { + this.Key = value; + return this; + } + + public PersonaProperties WithId(string value) + { + this.Id = value; + return this; + } + + public PersonaProperties WithUserPrincipalName(string value) + { + this.UserPrincipalName = value; + return this; + } + + public PersonaProperties WithDisplayName(string value) + { + this.DisplayName = value; + return this; + } + + public PersonaProperties WithIconStyle(PersonaIconStyle value) + { + this.IconStyle = value; + return this; + } + + public PersonaProperties WithStyle(PersonaDisplayStyle value) + { + this.Style = value; + return this; + } +} + +/// +/// Displays multiple users' information, including their profile pictures. +/// +public class ComUsersMicrosoftGraphComponent : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ComUsersMicrosoftGraphComponent. + /// + public static ComUsersMicrosoftGraphComponent? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Component**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Component"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// Must be **graph.microsoft.com/users**. + /// + [JsonPropertyName("name")] + public string Name { get; } = "graph.microsoft.com/users"; + + /// + /// The properties of the PersonaSet component. + /// + [JsonPropertyName("properties")] + public PersonaSetProperties? Properties { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ComUsersMicrosoftGraphComponent into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ComUsersMicrosoftGraphComponent WithKey(string value) + { + this.Key = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithId(string value) + { + this.Id = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithLang(string value) + { + this.Lang = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithProperties(PersonaSetProperties value) + { + this.Properties = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public ComUsersMicrosoftGraphComponent WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// Represents the properties of a PersonaSet component. +/// +public class PersonaSetProperties : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type PersonaSetProperties. + /// + public static PersonaSetProperties? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The users a PersonaSet component should display. + /// + [JsonPropertyName("users")] + public IList? Users { get; set; } + + /// + /// Defines the style of the icon for the personas in the set. + /// + [JsonPropertyName("iconStyle")] + public PersonaIconStyle? IconStyle { get; set; } + + /// + /// Defines how each persona in the set should be displayed. + /// + [JsonPropertyName("style")] + public PersonaDisplayStyle? Style { get; set; } + + /// + /// Serializes this PersonaSetProperties into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public PersonaSetProperties WithKey(string value) + { + this.Key = value; + return this; + } + + public PersonaSetProperties WithUsers(params IList value) + { + this.Users = value; + return this; + } + + public PersonaSetProperties WithIconStyle(PersonaIconStyle value) + { + this.IconStyle = value; + return this; + } + + public PersonaSetProperties WithStyle(PersonaDisplayStyle value) + { + this.Style = value; + return this; + } +} + +/// +/// Displays information about a generic graph resource. +/// +public class ComResourceMicrosoftGraphComponent : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ComResourceMicrosoftGraphComponent. + /// + public static ComResourceMicrosoftGraphComponent? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Component**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Component"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// Must be **graph.microsoft.com/resource**. + /// + [JsonPropertyName("name")] + public string Name { get; } = "graph.microsoft.com/resource"; + + /// + /// The properties of the resource. + /// + [JsonPropertyName("properties")] + public ResourceProperties? Properties { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ComResourceMicrosoftGraphComponent into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ComResourceMicrosoftGraphComponent WithKey(string value) + { + this.Key = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithId(string value) + { + this.Id = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithLang(string value) + { + this.Lang = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithProperties(ResourceProperties value) + { + this.Properties = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public ComResourceMicrosoftGraphComponent WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// Represents the properties of a resource component. +/// +public class ResourceProperties : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type ResourceProperties. + /// + public static ResourceProperties? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The Id of the resource. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// The reference to the resource. + /// + [JsonPropertyName("resourceReference")] + public IDictionary? ResourceReference { get; set; } + + /// + /// The visualization of the resource. + /// + [JsonPropertyName("resourceVisualization")] + public ResourceVisualization? ResourceVisualization { get; set; } + + /// + /// Serializes this ResourceProperties into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ResourceProperties WithKey(string value) + { + this.Key = value; + return this; + } + + public ResourceProperties WithId(string value) + { + this.Id = value; + return this; + } + + public ResourceProperties WithResourceReference(IDictionary value) + { + this.ResourceReference = value; + return this; + } + + public ResourceProperties WithResourceVisualization(ResourceVisualization value) + { + this.ResourceVisualization = value; + return this; + } +} + +/// +/// Represents a visualization of a resource. +/// +public class ResourceVisualization : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type ResourceVisualization. + /// + public static ResourceVisualization? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The media associated with the resource. + /// + [JsonPropertyName("media")] + public string? Media { get; set; } + + /// + /// Serializes this ResourceVisualization into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ResourceVisualization WithKey(string value) + { + this.Key = value; + return this; + } + + public ResourceVisualization WithMedia(string value) + { + this.Media = value; + return this; + } +} + +/// +/// Displays information about a file resource. +/// +public class ComFileMicrosoftGraphComponent : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ComFileMicrosoftGraphComponent. + /// + public static ComFileMicrosoftGraphComponent? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Component**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Component"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// Must be **graph.microsoft.com/file**. + /// + [JsonPropertyName("name")] + public string Name { get; } = "graph.microsoft.com/file"; + + /// + /// The properties of the file. + /// + [JsonPropertyName("properties")] + public FileProperties? Properties { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ComFileMicrosoftGraphComponent into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ComFileMicrosoftGraphComponent WithKey(string value) + { + this.Key = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithId(string value) + { + this.Id = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithLang(string value) + { + this.Lang = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithProperties(FileProperties value) + { + this.Properties = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public ComFileMicrosoftGraphComponent WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// Represents the properties of a file component. +/// +public class FileProperties : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type FileProperties. + /// + public static FileProperties? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The name of the file. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The file extension. + /// + [JsonPropertyName("extension")] + public string? Extension { get; set; } + + /// + /// The URL of the file. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// Serializes this FileProperties into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public FileProperties WithKey(string value) + { + this.Key = value; + return this; + } + + public FileProperties WithName(string value) + { + this.Name = value; + return this; + } + + public FileProperties WithExtension(string value) + { + this.Extension = value; + return this; + } + + public FileProperties WithUrl(string value) + { + this.Url = value; + return this; + } +} + +/// +/// Displays information about a calendar event. +/// +public class ComEventMicrosoftGraphComponent : CardElement +{ + /// + /// Deserializes a JSON string into an object of type ComEventMicrosoftGraphComponent. + /// + public static ComEventMicrosoftGraphComponent? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **Component**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Component"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// Must be **graph.microsoft.com/event**. + /// + [JsonPropertyName("name")] + public string Name { get; } = "graph.microsoft.com/event"; + + /// + /// The properties of the event. + /// + [JsonPropertyName("properties")] + public CalendarEventProperties? Properties { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ComEventMicrosoftGraphComponent into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ComEventMicrosoftGraphComponent WithKey(string value) + { + this.Key = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithId(string value) + { + this.Id = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithLang(string value) + { + this.Lang = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithProperties(CalendarEventProperties value) + { + this.Properties = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public ComEventMicrosoftGraphComponent WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } +} + +/// +/// The properties of a calendar event. +/// +public class CalendarEventProperties : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type CalendarEventProperties. + /// + public static CalendarEventProperties? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The ID of the event. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// The title of the event. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// The start date and time of the event. + /// + [JsonPropertyName("start")] + public string? Start { get; set; } + + /// + /// The end date and time of the event. + /// + [JsonPropertyName("end")] + public string? End { get; set; } + + /// + /// The status of the event. + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// The locations of the event. + /// + [JsonPropertyName("locations")] + public IList? Locations { get; set; } + + /// + /// The URL of the online meeting. + /// + [JsonPropertyName("onlineMeetingUrl")] + public string? OnlineMeetingUrl { get; set; } + + /// + /// Indicates if the event is all day. + /// + [JsonPropertyName("isAllDay")] + public bool? IsAllDay { get; set; } + + /// + /// The extension of the event. + /// + [JsonPropertyName("extension")] + public string? Extension { get; set; } + + /// + /// The URL of the event. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// The attendees of the event. + /// + [JsonPropertyName("attendees")] + public IList? Attendees { get; set; } + + /// + /// The organizer of the event. + /// + [JsonPropertyName("organizer")] + public CalendarEventAttendee? Organizer { get; set; } + + /// + /// Serializes this CalendarEventProperties into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public CalendarEventProperties WithKey(string value) + { + this.Key = value; + return this; + } + + public CalendarEventProperties WithId(string value) + { + this.Id = value; + return this; + } + + public CalendarEventProperties WithTitle(string value) + { + this.Title = value; + return this; + } + + public CalendarEventProperties WithStart(string value) + { + this.Start = value; + return this; + } + + public CalendarEventProperties WithEnd(string value) + { + this.End = value; + return this; + } + + public CalendarEventProperties WithStatus(string value) + { + this.Status = value; + return this; + } + + public CalendarEventProperties WithLocations(params IList value) + { + this.Locations = value; + return this; + } + + public CalendarEventProperties WithOnlineMeetingUrl(string value) + { + this.OnlineMeetingUrl = value; + return this; + } + + public CalendarEventProperties WithIsAllDay(bool value) + { + this.IsAllDay = value; + return this; + } + + public CalendarEventProperties WithExtension(string value) + { + this.Extension = value; + return this; + } + + public CalendarEventProperties WithUrl(string value) + { + this.Url = value; + return this; + } + + public CalendarEventProperties WithAttendees(params IList value) + { + this.Attendees = value; + return this; + } + + public CalendarEventProperties WithOrganizer(CalendarEventAttendee value) + { + this.Organizer = value; + return this; + } +} + /// /// Represents a calendar event attendee. /// public class CalendarEventAttendee : SerializableObject { - /// - /// Deserializes a JSON string into an object of type CalendarEventAttendee. - /// - public static CalendarEventAttendee? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The name of the attendee. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// The email address of the attendee. - /// - [JsonPropertyName("email")] - public string? Email { get; set; } - - /// - /// The title of the attendee. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// The type of the attendee. - /// - [JsonPropertyName("type")] - public string? Type { get; set; } - - /// - /// The status of the attendee. - /// - [JsonPropertyName("status")] - public string? Status { get; set; } - - /// - /// Serializes this CalendarEventAttendee into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public CalendarEventAttendee WithKey(string value) { - this.Key = value; - return this; - } - - public CalendarEventAttendee WithName(string value) { - this.Name = value; - return this; - } - - public CalendarEventAttendee WithEmail(string value) { - this.Email = value; - return this; - } - - public CalendarEventAttendee WithTitle(string value) { - this.Title = value; - return this; - } - - public CalendarEventAttendee WithType(string value) { - this.Type = value; - return this; - } - - public CalendarEventAttendee WithStatus(string value) { - this.Status = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type CalendarEventAttendee. + /// + public static CalendarEventAttendee? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The name of the attendee. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The email address of the attendee. + /// + [JsonPropertyName("email")] + public string? Email { get; set; } + + /// + /// The title of the attendee. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// The type of the attendee. + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// The status of the attendee. + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Serializes this CalendarEventAttendee into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public CalendarEventAttendee WithKey(string value) + { + this.Key = value; + return this; + } + + public CalendarEventAttendee WithName(string value) + { + this.Name = value; + return this; + } + + public CalendarEventAttendee WithEmail(string value) + { + this.Email = value; + return this; + } + + public CalendarEventAttendee WithTitle(string value) + { + this.Title = value; + return this; + } + + public CalendarEventAttendee WithType(string value) + { + this.Type = value; + return this; + } + + public CalendarEventAttendee WithStatus(string value) + { + this.Status = value; + return this; + } } -/// -/// A page inside a Carousel element. -/// -public class CarouselPage : CardElement -{ - /// - /// Deserializes a JSON string into an object of type CarouselPage. - /// - public static CarouselPage? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **CarouselPage**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "CarouselPage"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - /// - [JsonPropertyName("style")] - public ContainerStyle? Style { get; set; } - - /// - /// Controls if a border should be displayed around the container. - /// - [JsonPropertyName("showBorder")] - public bool? ShowBorder { get; set; } = false; - - /// - /// Controls if the container should have rounded corners. - /// - [JsonPropertyName("roundedCorners")] - public bool? RoundedCorners { get; set; } = false; - - /// - /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. - /// - [JsonPropertyName("layouts")] - public IList? Layouts { get; set; } - - /// - /// The minimum height, in pixels, of the container, in the `px` format. - /// - [JsonPropertyName("minHeight")] - public string? MinHeight { get; set; } - - /// - /// Defines the container's background image. - /// - [JsonPropertyName("backgroundImage")] - public IUnion? BackgroundImage { get; set; } - - /// - /// Controls how the container's content should be vertically aligned. - /// - [JsonPropertyName("verticalContentAlignment")] - public VerticalAlignment? VerticalContentAlignment { get; set; } - - /// - /// Controls if the content of the card is to be rendered left-to-right or right-to-left. - /// - [JsonPropertyName("rtl")] - public bool? Rtl { get; set; } - - /// - /// The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. - /// - [JsonPropertyName("maxHeight")] - public string? MaxHeight { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The elements in the page. - /// - [JsonPropertyName("items")] - public IList? Items { get; set; } - - public CarouselPage(params IList items) - { - this.Items = items; - } +/// +/// A page inside a Carousel element. +/// +public class CarouselPage : CardElement +{ + /// + /// Deserializes a JSON string into an object of type CarouselPage. + /// + public static CarouselPage? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **CarouselPage**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "CarouselPage"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + /// + [JsonPropertyName("style")] + public ContainerStyle? Style { get; set; } + + /// + /// Controls if a border should be displayed around the container. + /// + [JsonPropertyName("showBorder")] + public bool? ShowBorder { get; set; } = false; + + /// + /// Controls if the container should have rounded corners. + /// + [JsonPropertyName("roundedCorners")] + public bool? RoundedCorners { get; set; } = false; + + /// + /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. + /// + [JsonPropertyName("layouts")] + public IList? Layouts { get; set; } + + /// + /// The minimum height, in pixels, of the container, in the `px` format. + /// + [JsonPropertyName("minHeight")] + public string? MinHeight { get; set; } + + /// + /// Defines the container's background image. + /// + [JsonPropertyName("backgroundImage")] + public IUnion? BackgroundImage { get; set; } + + /// + /// Controls how the container's content should be vertically aligned. + /// + [JsonPropertyName("verticalContentAlignment")] + public VerticalAlignment? VerticalContentAlignment { get; set; } + + /// + /// Controls if the content of the card is to be rendered left-to-right or right-to-left. + /// + [JsonPropertyName("rtl")] + public bool? Rtl { get; set; } + + /// + /// The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. + /// + [JsonPropertyName("maxHeight")] + public string? MaxHeight { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The elements in the page. + /// + [JsonPropertyName("items")] + public IList? Items { get; set; } + + public CarouselPage(params IList items) + { + this.Items = items; + } + + /// + /// Serializes this CarouselPage into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public CarouselPage WithKey(string value) + { + this.Key = value; + return this; + } + + public CarouselPage WithId(string value) + { + this.Id = value; + return this; + } + + public CarouselPage WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } - /// - /// Serializes this CarouselPage into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public CarouselPage WithKey(string value) { - this.Key = value; - return this; - } - - public CarouselPage WithId(string value) { - this.Id = value; - return this; - } - - public CarouselPage WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public CarouselPage WithLang(string value) { - this.Lang = value; - return this; - } - - public CarouselPage WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public CarouselPage WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public CarouselPage WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public CarouselPage WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public CarouselPage WithSelectAction(Action value) { - this.SelectAction = value; - return this; - } - - public CarouselPage WithStyle(ContainerStyle value) { - this.Style = value; - return this; - } - - public CarouselPage WithShowBorder(bool value) { - this.ShowBorder = value; - return this; - } - - public CarouselPage WithRoundedCorners(bool value) { - this.RoundedCorners = value; - return this; - } - - public CarouselPage WithLayouts(params IList value) { - this.Layouts = value; - return this; - } - - public CarouselPage WithMinHeight(string value) { - this.MinHeight = value; - return this; - } - - public CarouselPage WithBackgroundImage(IUnion value) { - this.BackgroundImage = value; - return this; - } - - public CarouselPage WithVerticalContentAlignment(VerticalAlignment value) { - this.VerticalContentAlignment = value; - return this; - } - - public CarouselPage WithRtl(bool value) { - this.Rtl = value; - return this; - } - - public CarouselPage WithMaxHeight(string value) { - this.MaxHeight = value; - return this; - } - - public CarouselPage WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public CarouselPage WithFallback(IUnion value) { - this.Fallback = value; - return this; - } - - public CarouselPage WithItems(params IList value) { - this.Items = value; - return this; - } + public CarouselPage WithLang(string value) + { + this.Lang = value; + return this; + } + + public CarouselPage WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public CarouselPage WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public CarouselPage WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public CarouselPage WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public CarouselPage WithSelectAction(Action value) + { + this.SelectAction = value; + return this; + } + + public CarouselPage WithStyle(ContainerStyle value) + { + this.Style = value; + return this; + } + + public CarouselPage WithShowBorder(bool value) + { + this.ShowBorder = value; + return this; + } + + public CarouselPage WithRoundedCorners(bool value) + { + this.RoundedCorners = value; + return this; + } + + public CarouselPage WithLayouts(params IList value) + { + this.Layouts = value; + return this; + } + + public CarouselPage WithMinHeight(string value) + { + this.MinHeight = value; + return this; + } + + public CarouselPage WithBackgroundImage(IUnion value) + { + this.BackgroundImage = value; + return this; + } + + public CarouselPage WithVerticalContentAlignment(VerticalAlignment value) + { + this.VerticalContentAlignment = value; + return this; + } + + public CarouselPage WithRtl(bool value) + { + this.Rtl = value; + return this; + } + + public CarouselPage WithMaxHeight(string value) + { + this.MaxHeight = value; + return this; + } + + public CarouselPage WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public CarouselPage WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } + + public CarouselPage WithItems(params IList value) + { + this.Items = value; + return this; + } } /// @@ -15752,243 +16781,262 @@ public CarouselPage WithItems(params IList value) { /// public class TableRow : CardElement { - /// - /// Deserializes a JSON string into an object of type TableRow. - /// - public static TableRow? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **TableRow**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "TableRow"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// Controls if a border should be displayed around the container. - /// - [JsonPropertyName("showBorder")] - public bool? ShowBorder { get; set; } = false; - - /// - /// Controls if the container should have rounded corners. - /// - [JsonPropertyName("roundedCorners")] - public bool? RoundedCorners { get; set; } = false; - - /// - /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - /// - [JsonPropertyName("style")] - public ContainerStyle? Style { get; set; } - - /// - /// Controls how the content of every cell in the row should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table and columns. - /// - [JsonPropertyName("horizontalCellContentAlignment")] - public HorizontalAlignment? HorizontalCellContentAlignment { get; set; } - - /// - /// Controls how the content of every cell in the row should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table and columns. - /// - [JsonPropertyName("verticalCellContentAlignment")] - public VerticalAlignment? VerticalCellContentAlignment { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The cells in the row. - /// - [JsonPropertyName("cells")] - public IList? Cells { get; set; } - - /// - /// Serializes this TableRow into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TableRow WithKey(string value) { - this.Key = value; - return this; - } - - public TableRow WithId(string value) { - this.Id = value; - return this; - } - - public TableRow WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public TableRow WithLang(string value) { - this.Lang = value; - return this; - } - - public TableRow WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public TableRow WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public TableRow WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public TableRow WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public TableRow WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public TableRow WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public TableRow WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public TableRow WithShowBorder(bool value) { - this.ShowBorder = value; - return this; - } - - public TableRow WithRoundedCorners(bool value) { - this.RoundedCorners = value; - return this; - } - - public TableRow WithStyle(ContainerStyle value) { - this.Style = value; - return this; - } - - public TableRow WithHorizontalCellContentAlignment(HorizontalAlignment value) { - this.HorizontalCellContentAlignment = value; - return this; - } - - public TableRow WithVerticalCellContentAlignment(VerticalAlignment value) { - this.VerticalCellContentAlignment = value; - return this; - } - - public TableRow WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public TableRow WithFallback(IUnion value) { - this.Fallback = value; - return this; - } - - public TableRow WithCells(params IList value) { - this.Cells = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type TableRow. + /// + public static TableRow? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **TableRow**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "TableRow"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// Controls if a border should be displayed around the container. + /// + [JsonPropertyName("showBorder")] + public bool? ShowBorder { get; set; } = false; + + /// + /// Controls if the container should have rounded corners. + /// + [JsonPropertyName("roundedCorners")] + public bool? RoundedCorners { get; set; } = false; + + /// + /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + /// + [JsonPropertyName("style")] + public ContainerStyle? Style { get; set; } + + /// + /// Controls how the content of every cell in the row should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table and columns. + /// + [JsonPropertyName("horizontalCellContentAlignment")] + public HorizontalAlignment? HorizontalCellContentAlignment { get; set; } + + /// + /// Controls how the content of every cell in the row should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table and columns. + /// + [JsonPropertyName("verticalCellContentAlignment")] + public VerticalAlignment? VerticalCellContentAlignment { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The cells in the row. + /// + [JsonPropertyName("cells")] + public IList? Cells { get; set; } + + /// + /// Serializes this TableRow into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TableRow WithKey(string value) + { + this.Key = value; + return this; + } + + public TableRow WithId(string value) + { + this.Id = value; + return this; + } + + public TableRow WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public TableRow WithLang(string value) + { + this.Lang = value; + return this; + } + + public TableRow WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public TableRow WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public TableRow WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public TableRow WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public TableRow WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public TableRow WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public TableRow WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public TableRow WithShowBorder(bool value) + { + this.ShowBorder = value; + return this; + } + + public TableRow WithRoundedCorners(bool value) + { + this.RoundedCorners = value; + return this; + } + + public TableRow WithStyle(ContainerStyle value) + { + this.Style = value; + return this; + } + + public TableRow WithHorizontalCellContentAlignment(HorizontalAlignment value) + { + this.HorizontalCellContentAlignment = value; + return this; + } + + public TableRow WithVerticalCellContentAlignment(VerticalAlignment value) + { + this.VerticalCellContentAlignment = value; + return this; + } + + public TableRow WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public TableRow WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } + + public TableRow WithCells(params IList value) + { + this.Cells = value; + return this; + } } /// @@ -15996,281 +17044,303 @@ public TableRow WithCells(params IList value) { /// public class TableCell : CardElement { - /// - /// Deserializes a JSON string into an object of type TableCell. - /// - public static TableCell? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **TableCell**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "TableCell"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - /// - [JsonPropertyName("style")] - public ContainerStyle? Style { get; set; } - - /// - /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. - /// - [JsonPropertyName("layouts")] - public IList? Layouts { get; set; } - - /// - /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. - /// - [JsonPropertyName("bleed")] - public bool? Bleed { get; set; } = false; - - /// - /// The minimum height, in pixels, of the container, in the `px` format. - /// - [JsonPropertyName("minHeight")] - public string? MinHeight { get; set; } - - /// - /// Defines the container's background image. - /// - [JsonPropertyName("backgroundImage")] - public IUnion? BackgroundImage { get; set; } - - /// - /// Controls how the container's content should be vertically aligned. - /// - [JsonPropertyName("verticalContentAlignment")] - public VerticalAlignment? VerticalContentAlignment { get; set; } - - /// - /// Controls if the content of the card is to be rendered left-to-right or right-to-left. - /// - [JsonPropertyName("rtl")] - public bool? Rtl { get; set; } - - /// - /// The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. - /// - [JsonPropertyName("maxHeight")] - public string? MaxHeight { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The items (elements) in the cell. - /// - [JsonPropertyName("items")] - public IList? Items { get; set; } - - public TableCell(params IList items) - { - this.Items = items; - } + /// + /// Deserializes a JSON string into an object of type TableCell. + /// + public static TableCell? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } - /// - /// Serializes this TableCell into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TableCell WithKey(string value) { - this.Key = value; - return this; - } - - public TableCell WithId(string value) { - this.Id = value; - return this; - } - - public TableCell WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public TableCell WithLang(string value) { - this.Lang = value; - return this; - } - - public TableCell WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public TableCell WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public TableCell WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public TableCell WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public TableCell WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public TableCell WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public TableCell WithSelectAction(Action value) { - this.SelectAction = value; - return this; - } - - public TableCell WithStyle(ContainerStyle value) { - this.Style = value; - return this; - } - - public TableCell WithLayouts(params IList value) { - this.Layouts = value; - return this; - } - - public TableCell WithBleed(bool value) { - this.Bleed = value; - return this; - } - - public TableCell WithMinHeight(string value) { - this.MinHeight = value; - return this; - } - - public TableCell WithBackgroundImage(IUnion value) { - this.BackgroundImage = value; - return this; - } - - public TableCell WithVerticalContentAlignment(VerticalAlignment value) { - this.VerticalContentAlignment = value; - return this; - } - - public TableCell WithRtl(bool value) { - this.Rtl = value; - return this; - } - - public TableCell WithMaxHeight(string value) { - this.MaxHeight = value; - return this; - } - - public TableCell WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public TableCell WithFallback(IUnion value) { - this.Fallback = value; - return this; - } - - public TableCell WithItems(params IList value) { - this.Items = value; - return this; - } + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **TableCell**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "TableCell"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + /// + [JsonPropertyName("style")] + public ContainerStyle? Style { get; set; } + + /// + /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. + /// + [JsonPropertyName("layouts")] + public IList? Layouts { get; set; } + + /// + /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + /// + [JsonPropertyName("bleed")] + public bool? Bleed { get; set; } = false; + + /// + /// The minimum height, in pixels, of the container, in the `px` format. + /// + [JsonPropertyName("minHeight")] + public string? MinHeight { get; set; } + + /// + /// Defines the container's background image. + /// + [JsonPropertyName("backgroundImage")] + public IUnion? BackgroundImage { get; set; } + + /// + /// Controls how the container's content should be vertically aligned. + /// + [JsonPropertyName("verticalContentAlignment")] + public VerticalAlignment? VerticalContentAlignment { get; set; } + + /// + /// Controls if the content of the card is to be rendered left-to-right or right-to-left. + /// + [JsonPropertyName("rtl")] + public bool? Rtl { get; set; } + + /// + /// The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. + /// + [JsonPropertyName("maxHeight")] + public string? MaxHeight { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The items (elements) in the cell. + /// + [JsonPropertyName("items")] + public IList? Items { get; set; } + + public TableCell(params IList items) + { + this.Items = items; + } + + /// + /// Serializes this TableCell into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TableCell WithKey(string value) + { + this.Key = value; + return this; + } + + public TableCell WithId(string value) + { + this.Id = value; + return this; + } + + public TableCell WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public TableCell WithLang(string value) + { + this.Lang = value; + return this; + } + + public TableCell WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public TableCell WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public TableCell WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public TableCell WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public TableCell WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public TableCell WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public TableCell WithSelectAction(Action value) + { + this.SelectAction = value; + return this; + } + + public TableCell WithStyle(ContainerStyle value) + { + this.Style = value; + return this; + } + + public TableCell WithLayouts(params IList value) + { + this.Layouts = value; + return this; + } + + public TableCell WithBleed(bool value) + { + this.Bleed = value; + return this; + } + + public TableCell WithMinHeight(string value) + { + this.MinHeight = value; + return this; + } + + public TableCell WithBackgroundImage(IUnion value) + { + this.BackgroundImage = value; + return this; + } + + public TableCell WithVerticalContentAlignment(VerticalAlignment value) + { + this.VerticalContentAlignment = value; + return this; + } + + public TableCell WithRtl(bool value) + { + this.Rtl = value; + return this; + } + + public TableCell WithMaxHeight(string value) + { + this.MaxHeight = value; + return this; + } + + public TableCell WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public TableCell WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } + + public TableCell WithItems(params IList value) + { + this.Items = value; + return this; + } } /// @@ -16278,237 +17348,255 @@ public TableCell WithItems(params IList value) { /// public class TextRun : CardElement { - /// - /// Deserializes a JSON string into an object of type TextRun. - /// - public static TextRun? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **TextRun**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "TextRun"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The text to display. A subset of markdown is supported. - /// - [JsonPropertyName("text")] - public string? Text { get; set; } - - /// - /// The size of the text. - /// - [JsonPropertyName("size")] - public TextSize? Size { get; set; } - - /// - /// The weight of the text. - /// - [JsonPropertyName("weight")] - public TextWeight? Weight { get; set; } - - /// - /// The color of the text. - /// - [JsonPropertyName("color")] - public TextColor? Color { get; set; } - - /// - /// Controls whether the text should be renderer using a subtler variant of the select color. - /// - [JsonPropertyName("isSubtle")] - public bool? IsSubtle { get; set; } - - /// - /// The type of font to use for rendering. - /// - [JsonPropertyName("fontType")] - public FontType? FontType { get; set; } - - /// - /// Controls if the text should be italicized. - /// - [JsonPropertyName("italic")] - public bool? Italic { get; set; } = false; - - /// - /// Controls if the text should be struck through. - /// - [JsonPropertyName("strikethrough")] - public bool? Strikethrough { get; set; } = false; - - /// - /// Controls if the text should be highlighted. - /// - [JsonPropertyName("highlight")] - public bool? Highlight { get; set; } = false; - - /// - /// Controls if the text should be underlined. - /// - [JsonPropertyName("underline")] - public bool? Underline { get; set; } = false; - - /// - /// An Action that will be invoked when the text is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - public TextRun(string text) - { - this.Text = text; - } + /// + /// Deserializes a JSON string into an object of type TextRun. + /// + public static TextRun? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **TextRun**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "TextRun"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The text to display. A subset of markdown is supported. + /// + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// + /// The size of the text. + /// + [JsonPropertyName("size")] + public TextSize? Size { get; set; } + + /// + /// The weight of the text. + /// + [JsonPropertyName("weight")] + public TextWeight? Weight { get; set; } + + /// + /// The color of the text. + /// + [JsonPropertyName("color")] + public TextColor? Color { get; set; } + + /// + /// Controls whether the text should be renderer using a subtler variant of the select color. + /// + [JsonPropertyName("isSubtle")] + public bool? IsSubtle { get; set; } + + /// + /// The type of font to use for rendering. + /// + [JsonPropertyName("fontType")] + public FontType? FontType { get; set; } + + /// + /// Controls if the text should be italicized. + /// + [JsonPropertyName("italic")] + public bool? Italic { get; set; } = false; + + /// + /// Controls if the text should be struck through. + /// + [JsonPropertyName("strikethrough")] + public bool? Strikethrough { get; set; } = false; + + /// + /// Controls if the text should be highlighted. + /// + [JsonPropertyName("highlight")] + public bool? Highlight { get; set; } = false; + + /// + /// Controls if the text should be underlined. + /// + [JsonPropertyName("underline")] + public bool? Underline { get; set; } = false; + + /// + /// An Action that will be invoked when the text is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + public TextRun(string text) + { + this.Text = text; + } + + /// + /// Serializes this TextRun into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TextRun WithKey(string value) + { + this.Key = value; + return this; + } + + public TextRun WithId(string value) + { + this.Id = value; + return this; + } + + public TextRun WithLang(string value) + { + this.Lang = value; + return this; + } + + public TextRun WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public TextRun WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public TextRun WithText(string value) + { + this.Text = value; + return this; + } + + public TextRun WithSize(TextSize value) + { + this.Size = value; + return this; + } + + public TextRun WithWeight(TextWeight value) + { + this.Weight = value; + return this; + } + + public TextRun WithColor(TextColor value) + { + this.Color = value; + return this; + } + + public TextRun WithIsSubtle(bool value) + { + this.IsSubtle = value; + return this; + } + + public TextRun WithFontType(FontType value) + { + this.FontType = value; + return this; + } + + public TextRun WithItalic(bool value) + { + this.Italic = value; + return this; + } + + public TextRun WithStrikethrough(bool value) + { + this.Strikethrough = value; + return this; + } + + public TextRun WithHighlight(bool value) + { + this.Highlight = value; + return this; + } + + public TextRun WithUnderline(bool value) + { + this.Underline = value; + return this; + } - /// - /// Serializes this TextRun into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TextRun WithKey(string value) { - this.Key = value; - return this; - } - - public TextRun WithId(string value) { - this.Id = value; - return this; - } - - public TextRun WithLang(string value) { - this.Lang = value; - return this; - } - - public TextRun WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public TextRun WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public TextRun WithText(string value) { - this.Text = value; - return this; - } - - public TextRun WithSize(TextSize value) { - this.Size = value; - return this; - } - - public TextRun WithWeight(TextWeight value) { - this.Weight = value; - return this; - } - - public TextRun WithColor(TextColor value) { - this.Color = value; - return this; - } - - public TextRun WithIsSubtle(bool value) { - this.IsSubtle = value; - return this; - } - - public TextRun WithFontType(FontType value) { - this.FontType = value; - return this; - } - - public TextRun WithItalic(bool value) { - this.Italic = value; - return this; - } - - public TextRun WithStrikethrough(bool value) { - this.Strikethrough = value; - return this; - } - - public TextRun WithHighlight(bool value) { - this.Highlight = value; - return this; - } - - public TextRun WithUnderline(bool value) { - this.Underline = value; - return this; - } - - public TextRun WithSelectAction(Action value) { - this.SelectAction = value; - return this; - } - - public TextRun WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public TextRun WithFallback(IUnion value) { - this.Fallback = value; - return this; - } + public TextRun WithSelectAction(Action value) + { + this.SelectAction = value; + return this; + } + + public TextRun WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public TextRun WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } } /// @@ -16516,166 +17604,178 @@ public TextRun WithFallback(IUnion value) { /// public class IconRun : CardElement { - /// - /// Deserializes a JSON string into an object of type IconRun. - /// - public static IconRun? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **IconRun**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "IconRun"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The name of the inline icon to display. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// The size of the inline icon. - /// - [JsonPropertyName("size")] - public SizeEnum? Size { get; set; } = SizeEnum.Default; - - /// - /// The style of the inline icon. - /// - [JsonPropertyName("style")] - public IconStyle? Style { get; set; } = IconStyle.Regular; - - /// - /// The color of the inline icon. - /// - [JsonPropertyName("color")] - public TextColor? Color { get; set; } = TextColor.Default; - - /// - /// An Action that will be invoked when the inline icon is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this IconRun into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public IconRun WithKey(string value) { - this.Key = value; - return this; - } - - public IconRun WithId(string value) { - this.Id = value; - return this; - } - - public IconRun WithLang(string value) { - this.Lang = value; - return this; - } - - public IconRun WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public IconRun WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public IconRun WithName(string value) { - this.Name = value; - return this; - } - - public IconRun WithSize(SizeEnum value) { - this.Size = value; - return this; - } - - public IconRun WithStyle(IconStyle value) { - this.Style = value; - return this; - } - - public IconRun WithColor(TextColor value) { - this.Color = value; - return this; - } - - public IconRun WithSelectAction(Action value) { - this.SelectAction = value; - return this; - } - - public IconRun WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public IconRun WithFallback(IUnion value) { - this.Fallback = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type IconRun. + /// + public static IconRun? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **IconRun**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "IconRun"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The name of the inline icon to display. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The size of the inline icon. + /// + [JsonPropertyName("size")] + public SizeEnum? Size { get; set; } = SizeEnum.Default; + + /// + /// The style of the inline icon. + /// + [JsonPropertyName("style")] + public IconStyle? Style { get; set; } = IconStyle.Regular; + + /// + /// The color of the inline icon. + /// + [JsonPropertyName("color")] + public TextColor? Color { get; set; } = TextColor.Default; + + /// + /// An Action that will be invoked when the inline icon is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this IconRun into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public IconRun WithKey(string value) + { + this.Key = value; + return this; + } + + public IconRun WithId(string value) + { + this.Id = value; + return this; + } + + public IconRun WithLang(string value) + { + this.Lang = value; + return this; + } + + public IconRun WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public IconRun WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public IconRun WithName(string value) + { + this.Name = value; + return this; + } + + public IconRun WithSize(SizeEnum value) + { + this.Size = value; + return this; + } + + public IconRun WithStyle(IconStyle value) + { + this.Style = value; + return this; + } + + public IconRun WithColor(TextColor value) + { + this.Color = value; + return this; + } + + public IconRun WithSelectAction(Action value) + { + this.SelectAction = value; + return this; + } + + public IconRun WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public IconRun WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } } /// @@ -16683,166 +17783,178 @@ public IconRun WithFallback(IUnion value) { /// public class ImageRun : CardElement { - /// - /// Deserializes a JSON string into an object of type ImageRun. - /// - public static ImageRun? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **ImageRun**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "ImageRun"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. - /// - [JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The size of the inline image. - /// - [JsonPropertyName("size")] - public SizeEnum? Size { get; set; } = SizeEnum.Default; - - /// - /// The style of the inline image. - /// - [JsonPropertyName("style")] - public ImageStyle? Style { get; set; } = ImageStyle.Default; - - /// - /// An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// A set of theme-specific image URLs. - /// - [JsonPropertyName("themedUrls")] - public IList? ThemedUrls { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// Serializes this ImageRun into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ImageRun WithKey(string value) { - this.Key = value; - return this; - } - - public ImageRun WithId(string value) { - this.Id = value; - return this; - } - - public ImageRun WithLang(string value) { - this.Lang = value; - return this; - } - - public ImageRun WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public ImageRun WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public ImageRun WithUrl(string value) { - this.Url = value; - return this; - } - - public ImageRun WithSize(SizeEnum value) { - this.Size = value; - return this; - } - - public ImageRun WithStyle(ImageStyle value) { - this.Style = value; - return this; - } - - public ImageRun WithSelectAction(Action value) { - this.SelectAction = value; - return this; - } - - public ImageRun WithThemedUrls(params IList value) { - this.ThemedUrls = value; - return this; - } - - public ImageRun WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public ImageRun WithFallback(IUnion value) { - this.Fallback = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type ImageRun. + /// + public static ImageRun? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **ImageRun**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "ImageRun"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// The size of the inline image. + /// + [JsonPropertyName("size")] + public SizeEnum? Size { get; set; } = SizeEnum.Default; + + /// + /// The style of the inline image. + /// + [JsonPropertyName("style")] + public ImageStyle? Style { get; set; } = ImageStyle.Default; + + /// + /// An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// A set of theme-specific image URLs. + /// + [JsonPropertyName("themedUrls")] + public IList? ThemedUrls { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// Serializes this ImageRun into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ImageRun WithKey(string value) + { + this.Key = value; + return this; + } + + public ImageRun WithId(string value) + { + this.Id = value; + return this; + } + + public ImageRun WithLang(string value) + { + this.Lang = value; + return this; + } + + public ImageRun WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public ImageRun WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public ImageRun WithUrl(string value) + { + this.Url = value; + return this; + } + + public ImageRun WithSize(SizeEnum value) + { + this.Size = value; + return this; + } + + public ImageRun WithStyle(ImageStyle value) + { + this.Style = value; + return this; + } + + public ImageRun WithSelectAction(Action value) + { + this.SelectAction = value; + return this; + } + + public ImageRun WithThemedUrls(params IList value) + { + this.ThemedUrls = value; + return this; + } + + public ImageRun WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public ImageRun WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } } /// @@ -16850,325 +17962,351 @@ public ImageRun WithFallback(IUnion value) { /// public class Column : CardElement { - /// - /// Deserializes a JSON string into an object of type Column. - /// - public static Column? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Optional. If specified, must be **Column**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "Column"; - - /// - /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - /// - [JsonPropertyName("requires")] - public HostCapabilities? Requires { get; set; } = new HostCapabilities(); - - /// - /// The locale associated with the element. - /// - [JsonPropertyName("lang")] - public string? Lang { get; set; } - - /// - /// Controls the visibility of the element. - /// - [JsonPropertyName("isVisible")] - public bool? IsVisible { get; set; } = true; - - /// - /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - /// - [JsonPropertyName("separator")] - public bool? Separator { get; set; } = false; - - /// - /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - /// - [JsonPropertyName("height")] - public ElementHeight? Height { get; set; } = ElementHeight.Auto; - - /// - /// Controls how the element should be horizontally aligned. - /// - [JsonPropertyName("horizontalAlignment")] - public HorizontalAlignment? HorizontalAlignment { get; set; } - - /// - /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - /// - [JsonPropertyName("spacing")] - public Spacing? Spacing { get; set; } = Spacing.Default; - - /// - /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - /// - [JsonPropertyName("targetWidth")] - public TargetWidth? TargetWidth { get; set; } - - /// - /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - /// - [JsonPropertyName("isSortKey")] - public bool? IsSortKey { get; set; } = false; - - /// - /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. - /// - [JsonPropertyName("selectAction")] - public Action? SelectAction { get; set; } - - /// - /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - /// - [JsonPropertyName("style")] - public ContainerStyle? Style { get; set; } - - /// - /// Controls if a border should be displayed around the container. - /// - [JsonPropertyName("showBorder")] - public bool? ShowBorder { get; set; } = false; - - /// - /// Controls if the container should have rounded corners. - /// - [JsonPropertyName("roundedCorners")] - public bool? RoundedCorners { get; set; } = false; - - /// - /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. - /// - [JsonPropertyName("layouts")] - public IList? Layouts { get; set; } - - /// - /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. - /// - [JsonPropertyName("bleed")] - public bool? Bleed { get; set; } = false; - - /// - /// The minimum height, in pixels, of the container, in the `px` format. - /// - [JsonPropertyName("minHeight")] - public string? MinHeight { get; set; } - - /// - /// Defines the container's background image. - /// - [JsonPropertyName("backgroundImage")] - public IUnion? BackgroundImage { get; set; } - - /// - /// Controls how the container's content should be vertically aligned. - /// - [JsonPropertyName("verticalContentAlignment")] - public VerticalAlignment? VerticalContentAlignment { get; set; } - - /// - /// Controls if the content of the card is to be rendered left-to-right or right-to-left. - /// - [JsonPropertyName("rtl")] - public bool? Rtl { get; set; } - - /// - /// The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. - /// - [JsonPropertyName("maxHeight")] - public string? MaxHeight { get; set; } - - /// - /// The width of the column. If expressed as a number, represents the relative weight of the column in the set. If expressed as a string, `auto` will automatically adjust the column's width according to its content, `stretch` will make the column use the remaining horizontal space (shared with other columns with width set to `stretch`) and using the `px` format will give the column an explicit width in pixels. - /// - [JsonPropertyName("width")] - public IUnion? Width { get; set; } - - /// - /// The area of a Layout.AreaGrid layout in which an element should be displayed. - /// - [JsonPropertyName("grid.area")] - public string? GridArea { get; set; } - - /// - /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - /// - [JsonPropertyName("fallback")] - public IUnion? Fallback { get; set; } - - /// - /// The elements in the column. - /// - [JsonPropertyName("items")] - public IList? Items { get; set; } - - public Column(params IList items) - { - this.Items = items; - } + /// + /// Deserializes a JSON string into an object of type Column. + /// + public static Column? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } - /// - /// Serializes this Column into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Column WithKey(string value) { - this.Key = value; - return this; - } - - public Column WithId(string value) { - this.Id = value; - return this; - } - - public Column WithRequires(HostCapabilities value) { - this.Requires = value; - return this; - } - - public Column WithLang(string value) { - this.Lang = value; - return this; - } - - public Column WithIsVisible(bool value) { - this.IsVisible = value; - return this; - } - - public Column WithSeparator(bool value) { - this.Separator = value; - return this; - } - - public Column WithHeight(ElementHeight value) { - this.Height = value; - return this; - } - - public Column WithHorizontalAlignment(HorizontalAlignment value) { - this.HorizontalAlignment = value; - return this; - } - - public Column WithSpacing(Spacing value) { - this.Spacing = value; - return this; - } - - public Column WithTargetWidth(TargetWidth value) { - this.TargetWidth = value; - return this; - } - - public Column WithIsSortKey(bool value) { - this.IsSortKey = value; - return this; - } - - public Column WithSelectAction(Action value) { - this.SelectAction = value; - return this; - } - - public Column WithStyle(ContainerStyle value) { - this.Style = value; - return this; - } - - public Column WithShowBorder(bool value) { - this.ShowBorder = value; - return this; - } - - public Column WithRoundedCorners(bool value) { - this.RoundedCorners = value; - return this; - } - - public Column WithLayouts(params IList value) { - this.Layouts = value; - return this; - } - - public Column WithBleed(bool value) { - this.Bleed = value; - return this; - } - - public Column WithMinHeight(string value) { - this.MinHeight = value; - return this; - } - - public Column WithBackgroundImage(IUnion value) { - this.BackgroundImage = value; - return this; - } - - public Column WithVerticalContentAlignment(VerticalAlignment value) { - this.VerticalContentAlignment = value; - return this; - } - - public Column WithRtl(bool value) { - this.Rtl = value; - return this; - } - - public Column WithMaxHeight(string value) { - this.MaxHeight = value; - return this; - } - - public Column WithWidth(IUnion value) { - this.Width = value; - return this; - } - - public Column WithGridArea(string value) { - this.GridArea = value; - return this; - } - - public Column WithFallback(IUnion value) { - this.Fallback = value; - return this; - } - - public Column WithItems(params IList value) { - this.Items = value; - return this; - } + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Optional. If specified, must be **Column**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "Column"; + + /// + /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + /// + [JsonPropertyName("requires")] + public HostCapabilities? Requires { get; set; } = new HostCapabilities(); + + /// + /// The locale associated with the element. + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Controls the visibility of the element. + /// + [JsonPropertyName("isVisible")] + public bool? IsVisible { get; set; } = true; + + /// + /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + /// + [JsonPropertyName("separator")] + public bool? Separator { get; set; } = false; + + /// + /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + /// + [JsonPropertyName("height")] + public ElementHeight? Height { get; set; } = ElementHeight.Auto; + + /// + /// Controls how the element should be horizontally aligned. + /// + [JsonPropertyName("horizontalAlignment")] + public HorizontalAlignment? HorizontalAlignment { get; set; } + + /// + /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + /// + [JsonPropertyName("spacing")] + public Spacing? Spacing { get; set; } = Spacing.Default; + + /// + /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + /// + [JsonPropertyName("targetWidth")] + public TargetWidth? TargetWidth { get; set; } + + /// + /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + /// + [JsonPropertyName("isSortKey")] + public bool? IsSortKey { get; set; } = false; + + /// + /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. + /// + [JsonPropertyName("selectAction")] + public Action? SelectAction { get; set; } + + /// + /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + /// + [JsonPropertyName("style")] + public ContainerStyle? Style { get; set; } + + /// + /// Controls if a border should be displayed around the container. + /// + [JsonPropertyName("showBorder")] + public bool? ShowBorder { get; set; } = false; + + /// + /// Controls if the container should have rounded corners. + /// + [JsonPropertyName("roundedCorners")] + public bool? RoundedCorners { get; set; } = false; + + /// + /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. + /// + [JsonPropertyName("layouts")] + public IList? Layouts { get; set; } + + /// + /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + /// + [JsonPropertyName("bleed")] + public bool? Bleed { get; set; } = false; + + /// + /// The minimum height, in pixels, of the container, in the `px` format. + /// + [JsonPropertyName("minHeight")] + public string? MinHeight { get; set; } + + /// + /// Defines the container's background image. + /// + [JsonPropertyName("backgroundImage")] + public IUnion? BackgroundImage { get; set; } + + /// + /// Controls how the container's content should be vertically aligned. + /// + [JsonPropertyName("verticalContentAlignment")] + public VerticalAlignment? VerticalContentAlignment { get; set; } + + /// + /// Controls if the content of the card is to be rendered left-to-right or right-to-left. + /// + [JsonPropertyName("rtl")] + public bool? Rtl { get; set; } + + /// + /// The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. + /// + [JsonPropertyName("maxHeight")] + public string? MaxHeight { get; set; } + + /// + /// The width of the column. If expressed as a number, represents the relative weight of the column in the set. If expressed as a string, `auto` will automatically adjust the column's width according to its content, `stretch` will make the column use the remaining horizontal space (shared with other columns with width set to `stretch`) and using the `px` format will give the column an explicit width in pixels. + /// + [JsonPropertyName("width")] + public IUnion? Width { get; set; } + + /// + /// The area of a Layout.AreaGrid layout in which an element should be displayed. + /// + [JsonPropertyName("grid.area")] + public string? GridArea { get; set; } + + /// + /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + /// + [JsonPropertyName("fallback")] + public IUnion? Fallback { get; set; } + + /// + /// The elements in the column. + /// + [JsonPropertyName("items")] + public IList? Items { get; set; } + + public Column(params IList items) + { + this.Items = items; + } + + /// + /// Serializes this Column into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Column WithKey(string value) + { + this.Key = value; + return this; + } + + public Column WithId(string value) + { + this.Id = value; + return this; + } + + public Column WithRequires(HostCapabilities value) + { + this.Requires = value; + return this; + } + + public Column WithLang(string value) + { + this.Lang = value; + return this; + } + + public Column WithIsVisible(bool value) + { + this.IsVisible = value; + return this; + } + + public Column WithSeparator(bool value) + { + this.Separator = value; + return this; + } + + public Column WithHeight(ElementHeight value) + { + this.Height = value; + return this; + } + + public Column WithHorizontalAlignment(HorizontalAlignment value) + { + this.HorizontalAlignment = value; + return this; + } + + public Column WithSpacing(Spacing value) + { + this.Spacing = value; + return this; + } + + public Column WithTargetWidth(TargetWidth value) + { + this.TargetWidth = value; + return this; + } + + public Column WithIsSortKey(bool value) + { + this.IsSortKey = value; + return this; + } + + public Column WithSelectAction(Action value) + { + this.SelectAction = value; + return this; + } + + public Column WithStyle(ContainerStyle value) + { + this.Style = value; + return this; + } + + public Column WithShowBorder(bool value) + { + this.ShowBorder = value; + return this; + } + + public Column WithRoundedCorners(bool value) + { + this.RoundedCorners = value; + return this; + } + + public Column WithLayouts(params IList value) + { + this.Layouts = value; + return this; + } + + public Column WithBleed(bool value) + { + this.Bleed = value; + return this; + } + + public Column WithMinHeight(string value) + { + this.MinHeight = value; + return this; + } + + public Column WithBackgroundImage(IUnion value) + { + this.BackgroundImage = value; + return this; + } + + public Column WithVerticalContentAlignment(VerticalAlignment value) + { + this.VerticalContentAlignment = value; + return this; + } + + public Column WithRtl(bool value) + { + this.Rtl = value; + return this; + } + + public Column WithMaxHeight(string value) + { + this.MaxHeight = value; + return this; + } + + public Column WithWidth(IUnion value) + { + this.Width = value; + return this; + } + + public Column WithGridArea(string value) + { + this.GridArea = value; + return this; + } + + public Column WithFallback(IUnion value) + { + this.Fallback = value; + return this; + } + + public Column WithItems(params IList value) + { + this.Items = value; + return this; + } } /// @@ -17176,63 +18314,54 @@ public Column WithItems(params IList value) { /// public class SubmitActionData : SerializableObject { - /// - /// Deserializes a JSON string into an object of type SubmitActionData. - /// - public static SubmitActionData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Defines the optional Teams-specific portion of the action's data. - /// - [JsonPropertyName("msteams")] - public object? Msteams { get; set; } - - /// - /// Defines the optional Teams-specific portion of the action's data. Equivalent to `msteams`. - /// - [JsonPropertyName("msTeams")] - public object? MsTeams { get; set; } - - /// - /// Serializes this SubmitActionData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public SubmitActionData WithKey(string value) { - this.Key = value; - return this; - } - - public SubmitActionData WithMsteams(object value) { - this.Msteams = value; - return this; - } - - public SubmitActionData WithMsTeams(object value) { - this.MsTeams = value; - return this; - } - [JsonExtensionData] - public IDictionary NonSchemaProperties { get; set; } = new Dictionary(); + /// + /// Deserializes a JSON string into an object of type SubmitActionData. + /// + public static SubmitActionData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Defines the optional Teams-specific portion of the action's data. + /// + [JsonPropertyName("msteams")] + public object? Msteams { get; set; } + + /// + /// Serializes this SubmitActionData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public SubmitActionData WithKey(string value) + { + this.Key = value; + return this; + } + + public SubmitActionData WithMsteams(object value) + { + this.Msteams = value; + return this; + } + [JsonExtensionData] + public IDictionary NonSchemaProperties { get; set; } = new Dictionary(); } /// @@ -17240,61 +18369,63 @@ public SubmitActionData WithMsTeams(object value) { /// public class ImBackSubmitActionData : SerializableObject { - /// - /// Deserializes a JSON string into an object of type ImBackSubmitActionData. - /// - public static ImBackSubmitActionData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **imBack**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "imBack"; - - /// - /// The value that will be sent to the Bot. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - public ImBackSubmitActionData(string value) - { - this.Value = value; - } + /// + /// Deserializes a JSON string into an object of type ImBackSubmitActionData. + /// + public static ImBackSubmitActionData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } - /// - /// Serializes this ImBackSubmitActionData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public ImBackSubmitActionData WithKey(string value) { - this.Key = value; - return this; - } - - public ImBackSubmitActionData WithValue(string value) { - this.Value = value; - return this; - } + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **imBack**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "imBack"; + + /// + /// The value that will be sent to the Bot. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + public ImBackSubmitActionData(string value) + { + this.Value = value; + } + + /// + /// Serializes this ImBackSubmitActionData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public ImBackSubmitActionData WithKey(string value) + { + this.Key = value; + return this; + } + + public ImBackSubmitActionData WithValue(string value) + { + this.Value = value; + return this; + } } /// @@ -17302,61 +18433,63 @@ public ImBackSubmitActionData WithValue(string value) { /// public class InvokeSubmitActionData : SerializableObject { - /// - /// Deserializes a JSON string into an object of type InvokeSubmitActionData. - /// - public static InvokeSubmitActionData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **invoke**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "invoke"; - - /// - /// The object to send to the Bot with the Invoke request. Can be strongly typed as one of the below values to trigger a specific action in Teams. - /// - [JsonPropertyName("value")] - public IUnion? Value { get; set; } - - public InvokeSubmitActionData(IUnion value) - { - this.Value = value; - } + /// + /// Deserializes a JSON string into an object of type InvokeSubmitActionData. + /// + public static InvokeSubmitActionData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } - /// - /// Serializes this InvokeSubmitActionData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public InvokeSubmitActionData WithKey(string value) { - this.Key = value; - return this; - } - - public InvokeSubmitActionData WithValue(IUnion value) { - this.Value = value; - return this; - } + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **invoke**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "invoke"; + + /// + /// The object to send to the Bot with the Invoke request. Can be strongly typed as one of the below values to trigger a specific action in Teams. + /// + [JsonPropertyName("value")] + public IUnion? Value { get; set; } + + public InvokeSubmitActionData(IUnion value) + { + this.Value = value; + } + + /// + /// Serializes this InvokeSubmitActionData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public InvokeSubmitActionData WithKey(string value) + { + this.Key = value; + return this; + } + + public InvokeSubmitActionData WithValue(IUnion value) + { + this.Value = value; + return this; + } } /// @@ -17364,118 +18497,123 @@ public InvokeSubmitActionData WithValue(IUnion public class CollabStageInvokeDataValue : SerializableObject { - /// - /// Deserializes a JSON string into an object of type CollabStageInvokeDataValue. - /// - public static CollabStageInvokeDataValue? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Must be **tab/tabInfoAction**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "tab/tabInfoAction"; - - /// - /// Provides information about the iFrame content, rendered in the collab stage popout window. - /// - [JsonPropertyName("tabInfo")] - public TabInfo? TabInfo { get; set; } - - /// - /// Serializes this CollabStageInvokeDataValue into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public CollabStageInvokeDataValue WithTabInfo(TabInfo value) { - this.TabInfo = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type CollabStageInvokeDataValue. + /// + public static CollabStageInvokeDataValue? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Must be **tab/tabInfoAction**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "tab/tabInfoAction"; + + /// + /// Provides information about the iFrame content, rendered in the collab stage popout window. + /// + [JsonPropertyName("tabInfo")] + public TabInfo? TabInfo { get; set; } + + /// + /// Serializes this CollabStageInvokeDataValue into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public CollabStageInvokeDataValue WithTabInfo(TabInfo value) + { + this.TabInfo = value; + return this; + } } -/// -/// Represents information about the iFrame content, rendered in the collab stage popout window. -/// -public class TabInfo : SerializableObject -{ - /// - /// Deserializes a JSON string into an object of type TabInfo. - /// - public static TabInfo? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// The name for the content. This will be displayed as the title of the window hosting the iFrame. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// The URL to open in an iFrame. - /// - [JsonPropertyName("contentUrl")] - public string? ContentUrl { get; set; } - - /// - /// The unique entity id for this content (e.g., random UUID). - /// - [JsonPropertyName("entityId")] - public string? EntityId { get; set; } - - /// - /// An optional website URL to the content, allowing users to open this content in the browser (if they prefer). - /// - [JsonPropertyName("websiteUrl")] - public string? WebsiteUrl { get; set; } - - /// - /// Serializes this TabInfo into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TabInfo WithName(string value) { - this.Name = value; - return this; - } - - public TabInfo WithContentUrl(string value) { - this.ContentUrl = value; - return this; - } - - public TabInfo WithEntityId(string value) { - this.EntityId = value; - return this; - } - - public TabInfo WithWebsiteUrl(string value) { - this.WebsiteUrl = value; - return this; - } +/// +/// Represents information about the iFrame content, rendered in the collab stage popout window. +/// +public class TabInfo : SerializableObject +{ + /// + /// Deserializes a JSON string into an object of type TabInfo. + /// + public static TabInfo? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// The name for the content. This will be displayed as the title of the window hosting the iFrame. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The URL to open in an iFrame. + /// + [JsonPropertyName("contentUrl")] + public string? ContentUrl { get; set; } + + /// + /// The unique entity id for this content (e.g., random UUID). + /// + [JsonPropertyName("entityId")] + public string? EntityId { get; set; } + + /// + /// An optional website URL to the content, allowing users to open this content in the browser (if they prefer). + /// + [JsonPropertyName("websiteUrl")] + public string? WebsiteUrl { get; set; } + + /// + /// Serializes this TabInfo into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TabInfo WithName(string value) + { + this.Name = value; + return this; + } + + public TabInfo WithContentUrl(string value) + { + this.ContentUrl = value; + return this; + } + + public TabInfo WithEntityId(string value) + { + this.EntityId = value; + return this; + } + + public TabInfo WithWebsiteUrl(string value) + { + this.WebsiteUrl = value; + return this; + } } /// @@ -17483,78 +18621,82 @@ public TabInfo WithWebsiteUrl(string value) { /// public class MessageBackSubmitActionData : SerializableObject { - /// - /// Deserializes a JSON string into an object of type MessageBackSubmitActionData. - /// - public static MessageBackSubmitActionData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **messageBack**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "messageBack"; - - /// - /// The text that will be sent to the Bot. - /// - [JsonPropertyName("text")] - public string? Text { get; set; } - - /// - /// The optional text that will be displayed as a new message in the conversation, as if the end-user sent it. `displayText` is not sent to the Bot. - /// - [JsonPropertyName("displayText")] - public string? DisplayText { get; set; } - - /// - /// Optional additional value that will be sent to the Bot. For instance, `value` can encode specific context for the action, such as unique identifiers or a JSON object. - /// - [JsonPropertyName("value")] - public object? Value { get; set; } - - /// - /// Serializes this MessageBackSubmitActionData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public MessageBackSubmitActionData WithKey(string value) { - this.Key = value; - return this; - } - - public MessageBackSubmitActionData WithText(string value) { - this.Text = value; - return this; - } - - public MessageBackSubmitActionData WithDisplayText(string value) { - this.DisplayText = value; - return this; - } - - public MessageBackSubmitActionData WithValue(object value) { - this.Value = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type MessageBackSubmitActionData. + /// + public static MessageBackSubmitActionData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **messageBack**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "messageBack"; + + /// + /// The text that will be sent to the Bot. + /// + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// + /// The optional text that will be displayed as a new message in the conversation, as if the end-user sent it. `displayText` is not sent to the Bot. + /// + [JsonPropertyName("displayText")] + public string? DisplayText { get; set; } + + /// + /// Optional additional value that will be sent to the Bot. For instance, `value` can encode specific context for the action, such as unique identifiers or a JSON object. + /// + [JsonPropertyName("value")] + public object? Value { get; set; } + + /// + /// Serializes this MessageBackSubmitActionData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public MessageBackSubmitActionData WithKey(string value) + { + this.Key = value; + return this; + } + + public MessageBackSubmitActionData WithText(string value) + { + this.Text = value; + return this; + } + + public MessageBackSubmitActionData WithDisplayText(string value) + { + this.DisplayText = value; + return this; + } + + public MessageBackSubmitActionData WithValue(object value) + { + this.Value = value; + return this; + } } /// @@ -17562,61 +18704,63 @@ public MessageBackSubmitActionData WithValue(object value) { /// public class SigninSubmitActionData : SerializableObject { - /// - /// Deserializes a JSON string into an object of type SigninSubmitActionData. - /// - public static SigninSubmitActionData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **signin**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "signin"; - - /// - /// The URL to redirect the end-user for signing in. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - public SigninSubmitActionData(string value) - { - this.Value = value; - } + /// + /// Deserializes a JSON string into an object of type SigninSubmitActionData. + /// + public static SigninSubmitActionData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } - /// - /// Serializes this SigninSubmitActionData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public SigninSubmitActionData WithKey(string value) { - this.Key = value; - return this; - } - - public SigninSubmitActionData WithValue(string value) { - this.Value = value; - return this; - } + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **signin**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "signin"; + + /// + /// The URL to redirect the end-user for signing in. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + public SigninSubmitActionData(string value) + { + this.Value = value; + } + + /// + /// Serializes this SigninSubmitActionData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public SigninSubmitActionData WithKey(string value) + { + this.Key = value; + return this; + } + + public SigninSubmitActionData WithValue(string value) + { + this.Value = value; + return this; + } } /// @@ -17624,45 +18768,46 @@ public SigninSubmitActionData WithValue(string value) { /// public class TaskFetchSubmitActionData : SerializableObject { - /// - /// Deserializes a JSON string into an object of type TaskFetchSubmitActionData. - /// - public static TaskFetchSubmitActionData? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **task/fetch**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "task/fetch"; - - /// - /// Serializes this TaskFetchSubmitActionData into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TaskFetchSubmitActionData WithKey(string value) { - this.Key = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type TaskFetchSubmitActionData. + /// + public static TaskFetchSubmitActionData? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **task/fetch**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "task/fetch"; + + /// + /// Serializes this TaskFetchSubmitActionData into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TaskFetchSubmitActionData WithKey(string value) + { + this.Key = value; + return this; + } } /// @@ -17670,50 +18815,52 @@ public TaskFetchSubmitActionData WithKey(string value) { /// public class TeamsSubmitActionProperties : SerializableObject { - /// - /// Deserializes a JSON string into an object of type TeamsSubmitActionProperties. - /// - public static TeamsSubmitActionProperties? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Defines how feedback is provided to the end-user when the action is executed. - /// - [JsonPropertyName("feedback")] - public TeamsSubmitActionFeedback? Feedback { get; set; } - - /// - /// Serializes this TeamsSubmitActionProperties into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TeamsSubmitActionProperties WithKey(string value) { - this.Key = value; - return this; - } - - public TeamsSubmitActionProperties WithFeedback(TeamsSubmitActionFeedback value) { - this.Feedback = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type TeamsSubmitActionProperties. + /// + public static TeamsSubmitActionProperties? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Defines how feedback is provided to the end-user when the action is executed. + /// + [JsonPropertyName("feedback")] + public TeamsSubmitActionFeedback? Feedback { get; set; } + + /// + /// Serializes this TeamsSubmitActionProperties into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TeamsSubmitActionProperties WithKey(string value) + { + this.Key = value; + return this; + } + + public TeamsSubmitActionProperties WithFeedback(TeamsSubmitActionFeedback value) + { + this.Feedback = value; + return this; + } } /// @@ -17721,50 +18868,52 @@ public TeamsSubmitActionProperties WithFeedback(TeamsSubmitActionFeedback value) /// public class TeamsSubmitActionFeedback : SerializableObject { - /// - /// Deserializes a JSON string into an object of type TeamsSubmitActionFeedback. - /// - public static TeamsSubmitActionFeedback? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Defines if a feedback message should be displayed after the action is executed. - /// - [JsonPropertyName("hide")] - public bool? Hide { get; set; } - - /// - /// Serializes this TeamsSubmitActionFeedback into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TeamsSubmitActionFeedback WithKey(string value) { - this.Key = value; - return this; - } - - public TeamsSubmitActionFeedback WithHide(bool value) { - this.Hide = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type TeamsSubmitActionFeedback. + /// + public static TeamsSubmitActionFeedback? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Defines if a feedback message should be displayed after the action is executed. + /// + [JsonPropertyName("hide")] + public bool? Hide { get; set; } + + /// + /// Serializes this TeamsSubmitActionFeedback into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TeamsSubmitActionFeedback WithKey(string value) + { + this.Key = value; + return this; + } + + public TeamsSubmitActionFeedback WithHide(bool value) + { + this.Hide = value; + return this; + } } /// @@ -17772,61 +18921,64 @@ public TeamsSubmitActionFeedback WithHide(bool value) { /// public class RefreshDefinition : SerializableObject { - /// - /// Deserializes a JSON string into an object of type RefreshDefinition. - /// - public static RefreshDefinition? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The Action.Execute action to invoke to refresh the card. - /// - [JsonPropertyName("action")] - public ExecuteAction? Action { get; set; } - - /// - /// The list of user Ids for which the card will be automatically refreshed. In Teams, in chats or channels with more than 60 users, the card will automatically refresh only for users specified in the userIds list. Other users will have to manually click on a "refresh" button. In contexts with fewer than 60 users, the card will automatically refresh for all users. - /// - [JsonPropertyName("userIds")] - public IList? UserIds { get; set; } - - /// - /// Serializes this RefreshDefinition into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public RefreshDefinition WithKey(string value) { - this.Key = value; - return this; - } - - public RefreshDefinition WithAction(ExecuteAction value) { - this.Action = value; - return this; - } - - public RefreshDefinition WithUserIds(params IList value) { - this.UserIds = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type RefreshDefinition. + /// + public static RefreshDefinition? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The Action.Execute action to invoke to refresh the card. + /// + [JsonPropertyName("action")] + public ExecuteAction? Action { get; set; } + + /// + /// The list of user Ids for which the card will be automatically refreshed. In Teams, in chats or channels with more than 60 users, the card will automatically refresh only for users specified in the userIds list. Other users will have to manually click on a "refresh" button. In contexts with fewer than 60 users, the card will automatically refresh for all users. + /// + [JsonPropertyName("userIds")] + public IList? UserIds { get; set; } + + /// + /// Serializes this RefreshDefinition into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public RefreshDefinition WithKey(string value) + { + this.Key = value; + return this; + } + + public RefreshDefinition WithAction(ExecuteAction value) + { + this.Action = value; + return this; + } + + public RefreshDefinition WithUserIds(params IList value) + { + this.UserIds = value; + return this; + } } /// @@ -17834,83 +18986,88 @@ public RefreshDefinition WithUserIds(params IList value) { /// public class Authentication : SerializableObject { - /// - /// Deserializes a JSON string into an object of type Authentication. - /// - public static Authentication? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The text that can be displayed to the end user when prompting them to authenticate. - /// - [JsonPropertyName("text")] - public string? Text { get; set; } - - /// - /// The identifier for registered OAuth connection setting information. - /// - [JsonPropertyName("connectionName")] - public string? ConnectionName { get; set; } - - /// - /// The buttons that should be displayed to the user when prompting for authentication. The array MUST contain one button of type “signin”. Other button types are not currently supported. - /// - [JsonPropertyName("buttons")] - public IList? Buttons { get; set; } - - /// - /// Provides information required to enable on-behalf-of single sign-on user authentication. - /// - [JsonPropertyName("tokenExchangeResource")] - public TokenExchangeResource? TokenExchangeResource { get; set; } - - /// - /// Serializes this Authentication into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Authentication WithKey(string value) { - this.Key = value; - return this; - } - - public Authentication WithText(string value) { - this.Text = value; - return this; - } - - public Authentication WithConnectionName(string value) { - this.ConnectionName = value; - return this; - } - - public Authentication WithButtons(params IList value) { - this.Buttons = value; - return this; - } - - public Authentication WithTokenExchangeResource(TokenExchangeResource value) { - this.TokenExchangeResource = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type Authentication. + /// + public static Authentication? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The text that can be displayed to the end user when prompting them to authenticate. + /// + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// + /// The identifier for registered OAuth connection setting information. + /// + [JsonPropertyName("connectionName")] + public string? ConnectionName { get; set; } + + /// + /// The buttons that should be displayed to the user when prompting for authentication. The array MUST contain one button of type “signin”. Other button types are not currently supported. + /// + [JsonPropertyName("buttons")] + public IList? Buttons { get; set; } + + /// + /// Provides information required to enable on-behalf-of single sign-on user authentication. + /// + [JsonPropertyName("tokenExchangeResource")] + public TokenExchangeResource? TokenExchangeResource { get; set; } + + /// + /// Serializes this Authentication into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Authentication WithKey(string value) + { + this.Key = value; + return this; + } + + public Authentication WithText(string value) + { + this.Text = value; + return this; + } + + public Authentication WithConnectionName(string value) + { + this.ConnectionName = value; + return this; + } + + public Authentication WithButtons(params IList value) + { + this.Buttons = value; + return this; + } + + public Authentication WithTokenExchangeResource(TokenExchangeResource value) + { + this.TokenExchangeResource = value; + return this; + } } /// @@ -17918,83 +19075,88 @@ public Authentication WithTokenExchangeResource(TokenExchangeResource value) { /// public class AuthCardButton : SerializableObject { - /// - /// Deserializes a JSON string into an object of type AuthCardButton. - /// - public static AuthCardButton? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **signin**. - /// - [JsonPropertyName("type")] - public string? Type { get; set; } - - /// - /// The caption of the button. - /// - [JsonPropertyName("title")] - public string? Title { get; set; } - - /// - /// A URL to an image to display alongside the button’s caption. - /// - [JsonPropertyName("image")] - public string? Image { get; set; } - - /// - /// The value associated with the button. The meaning of value depends on the button’s type. - /// - [JsonPropertyName("value")] - public string? Value { get; set; } - - /// - /// Serializes this AuthCardButton into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public AuthCardButton WithKey(string value) { - this.Key = value; - return this; - } - - public AuthCardButton WithType(string value) { - this.Type = value; - return this; - } - - public AuthCardButton WithTitle(string value) { - this.Title = value; - return this; - } - - public AuthCardButton WithImage(string value) { - this.Image = value; - return this; - } - - public AuthCardButton WithValue(string value) { - this.Value = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type AuthCardButton. + /// + public static AuthCardButton? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **signin**. + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// The caption of the button. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A URL to an image to display alongside the button’s caption. + /// + [JsonPropertyName("image")] + public string? Image { get; set; } + + /// + /// The value associated with the button. The meaning of value depends on the button’s type. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + /// + /// Serializes this AuthCardButton into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public AuthCardButton WithKey(string value) + { + this.Key = value; + return this; + } + + public AuthCardButton WithType(string value) + { + this.Type = value; + return this; + } + + public AuthCardButton WithTitle(string value) + { + this.Title = value; + return this; + } + + public AuthCardButton WithImage(string value) + { + this.Image = value; + return this; + } + + public AuthCardButton WithValue(string value) + { + this.Value = value; + return this; + } } /// @@ -18002,72 +19164,76 @@ public AuthCardButton WithValue(string value) { /// public class TokenExchangeResource : SerializableObject { - /// - /// Deserializes a JSON string into an object of type TokenExchangeResource. - /// - public static TokenExchangeResource? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The unique identified of this token exchange instance. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// An application ID or resource identifier with which to exchange a token on behalf of. This property is identity provider- and application-specific. - /// - [JsonPropertyName("uri")] - public string? Uri { get; set; } - - /// - /// An identifier for the identity provider with which to attempt a token exchange. - /// - [JsonPropertyName("providerId")] - public string? ProviderId { get; set; } - - /// - /// Serializes this TokenExchangeResource into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TokenExchangeResource WithKey(string value) { - this.Key = value; - return this; - } - - public TokenExchangeResource WithId(string value) { - this.Id = value; - return this; - } - - public TokenExchangeResource WithUri(string value) { - this.Uri = value; - return this; - } - - public TokenExchangeResource WithProviderId(string value) { - this.ProviderId = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type TokenExchangeResource. + /// + public static TokenExchangeResource? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The unique identified of this token exchange instance. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// An application ID or resource identifier with which to exchange a token on behalf of. This property is identity provider- and application-specific. + /// + [JsonPropertyName("uri")] + public string? Uri { get; set; } + + /// + /// An identifier for the identity provider with which to attempt a token exchange. + /// + [JsonPropertyName("providerId")] + public string? ProviderId { get; set; } + + /// + /// Serializes this TokenExchangeResource into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TokenExchangeResource WithKey(string value) + { + this.Key = value; + return this; + } + + public TokenExchangeResource WithId(string value) + { + this.Id = value; + return this; + } + + public TokenExchangeResource WithUri(string value) + { + this.Uri = value; + return this; + } + + public TokenExchangeResource WithProviderId(string value) + { + this.ProviderId = value; + return this; + } } /// @@ -18075,63 +19241,66 @@ public TokenExchangeResource WithProviderId(string value) { /// public class TeamsCardProperties : SerializableObject { - /// - /// Deserializes a JSON string into an object of type TeamsCardProperties. - /// - public static TeamsCardProperties? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Controls the width of the card in a Teams chat. - /// - /// Note that setting `width` to "full" will not actually stretch the card to the "full width" of the chat pane. It will only make the card wider than when the `width` property isn't set. - /// - [JsonPropertyName("width")] - public TeamsCardWidth? Width { get; set; } - - /// - /// The Teams-specific entities associated with the card. - /// - [JsonPropertyName("entities")] - public IList? Entities { get; set; } - - /// - /// Serializes this TeamsCardProperties into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public TeamsCardProperties WithKey(string value) { - this.Key = value; - return this; - } - - public TeamsCardProperties WithWidth(TeamsCardWidth value) { - this.Width = value; - return this; - } - - public TeamsCardProperties WithEntities(params IList value) { - this.Entities = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type TeamsCardProperties. + /// + public static TeamsCardProperties? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Controls the width of the card in a Teams chat. + /// + /// Note that setting `width` to "full" will not actually stretch the card to the "full width" of the chat pane. It will only make the card wider than when the `width` property isn't set. + /// + [JsonPropertyName("width")] + public TeamsCardWidth? Width { get; set; } + + /// + /// The Teams-specific entities associated with the card. + /// + [JsonPropertyName("entities")] + public IList? Entities { get; set; } + + /// + /// Serializes this TeamsCardProperties into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public TeamsCardProperties WithKey(string value) + { + this.Key = value; + return this; + } + + public TeamsCardProperties WithWidth(TeamsCardWidth value) + { + this.Width = value; + return this; + } + + public TeamsCardProperties WithEntities(params IList value) + { + this.Entities = value; + return this; + } } /// @@ -18139,67 +19308,70 @@ public TeamsCardProperties WithEntities(params IList value) { /// public class Mention : SerializableObject { - /// - /// Deserializes a JSON string into an object of type Mention. - /// - public static Mention? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// Must be **mention**. - /// - [JsonPropertyName("type")] - public string Type { get; } = "mention"; - - /// - /// The text that will be substituted with the mention. - /// - [JsonPropertyName("text")] - public string? Text { get; set; } - - /// - /// Defines the entity being mentioned. - /// - [JsonPropertyName("mentioned")] - public MentionedEntity? Mentioned { get; set; } - - /// - /// Serializes this Mention into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Mention WithKey(string value) { - this.Key = value; - return this; - } - - public Mention WithText(string value) { - this.Text = value; - return this; - } - - public Mention WithMentioned(MentionedEntity value) { - this.Mentioned = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type Mention. + /// + public static Mention? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Must be **mention**. + /// + [JsonPropertyName("type")] + public string Type { get; } = "mention"; + + /// + /// The text that will be substituted with the mention. + /// + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// + /// Defines the entity being mentioned. + /// + [JsonPropertyName("mentioned")] + public MentionedEntity? Mentioned { get; set; } + + /// + /// Serializes this Mention into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Mention WithKey(string value) + { + this.Key = value; + return this; + } + + public Mention WithText(string value) + { + this.Text = value; + return this; + } + + public Mention WithMentioned(MentionedEntity value) + { + this.Mentioned = value; + return this; + } } /// @@ -18207,72 +19379,76 @@ public Mention WithMentioned(MentionedEntity value) { /// public class MentionedEntity : SerializableObject { - /// - /// Deserializes a JSON string into an object of type MentionedEntity. - /// - public static MentionedEntity? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The Id of a person (typically a Microsoft Entra user Id) or tag. - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// The name of the mentioned entity. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// The type of the mentioned entity. - /// - [JsonPropertyName("mentionType")] - public MentionType? MentionType { get; set; } = MentionType.Person; - - /// - /// Serializes this MentionedEntity into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public MentionedEntity WithKey(string value) { - this.Key = value; - return this; - } - - public MentionedEntity WithId(string value) { - this.Id = value; - return this; - } - - public MentionedEntity WithName(string value) { - this.Name = value; - return this; - } - - public MentionedEntity WithMentionType(MentionType value) { - this.MentionType = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type MentionedEntity. + /// + public static MentionedEntity? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The Id of a person (typically a Microsoft Entra user Id) or tag. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// The name of the mentioned entity. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The type of the mentioned entity. + /// + [JsonPropertyName("mentionType")] + public MentionType? MentionType { get; set; } = MentionType.Person; + + /// + /// Serializes this MentionedEntity into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public MentionedEntity WithKey(string value) + { + this.Key = value; + return this; + } + + public MentionedEntity WithId(string value) + { + this.Id = value; + return this; + } + + public MentionedEntity WithName(string value) + { + this.Name = value; + return this; + } + + public MentionedEntity WithMentionType(MentionType value) + { + this.MentionType = value; + return this; + } } /// @@ -18280,50 +19456,52 @@ public MentionedEntity WithMentionType(MentionType value) { /// public class CardMetadata : SerializableObject { - /// - /// Deserializes a JSON string into an object of type CardMetadata. - /// - public static CardMetadata? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The URL the card originates from. When `webUrl` is set, the card is dubbed an **Adaptive Card-based Loop Component** and, when pasted in Teams or other Loop Component-capable host applications, the URL will unfurl to the same exact card. - /// - [JsonPropertyName("webUrl")] - public string? WebUrl { get; set; } - - /// - /// Serializes this CardMetadata into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public CardMetadata WithKey(string value) { - this.Key = value; - return this; - } - - public CardMetadata WithWebUrl(string value) { - this.WebUrl = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type CardMetadata. + /// + public static CardMetadata? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The URL the card originates from. When `webUrl` is set, the card is dubbed an **Adaptive Card-based Loop Component** and, when pasted in Teams or other Loop Component-capable host applications, the URL will unfurl to the same exact card. + /// + [JsonPropertyName("webUrl")] + public string? WebUrl { get; set; } + + /// + /// Serializes this CardMetadata into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public CardMetadata WithKey(string value) + { + this.Key = value; + return this; + } + + public CardMetadata WithWebUrl(string value) + { + this.WebUrl = value; + return this; + } } /// @@ -18331,50 +19509,52 @@ public CardMetadata WithWebUrl(string value) { /// public class Resources : SerializableObject { - /// - /// Deserializes a JSON string into an object of type Resources. - /// - public static Resources? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// String resources that can provide translations in multiple languages. String resources make it possible to craft cards that are automatically localized according to the language settings of the application that displays the card. - /// - [JsonPropertyName("strings")] - public IDictionary? Strings { get; set; } - - /// - /// Serializes this Resources into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public Resources WithKey(string value) { - this.Key = value; - return this; - } - - public Resources WithStrings(IDictionary value) { - this.Strings = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type Resources. + /// + public static Resources? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// String resources that can provide translations in multiple languages. String resources make it possible to craft cards that are automatically localized according to the language settings of the application that displays the card. + /// + [JsonPropertyName("strings")] + public IDictionary? Strings { get; set; } + + /// + /// Serializes this Resources into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public Resources WithKey(string value) + { + this.Key = value; + return this; + } + + public Resources WithStrings(IDictionary value) + { + this.Strings = value; + return this; + } } /// @@ -18382,59 +19562,62 @@ public Resources WithStrings(IDictionary value) { /// public class StringResource : SerializableObject { - /// - /// Deserializes a JSON string into an object of type StringResource. - /// - public static StringResource? Deserialize(string json) - { - return JsonSerializer.Deserialize(json); - } - - /// - /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. - /// - [JsonPropertyName("key")] - public string? Key { get; set; } - - /// - /// The default value of the string, which is used when no matching localized value is found. - /// - [JsonPropertyName("defaultValue")] - public string? DefaultValue { get; set; } - - /// - /// Localized values of the string, where keys represent the locale (e.g. `en-US`) in the `(-)` format. `` is the 2-letter language code and `` is the optional 2-letter country code. - /// - [JsonPropertyName("localizedValues")] - public IDictionary? LocalizedValues { get; set; } - - /// - /// Serializes this StringResource into a JSON string. - /// - public string Serialize() - { - return JsonSerializer.Serialize( - this, - new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - } - ); - } - - public StringResource WithKey(string value) { - this.Key = value; - return this; - } - - public StringResource WithDefaultValue(string value) { - this.DefaultValue = value; - return this; - } - - public StringResource WithLocalizedValues(IDictionary value) { - this.LocalizedValues = value; - return this; - } + /// + /// Deserializes a JSON string into an object of type StringResource. + /// + public static StringResource? Deserialize(string json) + { + return JsonSerializer.Deserialize(json); + } + + /// + /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The default value of the string, which is used when no matching localized value is found. + /// + [JsonPropertyName("defaultValue")] + public string? DefaultValue { get; set; } + + /// + /// Localized values of the string, where keys represent the locale (e.g. `en-US`) in the `(-)` format. `` is the 2-letter language code and `` is the optional 2-letter country code. + /// + [JsonPropertyName("localizedValues")] + public IDictionary? LocalizedValues { get; set; } + + /// + /// Serializes this StringResource into a JSON string. + /// + public string Serialize() + { + return JsonSerializer.Serialize( + this, + new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + } + ); + } + + public StringResource WithKey(string value) + { + this.Key = value; + return this; + } + + public StringResource WithDefaultValue(string value) + { + this.DefaultValue = value; + return this; + } + + public StringResource WithLocalizedValues(IDictionary value) + { + this.LocalizedValues = value; + return this; + } } \ No newline at end of file diff --git a/Tests/Microsoft.Teams.Cards.Tests/AdaptiveCardsTest.cs b/Tests/Microsoft.Teams.Cards.Tests/AdaptiveCardsTest.cs index 44e92bbb..af57064f 100644 --- a/Tests/Microsoft.Teams.Cards.Tests/AdaptiveCardsTest.cs +++ b/Tests/Microsoft.Teams.Cards.Tests/AdaptiveCardsTest.cs @@ -10,13 +10,10 @@ public class AdaptiveCardsTest public void Should_Serialize_AdaptiveCard_Simple() { // arrange - AdaptiveCard card = new AdaptiveCard() - { - Body = new List() + AdaptiveCard card = new AdaptiveCard(new List { new TextBlock("Hello, Adaptive Card!") - } - }; + }); // act var json = JsonSerializer.Serialize(card); @@ -58,10 +55,7 @@ public void Should_Deserialize_AdaptiveCard_Simple() public void Should_Serialize_BasicCard_WithToggleInput() { // arrange - recreating CreateBasicAdaptiveCard from samples - var card = new AdaptiveCard - { - Schema = "http://adaptivecards.io/schemas/adaptive-card.json", - Body = new List + var card = new AdaptiveCard(new List { new TextBlock("Hello world") { @@ -72,7 +66,9 @@ public void Should_Serialize_BasicCard_WithToggleInput() { Id = "notify" } - }, + }) + { + Schema = "http://adaptivecards.io/schemas/adaptive-card.json", Actions = new List { new ExecuteAction @@ -153,7 +149,7 @@ public void Should_Deserialize_ProfileCard_WithInputs() ] }"; - var card = JsonSerializer.Deserialize(cardJson); + var card = JsonSerializer.Deserialize(json); Assert.NotNull(card); // Note: Schema might be serialized as $schema in JSON but not always set on deserialized object @@ -190,10 +186,7 @@ public void Should_Deserialize_ProfileCard_WithInputs() public void Should_Serialize_TaskFormCard_WithChoiceSet() { // arrange - recreating CreateTaskFormCard from samples - var card = new AdaptiveCard - { - Schema = "http://adaptivecards.io/schemas/adaptive-card.json", - Body = new List + var card = new AdaptiveCard(new List { new TextBlock("Create New Task") { @@ -206,17 +199,16 @@ public void Should_Serialize_TaskFormCard_WithChoiceSet() Label = "Task Title", Placeholder = "Enter task title" }, - new ChoiceSetInput - { - Id = "priority", - Label = "Priority", - Value = "medium", - Choices = new List + new ChoiceSetInput(new List { new() { Title = "High", Value = "high" }, new() { Title = "Medium", Value = "medium" }, new() { Title = "Low", Value = "low" } - } + }) + { + Id = "priority", + Label = "Priority", + Value = "medium" }, new DateInput { @@ -224,7 +216,9 @@ public void Should_Serialize_TaskFormCard_WithChoiceSet() Label = "Due Date", Value = "2024-01-15" } - } + }) + { + Schema = "http://adaptivecards.io/schemas/adaptive-card.json" }; // act @@ -350,10 +344,7 @@ public void Should_Deserialize_ComplexCard_FromJson() public void Should_Serialize_FeedbackCard_WithMultilineInput() { // arrange - recreating CreateFeedbackCard from samples - var card = new AdaptiveCard - { - Schema = "http://adaptivecards.io/schemas/adaptive-card.json", - Body = new List + var card = new AdaptiveCard(new List { new TextBlock("Feedback Form") { @@ -368,7 +359,9 @@ public void Should_Serialize_FeedbackCard_WithMultilineInput() IsMultiline = true, IsRequired = true } - }, + }) + { + Schema = "http://adaptivecards.io/schemas/adaptive-card.json", Actions = new List { new ExecuteAction @@ -433,7 +426,7 @@ public void Should_Deserialize_ValidationCard_WithNumberInput() ] }"; - var card = JsonSerializer.Deserialize(cardJson); + var card = JsonSerializer.Deserialize(json); Assert.NotNull(card); Assert.Equal(3, card.Body!.Count); @@ -512,12 +505,11 @@ public void Should_Deserialize() public void Should_Not_Serialize_Null_MsTeams_Property_On_SubmitAction() { // arrange - var card = new AdaptiveCard - { - Body = new List + var card = new AdaptiveCard(new List { new TextBlock("Test card with Submit action") - }, + }) + { Actions = new List { new SubmitAction