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; }
+
+ ///