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..9009b8d2 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
{
///
@@ -18,7 +19,7 @@ public InvokeAction(object value)
{
Data = new Union(new SubmitActionData
{
- Msteams = new InvokeSubmitActionData(value)
+ Msteams = new InvokeSubmitActionData(new Union
[JsonPropertyName("requires")]
- public HostCapabilities? Requires { get; set; }
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
///
/// The locale associated with the element.
@@ -1026,7 +1243,7 @@ public class AdaptiveCard : CardElement
/// 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; }
+ public bool? IsSortKey { get; set; } = false;
///
/// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported.
@@ -1080,7 +1297,7 @@ public class AdaptiveCard : CardElement
/// The Adaptive Card schema version the card is authored against.
///
[JsonPropertyName("version")]
- public Version? Version { get; set; }
+ public Version? Version { get; set; } = Version.Version1_5;
///
/// The text that should be displayed if the client is not able to render the card.
@@ -1106,6 +1323,9 @@ public class AdaptiveCard : CardElement
[JsonPropertyName("authentication")]
public Authentication? Authentication { get; set; }
+ ///
+ /// Teams-specific metadata associated with the card.
+ ///
[JsonPropertyName("msteams")]
public TeamsCardProperties? Msteams { get; set; }
@@ -1115,6 +1335,12 @@ public class AdaptiveCard : CardElement
[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.
///
@@ -1159,6 +1385,12 @@ public string Serialize()
);
}
+ public AdaptiveCard WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
public AdaptiveCard WithId(string value)
{
this.Id = value;
@@ -1273,6 +1505,12 @@ public AdaptiveCard WithMetadata(CardMetadata value)
return this;
}
+ public AdaptiveCard WithResources(Resources value)
+ {
+ this.Resources = value;
+ return this;
+ }
+
public AdaptiveCard WithGridArea(string value)
{
this.GridArea = value;
@@ -1311,6 +1549,11 @@ public class HostCapabilities : SerializableObject
return JsonSerializer.Deserialize(json);
}
+ ///
+ /// Defines an optional key for the object. Keys are 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.
@@ -1326,6 +1569,12 @@ public string Serialize()
}
);
}
+
+ public HostCapabilities WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
[JsonExtensionData]
public IDictionary NonSchemaProperties { get; set; } = new Dictionary();
}
@@ -1343,6 +1592,12 @@ public class ExecuteAction : Action
return JsonSerializer.Deserialize(json);
}
+ ///
+ /// Defines an optional key for the object. Keys are 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**.
///
@@ -1359,7 +1614,7 @@ public class ExecuteAction : Action
/// 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; }
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
///
/// The title of the action, as it appears on buttons.
@@ -1379,13 +1634,13 @@ public class ExecuteAction : Action
/// Control the style of the action, affecting its visual and spoken representations.
///
[JsonPropertyName("style")]
- public ActionStyle? Style { get; set; }
+ 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; }
+ public ActionMode? Mode { get; set; } = ActionMode.Primary;
///
/// The tooltip text to display when the action is hovered over.
@@ -1397,7 +1652,19 @@ public class ExecuteAction : Action
/// 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; }
+ 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.
@@ -1415,7 +1682,7 @@ public class ExecuteAction : Action
/// 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; }
+ public bool? ConditionallyEnabled { get; set; } = false;
///
/// The verb of the action.
@@ -1444,6 +1711,12 @@ public string Serialize()
);
}
+ public ExecuteAction WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
public ExecuteAction WithId(string value)
{
this.Id = value;
@@ -1492,6 +1765,18 @@ public ExecuteAction WithIsEnabled(bool 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;
@@ -1524,188 +1809,118 @@ public ExecuteAction WithFallback(IUnion value)
}
///
-/// Represents the data of an Action.Submit.
+/// Inserts an image into the host application's canvas.
///
-public class SubmitActionData : SerializableObject
+public class InsertImageAction : Action
{
///
- /// Deserializes a JSON string into an object of type SubmitActionData.
+ /// Deserializes a JSON string into an object of type InsertImageAction.
///
- public static SubmitActionData? Deserialize(string json)
+ public static InsertImageAction? Deserialize(string json)
{
- return JsonSerializer.Deserialize(json);
+ return JsonSerializer.Deserialize(json);
}
- [JsonPropertyName("msteams")]
- public object? Msteams { get; set; }
-
///
- /// Serializes this SubmitActionData into a JSON string.
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
///
- public string Serialize()
- {
- return JsonSerializer.Serialize(
- this,
- new JsonSerializerOptions
- {
- WriteIndented = true,
- DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
- }
- );
- }
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
- public SubmitActionData WithMsteams(object value)
- {
- this.Msteams = value;
- return this;
- }
- [JsonExtensionData]
- public IDictionary NonSchemaProperties { get; set; } = new Dictionary();
-}
+ ///
+ /// Must be **Action.InsertImage**.
+ ///
+ [JsonPropertyName("type")]
+ public string Type { get; } = "Action.InsertImage";
-///
-/// Represents Teams-specific data in an Action.Submit to send an Instant Message back to the Bot.
-///
-public class ImBackSubmitActionData : SerializableObject
-{
///
- /// Deserializes a JSON string into an object of type ImBackSubmitActionData.
+ /// 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.
///
- public static ImBackSubmitActionData? Deserialize(string json)
- {
- return JsonSerializer.Deserialize(json);
- }
+ [JsonPropertyName("id")]
+ public string? Id { get; set; }
///
- /// Must be **imBack**.
+ /// 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("type")]
- public string Type { get; } = "imBack";
+ [JsonPropertyName("requires")]
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
///
- /// The value that will be sent to the Bot.
+ /// The title of the action, as it appears on buttons.
///
- [JsonPropertyName("value")]
- public string? Value { get; set; }
+ [JsonPropertyName("title")]
+ public string? Title { get; set; }
- public ImBackSubmitActionData(string value)
- {
- this.Value = value;
- }
+ ///
+ /// 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; }
///
- /// Serializes this ImBackSubmitActionData into a JSON string.
+ /// Control the style of the action, affecting its visual and spoken representations.
///
- public string Serialize()
- {
- return JsonSerializer.Serialize(
- this,
- new JsonSerializerOptions
- {
- WriteIndented = true,
- DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
- }
- );
- }
-
- public ImBackSubmitActionData WithValue(string value)
- {
- this.Value = value;
- return this;
- }
-}
+ [JsonPropertyName("style")]
+ public ActionStyle? Style { get; set; } = ActionStyle.Default;
-///
-/// Represents Teams-specific data in an Action.Submit to make an Invoke request to the Bot.
-///
-public class InvokeSubmitActionData : SerializableObject
-{
///
- /// Deserializes a JSON string into an object of type InvokeSubmitActionData.
+ /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.
///
- public static InvokeSubmitActionData? Deserialize(string json)
- {
- return JsonSerializer.Deserialize(json);
- }
+ [JsonPropertyName("mode")]
+ public ActionMode? Mode { get; set; } = ActionMode.Primary;
///
- /// Must be **invoke**.
+ /// The tooltip text to display when the action is hovered over.
///
- [JsonPropertyName("type")]
- public string Type { get; } = "invoke";
+ [JsonPropertyName("tooltip")]
+ public string? Tooltip { get; set; }
///
- /// The object to send to the Bot with the Invoke request.
+ /// 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("value")]
- public object? Value { get; set; }
-
- public InvokeSubmitActionData(object value)
- {
- this.Value = value;
- }
+ [JsonPropertyName("isEnabled")]
+ public bool? IsEnabled { get; set; } = true;
///
- /// Serializes this InvokeSubmitActionData into a JSON string.
+ /// The actions to display in the overflow menu of a Split action button.
///
- public string Serialize()
- {
- return JsonSerializer.Serialize(
- this,
- new JsonSerializerOptions
- {
- WriteIndented = true,
- DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
- }
- );
- }
-
- public InvokeSubmitActionData WithValue(object value)
- {
- this.Value = value;
- return this;
- }
-}
+ [JsonPropertyName("menuActions")]
+ public IList? MenuActions { get; set; }
-///
-/// Represents Teams-specific data in an Action.Submit to send a message back to the Bot.
-///
-public class MessageBackSubmitActionData : SerializableObject
-{
///
- /// Deserializes a JSON string into an object of type MessageBackSubmitActionData.
+ /// A set of theme-specific icon URLs.
///
- public static MessageBackSubmitActionData? Deserialize(string json)
- {
- return JsonSerializer.Deserialize(json);
- }
+ [JsonPropertyName("themedIconUrls")]
+ public IList? ThemedIconUrls { get; set; }
///
- /// Must be **messageBack**.
+ /// The URL of the image to insert.
///
- [JsonPropertyName("type")]
- public string Type { get; } = "messageBack";
+ [JsonPropertyName("url")]
+ public string? Url { get; set; }
///
- /// The text that will be sent to the Bot.
+ /// The alternate text for the image.
///
- [JsonPropertyName("text")]
- public string? Text { get; set; }
+ [JsonPropertyName("altText")]
+ public string? AltText { 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.
+ /// The position at which to insert the image.
///
- [JsonPropertyName("displayText")]
- public string? DisplayText { get; set; }
+ [JsonPropertyName("insertPosition")]
+ public ImageInsertPosition? InsertPosition { get; set; } = ImageInsertPosition.Selection;
///
- /// 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.
+ /// 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("value")]
- public string? Value { get; set; }
+ [JsonPropertyName("fallback")]
+ public IUnion? Fallback { get; set; }
///
- /// Serializes this MessageBackSubmitActionData into a JSON string.
+ /// Serializes this InsertImageAction into a JSON string.
///
public string Serialize()
{
@@ -1719,130 +1934,121 @@ public string Serialize()
);
}
- public MessageBackSubmitActionData WithText(string value)
+ public InsertImageAction WithKey(string value)
{
- this.Text = value;
+ this.Key = value;
return this;
}
- public MessageBackSubmitActionData WithDisplayText(string value)
+ public InsertImageAction WithId(string value)
{
- this.DisplayText = value;
+ this.Id = value;
return this;
}
- public MessageBackSubmitActionData WithValue(string value)
+ public InsertImageAction WithRequires(HostCapabilities value)
{
- this.Value = value;
+ this.Requires = value;
return this;
}
-}
-///
-/// Represents Teams-specific data in an Action.Submit to sign in a user.
-///
-public class SigninSubmitActionData : SerializableObject
-{
- ///
- /// Deserializes a JSON string into an object of type SigninSubmitActionData.
- ///
- public static SigninSubmitActionData? Deserialize(string json)
+ public InsertImageAction WithTitle(string value)
{
- return JsonSerializer.Deserialize(json);
+ this.Title = value;
+ return this;
}
- ///
- /// Must be **signin**.
- ///
- [JsonPropertyName("type")]
- public string Type { get; } = "signin";
+ public InsertImageAction WithIconUrl(string value)
+ {
+ this.IconUrl = value;
+ return this;
+ }
- ///
- /// The URL to redirect the end-user for signing in.
- ///
- [JsonPropertyName("value")]
- public string? Value { get; set; }
+ public InsertImageAction WithStyle(ActionStyle value)
+ {
+ this.Style = value;
+ return this;
+ }
- public SigninSubmitActionData(string value)
+ public InsertImageAction WithMode(ActionMode value)
{
- this.Value = value;
+ this.Mode = value;
+ return this;
}
- ///
- /// Serializes this SigninSubmitActionData into a JSON string.
- ///
- public string Serialize()
+ public InsertImageAction WithTooltip(string value)
{
- return JsonSerializer.Serialize(
- this,
- new JsonSerializerOptions
- {
- WriteIndented = true,
- DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
- }
- );
+ this.Tooltip = value;
+ return this;
}
- public SigninSubmitActionData WithValue(string value)
+ public InsertImageAction WithIsEnabled(bool value)
{
- this.Value = value;
+ this.IsEnabled = value;
return this;
}
-}
-///
-/// Represents Teams-specific data in an Action.Submit to open a task module.
-///
-public class TaskFetchSubmitActionData : SerializableObject
-{
- ///
- /// Deserializes a JSON string into an object of type TaskFetchSubmitActionData.
- ///
- public static TaskFetchSubmitActionData? Deserialize(string json)
+ public InsertImageAction WithMenuActions(params IList value)
{
- return JsonSerializer.Deserialize(json);
+ this.MenuActions = value;
+ return this;
}
- ///
- /// Must be **task/fetch**.
- ///
- [JsonPropertyName("type")]
- public string Type { get; } = "task/fetch";
+ public InsertImageAction WithThemedIconUrls(params IList value)
+ {
+ this.ThemedIconUrls = value;
+ return this;
+ }
- ///
- /// Serializes this TaskFetchSubmitActionData into a JSON string.
- ///
- public string Serialize()
+ public InsertImageAction WithUrl(string value)
{
- return JsonSerializer.Serialize(
- this,
- new JsonSerializerOptions
- {
- WriteIndented = true,
- DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
- }
- );
+ 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;
}
}
///
-/// 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.
+/// Opens the provided URL in either a separate browser tab or within the host application.
///
-public class SubmitAction : Action
+public class OpenUrlAction : Action
{
///
- /// Deserializes a JSON string into an object of type SubmitAction.
+ /// Deserializes a JSON string into an object of type OpenUrlAction.
///
- public static SubmitAction? Deserialize(string json)
+ public static OpenUrlAction? Deserialize(string json)
{
- return JsonSerializer.Deserialize(json);
+ return JsonSerializer.Deserialize(json);
}
///
- /// Must be **Action.Submit**.
+ /// Defines an optional key for the object. Keys are 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.Submit";
+ 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.
@@ -1854,7 +2060,7 @@ public class SubmitAction : Action
/// 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; }
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
///
/// The title of the action, as it appears on buttons.
@@ -1874,13 +2080,13 @@ public class SubmitAction : Action
/// Control the style of the action, affecting its visual and spoken representations.
///
[JsonPropertyName("style")]
- public ActionStyle? Style { get; set; }
+ 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; }
+ public ActionMode? Mode { get; set; } = ActionMode.Primary;
///
/// The tooltip text to display when the action is hovered over.
@@ -1892,28 +2098,25 @@ public class SubmitAction : Action
/// 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; }
+ public bool? IsEnabled { get; set; } = true;
///
- /// 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.
+ /// The actions to display in the overflow menu of a Split action button.
///
- [JsonPropertyName("data")]
- public IUnion? Data { get; set; }
+ [JsonPropertyName("menuActions")]
+ public IList? MenuActions { 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.
+ /// A set of theme-specific icon URLs.
///
- [JsonPropertyName("associatedInputs")]
- public AssociatedInputs? AssociatedInputs { get; set; }
+ [JsonPropertyName("themedIconUrls")]
+ public IList? ThemedIconUrls { get; set; }
///
- /// Controls if the action is enabled only if at least one required input has been filled by the user.
+ /// The URL to open.
///
- [JsonPropertyName("conditionallyEnabled")]
- public bool? ConditionallyEnabled { get; set; }
-
- [JsonPropertyName("msteams")]
- public TeamsSubmitActionProperties? Msteams { get; set; }
+ [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.
@@ -1921,8 +2124,13 @@ public class SubmitAction : Action
[JsonPropertyName("fallback")]
public IUnion? Fallback { get; set; }
+ public OpenUrlAction(string url)
+ {
+ this.Url = url;
+ }
+
///
- /// Serializes this SubmitAction into a JSON string.
+ /// Serializes this OpenUrlAction into a JSON string.
///
public string Serialize()
{
@@ -1936,79 +2144,79 @@ public string Serialize()
);
}
- public SubmitAction WithId(string value)
+ public OpenUrlAction WithKey(string value)
{
- this.Id = value;
+ this.Key = value;
return this;
}
- public SubmitAction WithRequires(HostCapabilities value)
+ public OpenUrlAction WithId(string value)
+ {
+ this.Id = value;
+ return this;
+ }
+
+ public OpenUrlAction WithRequires(HostCapabilities value)
{
this.Requires = value;
return this;
}
- public SubmitAction WithTitle(string value)
+ public OpenUrlAction WithTitle(string value)
{
this.Title = value;
return this;
}
- public SubmitAction WithIconUrl(string value)
+ public OpenUrlAction WithIconUrl(string value)
{
this.IconUrl = value;
return this;
}
- public SubmitAction WithStyle(ActionStyle value)
+ public OpenUrlAction WithStyle(ActionStyle value)
{
this.Style = value;
return this;
}
- public SubmitAction WithMode(ActionMode value)
+ public OpenUrlAction WithMode(ActionMode value)
{
this.Mode = value;
return this;
}
- public SubmitAction WithTooltip(string value)
+ public OpenUrlAction WithTooltip(string value)
{
this.Tooltip = value;
return this;
}
- public SubmitAction WithIsEnabled(bool value)
+ public OpenUrlAction WithIsEnabled(bool value)
{
this.IsEnabled = value;
return this;
}
- public SubmitAction WithData(IUnion value)
- {
- this.Data = value;
- return this;
- }
-
- public SubmitAction WithAssociatedInputs(AssociatedInputs value)
+ public OpenUrlAction WithMenuActions(params IList value)
{
- this.AssociatedInputs = value;
+ this.MenuActions = value;
return this;
}
- public SubmitAction WithConditionallyEnabled(bool value)
+ public OpenUrlAction WithThemedIconUrls(params IList value)
{
- this.ConditionallyEnabled = value;
+ this.ThemedIconUrls = value;
return this;
}
- public SubmitAction WithMsteams(TeamsSubmitActionProperties value)
+ public OpenUrlAction WithUrl(string value)
{
- this.Msteams = value;
+ this.Url = value;
return this;
}
- public SubmitAction WithFallback(IUnion value)
+ public OpenUrlAction WithFallback(IUnion value)
{
this.Fallback = value;
return this;
@@ -2016,105 +2224,29 @@ public SubmitAction WithFallback(IUnion value)
}
///
-/// Teams-specific properties associated with the action.
-///
-public class TeamsSubmitActionProperties : SerializableObject
-{
- ///
- /// Deserializes a JSON string into an object of type TeamsSubmitActionProperties.
- ///
- public static TeamsSubmitActionProperties? Deserialize(string json)
- {
- return JsonSerializer.Deserialize(json);
- }
-
- ///
- /// Defines 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;
- }
-}
-
-///
-/// Represents feedback options for an [Action.Submit](https://adaptivecards.microsoft.com/?topic=Action.Submit).
+/// Opens a task module in a modal dialog hosting the content at a provided URL.
///
-public class TeamsSubmitActionFeedback : SerializableObject
+public class OpenUrlDialogAction : Action
{
///
- /// 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.
+ /// Deserializes a JSON string into an object of type OpenUrlDialogAction.
///
- public string Serialize()
- {
- return JsonSerializer.Serialize(
- this,
- new JsonSerializerOptions
- {
- WriteIndented = true,
- DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
- }
- );
- }
-
- public TeamsSubmitActionFeedback WithHide(bool value)
+ public static OpenUrlDialogAction? Deserialize(string json)
{
- this.Hide = value;
- return this;
+ return JsonSerializer.Deserialize(json);
}
-}
-///
-/// 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.
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
///
- public static OpenUrlAction? Deserialize(string json)
- {
- return JsonSerializer.Deserialize(json);
- }
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
///
- /// Must be **Action.OpenUrl**.
+ /// Must be **Action.OpenUrlDialog**.
///
[JsonPropertyName("type")]
- public string Type { get; } = "Action.OpenUrl";
+ 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.
@@ -2126,7 +2258,7 @@ public class OpenUrlAction : Action
/// 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; }
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
///
/// The title of the action, as it appears on buttons.
@@ -2146,13 +2278,13 @@ public class OpenUrlAction : Action
/// Control the style of the action, affecting its visual and spoken representations.
///
[JsonPropertyName("style")]
- public ActionStyle? Style { get; set; }
+ 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; }
+ public ActionMode? Mode { get; set; } = ActionMode.Primary;
///
/// The tooltip text to display when the action is hovered over.
@@ -2164,7 +2296,37 @@ public class OpenUrlAction : Action
/// 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; }
+ 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.
@@ -2178,13 +2340,8 @@ public class OpenUrlAction : Action
[JsonPropertyName("fallback")]
public IUnion? Fallback { get; set; }
- public OpenUrlAction(string url)
- {
- this.Url = url;
- }
-
///
- /// Serializes this OpenUrlAction into a JSON string.
+ /// Serializes this OpenUrlDialogAction into a JSON string.
///
public string Serialize()
{
@@ -2198,61 +2355,97 @@ public string Serialize()
);
}
- public OpenUrlAction WithId(string value)
+ public OpenUrlDialogAction WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public OpenUrlDialogAction WithId(string value)
{
this.Id = value;
return this;
}
- public OpenUrlAction WithRequires(HostCapabilities value)
+ public OpenUrlDialogAction WithRequires(HostCapabilities value)
{
this.Requires = value;
return this;
}
- public OpenUrlAction WithTitle(string value)
+ public OpenUrlDialogAction WithTitle(string value)
{
this.Title = value;
return this;
}
- public OpenUrlAction WithIconUrl(string value)
+ public OpenUrlDialogAction WithIconUrl(string value)
{
this.IconUrl = value;
return this;
}
- public OpenUrlAction WithStyle(ActionStyle value)
+ public OpenUrlDialogAction WithStyle(ActionStyle value)
{
this.Style = value;
return this;
}
- public OpenUrlAction WithMode(ActionMode value)
+ public OpenUrlDialogAction WithMode(ActionMode value)
{
this.Mode = value;
return this;
}
- public OpenUrlAction WithTooltip(string value)
+ public OpenUrlDialogAction WithTooltip(string value)
{
this.Tooltip = value;
return this;
}
- public OpenUrlAction WithIsEnabled(bool value)
+ public OpenUrlDialogAction WithIsEnabled(bool value)
{
this.IsEnabled = value;
return this;
}
- public OpenUrlAction WithUrl(string value)
+ 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 OpenUrlAction WithFallback(IUnion value)
+ public OpenUrlDialogAction WithFallback(IUnion value)
{
this.Fallback = value;
return this;
@@ -2260,23 +2453,29 @@ public OpenUrlAction WithFallback(IUnion value)
}
///
-/// Toggles the visibility of a set of elements. Action.ToggleVisibility is useful for creating "Show more" type UI patterns.
+/// Resets the values of the inputs in the card.
///
-public class ToggleVisibilityAction : Action
+public class ResetInputsAction : Action
{
///
- /// Deserializes a JSON string into an object of type ToggleVisibilityAction.
+ /// Deserializes a JSON string into an object of type ResetInputsAction.
///
- public static ToggleVisibilityAction? Deserialize(string json)
+ public static ResetInputsAction? Deserialize(string json)
{
- return JsonSerializer.Deserialize(json);
+ return JsonSerializer.Deserialize(json);
}
///
- /// Must be **Action.ToggleVisibility**.
+ /// Defines an optional key for the object. Keys are 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.ToggleVisibility";
+ 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.
@@ -2288,7 +2487,7 @@ public class ToggleVisibilityAction : Action
/// 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; }
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
///
/// The title of the action, as it appears on buttons.
@@ -2308,13 +2507,13 @@ public class ToggleVisibilityAction : Action
/// Control the style of the action, affecting its visual and spoken representations.
///
[JsonPropertyName("style")]
- public ActionStyle? Style { get; set; }
+ 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; }
+ public ActionMode? Mode { get; set; } = ActionMode.Primary;
///
/// The tooltip text to display when the action is hovered over.
@@ -2326,13 +2525,25 @@ public class ToggleVisibilityAction : Action
/// 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; }
+ public bool? IsEnabled { get; set; } = true;
///
- /// The Ids of the elements to toggle the visibility of.
+ /// The actions to display in the overflow menu of a Split action button.
///
- [JsonPropertyName("targetElements")]
- public IUnion, IList>? TargetElements { get; set; }
+ [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.
@@ -2341,7 +2552,7 @@ public class ToggleVisibilityAction : Action
public IUnion? Fallback { get; set; }
///
- /// Serializes this ToggleVisibilityAction into a JSON string.
+ /// Serializes this ResetInputsAction into a JSON string.
///
public string Serialize()
{
@@ -2355,61 +2566,79 @@ public string Serialize()
);
}
- public ToggleVisibilityAction WithId(string value)
+ public ResetInputsAction WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public ResetInputsAction WithId(string value)
{
this.Id = value;
return this;
}
- public ToggleVisibilityAction WithRequires(HostCapabilities value)
+ public ResetInputsAction WithRequires(HostCapabilities value)
{
this.Requires = value;
return this;
}
- public ToggleVisibilityAction WithTitle(string value)
+ public ResetInputsAction WithTitle(string value)
{
this.Title = value;
return this;
}
- public ToggleVisibilityAction WithIconUrl(string value)
+ public ResetInputsAction WithIconUrl(string value)
{
this.IconUrl = value;
return this;
}
- public ToggleVisibilityAction WithStyle(ActionStyle value)
+ public ResetInputsAction WithStyle(ActionStyle value)
{
this.Style = value;
return this;
}
- public ToggleVisibilityAction WithMode(ActionMode value)
+ public ResetInputsAction WithMode(ActionMode value)
{
this.Mode = value;
return this;
}
- public ToggleVisibilityAction WithTooltip(string value)
+ public ResetInputsAction WithTooltip(string value)
{
this.Tooltip = value;
return this;
}
- public ToggleVisibilityAction WithIsEnabled(bool value)
+ public ResetInputsAction WithIsEnabled(bool value)
{
this.IsEnabled = value;
return this;
}
- public ToggleVisibilityAction WithTargetElements(IUnion, IList> value)
+ public ResetInputsAction WithMenuActions(params IList value)
{
- this.TargetElements = value;
+ this.MenuActions = value;
return this;
}
- public ToggleVisibilityAction WithFallback(IUnion value)
+ 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;
@@ -2417,76 +2646,29 @@ public ToggleVisibilityAction WithFallback(IUnion value)
}
///
-/// Defines a target element in an Action.ToggleVisibility.
+/// 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 TargetElement : SerializableObject
+public class SubmitAction : Action
{
///
- /// Deserializes a JSON string into an object of type TargetElement.
+ /// Deserializes a JSON string into an object of type SubmitAction.
///
- public static TargetElement? Deserialize(string json)
+ public static SubmitAction? Deserialize(string json)
{
- return JsonSerializer.Deserialize(json);
+ return JsonSerializer.Deserialize(json);
}
///
- /// The Id of the element to change the visibility of.
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
///
- [JsonPropertyName("elementId")]
- public string? ElementId { get; set; }
+ [JsonPropertyName("key")]
+ public string? Key { 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;
- }
-}
-
-///
-/// Expands or collapses an embedded card within the main card.
-///
-public class ShowCardAction : Action
-{
- ///
- /// Deserializes a JSON string into an object of type ShowCardAction.
- ///
- public static ShowCardAction? Deserialize(string json)
- {
- return JsonSerializer.Deserialize(json);
- }
-
- ///
- /// Must be **Action.ShowCard**.
+ /// Must be **Action.Submit**.
///
[JsonPropertyName("type")]
- public string Type { get; } = "Action.ShowCard";
+ 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.
@@ -2498,7 +2680,7 @@ public class ShowCardAction : Action
/// 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; }
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
///
/// The title of the action, as it appears on buttons.
@@ -2518,13 +2700,13 @@ public class ShowCardAction : Action
/// Control the style of the action, affecting its visual and spoken representations.
///
[JsonPropertyName("style")]
- public ActionStyle? Style { get; set; }
+ 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; }
+ public ActionMode? Mode { get; set; } = ActionMode.Primary;
///
/// The tooltip text to display when the action is hovered over.
@@ -2536,22 +2718,52 @@ public class ShowCardAction : Action
/// 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; }
+ public bool? IsEnabled { get; set; } = true;
///
- /// 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.
+ /// The actions to display in the overflow menu of a Split action button.
///
- [JsonPropertyName("fallback")]
- public IUnion? Fallback { get; set; }
+ [JsonPropertyName("menuActions")]
+ public IList? MenuActions { get; set; }
///
- /// The card that should be displayed when the action is executed.
+ /// A set of theme-specific icon URLs.
///
- [JsonPropertyName("card")]
- public AdaptiveCard? Card { get; set; }
+ [JsonPropertyName("themedIconUrls")]
+ public IList? ThemedIconUrls { get; set; }
///
- /// Serializes this ShowCardAction into a JSON string.
+ /// The data to send to the Bot when the action is executed. When expressed as an object, `data` is sent back to the Bot when the action is executed, adorned with the values of the inputs expressed as key/value pairs, where the key is the Id of the input. If `data` is expressed as a string, input values are not sent to the Bot.
+ ///
+ [JsonPropertyName("data")]
+ public IUnion? Data { get; set; }
+
+ ///
+ /// The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
+ ///
+ [JsonPropertyName("associatedInputs")]
+ public AssociatedInputs? AssociatedInputs { get; set; }
+
+ ///
+ /// Controls if the action is enabled only if at least one required input has been filled by the user.
+ ///
+ [JsonPropertyName("conditionallyEnabled")]
+ public bool? ConditionallyEnabled { get; set; } = false;
+
+ ///
+ /// Teams-specific metadata associated with the action.
+ ///
+ [JsonPropertyName("msteams")]
+ public TeamsSubmitActionProperties? Msteams { get; set; }
+
+ ///
+ /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
+ ///
+ [JsonPropertyName("fallback")]
+ public IUnion? Fallback { get; set; }
+
+ ///
+ /// Serializes this SubmitAction into a JSON string.
///
public string Serialize()
{
@@ -2565,85 +2777,127 @@ public string Serialize()
);
}
- public ShowCardAction WithId(string value)
+ public SubmitAction WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public SubmitAction WithId(string value)
{
this.Id = value;
return this;
}
- public ShowCardAction WithRequires(HostCapabilities value)
+ public SubmitAction WithRequires(HostCapabilities value)
{
this.Requires = value;
return this;
}
- public ShowCardAction WithTitle(string value)
+ public SubmitAction WithTitle(string value)
{
this.Title = value;
return this;
}
- public ShowCardAction WithIconUrl(string value)
+ public SubmitAction WithIconUrl(string value)
{
this.IconUrl = value;
return this;
}
- public ShowCardAction WithStyle(ActionStyle value)
+ public SubmitAction WithStyle(ActionStyle value)
{
this.Style = value;
return this;
}
- public ShowCardAction WithMode(ActionMode value)
+ public SubmitAction WithMode(ActionMode value)
{
this.Mode = value;
return this;
}
- public ShowCardAction WithTooltip(string value)
+ public SubmitAction WithTooltip(string value)
{
this.Tooltip = value;
return this;
}
- public ShowCardAction WithIsEnabled(bool value)
+ public SubmitAction WithIsEnabled(bool value)
{
this.IsEnabled = value;
return this;
}
- public ShowCardAction WithFallback(IUnion value)
+ public SubmitAction WithMenuActions(params IList value)
{
- this.Fallback = value;
+ this.MenuActions = value;
return this;
}
- public ShowCardAction WithCard(AdaptiveCard value)
+ public SubmitAction WithThemedIconUrls(params IList value)
{
- this.Card = 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 WithFallback(IUnion value)
+ {
+ this.Fallback = value;
return this;
}
}
///
-/// Resets the values of the inputs in the card.
+/// Toggles the visibility of a set of elements. Action.ToggleVisibility is useful for creating "Show more" type UI patterns.
///
-public class ResetInputsAction : Action
+public class ToggleVisibilityAction : Action
{
///
- /// Deserializes a JSON string into an object of type ResetInputsAction.
+ /// Deserializes a JSON string into an object of type ToggleVisibilityAction.
///
- public static ResetInputsAction? Deserialize(string json)
+ public static ToggleVisibilityAction? Deserialize(string json)
{
- return JsonSerializer.Deserialize(json);
+ return JsonSerializer.Deserialize(json);
}
///
- /// Must be **Action.ResetInputs**.
+ /// Defines an optional key for the object. Keys are 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.ResetInputs";
+ 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.
@@ -2655,7 +2909,7 @@ public class ResetInputsAction : Action
/// 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; }
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
///
/// The title of the action, as it appears on buttons.
@@ -2675,13 +2929,13 @@ public class ResetInputsAction : Action
/// Control the style of the action, affecting its visual and spoken representations.
///
[JsonPropertyName("style")]
- public ActionStyle? Style { get; set; }
+ 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; }
+ public ActionMode? Mode { get; set; } = ActionMode.Primary;
///
/// The tooltip text to display when the action is hovered over.
@@ -2693,13 +2947,25 @@ public class ResetInputsAction : Action
/// 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; }
+ public bool? IsEnabled { get; set; } = true;
///
- /// The Ids of the inputs that should be reset.
+ /// The actions to display in the overflow menu of a Split action button.
///
- [JsonPropertyName("targetInputIds")]
- public IList? TargetInputIds { get; set; }
+ [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.
@@ -2708,7 +2974,7 @@ public class ResetInputsAction : Action
public IUnion? Fallback { get; set; }
///
- /// Serializes this ResetInputsAction into a JSON string.
+ /// Serializes this ToggleVisibilityAction into a JSON string.
///
public string Serialize()
{
@@ -2722,61 +2988,79 @@ public string Serialize()
);
}
- public ResetInputsAction WithId(string value)
+ public ToggleVisibilityAction WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public ToggleVisibilityAction WithId(string value)
{
this.Id = value;
return this;
}
- public ResetInputsAction WithRequires(HostCapabilities value)
+ public ToggleVisibilityAction WithRequires(HostCapabilities value)
{
this.Requires = value;
return this;
}
- public ResetInputsAction WithTitle(string value)
+ public ToggleVisibilityAction WithTitle(string value)
{
this.Title = value;
return this;
}
- public ResetInputsAction WithIconUrl(string value)
+ public ToggleVisibilityAction WithIconUrl(string value)
{
this.IconUrl = value;
return this;
}
- public ResetInputsAction WithStyle(ActionStyle value)
+ public ToggleVisibilityAction WithStyle(ActionStyle value)
{
this.Style = value;
return this;
}
- public ResetInputsAction WithMode(ActionMode value)
+ public ToggleVisibilityAction WithMode(ActionMode value)
{
this.Mode = value;
return this;
}
- public ResetInputsAction WithTooltip(string value)
+ public ToggleVisibilityAction WithTooltip(string value)
{
this.Tooltip = value;
return this;
}
- public ResetInputsAction WithIsEnabled(bool value)
+ public ToggleVisibilityAction WithIsEnabled(bool value)
{
this.IsEnabled = value;
return this;
}
- public ResetInputsAction WithTargetInputIds(params IList value)
+ public ToggleVisibilityAction WithMenuActions(params IList value)
{
- this.TargetInputIds = value;
+ this.MenuActions = value;
return this;
}
- public ResetInputsAction WithFallback(IUnion value)
+ 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;
@@ -2784,61 +3068,185 @@ public ResetInputsAction WithFallback(IUnion value)
}
///
-/// Inserts an image into the host application's canvas.
+/// Defines a theme-specific URL.
///
-public class InsertImageAction : Action
+public class ThemedUrl : SerializableObject
{
///
- /// Deserializes a JSON string into an object of type InsertImageAction.
+ /// Deserializes a JSON string into an object of type ThemedUrl.
///
- public static InsertImageAction? Deserialize(string json)
+ public static ThemedUrl? Deserialize(string json)
{
- return JsonSerializer.Deserialize(json);
+ return JsonSerializer.Deserialize(json);
}
///
- /// Must be **Action.InsertImage**.
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
///
- [JsonPropertyName("type")]
- public string Type { get; } = "Action.InsertImage";
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
///
- /// 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.
+ /// The theme this URL applies to.
///
- [JsonPropertyName("id")]
- public string? Id { get; set; }
+ [JsonPropertyName("theme")]
+ public ThemeName? Theme { get; set; } = ThemeName.Light;
///
- /// 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).
+ /// The URL to use for the associated theme.
///
- [JsonPropertyName("requires")]
- public HostCapabilities? Requires { get; set; }
+ [JsonPropertyName("url")]
+ public string? Url { get; set; }
///
- /// The title of the action, as it appears on buttons.
+ /// Serializes this ThemedUrl into a JSON string.
///
- [JsonPropertyName("title")]
- public string? Title { get; set; }
+ public string Serialize()
+ {
+ return JsonSerializer.Serialize(
+ this,
+ new JsonSerializerOptions
+ {
+ WriteIndented = true,
+ DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
+ }
+ );
+ }
- ///
- /// 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; }
+ public ThemedUrl WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
- ///
- /// Control the style of the action, affecting its visual and spoken representations.
- ///
+ public ThemedUrl WithTheme(ThemeName value)
+ {
+ this.Theme = value;
+ return this;
+ }
+
+ public ThemedUrl WithUrl(string value)
+ {
+ this.Url = value;
+ return this;
+ }
+}
+
+///
+/// Defines a target element in an Action.ToggleVisibility.
+///
+public class TargetElement : SerializableObject
+{
+ ///
+ /// Deserializes a JSON string into an object of type TargetElement.
+ ///
+ public static TargetElement? Deserialize(string json)
+ {
+ return JsonSerializer.Deserialize(json);
+ }
+
+ ///
+ /// The Id of the element to change the visibility of.
+ ///
+ [JsonPropertyName("elementId")]
+ public string? ElementId { get; set; }
+
+ ///
+ /// The new visibility state of the element.
+ ///
+ [JsonPropertyName("isVisible")]
+ public bool? IsVisible { get; set; }
+
+ ///
+ /// Serializes this TargetElement into a JSON string.
+ ///
+ public string Serialize()
+ {
+ return JsonSerializer.Serialize(
+ this,
+ new JsonSerializerOptions
+ {
+ WriteIndented = true,
+ DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
+ }
+ );
+ }
+
+ public TargetElement WithElementId(string value)
+ {
+ this.ElementId = value;
+ return this;
+ }
+
+ public TargetElement WithIsVisible(bool value)
+ {
+ this.IsVisible = value;
+ return this;
+ }
+}
+
+///
+/// Expands or collapses an embedded card within the main card.
+///
+public class ShowCardAction : Action
+{
+ ///
+ /// Deserializes a JSON string into an object of type ShowCardAction.
+ ///
+ public static ShowCardAction? Deserialize(string json)
+ {
+ return JsonSerializer.Deserialize(json);
+ }
+
+ ///
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
+ ///
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
+
+ ///
+ /// Must be **Action.ShowCard**.
+ ///
+ [JsonPropertyName("type")]
+ public string Type { get; } = "Action.ShowCard";
+
+ ///
+ /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
+ ///
+ [JsonPropertyName("id")]
+ public string? Id { get; set; }
+
+ ///
+ /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
+ ///
+ [JsonPropertyName("requires")]
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
+
+ ///
+ /// The title of the action, as it appears on buttons.
+ ///
+ [JsonPropertyName("title")]
+ public string? Title { get; set; }
+
+ ///
+ /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title.
+ ///
+ /// `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image.
+ ///
+ [JsonPropertyName("iconUrl")]
+ public string? IconUrl { get; set; }
+
+ ///
+ /// Control the style of the action, affecting its visual and spoken representations.
+ ///
[JsonPropertyName("style")]
- public ActionStyle? Style { get; set; }
+ 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; }
+ public ActionMode? Mode { get; set; } = ActionMode.Primary;
///
/// The tooltip text to display when the action is hovered over.
@@ -2850,25 +3258,19 @@ public class InsertImageAction : Action
/// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state.
///
[JsonPropertyName("isEnabled")]
- public bool? IsEnabled { get; set; }
-
- ///
- /// The URL of the image to insert.
- ///
- [JsonPropertyName("url")]
- public string? Url { get; set; }
+ public bool? IsEnabled { get; set; } = true;
///
- /// The alternate text for the image.
+ /// The actions to display in the overflow menu of a Split action button.
///
- [JsonPropertyName("altText")]
- public string? AltText { get; set; }
+ [JsonPropertyName("menuActions")]
+ public IList? MenuActions { get; set; }
///
- /// The position at which to insert the image.
+ /// A set of theme-specific icon URLs.
///
- [JsonPropertyName("insertPosition")]
- public ImageInsertPosition? InsertPosition { get; set; }
+ [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.
@@ -2877,7 +3279,13 @@ public class InsertImageAction : Action
public IUnion? Fallback { get; set; }
///
- /// Serializes this InsertImageAction into a JSON string.
+ /// 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()
{
@@ -2891,201 +3299,198 @@ public string Serialize()
);
}
- public InsertImageAction WithId(string value)
+ public ShowCardAction WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public ShowCardAction WithId(string value)
{
this.Id = value;
return this;
}
- public InsertImageAction WithRequires(HostCapabilities value)
+ public ShowCardAction WithRequires(HostCapabilities value)
{
this.Requires = value;
return this;
}
- public InsertImageAction WithTitle(string value)
+ public ShowCardAction WithTitle(string value)
{
this.Title = value;
return this;
}
- public InsertImageAction WithIconUrl(string value)
+ public ShowCardAction WithIconUrl(string value)
{
this.IconUrl = value;
return this;
}
- public InsertImageAction WithStyle(ActionStyle value)
+ public ShowCardAction WithStyle(ActionStyle value)
{
this.Style = value;
return this;
}
- public InsertImageAction WithMode(ActionMode value)
+ public ShowCardAction WithMode(ActionMode value)
{
this.Mode = value;
return this;
}
- public InsertImageAction WithTooltip(string value)
+ public ShowCardAction WithTooltip(string value)
{
this.Tooltip = value;
return this;
}
- public InsertImageAction WithIsEnabled(bool value)
+ public ShowCardAction WithIsEnabled(bool value)
{
this.IsEnabled = value;
return this;
}
- public InsertImageAction WithUrl(string value)
+ public ShowCardAction WithMenuActions(params IList value)
{
- this.Url = value;
+ this.MenuActions = value;
return this;
}
- public InsertImageAction WithAltText(string value)
+ public ShowCardAction WithThemedIconUrls(params IList value)
{
- this.AltText = value;
+ this.ThemedIconUrls = value;
return this;
}
- public InsertImageAction WithInsertPosition(ImageInsertPosition value)
+ public ShowCardAction WithFallback(IUnion value)
{
- this.InsertPosition = value;
+ this.Fallback = value;
return this;
}
- public InsertImageAction WithFallback(IUnion value)
+ public ShowCardAction WithCard(AdaptiveCard value)
{
- this.Fallback = value;
+ this.Card = value;
return this;
}
}
///
-/// A layout that stacks elements on top of each other. Layout.Stack is the default layout used by AdaptiveCard and all containers.
+/// Shows a popover to display more information to the user.
///
-public class StackLayout : ContainerLayout
+public class PopoverAction : Action
{
///
- /// Deserializes a JSON string into an object of type StackLayout.
+ /// Deserializes a JSON string into an object of type PopoverAction.
///
- public static StackLayout? Deserialize(string json)
+ public static PopoverAction? Deserialize(string json)
{
- return JsonSerializer.Deserialize(json);
+ return JsonSerializer.Deserialize(json);
}
///
- /// Must be **Layout.Stack**.
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
///
- [JsonPropertyName("type")]
- public string Type { get; } = "Layout.Stack";
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
///
- /// Controls for which card width the layout should be used.
+ /// Must be **Action.Popover**.
///
- [JsonPropertyName("targetWidth")]
- public TargetWidth? TargetWidth { get; set; }
+ [JsonPropertyName("type")]
+ public string Type { get; } = "Action.Popover";
///
- /// Serializes this StackLayout into a JSON string.
+ /// 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.
///
- public string Serialize()
- {
- return JsonSerializer.Serialize(
- this,
- new JsonSerializerOptions
- {
- WriteIndented = true,
- DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
- }
- );
- }
-
- public StackLayout WithTargetWidth(TargetWidth value)
- {
- this.TargetWidth = value;
- return this;
- }
-}
+ [JsonPropertyName("id")]
+ public string? Id { get; set; }
-///
-/// A layout that spreads elements horizontally and wraps them across multiple rows, as needed.
-///
-public class FlowLayout : ContainerLayout
-{
///
- /// Deserializes a JSON string into an object of type FlowLayout.
+ /// 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).
///
- public static FlowLayout? Deserialize(string json)
- {
- return JsonSerializer.Deserialize(json);
- }
+ [JsonPropertyName("requires")]
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
///
- /// Must be **Layout.Flow**.
+ /// The title of the action, as it appears on buttons.
///
- [JsonPropertyName("type")]
- public string Type { get; } = "Layout.Flow";
+ [JsonPropertyName("title")]
+ public string? Title { get; set; }
///
- /// Controls for which card width the layout should be used.
+ /// 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("targetWidth")]
- public TargetWidth? TargetWidth { get; set; }
+ [JsonPropertyName("iconUrl")]
+ public string? IconUrl { get; set; }
///
- /// Controls how the content of the container should be horizontally aligned.
+ /// Control the style of the action, affecting its visual and spoken representations.
///
- [JsonPropertyName("horizontalItemsAlignment")]
- public HorizontalAlignment? HorizontalItemsAlignment { get; set; }
+ [JsonPropertyName("style")]
+ public ActionStyle? Style { get; set; } = ActionStyle.Default;
///
- /// Controls how the content of the container should be vertically aligned.
+ /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.
///
- [JsonPropertyName("verticalItemsAlignment")]
- public VerticalAlignment? VerticalItemsAlignment { get; set; }
+ [JsonPropertyName("mode")]
+ public ActionMode? Mode { get; set; } = ActionMode.Primary;
///
- /// Controls how item should fit inside the container.
+ /// The tooltip text to display when the action is hovered over.
///
- [JsonPropertyName("itemFit")]
- public FlowLayoutItemFit? ItemFit { get; set; }
+ [JsonPropertyName("tooltip")]
+ public string? Tooltip { get; set; }
///
- /// The minimum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is 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("minItemWidth")]
- public string? MinItemWidth { get; set; }
+ [JsonPropertyName("isEnabled")]
+ public bool? IsEnabled { get; set; } = true;
///
- /// The maximum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set.
+ /// A set of theme-specific icon URLs.
///
- [JsonPropertyName("maxItemWidth")]
- public string? MaxItemWidth { get; set; }
+ [JsonPropertyName("themedIconUrls")]
+ public IList? ThemedIconUrls { get; set; }
///
- /// The width, in pixels, of each item, in the `px` format. Should not be used if maxItemWidth and/or minItemWidth are set.
+ /// The content of the popover, which can be any element.
///
- [JsonPropertyName("itemWidth")]
- public string? ItemWidth { get; set; }
+ [JsonPropertyName("content")]
+ public CardElement? Content { get; set; }
///
- /// The space between items.
+ /// Controls if an arrow should be displayed towards the element that triggered the popover.
///
- [JsonPropertyName("columnSpacing")]
- public Spacing? ColumnSpacing { get; set; }
+ [JsonPropertyName("displayArrow")]
+ public bool? DisplayArrow { get; set; } = true;
///
- /// The space between rows of items.
+ /// Controls where the popover should be displayed with regards to the element that triggered it.
///
- [JsonPropertyName("rowSpacing")]
- public Spacing? RowSpacing { get; set; }
+ [JsonPropertyName("position")]
+ public PopoverPosition? Position { get; set; } = PopoverPosition.Above;
///
- /// Serializes this FlowLayout into a JSON string.
+ /// 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()
{
@@ -3099,284 +3504,207 @@ public string Serialize()
);
}
- public FlowLayout WithTargetWidth(TargetWidth value)
+ public PopoverAction WithKey(string value)
{
- this.TargetWidth = value;
+ this.Key = value;
return this;
}
- public FlowLayout WithHorizontalItemsAlignment(HorizontalAlignment value)
+ public PopoverAction WithId(string value)
{
- this.HorizontalItemsAlignment = value;
+ this.Id = value;
return this;
}
- public FlowLayout WithVerticalItemsAlignment(VerticalAlignment value)
+ public PopoverAction WithRequires(HostCapabilities value)
{
- this.VerticalItemsAlignment = value;
+ this.Requires = value;
return this;
}
- public FlowLayout WithItemFit(FlowLayoutItemFit value)
+ public PopoverAction WithTitle(string value)
{
- this.ItemFit = value;
+ this.Title = value;
return this;
}
- public FlowLayout WithMinItemWidth(string value)
+ public PopoverAction WithIconUrl(string value)
{
- this.MinItemWidth = value;
+ this.IconUrl = value;
return this;
}
- public FlowLayout WithMaxItemWidth(string value)
+ public PopoverAction WithStyle(ActionStyle value)
{
- this.MaxItemWidth = value;
+ this.Style = value;
return this;
}
- public FlowLayout WithItemWidth(string value)
+ public PopoverAction WithMode(ActionMode value)
{
- this.ItemWidth = value;
+ this.Mode = value;
return this;
}
- public FlowLayout WithColumnSpacing(Spacing value)
+ public PopoverAction WithTooltip(string value)
{
- this.ColumnSpacing = value;
+ this.Tooltip = value;
return this;
}
- public FlowLayout WithRowSpacing(Spacing value)
+ public PopoverAction WithIsEnabled(bool value)
{
- this.RowSpacing = value;
+ this.IsEnabled = 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);
- }
-
- ///
- /// Must be **Layout.AreaGrid**.
- ///
- [JsonPropertyName("type")]
- public string Type { get; } = "Layout.AreaGrid";
-
- ///
- /// Controls for which card width the layout should be used.
- ///
- [JsonPropertyName("targetWidth")]
- public TargetWidth? TargetWidth { get; set; }
-
- ///
- /// The columns in the grid layout, defined as a percentage of the available width or in pixels using the `px` format.
- ///
- [JsonPropertyName("columns")]
- public IUnion, IList>? Columns { get; set; }
-
- ///
- /// The areas in the grid layout.
- ///
- [JsonPropertyName("areas")]
- public IList? Areas { get; set; }
-
- ///
- /// The space between columns.
- ///
- [JsonPropertyName("columnSpacing")]
- public Spacing? ColumnSpacing { get; set; }
-
- ///
- /// The space between rows.
- ///
- [JsonPropertyName("rowSpacing")]
- public Spacing? RowSpacing { get; set; }
- ///
- /// Serializes this AreaGridLayout into a JSON string.
- ///
- public string Serialize()
+ public PopoverAction WithThemedIconUrls(params IList value)
{
- return JsonSerializer.Serialize(
- this,
- new JsonSerializerOptions
- {
- WriteIndented = true,
- DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
- }
- );
+ this.ThemedIconUrls = value;
+ return this;
}
- public AreaGridLayout WithTargetWidth(TargetWidth value)
+ public PopoverAction WithContent(CardElement value)
{
- this.TargetWidth = value;
+ this.Content = value;
return this;
}
- public AreaGridLayout WithColumns(IUnion, IList> value)
+ public PopoverAction WithDisplayArrow(bool value)
{
- this.Columns = value;
+ this.DisplayArrow = value;
return this;
}
- public AreaGridLayout WithAreas(params IList value)
+ public PopoverAction WithPosition(PopoverPosition value)
{
- this.Areas = value;
+ this.Position = value;
return this;
}
- public AreaGridLayout WithColumnSpacing(Spacing value)
+ public PopoverAction WithMaxPopoverWidth(string value)
{
- this.ColumnSpacing = value;
+ this.MaxPopoverWidth = value;
return this;
}
- public AreaGridLayout WithRowSpacing(Spacing value)
+ public PopoverAction WithFallback(IUnion value)
{
- this.RowSpacing = value;
+ this.Fallback = value;
return this;
}
}
///
-/// Defines an area in a Layout.AreaGrid layout.
+/// Displays a set of action, which can be placed anywhere in the card.
///
-public class GridArea : SerializableObject
+public class ActionSet : CardElement
{
///
- /// Deserializes a JSON string into an object of type GridArea.
+ /// Deserializes a JSON string into an object of type ActionSet.
///
- public static GridArea? Deserialize(string json)
+ public static ActionSet? Deserialize(string json)
{
- return JsonSerializer.Deserialize(json);
+ return JsonSerializer.Deserialize(json);
}
///
- /// The name of the area. To place an element in this area, set its `grid.area` property to match the name of the area.
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
///
- [JsonPropertyName("name")]
- public string? Name { get; set; }
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
///
- /// The start column index of the area. Column indices start at 1.
+ /// Must be **ActionSet**.
///
- [JsonPropertyName("column")]
- public float? Column { get; set; }
+ [JsonPropertyName("type")]
+ public string Type { get; } = "ActionSet";
///
- /// Defines how many columns the area should span.
+ /// 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("columnSpan")]
- public float? ColumnSpan { get; set; }
+ [JsonPropertyName("id")]
+ public string? Id { get; set; }
///
- /// The start row index of the area. Row indices start at 1.
+ /// 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("row")]
- public float? Row { get; set; }
+ [JsonPropertyName("requires")]
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
///
- /// Defines how many rows the area should span.
+ /// The locale associated with the element.
///
- [JsonPropertyName("rowSpan")]
- public float? RowSpan { get; set; }
+ [JsonPropertyName("lang")]
+ public string? Lang { get; set; }
///
- /// Serializes this GridArea into a JSON string.
+ /// Controls the visibility of the element.
///
- public string Serialize()
- {
- return JsonSerializer.Serialize(
- this,
- new JsonSerializerOptions
- {
- WriteIndented = true,
- DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
- }
- );
- }
-
- public GridArea WithName(string value)
- {
- this.Name = value;
- return this;
- }
+ [JsonPropertyName("isVisible")]
+ public bool? IsVisible { get; set; } = true;
- public GridArea WithColumn(float value)
- {
- this.Column = value;
- return this;
- }
+ ///
+ /// 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;
- public GridArea WithColumnSpan(float value)
- {
- this.ColumnSpan = value;
- return this;
- }
+ ///
+ /// 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;
- public GridArea WithRow(float value)
- {
- this.Row = value;
- return this;
- }
+ ///
+ /// Controls how the element should be horizontally aligned.
+ ///
+ [JsonPropertyName("horizontalAlignment")]
+ public HorizontalAlignment? HorizontalAlignment { get; set; }
- public GridArea WithRowSpan(float value)
- {
- this.RowSpan = value;
- return this;
- }
-}
+ ///
+ /// 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;
-///
-/// Defines a container's background image and the way it should be rendered.
-///
-public class BackgroundImage : SerializableObject
-{
///
- /// Deserializes a JSON string into an object of type BackgroundImage.
+ /// 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).
///
- public static BackgroundImage? Deserialize(string json)
- {
- return JsonSerializer.Deserialize(json);
- }
+ [JsonPropertyName("targetWidth")]
+ public TargetWidth? TargetWidth { get; set; }
///
- /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG.
+ /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
///
- [JsonPropertyName("url")]
- public string? Url { get; set; }
+ [JsonPropertyName("isSortKey")]
+ public bool? IsSortKey { get; set; } = false;
///
- /// Controls how the image should fill the area.
+ /// The area of a Layout.AreaGrid layout in which an element should be displayed.
///
- [JsonPropertyName("fillMode")]
- public FillMode? FillMode { get; set; }
+ [JsonPropertyName("grid.area")]
+ public string? GridArea { get; set; }
///
- /// Controls how the image should be aligned if it must be cropped or if using repeat fill mode.
+ /// 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("horizontalAlignment")]
- public HorizontalAlignment? HorizontalAlignment { get; set; }
+ [JsonPropertyName("fallback")]
+ public IUnion? Fallback { get; set; }
///
- /// Controls how the image should be aligned if it must be cropped or if using repeat fill mode.
+ /// The actions in the set.
///
- [JsonPropertyName("verticalAlignment")]
- public VerticalAlignment? VerticalAlignment { get; set; }
+ [JsonPropertyName("actions")]
+ public IList? Actions { get; set; }
+
+ public ActionSet(params IList actions)
+ {
+ this.Actions = actions;
+ }
///
- /// Serializes this BackgroundImage into a JSON string.
+ /// Serializes this ActionSet into a JSON string.
///
public string Serialize()
{
@@ -3390,58 +3718,1721 @@ public string Serialize()
);
}
- public BackgroundImage WithUrl(string value)
+ public ActionSet WithKey(string value)
{
- this.Url = value;
+ this.Key = value;
return this;
}
- public BackgroundImage WithFillMode(FillMode value)
+ public ActionSet WithId(string value)
{
- this.FillMode = value;
+ this.Id = value;
return this;
}
- public BackgroundImage WithHorizontalAlignment(HorizontalAlignment value)
+ public ActionSet WithRequires(HostCapabilities value)
{
- this.HorizontalAlignment = value;
+ this.Requires = value;
return this;
}
- public BackgroundImage WithVerticalAlignment(VerticalAlignment value)
+ public ActionSet WithLang(string value)
{
- this.VerticalAlignment = value;
+ this.Lang = value;
return this;
}
-}
-///
-/// Defines how a card can be refreshed by making a request to the target Bot.
-///
-public class RefreshDefinition : SerializableObject
+ public ActionSet WithIsVisible(bool value)
+ {
+ this.IsVisible = value;
+ return this;
+ }
+
+ public ActionSet WithSeparator(bool value)
+ {
+ this.Separator = value;
+ return this;
+ }
+
+ public ActionSet WithHeight(ElementHeight value)
+ {
+ this.Height = value;
+ return this;
+ }
+
+ public ActionSet WithHorizontalAlignment(HorizontalAlignment value)
+ {
+ this.HorizontalAlignment = value;
+ return this;
+ }
+
+ public ActionSet WithSpacing(Spacing value)
+ {
+ this.Spacing = value;
+ return this;
+ }
+
+ public ActionSet WithTargetWidth(TargetWidth value)
+ {
+ this.TargetWidth = value;
+ return this;
+ }
+
+ public ActionSet WithIsSortKey(bool value)
+ {
+ this.IsSortKey = value;
+ return this;
+ }
+
+ public ActionSet WithGridArea(string value)
+ {
+ this.GridArea = value;
+ return this;
+ }
+
+ public ActionSet WithFallback(IUnion value)
+ {
+ this.Fallback = value;
+ return this;
+ }
+
+ public ActionSet WithActions(params IList value)
+ {
+ this.Actions = value;
+ return this;
+ }
+}
+
+///
+/// A container for other elements. Use containers for styling purposes and/or to logically group a set of elements together, which can be especially useful when used with Action.ToggleVisibility.
+///
+public class Container : CardElement
+{
+ ///
+ /// Deserializes a JSON string into an object of type Container.
+ ///
+ public static Container? Deserialize(string json)
+ {
+ return JsonSerializer.Deserialize(json);
+ }
+
+ ///
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
+ ///
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
+
+ ///
+ /// Must be **Container**.
+ ///
+ [JsonPropertyName("type")]
+ public string Type { get; } = "Container";
+
+ ///
+ /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
+ ///
+ [JsonPropertyName("id")]
+ public string? Id { get; set; }
+
+ ///
+ /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
+ ///
+ [JsonPropertyName("requires")]
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
+
+ ///
+ /// The locale associated with the element.
+ ///
+ [JsonPropertyName("lang")]
+ public string? Lang { get; set; }
+
+ ///
+ /// Controls the visibility of the element.
+ ///
+ [JsonPropertyName("isVisible")]
+ public bool? IsVisible { get; set; } = true;
+
+ ///
+ /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
+ ///
+ [JsonPropertyName("separator")]
+ public bool? Separator { get; set; } = false;
+
+ ///
+ /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
+ ///
+ [JsonPropertyName("height")]
+ public ElementHeight? Height { get; set; } = ElementHeight.Auto;
+
+ ///
+ /// Controls how the element should be horizontally aligned.
+ ///
+ [JsonPropertyName("horizontalAlignment")]
+ public HorizontalAlignment? HorizontalAlignment { get; set; }
+
+ ///
+ /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
+ ///
+ [JsonPropertyName("spacing")]
+ public Spacing? Spacing { get; set; } = Spacing.Default;
+
+ ///
+ /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
+ ///
+ [JsonPropertyName("targetWidth")]
+ public TargetWidth? TargetWidth { get; set; }
+
+ ///
+ /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
+ ///
+ [JsonPropertyName("isSortKey")]
+ public bool? IsSortKey { get; set; } = false;
+
+ ///
+ /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported.
+ ///
+ [JsonPropertyName("selectAction")]
+ public Action? SelectAction { get; set; }
+
+ ///
+ /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met.
+ ///
+ [JsonPropertyName("style")]
+ public ContainerStyle? Style { get; set; }
+
+ ///
+ /// Controls if a border should be displayed around the container.
+ ///
+ [JsonPropertyName("showBorder")]
+ public bool? ShowBorder { get; set; } = false;
+
+ ///
+ /// Controls if the container should have rounded corners.
+ ///
+ [JsonPropertyName("roundedCorners")]
+ public bool? RoundedCorners { get; set; } = false;
+
+ ///
+ /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details.
+ ///
+ [JsonPropertyName("layouts")]
+ public IList? Layouts { get; set; }
+
+ ///
+ /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding.
+ ///
+ [JsonPropertyName("bleed")]
+ public bool? Bleed { get; set; } = false;
+
+ ///
+ /// The minimum height, in pixels, of the container, in the `px` format.
+ ///
+ [JsonPropertyName("minHeight")]
+ public string? MinHeight { get; set; }
+
+ ///
+ /// Defines the container's background image.
+ ///
+ [JsonPropertyName("backgroundImage")]
+ public IUnion? BackgroundImage { get; set; }
+
+ ///
+ /// Controls how the container's content should be vertically aligned.
+ ///
+ [JsonPropertyName("verticalContentAlignment")]
+ public VerticalAlignment? VerticalContentAlignment { get; set; }
+
+ ///
+ /// Controls if the content of the card is to be rendered left-to-right or right-to-left.
+ ///
+ [JsonPropertyName("rtl")]
+ public bool? Rtl { get; set; }
+
+ ///
+ /// The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed.
+ ///
+ [JsonPropertyName("maxHeight")]
+ public string? MaxHeight { get; set; }
+
+ ///
+ /// The area of a Layout.AreaGrid layout in which an element should be displayed.
+ ///
+ [JsonPropertyName("grid.area")]
+ public string? GridArea { get; set; }
+
+ ///
+ /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
+ ///
+ [JsonPropertyName("fallback")]
+ public IUnion? Fallback { get; set; }
+
+ ///
+ /// The elements in the container.
+ ///
+ [JsonPropertyName("items")]
+ public IList? Items { get; set; }
+
+ public Container(params IList items)
+ {
+ this.Items = items;
+ }
+
+ ///
+ /// Serializes this Container into a JSON string.
+ ///
+ public string Serialize()
+ {
+ return JsonSerializer.Serialize(
+ this,
+ new JsonSerializerOptions
+ {
+ WriteIndented = true,
+ DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
+ }
+ );
+ }
+
+ public Container WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public Container WithId(string value)
+ {
+ this.Id = value;
+ return this;
+ }
+
+ public Container WithRequires(HostCapabilities value)
+ {
+ this.Requires = value;
+ return this;
+ }
+
+ public Container WithLang(string value)
+ {
+ this.Lang = value;
+ return this;
+ }
+
+ public Container WithIsVisible(bool value)
+ {
+ this.IsVisible = value;
+ return this;
+ }
+
+ public Container WithSeparator(bool value)
+ {
+ this.Separator = value;
+ return this;
+ }
+
+ public Container WithHeight(ElementHeight value)
+ {
+ this.Height = value;
+ return this;
+ }
+
+ public Container WithHorizontalAlignment(HorizontalAlignment value)
+ {
+ this.HorizontalAlignment = value;
+ return this;
+ }
+
+ public Container WithSpacing(Spacing value)
+ {
+ this.Spacing = value;
+ return this;
+ }
+
+ public Container WithTargetWidth(TargetWidth value)
+ {
+ this.TargetWidth = value;
+ return this;
+ }
+
+ public Container WithIsSortKey(bool value)
+ {
+ this.IsSortKey = value;
+ return this;
+ }
+
+ public Container WithSelectAction(Action value)
+ {
+ this.SelectAction = value;
+ return this;
+ }
+
+ public Container WithStyle(ContainerStyle value)
+ {
+ this.Style = value;
+ return this;
+ }
+
+ public Container WithShowBorder(bool value)
+ {
+ this.ShowBorder = value;
+ return this;
+ }
+
+ public Container WithRoundedCorners(bool value)
+ {
+ this.RoundedCorners = value;
+ return this;
+ }
+
+ public Container WithLayouts(params IList value)
+ {
+ this.Layouts = value;
+ return this;
+ }
+
+ public Container WithBleed(bool value)
+ {
+ this.Bleed = value;
+ return this;
+ }
+
+ public Container WithMinHeight(string value)
+ {
+ this.MinHeight = value;
+ return this;
+ }
+
+ public Container WithBackgroundImage(IUnion value)
+ {
+ this.BackgroundImage = value;
+ return this;
+ }
+
+ public Container WithVerticalContentAlignment(VerticalAlignment value)
+ {
+ this.VerticalContentAlignment = value;
+ return this;
+ }
+
+ public Container WithRtl(bool value)
+ {
+ this.Rtl = value;
+ return this;
+ }
+
+ public Container WithMaxHeight(string value)
+ {
+ this.MaxHeight = value;
+ return this;
+ }
+
+ public Container WithGridArea(string value)
+ {
+ this.GridArea = value;
+ return this;
+ }
+
+ public Container WithFallback(IUnion value)
+ {
+ this.Fallback = value;
+ return this;
+ }
+
+ public Container WithItems(params IList value)
+ {
+ this.Items = value;
+ return this;
+ }
+}
+
+///
+/// A layout that stacks elements on top of each other. Layout.Stack is the default layout used by AdaptiveCard and all containers.
+///
+public class StackLayout : ContainerLayout
+{
+ ///
+ /// Deserializes a JSON string into an object of type StackLayout.
+ ///
+ public static StackLayout? Deserialize(string json)
+ {
+ return JsonSerializer.Deserialize(json);
+ }
+
+ ///
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
+ ///
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
+
+ ///
+ /// Must be **Layout.Stack**.
+ ///
+ [JsonPropertyName("type")]
+ public string Type { get; } = "Layout.Stack";
+
+ ///
+ /// Controls for which card width the layout should be used.
+ ///
+ [JsonPropertyName("targetWidth")]
+ public TargetWidth? TargetWidth { get; set; }
+
+ ///
+ /// Serializes this StackLayout into a JSON string.
+ ///
+ public string Serialize()
+ {
+ return JsonSerializer.Serialize(
+ this,
+ new JsonSerializerOptions
+ {
+ WriteIndented = true,
+ DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
+ }
+ );
+ }
+
+ public StackLayout WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public StackLayout WithTargetWidth(TargetWidth value)
+ {
+ this.TargetWidth = value;
+ return this;
+ }
+}
+
+///
+/// A layout that spreads elements horizontally and wraps them across multiple rows, as needed.
+///
+public class FlowLayout : ContainerLayout
+{
+ ///
+ /// Deserializes a JSON string into an object of type FlowLayout.
+ ///
+ public static FlowLayout? Deserialize(string json)
+ {
+ return JsonSerializer.Deserialize(json);
+ }
+
+ ///
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
+ ///
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
+
+ ///
+ /// Must be **Layout.Flow**.
+ ///
+ [JsonPropertyName("type")]
+ public string Type { get; } = "Layout.Flow";
+
+ ///
+ /// Controls for which card width the layout should be used.
+ ///
+ [JsonPropertyName("targetWidth")]
+ public TargetWidth? TargetWidth { get; set; }
+
+ ///
+ /// Controls how the content of the container should be horizontally aligned.
+ ///
+ [JsonPropertyName("horizontalItemsAlignment")]
+ public HorizontalAlignment? HorizontalItemsAlignment { get; set; } = HorizontalAlignment.Center;
+
+ ///
+ /// Controls how the content of the container should be vertically aligned.
+ ///
+ [JsonPropertyName("verticalItemsAlignment")]
+ public VerticalAlignment? VerticalItemsAlignment { get; set; } = VerticalAlignment.Top;
+
+ ///
+ /// Controls how item should fit inside the container.
+ ///
+ [JsonPropertyName("itemFit")]
+ public FlowLayoutItemFit? ItemFit { get; set; } = FlowLayoutItemFit.Fit;
+
+ ///
+ /// The minimum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set.
+ ///
+ [JsonPropertyName("minItemWidth")]
+ public string? MinItemWidth { get; set; }
+
+ ///
+ /// The maximum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set.
+ ///
+ [JsonPropertyName("maxItemWidth")]
+ public string? MaxItemWidth { get; set; }
+
+ ///
+ /// The width, in pixels, of each item, in the `px` format. Should not be used if maxItemWidth and/or minItemWidth are set.
+ ///
+ [JsonPropertyName("itemWidth")]
+ public string? ItemWidth { get; set; }
+
+ ///
+ /// The space between items.
+ ///
+ [JsonPropertyName("columnSpacing")]
+ public Spacing? ColumnSpacing { get; set; } = Spacing.Default;
+
+ ///
+ /// The space between rows of items.
+ ///
+ [JsonPropertyName("rowSpacing")]
+ public Spacing? RowSpacing { get; set; } = Spacing.Default;
+
+ ///
+ /// Serializes this FlowLayout into a JSON string.
+ ///
+ public string Serialize()
+ {
+ return JsonSerializer.Serialize(
+ this,
+ new JsonSerializerOptions
+ {
+ WriteIndented = true,
+ DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
+ }
+ );
+ }
+
+ public FlowLayout WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public FlowLayout WithTargetWidth(TargetWidth value)
+ {
+ this.TargetWidth = value;
+ return this;
+ }
+
+ public FlowLayout WithHorizontalItemsAlignment(HorizontalAlignment value)
+ {
+ this.HorizontalItemsAlignment = value;
+ return this;
+ }
+
+ public FlowLayout WithVerticalItemsAlignment(VerticalAlignment value)
+ {
+ this.VerticalItemsAlignment = value;
+ return this;
+ }
+
+ public FlowLayout WithItemFit(FlowLayoutItemFit value)
+ {
+ this.ItemFit = value;
+ return this;
+ }
+
+ public FlowLayout WithMinItemWidth(string value)
+ {
+ this.MinItemWidth = value;
+ return this;
+ }
+
+ public FlowLayout WithMaxItemWidth(string value)
+ {
+ this.MaxItemWidth = value;
+ return this;
+ }
+
+ public FlowLayout WithItemWidth(string value)
+ {
+ this.ItemWidth = value;
+ return this;
+ }
+
+ public FlowLayout WithColumnSpacing(Spacing value)
+ {
+ this.ColumnSpacing = value;
+ return this;
+ }
+
+ public FlowLayout WithRowSpacing(Spacing value)
+ {
+ this.RowSpacing = value;
+ return this;
+ }
+}
+
+///
+/// A layout that divides a container into named areas into which elements can be placed.
+///
+public class AreaGridLayout : ContainerLayout
+{
+ ///
+ /// Deserializes a JSON string into an object of type AreaGridLayout.
+ ///
+ public static AreaGridLayout? Deserialize(string json)
+ {
+ return JsonSerializer.Deserialize(json);
+ }
+
+ ///
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
+ ///
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
+
+ ///
+ /// Must be **Layout.AreaGrid**.
+ ///
+ [JsonPropertyName("type")]
+ public string Type { get; } = "Layout.AreaGrid";
+
+ ///
+ /// Controls for which card width the layout should be used.
+ ///
+ [JsonPropertyName("targetWidth")]
+ public TargetWidth? TargetWidth { get; set; }
+
+ ///
+ /// The columns in the grid layout, defined as a percentage of the available width or in pixels using the `px` format.
+ ///
+ [JsonPropertyName("columns")]
+ public IUnion, IList>? Columns { get; set; }
+
+ ///
+ /// The areas in the grid layout.
+ ///
+ [JsonPropertyName("areas")]
+ public IList? Areas { get; set; }
+
+ ///
+ /// The space between columns.
+ ///
+ [JsonPropertyName("columnSpacing")]
+ public Spacing? ColumnSpacing { get; set; } = Spacing.Default;
+
+ ///
+ /// The space between rows.
+ ///
+ [JsonPropertyName("rowSpacing")]
+ public Spacing? RowSpacing { get; set; } = Spacing.Default;
+
+ ///
+ /// Serializes this AreaGridLayout into a JSON string.
+ ///
+ public string Serialize()
+ {
+ return JsonSerializer.Serialize(
+ this,
+ new JsonSerializerOptions
+ {
+ WriteIndented = true,
+ DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
+ }
+ );
+ }
+
+ public AreaGridLayout WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public AreaGridLayout WithTargetWidth(TargetWidth value)
+ {
+ this.TargetWidth = value;
+ return this;
+ }
+
+ public AreaGridLayout WithColumns(IUnion, IList> value)
+ {
+ this.Columns = value;
+ return this;
+ }
+
+ public AreaGridLayout WithAreas(params IList value)
+ {
+ this.Areas = value;
+ return this;
+ }
+
+ public AreaGridLayout WithColumnSpacing(Spacing value)
+ {
+ this.ColumnSpacing = value;
+ return this;
+ }
+
+ public AreaGridLayout WithRowSpacing(Spacing value)
+ {
+ this.RowSpacing = value;
+ return this;
+ }
+}
+
+///
+/// Defines an area in a Layout.AreaGrid layout.
+///
+public class GridArea : SerializableObject
+{
+ ///
+ /// Deserializes a JSON string into an object of type GridArea.
+ ///
+ public static GridArea? Deserialize(string json)
+ {
+ return JsonSerializer.Deserialize(json);
+ }
+
+ ///
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
+ ///
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
+
+ ///
+ /// The name of the area. To place an element in this area, set its `grid.area` property to match the name of the area.
+ ///
+ [JsonPropertyName("name")]
+ public string? Name { get; set; }
+
+ ///
+ /// The start column index of the area. Column indices start at 1.
+ ///
+ [JsonPropertyName("column")]
+ public float? Column { get; set; } = 1;
+
+ ///
+ /// Defines how many columns the area should span.
+ ///
+ [JsonPropertyName("columnSpan")]
+ public float? ColumnSpan { get; set; } = 1;
+
+ ///
+ /// The start row index of the area. Row indices start at 1.
+ ///
+ [JsonPropertyName("row")]
+ public float? Row { get; set; } = 1;
+
+ ///
+ /// Defines how many rows the area should span.
+ ///
+ [JsonPropertyName("rowSpan")]
+ public float? RowSpan { get; set; } = 1;
+
+ ///
+ /// Serializes this GridArea into a JSON string.
+ ///
+ public string Serialize()
+ {
+ return JsonSerializer.Serialize(
+ this,
+ new JsonSerializerOptions
+ {
+ WriteIndented = true,
+ DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
+ }
+ );
+ }
+
+ public GridArea WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public GridArea WithName(string value)
+ {
+ this.Name = value;
+ return this;
+ }
+
+ public GridArea WithColumn(float value)
+ {
+ this.Column = value;
+ return this;
+ }
+
+ public GridArea WithColumnSpan(float value)
+ {
+ this.ColumnSpan = value;
+ return this;
+ }
+
+ public GridArea WithRow(float value)
+ {
+ this.Row = value;
+ return this;
+ }
+
+ public GridArea WithRowSpan(float value)
+ {
+ this.RowSpan = value;
+ return this;
+ }
+}
+
+///
+/// Defines a container's background image and the way it should be rendered.
+///
+public class BackgroundImage : SerializableObject
+{
+ ///
+ /// Deserializes a JSON string into an object of type BackgroundImage.
+ ///
+ public static BackgroundImage? Deserialize(string json)
+ {
+ return JsonSerializer.Deserialize(json);
+ }
+
+ ///
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
+ ///
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
+
+ ///
+ /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG.
+ ///
+ [JsonPropertyName("url")]
+ public string? Url { get; set; }
+
+ ///
+ /// Controls how the image should fill the area.
+ ///
+ [JsonPropertyName("fillMode")]
+ public FillMode? FillMode { get; set; } = FillMode.Cover;
+
+ ///
+ /// Controls how the image should be aligned if it must be cropped or if using repeat fill mode.
+ ///
+ [JsonPropertyName("horizontalAlignment")]
+ public HorizontalAlignment? HorizontalAlignment { get; set; } = HorizontalAlignment.Left;
+
+ ///
+ /// Controls how the image should be aligned if it must be cropped or if using repeat fill mode.
+ ///
+ [JsonPropertyName("verticalAlignment")]
+ public VerticalAlignment? VerticalAlignment { get; set; } = VerticalAlignment.Top;
+
+ ///
+ /// A set of theme-specific image URLs.
+ ///
+ [JsonPropertyName("themedUrls")]
+ public IList? ThemedUrls { get; set; }
+
+ ///
+ /// Serializes this BackgroundImage into a JSON string.
+ ///
+ public string Serialize()
+ {
+ return JsonSerializer.Serialize(
+ this,
+ new JsonSerializerOptions
+ {
+ WriteIndented = true,
+ DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
+ }
+ );
+ }
+
+ public BackgroundImage WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public BackgroundImage WithUrl(string value)
+ {
+ this.Url = value;
+ return this;
+ }
+
+ public BackgroundImage WithFillMode(FillMode value)
+ {
+ this.FillMode = value;
+ return this;
+ }
+
+ public BackgroundImage WithHorizontalAlignment(HorizontalAlignment value)
+ {
+ this.HorizontalAlignment = value;
+ return this;
+ }
+
+ public BackgroundImage WithVerticalAlignment(VerticalAlignment value)
+ {
+ this.VerticalAlignment = value;
+ return this;
+ }
+
+ public BackgroundImage WithThemedUrls(params IList value)
+ {
+ this.ThemedUrls = value;
+ return this;
+ }
+}
+
+///
+/// Splits the available horizontal space into separate columns, so elements can be organized in a row.
+///
+public class ColumnSet : CardElement
+{
+ ///
+ /// Deserializes a JSON string into an object of type ColumnSet.
+ ///
+ public static ColumnSet? Deserialize(string json)
+ {
+ return JsonSerializer.Deserialize(json);
+ }
+
+ ///
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
+ ///
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
+
+ ///
+ /// Must be **ColumnSet**.
+ ///
+ [JsonPropertyName("type")]
+ public string Type { get; } = "ColumnSet";
+
+ ///
+ /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
+ ///
+ [JsonPropertyName("id")]
+ public string? Id { get; set; }
+
+ ///
+ /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
+ ///
+ [JsonPropertyName("requires")]
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
+
+ ///
+ /// The locale associated with the element.
+ ///
+ [JsonPropertyName("lang")]
+ public string? Lang { get; set; }
+
+ ///
+ /// Controls the visibility of the element.
+ ///
+ [JsonPropertyName("isVisible")]
+ public bool? IsVisible { get; set; } = true;
+
+ ///
+ /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
+ ///
+ [JsonPropertyName("separator")]
+ public bool? Separator { get; set; } = false;
+
+ ///
+ /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
+ ///
+ [JsonPropertyName("height")]
+ public ElementHeight? Height { get; set; } = ElementHeight.Auto;
+
+ ///
+ /// Controls how the element should be horizontally aligned.
+ ///
+ [JsonPropertyName("horizontalAlignment")]
+ public HorizontalAlignment? HorizontalAlignment { get; set; }
+
+ ///
+ /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
+ ///
+ [JsonPropertyName("spacing")]
+ public Spacing? Spacing { get; set; } = Spacing.Default;
+
+ ///
+ /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
+ ///
+ [JsonPropertyName("targetWidth")]
+ public TargetWidth? TargetWidth { get; set; }
+
+ ///
+ /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
+ ///
+ [JsonPropertyName("isSortKey")]
+ public bool? IsSortKey { get; set; } = false;
+
+ ///
+ /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported.
+ ///
+ [JsonPropertyName("selectAction")]
+ public Action? SelectAction { get; set; }
+
+ ///
+ /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met.
+ ///
+ [JsonPropertyName("style")]
+ public ContainerStyle? Style { get; set; }
+
+ ///
+ /// Controls if a border should be displayed around the container.
+ ///
+ [JsonPropertyName("showBorder")]
+ public bool? ShowBorder { get; set; } = false;
+
+ ///
+ /// Controls if the container should have rounded corners.
+ ///
+ [JsonPropertyName("roundedCorners")]
+ public bool? RoundedCorners { get; set; } = false;
+
+ ///
+ /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding.
+ ///
+ [JsonPropertyName("bleed")]
+ public bool? Bleed { get; set; } = false;
+
+ ///
+ /// The minimum height, in pixels, of the container, in the `px` format.
+ ///
+ [JsonPropertyName("minHeight")]
+ public string? MinHeight { get; set; }
+
+ ///
+ /// The minimum width of the column set. `auto` will automatically adjust the column set's minimum width according to its content and using the `px` format will give the column set an explicit minimum width in pixels. A scrollbar will be displayed if the available width is less than the specified minimum width.
+ ///
+ [JsonPropertyName("minWidth")]
+ public string? MinWidth { get; set; }
+
+ ///
+ /// The area of a Layout.AreaGrid layout in which an element should be displayed.
+ ///
+ [JsonPropertyName("grid.area")]
+ public string? GridArea { get; set; }
+
+ ///
+ /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
+ ///
+ [JsonPropertyName("fallback")]
+ public IUnion? Fallback { get; set; }
+
+ ///
+ /// The columns in the set.
+ ///
+ [JsonPropertyName("columns")]
+ public IList? Columns { get; set; }
+
+ ///
+ /// Serializes this ColumnSet into a JSON string.
+ ///
+ public string Serialize()
+ {
+ return JsonSerializer.Serialize(
+ this,
+ new JsonSerializerOptions
+ {
+ WriteIndented = true,
+ DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
+ }
+ );
+ }
+
+ public ColumnSet WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public ColumnSet WithId(string value)
+ {
+ this.Id = value;
+ return this;
+ }
+
+ public ColumnSet WithRequires(HostCapabilities value)
+ {
+ this.Requires = value;
+ return this;
+ }
+
+ public ColumnSet WithLang(string value)
+ {
+ this.Lang = value;
+ return this;
+ }
+
+ public ColumnSet WithIsVisible(bool value)
+ {
+ this.IsVisible = value;
+ return this;
+ }
+
+ public ColumnSet WithSeparator(bool value)
+ {
+ this.Separator = value;
+ return this;
+ }
+
+ public ColumnSet WithHeight(ElementHeight value)
+ {
+ this.Height = value;
+ return this;
+ }
+
+ public ColumnSet WithHorizontalAlignment(HorizontalAlignment value)
+ {
+ this.HorizontalAlignment = value;
+ return this;
+ }
+
+ public ColumnSet WithSpacing(Spacing value)
+ {
+ this.Spacing = value;
+ return this;
+ }
+
+ public ColumnSet WithTargetWidth(TargetWidth value)
+ {
+ this.TargetWidth = value;
+ return this;
+ }
+
+ public ColumnSet WithIsSortKey(bool value)
+ {
+ this.IsSortKey = value;
+ return this;
+ }
+
+ public ColumnSet WithSelectAction(Action value)
+ {
+ this.SelectAction = value;
+ return this;
+ }
+
+ public ColumnSet WithStyle(ContainerStyle value)
+ {
+ this.Style = value;
+ return this;
+ }
+
+ public ColumnSet WithShowBorder(bool value)
+ {
+ this.ShowBorder = value;
+ return this;
+ }
+
+ public ColumnSet WithRoundedCorners(bool value)
+ {
+ this.RoundedCorners = value;
+ return this;
+ }
+
+ public ColumnSet WithBleed(bool value)
+ {
+ this.Bleed = value;
+ return this;
+ }
+
+ public ColumnSet WithMinHeight(string value)
+ {
+ this.MinHeight = value;
+ return this;
+ }
+
+ public ColumnSet WithMinWidth(string value)
+ {
+ this.MinWidth = value;
+ return this;
+ }
+
+ public ColumnSet WithGridArea(string value)
+ {
+ this.GridArea = value;
+ return this;
+ }
+
+ public ColumnSet WithFallback(IUnion value)
+ {
+ this.Fallback = value;
+ return this;
+ }
+
+ public ColumnSet WithColumns(params IList value)
+ {
+ this.Columns = value;
+ return this;
+ }
+}
+
+///
+/// A media element, that makes it possible to embed videos inside a card.
+///
+public class Media : CardElement
+{
+ ///
+ /// Deserializes a JSON string into an object of type Media.
+ ///
+ public static Media? Deserialize(string json)
+ {
+ return JsonSerializer.Deserialize(json);
+ }
+
+ ///
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
+ ///
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
+
+ ///
+ /// Must be **Media**.
+ ///
+ [JsonPropertyName("type")]
+ public string Type { get; } = "Media";
+
+ ///
+ /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
+ ///
+ [JsonPropertyName("id")]
+ public string? Id { get; set; }
+
+ ///
+ /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
+ ///
+ [JsonPropertyName("requires")]
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
+
+ ///
+ /// The locale associated with the element.
+ ///
+ [JsonPropertyName("lang")]
+ public string? Lang { get; set; }
+
+ ///
+ /// Controls the visibility of the element.
+ ///
+ [JsonPropertyName("isVisible")]
+ public bool? IsVisible { get; set; } = true;
+
+ ///
+ /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
+ ///
+ [JsonPropertyName("separator")]
+ public bool? Separator { get; set; } = false;
+
+ ///
+ /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
+ ///
+ [JsonPropertyName("height")]
+ public ElementHeight? Height { get; set; } = ElementHeight.Auto;
+
+ ///
+ /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
+ ///
+ [JsonPropertyName("spacing")]
+ public Spacing? Spacing { get; set; } = Spacing.Default;
+
+ ///
+ /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
+ ///
+ [JsonPropertyName("targetWidth")]
+ public TargetWidth? TargetWidth { get; set; }
+
+ ///
+ /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
+ ///
+ [JsonPropertyName("isSortKey")]
+ public bool? IsSortKey { get; set; } = false;
+
+ ///
+ /// The sources for the media. For YouTube, Dailymotion and Vimeo, only one source can be specified.
+ ///
+ [JsonPropertyName("sources")]
+ public IList? Sources { get; set; }
+
+ ///
+ /// The caption sources for the media. Caption sources are not used for YouTube, Dailymotion or Vimeo sources.
+ ///
+ [JsonPropertyName("captionSources")]
+ public IList? CaptionSources { get; set; }
+
+ ///
+ /// The URL of the poster image to display.
+ ///
+ [JsonPropertyName("poster")]
+ public string? Poster { get; set; }
+
+ ///
+ /// The alternate text for the media, used for accessibility purposes.
+ ///
+ [JsonPropertyName("altText")]
+ public string? AltText { get; set; }
+
+ ///
+ /// The area of a Layout.AreaGrid layout in which an element should be displayed.
+ ///
+ [JsonPropertyName("grid.area")]
+ public string? GridArea { get; set; }
+
+ ///
+ /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
+ ///
+ [JsonPropertyName("fallback")]
+ public IUnion? Fallback { get; set; }
+
+ ///
+ /// Serializes this Media into a JSON string.
+ ///
+ public string Serialize()
+ {
+ return JsonSerializer.Serialize(
+ this,
+ new JsonSerializerOptions
+ {
+ WriteIndented = true,
+ DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
+ }
+ );
+ }
+
+ public Media WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public Media WithId(string value)
+ {
+ this.Id = value;
+ return this;
+ }
+
+ public Media WithRequires(HostCapabilities value)
+ {
+ this.Requires = value;
+ return this;
+ }
+
+ public Media WithLang(string value)
+ {
+ this.Lang = value;
+ return this;
+ }
+
+ public Media WithIsVisible(bool value)
+ {
+ this.IsVisible = value;
+ return this;
+ }
+
+ public Media WithSeparator(bool value)
+ {
+ this.Separator = value;
+ return this;
+ }
+
+ public Media WithHeight(ElementHeight value)
+ {
+ this.Height = value;
+ return this;
+ }
+
+ public Media WithSpacing(Spacing value)
+ {
+ this.Spacing = value;
+ return this;
+ }
+
+ public Media WithTargetWidth(TargetWidth value)
+ {
+ this.TargetWidth = value;
+ return this;
+ }
+
+ public Media WithIsSortKey(bool value)
+ {
+ this.IsSortKey = value;
+ return this;
+ }
+
+ public Media WithSources(params IList value)
+ {
+ this.Sources = value;
+ return this;
+ }
+
+ public Media WithCaptionSources(params IList value)
+ {
+ this.CaptionSources = value;
+ return this;
+ }
+
+ public Media WithPoster(string value)
+ {
+ this.Poster = value;
+ return this;
+ }
+
+ public Media WithAltText(string value)
+ {
+ this.AltText = value;
+ return this;
+ }
+
+ public Media WithGridArea(string value)
+ {
+ this.GridArea = value;
+ return this;
+ }
+
+ public Media WithFallback(IUnion value)
+ {
+ this.Fallback = value;
+ return this;
+ }
+}
+
+///
+/// Defines the source URL of a media stream. YouTube, Dailymotion, Vimeo and Microsoft Stream URLs are supported.
+///
+public class MediaSource : SerializableObject
+{
+ ///
+ /// Deserializes a JSON string into an object of type MediaSource.
+ ///
+ public static MediaSource? Deserialize(string json)
+ {
+ return JsonSerializer.Deserialize(json);
+ }
+
+ ///
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
+ ///
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
+
+ ///
+ /// The MIME type of the source.
+ ///
+ [JsonPropertyName("mimeType")]
+ public string? MimeType { get; set; }
+
+ ///
+ /// The URL of the source.
+ ///
+ [JsonPropertyName("url")]
+ public string? Url { get; set; }
+
+ ///
+ /// Serializes this MediaSource into a JSON string.
+ ///
+ public string Serialize()
+ {
+ return JsonSerializer.Serialize(
+ this,
+ new JsonSerializerOptions
+ {
+ WriteIndented = true,
+ DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
+ }
+ );
+ }
+
+ public MediaSource WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public MediaSource WithMimeType(string value)
+ {
+ this.MimeType = value;
+ return this;
+ }
+
+ public MediaSource WithUrl(string value)
+ {
+ this.Url = value;
+ return this;
+ }
+}
+
+///
+/// Defines a source URL for a video captions.
+///
+public class CaptionSource : SerializableObject
+{
+ ///
+ /// Deserializes a JSON string into an object of type CaptionSource.
+ ///
+ public static CaptionSource? Deserialize(string json)
+ {
+ return JsonSerializer.Deserialize(json);
+ }
+
+ ///
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
+ ///
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
+
+ ///
+ /// The MIME type of the source.
+ ///
+ [JsonPropertyName("mimeType")]
+ public string? MimeType { get; set; }
+
+ ///
+ /// The URL of the source.
+ ///
+ [JsonPropertyName("url")]
+ public string? Url { get; set; }
+
+ ///
+ /// The label of this caption source.
+ ///
+ [JsonPropertyName("label")]
+ public string? Label { get; set; }
+
+ ///
+ /// Serializes this CaptionSource into a JSON string.
+ ///
+ public string Serialize()
+ {
+ return JsonSerializer.Serialize(
+ this,
+ new JsonSerializerOptions
+ {
+ WriteIndented = true,
+ DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
+ }
+ );
+ }
+
+ public CaptionSource WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public CaptionSource WithMimeType(string value)
+ {
+ this.MimeType = value;
+ return this;
+ }
+
+ public CaptionSource WithUrl(string value)
+ {
+ this.Url = value;
+ return this;
+ }
+
+ public CaptionSource WithLabel(string value)
+ {
+ this.Label = value;
+ return this;
+ }
+}
+
+///
+/// A rich text block that displays formatted text.
+///
+public class RichTextBlock : CardElement
{
///
- /// Deserializes a JSON string into an object of type RefreshDefinition.
+ /// Deserializes a JSON string into an object of type RichTextBlock.
///
- public static RefreshDefinition? Deserialize(string json)
+ public static RichTextBlock? Deserialize(string json)
{
- return JsonSerializer.Deserialize(json);
+ return JsonSerializer.Deserialize(json);
}
///
- /// The Action.Execute action to invoke to refresh the card.
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
///
- [JsonPropertyName("action")]
- public ExecuteAction? Action { get; set; }
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
///
- /// The list of user Ids for which the card will be automatically refreshed. In Teams, in chats or channels with more than 60 users, the card will automatically refresh only for users specified in the userIds list. Other users will have to manually click on a "refresh" button. In contexts with fewer than 60 users, the card will automatically refresh for all users.
+ /// Must be **RichTextBlock**.
///
- [JsonPropertyName("userIds")]
- public IList? UserIds { get; set; }
+ [JsonPropertyName("type")]
+ public string Type { get; } = "RichTextBlock";
///
- /// Serializes this RefreshDefinition into a JSON string.
+ /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
+ ///
+ [JsonPropertyName("id")]
+ public string? Id { get; set; }
+
+ ///
+ /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
+ ///
+ [JsonPropertyName("requires")]
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
+
+ ///
+ /// The locale associated with the element.
+ ///
+ [JsonPropertyName("lang")]
+ public string? Lang { get; set; }
+
+ ///
+ /// Controls the visibility of the element.
+ ///
+ [JsonPropertyName("isVisible")]
+ public bool? IsVisible { get; set; } = true;
+
+ ///
+ /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
+ ///
+ [JsonPropertyName("separator")]
+ public bool? Separator { get; set; } = false;
+
+ ///
+ /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
+ ///
+ [JsonPropertyName("height")]
+ public ElementHeight? Height { get; set; } = ElementHeight.Auto;
+
+ ///
+ /// Controls how the element should be horizontally aligned.
+ ///
+ [JsonPropertyName("horizontalAlignment")]
+ public HorizontalAlignment? HorizontalAlignment { get; set; }
+
+ ///
+ /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
+ ///
+ [JsonPropertyName("spacing")]
+ public Spacing? Spacing { get; set; } = Spacing.Default;
+
+ ///
+ /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
+ ///
+ [JsonPropertyName("targetWidth")]
+ public TargetWidth? TargetWidth { get; set; }
+
+ ///
+ /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
+ ///
+ [JsonPropertyName("isSortKey")]
+ public bool? IsSortKey { get; set; } = false;
+
+ ///
+ /// The Id of the input the RichTextBlock should act as the label of.
+ ///
+ [JsonPropertyName("labelFor")]
+ public string? LabelFor { get; set; }
+
+ ///
+ /// The area of a Layout.AreaGrid layout in which an element should be displayed.
+ ///
+ [JsonPropertyName("grid.area")]
+ public string? GridArea { get; set; }
+
+ ///
+ /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
+ ///
+ [JsonPropertyName("fallback")]
+ public IUnion? Fallback { get; set; }
+
+ ///
+ /// The inlines making up the rich text block.
+ ///
+ [JsonPropertyName("inlines")]
+ public IUnion, IList>? Inlines { get; set; }
+
+ ///
+ /// Serializes this RichTextBlock into a JSON string.
///
public string Serialize()
{
@@ -3455,135 +5446,262 @@ public string Serialize()
);
}
- public RefreshDefinition WithAction(ExecuteAction value)
+ public RichTextBlock WithKey(string value)
{
- this.Action = value;
+ this.Key = value;
+ return this;
+ }
+
+ public RichTextBlock WithId(string value)
+ {
+ this.Id = value;
+ return this;
+ }
+
+ public RichTextBlock WithRequires(HostCapabilities value)
+ {
+ this.Requires = value;
+ return this;
+ }
+
+ public RichTextBlock WithLang(string value)
+ {
+ this.Lang = value;
+ return this;
+ }
+
+ public RichTextBlock WithIsVisible(bool value)
+ {
+ this.IsVisible = value;
+ return this;
+ }
+
+ public RichTextBlock WithSeparator(bool value)
+ {
+ this.Separator = value;
+ return this;
+ }
+
+ public RichTextBlock WithHeight(ElementHeight value)
+ {
+ this.Height = value;
+ return this;
+ }
+
+ public RichTextBlock WithHorizontalAlignment(HorizontalAlignment value)
+ {
+ this.HorizontalAlignment = value;
+ return this;
+ }
+
+ public RichTextBlock WithSpacing(Spacing value)
+ {
+ this.Spacing = value;
+ return this;
+ }
+
+ public RichTextBlock WithTargetWidth(TargetWidth value)
+ {
+ this.TargetWidth = value;
+ return this;
+ }
+
+ public RichTextBlock WithIsSortKey(bool value)
+ {
+ this.IsSortKey = value;
+ return this;
+ }
+
+ public RichTextBlock WithLabelFor(string value)
+ {
+ this.LabelFor = value;
+ return this;
+ }
+
+ public RichTextBlock WithGridArea(string value)
+ {
+ this.GridArea = value;
+ return this;
+ }
+
+ public RichTextBlock WithFallback(IUnion value)
+ {
+ this.Fallback = value;
+ return this;
+ }
+
+ public RichTextBlock WithInlines(IUnion, IList> value)
+ {
+ this.Inlines = value;
return this;
}
+}
+
+///
+/// Use tables to display data in a tabular way, with rows, columns and cells.
+///
+public class Table : CardElement
+{
+ ///
+ /// Deserializes a JSON string into an object of type Table.
+ ///
+ public static Table? Deserialize(string json)
+ {
+ return JsonSerializer.Deserialize
(json);
+ }
+
+ ///
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
+ ///
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
+
+ ///
+ /// Must be **Table**.
+ ///
+ [JsonPropertyName("type")]
+ public string Type { get; } = "Table";
+
+ ///
+ /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
+ ///
+ [JsonPropertyName("id")]
+ public string? Id { get; set; }
+
+ ///
+ /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
+ ///
+ [JsonPropertyName("requires")]
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
+
+ ///
+ /// The locale associated with the element.
+ ///
+ [JsonPropertyName("lang")]
+ public string? Lang { get; set; }
+
+ ///
+ /// Controls the visibility of the element.
+ ///
+ [JsonPropertyName("isVisible")]
+ public bool? IsVisible { get; set; } = true;
+
+ ///
+ /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
+ ///
+ [JsonPropertyName("separator")]
+ public bool? Separator { get; set; } = false;
+
+ ///
+ /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
+ ///
+ [JsonPropertyName("height")]
+ public ElementHeight? Height { get; set; } = ElementHeight.Auto;
+
+ ///
+ /// Controls how the element should be horizontally aligned.
+ ///
+ [JsonPropertyName("horizontalAlignment")]
+ public HorizontalAlignment? HorizontalAlignment { get; set; }
- public RefreshDefinition WithUserIds(params IList value)
- {
- this.UserIds = value;
- return this;
- }
-}
+ ///
+ /// 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;
-///
-/// Defines authentication information associated with a card. For more information, refer to the [Bot Framework OAuthCard type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.oauthcard)
-///
-public class Authentication : SerializableObject
-{
///
- /// Deserializes a JSON string into an object of type Authentication.
+ /// 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).
///
- public static Authentication? Deserialize(string json)
- {
- return JsonSerializer.Deserialize(json);
- }
+ [JsonPropertyName("targetWidth")]
+ public TargetWidth? TargetWidth { get; set; }
///
- /// The text that can be displayed to the end user when prompting them to authenticate.
+ /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
///
- [JsonPropertyName("text")]
- public string? Text { get; set; }
+ [JsonPropertyName("isSortKey")]
+ public bool? IsSortKey { get; set; } = false;
///
- /// The identifier for registered OAuth connection setting information.
+ /// 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("connectionName")]
- public string? ConnectionName { get; set; }
+ [JsonPropertyName("style")]
+ public ContainerStyle? Style { get; set; }
///
- /// The buttons that should be displayed to the user when prompting for authentication. The array MUST contain one button of type “signin”. Other button types are not currently supported.
+ /// Controls if a border should be displayed around the container.
///
- [JsonPropertyName("buttons")]
- public IList? Buttons { get; set; }
+ [JsonPropertyName("showBorder")]
+ public bool? ShowBorder { get; set; } = false;
///
- /// Provides information required to enable on-behalf-of single sign-on user authentication.
+ /// Controls if the container should have rounded corners.
///
- [JsonPropertyName("tokenExchangeResource")]
- public TokenExchangeResource? TokenExchangeResource { get; set; }
+ [JsonPropertyName("roundedCorners")]
+ public bool? RoundedCorners { get; set; } = false;
///
- /// Serializes this Authentication into a JSON string.
+ /// The columns in the table.
///
- public string Serialize()
- {
- return JsonSerializer.Serialize(
- this,
- new JsonSerializerOptions
- {
- WriteIndented = true,
- DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
- }
- );
- }
+ [JsonPropertyName("columns")]
+ public IList? Columns { get; set; }
- public Authentication WithText(string value)
- {
- this.Text = value;
- return this;
- }
+ ///
+ /// The minimum width of the table in pixels. `auto` will automatically adjust the table's minimum width according to its content and using the `px` format will give the table an explicit minimum width in pixels. A scrollbar will be displayed if the available width is less than the specified minimum width.
+ ///
+ [JsonPropertyName("minWidth")]
+ public string? MinWidth { get; set; }
- public Authentication WithConnectionName(string value)
- {
- this.ConnectionName = value;
- return this;
- }
+ ///
+ /// Controls whether the first row of the table should be treated as a header.
+ ///
+ [JsonPropertyName("firstRowAsHeaders")]
+ public bool? FirstRowAsHeaders { get; set; } = true;
- public Authentication WithButtons(params IList value)
- {
- this.Buttons = value;
- return this;
- }
+ ///
+ /// Controls if grid lines should be displayed.
+ ///
+ [JsonPropertyName("showGridLines")]
+ public bool? ShowGridLines { get; set; } = true;
- public Authentication WithTokenExchangeResource(TokenExchangeResource value)
- {
- this.TokenExchangeResource = value;
- return this;
- }
-}
+ ///
+ /// The style of the grid lines between cells.
+ ///
+ [JsonPropertyName("gridStyle")]
+ public ContainerStyle? GridStyle { get; set; }
-///
-/// Defines a button as displayed when prompting a user to authenticate. For more information, refer to the [Bot Framework CardAction type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.cardaction).
-///
-public class AuthCardButton : SerializableObject
-{
///
- /// Deserializes a JSON string into an object of type AuthCardButton.
+ /// Controls how the content of every cell in the table should be horizontally aligned by default.
///
- public static AuthCardButton? Deserialize(string json)
- {
- return JsonSerializer.Deserialize(json);
- }
+ [JsonPropertyName("horizontalCellContentAlignment")]
+ public HorizontalAlignment? HorizontalCellContentAlignment { get; set; }
///
- /// Must be **signin**.
+ /// Controls how the content of every cell in the table should be vertically aligned by default.
///
- [JsonPropertyName("type")]
- public string? Type { get; set; }
+ [JsonPropertyName("verticalCellContentAlignment")]
+ public VerticalAlignment? VerticalCellContentAlignment { get; set; }
///
- /// The caption of the button.
+ /// The area of a Layout.AreaGrid layout in which an element should be displayed.
///
- [JsonPropertyName("title")]
- public string? Title { get; set; }
+ [JsonPropertyName("grid.area")]
+ public string? GridArea { get; set; }
///
- /// A URL to an image to display alongside the button’s caption.
+ /// 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("image")]
- public string? Image { get; set; }
+ [JsonPropertyName("fallback")]
+ public IUnion? Fallback { get; set; }
///
- /// The value associated with the button. The meaning of value depends on the button’s type.
+ /// The rows of the table.
///
- [JsonPropertyName("value")]
- public string? Value { get; set; }
+ [JsonPropertyName("rows")]
+ public IList? Rows { get; set; }
///
- /// Serializes this AuthCardButton into a JSON string.
+ /// Serializes this Table into a JSON string.
///
public string Serialize()
{
@@ -3597,243 +5715,190 @@ public string Serialize()
);
}
- public AuthCardButton WithType(string value)
+ public Table WithKey(string value)
{
- this.Type = value;
+ this.Key = value;
return this;
}
- public AuthCardButton WithTitle(string value)
+ public Table WithId(string value)
{
- this.Title = value;
+ this.Id = value;
return this;
}
- public AuthCardButton WithImage(string value)
+ public Table WithRequires(HostCapabilities value)
{
- this.Image = value;
+ this.Requires = value;
return this;
}
- public AuthCardButton WithValue(string value)
+ public Table WithLang(string value)
{
- this.Value = value;
+ this.Lang = value;
return this;
}
-}
-///
-/// Defines information required to enable on-behalf-of single sign-on user authentication. For more information, refer to the [Bot Framework TokenExchangeResource type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.tokenexchangeresource)
-///
-public class TokenExchangeResource : SerializableObject
-{
- ///
- /// Deserializes a JSON string into an object of type TokenExchangeResource.
- ///
- public static TokenExchangeResource? Deserialize(string json)
+ public Table WithIsVisible(bool value)
{
- return JsonSerializer.Deserialize(json);
+ this.IsVisible = value;
+ return this;
}
- ///
- /// The unique identified of this token exchange instance.
- ///
- [JsonPropertyName("id")]
- public string? Id { get; set; }
-
- ///
- /// An application ID or resource identifier with which to exchange a token on behalf of. This property is identity provider- and application-specific.
- ///
- [JsonPropertyName("uri")]
- public string? Uri { get; set; }
+ public Table WithSeparator(bool value)
+ {
+ this.Separator = value;
+ return this;
+ }
- ///
- /// An identifier for the identity provider with which to attempt a token exchange.
- ///
- [JsonPropertyName("providerId")]
- public string? ProviderId { get; set; }
+ public Table WithHeight(ElementHeight value)
+ {
+ this.Height = value;
+ return this;
+ }
- ///
- /// Serializes this TokenExchangeResource into a JSON string.
- ///
- public string Serialize()
+ public Table WithHorizontalAlignment(HorizontalAlignment value)
{
- return JsonSerializer.Serialize(
- this,
- new JsonSerializerOptions
- {
- WriteIndented = true,
- DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
- }
- );
+ this.HorizontalAlignment = value;
+ return this;
}
- public TokenExchangeResource WithId(string value)
+ public Table WithSpacing(Spacing value)
{
- this.Id = value;
+ this.Spacing = value;
return this;
}
- public TokenExchangeResource WithUri(string value)
+ public Table WithTargetWidth(TargetWidth value)
{
- this.Uri = value;
+ this.TargetWidth = value;
return this;
}
- public TokenExchangeResource WithProviderId(string value)
+ public Table WithIsSortKey(bool value)
{
- this.ProviderId = value;
+ this.IsSortKey = value;
return this;
}
-}
-///
-/// Represents a set of Teams-specific properties on a card.
-///
-public class TeamsCardProperties : SerializableObject
-{
- ///
- /// Deserializes a JSON string into an object of type TeamsCardProperties.
- ///
- public static TeamsCardProperties? Deserialize(string json)
+ public Table WithStyle(ContainerStyle value)
{
- return JsonSerializer.Deserialize(json);
+ this.Style = value;
+ return this;
}
- ///
- /// Controls the width of the card in a Teams chat.
- ///
- /// Note that setting `width` to "full" will not actually stretch the card to the "full width" of the chat pane. It will only make the card wider than when the `width` property isn't set.
- ///
- [JsonPropertyName("width")]
- public TeamsCardWidth? Width { get; set; }
+ public Table WithShowBorder(bool value)
+ {
+ this.ShowBorder = value;
+ return this;
+ }
- ///
- /// The Teams-specific entities associated with the card.
- ///
- [JsonPropertyName("entities")]
- public IList? Entities { get; set; }
+ public Table WithRoundedCorners(bool value)
+ {
+ this.RoundedCorners = value;
+ return this;
+ }
- ///
- /// Serializes this TeamsCardProperties into a JSON string.
- ///
- public string Serialize()
+ public Table WithColumns(params IList value)
{
- return JsonSerializer.Serialize(
- this,
- new JsonSerializerOptions
- {
- WriteIndented = true,
- DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
- }
- );
+ this.Columns = value;
+ return this;
}
- public TeamsCardProperties WithWidth(TeamsCardWidth value)
+ public Table WithMinWidth(string value)
{
- this.Width = value;
+ this.MinWidth = value;
return this;
}
- public TeamsCardProperties WithEntities(params IList value)
+ public Table WithFirstRowAsHeaders(bool value)
{
- this.Entities = value;
+ this.FirstRowAsHeaders = value;
return this;
}
-}
-///
-/// Represents a mention to a person.
-///
-public class Mention : SerializableObject
-{
- ///
- /// Deserializes a JSON string into an object of type Mention.
- ///
- public static Mention? Deserialize(string json)
+ public Table WithShowGridLines(bool value)
{
- return JsonSerializer.Deserialize(json);
+ this.ShowGridLines = value;
+ return this;
}
- ///
- /// Must be **mention**.
- ///
- [JsonPropertyName("type")]
- public string Type { get; } = "mention";
+ public Table WithGridStyle(ContainerStyle value)
+ {
+ this.GridStyle = value;
+ return this;
+ }
- ///
- /// The text that will be substituted with the mention.
- ///
- [JsonPropertyName("text")]
- public string? Text { get; set; }
+ public Table WithHorizontalCellContentAlignment(HorizontalAlignment value)
+ {
+ this.HorizontalCellContentAlignment = value;
+ return this;
+ }
- ///
- /// Defines the entity being mentioned.
- ///
- [JsonPropertyName("mentioned")]
- public MentionedEntity? Mentioned { get; set; }
+ public Table WithVerticalCellContentAlignment(VerticalAlignment value)
+ {
+ this.VerticalCellContentAlignment = value;
+ return this;
+ }
- ///
- /// Serializes this Mention into a JSON string.
- ///
- public string Serialize()
+ public Table WithGridArea(string value)
{
- return JsonSerializer.Serialize(
- this,
- new JsonSerializerOptions
- {
- WriteIndented = true,
- DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
- }
- );
+ this.GridArea = value;
+ return this;
}
- public Mention WithText(string value)
+ public Table WithFallback(IUnion value)
{
- this.Text = value;
+ this.Fallback = value;
return this;
}
- public Mention WithMentioned(MentionedEntity value)
+ public Table WithRows(params IList value)
{
- this.Mentioned = value;
+ this.Rows = value;
return this;
}
}
///
-/// Represents a mentioned person or tag.
+/// Defines a column in a Table element.
///
-public class MentionedEntity : SerializableObject
+public class ColumnDefinition : SerializableObject
{
///
- /// Deserializes a JSON string into an object of type MentionedEntity.
+ /// Deserializes a JSON string into an object of type ColumnDefinition.
///
- public static MentionedEntity? Deserialize(string json)
+ public static ColumnDefinition? Deserialize(string json)
{
- return JsonSerializer.Deserialize(json);
+ return JsonSerializer.Deserialize(json);
}
///
- /// The Id of a person (typically a Microsoft Entra user Id) or tag.
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
///
- [JsonPropertyName("id")]
- public string? Id { get; set; }
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
///
- /// The name of the mentioned entity.
+ /// Controls how the content of every cell in the table should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table.
///
- [JsonPropertyName("name")]
- public string? Name { get; set; }
+ [JsonPropertyName("horizontalCellContentAlignment")]
+ public HorizontalAlignment? HorizontalCellContentAlignment { get; set; }
///
- /// The type of the mentioned entity.
+ /// Controls how the content of every cell in the column should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table.
///
- [JsonPropertyName("mentionType")]
- public MentionType? MentionType { get; set; }
+ [JsonPropertyName("verticalCellContentAlignment")]
+ public VerticalAlignment? VerticalCellContentAlignment { get; set; }
///
- /// Serializes this MentionedEntity into a JSON string.
+ /// The width of the column in the table. If expressed as a number, represents the relative weight of the column in the table. If expressed as a string, `auto` will automatically adjust the column's width according to its content and using the `px` format will give the column an explicit width in pixels.
+ ///
+ [JsonPropertyName("width")]
+ public IUnion? Width { get; set; }
+
+ ///
+ /// Serializes this ColumnDefinition into a JSON string.
///
public string Serialize()
{
@@ -3847,84 +5912,55 @@ public string Serialize()
);
}
- public MentionedEntity WithId(string value)
+ public ColumnDefinition WithKey(string value)
{
- this.Id = value;
+ this.Key = value;
return this;
}
- public MentionedEntity WithName(string value)
+ public ColumnDefinition WithHorizontalCellContentAlignment(HorizontalAlignment value)
{
- this.Name = value;
+ this.HorizontalCellContentAlignment = value;
return this;
}
- public MentionedEntity WithMentionType(MentionType value)
+ public ColumnDefinition WithVerticalCellContentAlignment(VerticalAlignment value)
{
- this.MentionType = value;
+ this.VerticalCellContentAlignment = value;
return this;
}
-}
-
-///
-/// Card-level metadata.
-///
-public class CardMetadata : SerializableObject
-{
- ///
- /// Deserializes a JSON string into an object of type CardMetadata.
- ///
- public static CardMetadata? Deserialize(string json)
- {
- return JsonSerializer.Deserialize(json);
- }
-
- ///
- /// The URL the card originates from. When `webUrl` is set, the card is dubbed an **Adaptive Card-based Loop Component** and, when pasted in Teams or other Loop Component-capable host applications, the URL will unfurl to the same exact card.
- ///
- [JsonPropertyName("webUrl")]
- public string? WebUrl { get; set; }
-
- ///
- /// Serializes this CardMetadata into a JSON string.
- ///
- public string Serialize()
- {
- return JsonSerializer.Serialize(
- this,
- new JsonSerializerOptions
- {
- WriteIndented = true,
- DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
- }
- );
- }
- public CardMetadata WithWebUrl(string value)
+ public ColumnDefinition WithWidth(IUnion value)
{
- this.WebUrl = value;
+ this.Width = value;
return this;
}
}
///
-/// A container for other elements. Use containers for styling purposes and/or to logically group a set of elements together, which can be especially useful when used with Action.ToggleVisibility.
+/// A block of text, optionally formatted using Markdown.
///
-public class Container : CardElement
+public class TextBlock : CardElement
{
///
- /// Deserializes a JSON string into an object of type Container.
+ /// Deserializes a JSON string into an object of type TextBlock.
///
- public static Container? Deserialize(string json)
+ public static TextBlock? Deserialize(string json)
{
- return JsonSerializer.Deserialize(json);
+ return JsonSerializer.Deserialize(json);
}
///
- /// Must be **Container**.
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
+ ///
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
+
+ ///
+ /// Must be **TextBlock**.
///
[JsonPropertyName("type")]
- public string Type { get; } = "Container";
+ public string Type { get; } = "TextBlock";
///
/// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
@@ -3936,7 +5972,7 @@ public class Container : CardElement
/// 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; }
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
///
/// The locale associated with the element.
@@ -3948,19 +5984,19 @@ public class Container : CardElement
/// Controls the visibility of the element.
///
[JsonPropertyName("isVisible")]
- public bool? IsVisible { get; set; }
+ 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; }
+ 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; }
+ public ElementHeight? Height { get; set; } = ElementHeight.Auto;
///
/// Controls how the element should be horizontally aligned.
@@ -3972,7 +6008,7 @@ public class Container : CardElement
/// 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; }
+ 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).
@@ -3984,73 +6020,67 @@ public class Container : CardElement
/// 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; }
+ public bool? IsSortKey { get; set; } = false;
///
- /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met.
+ /// The text to display. A subset of markdown is supported.
///
- [JsonPropertyName("style")]
- public ContainerStyle? Style { get; set; }
+ [JsonPropertyName("text")]
+ public string? Text { get; set; }
///
- /// Controls if a border should be displayed around the container.
+ /// The size of the text.
///
- [JsonPropertyName("showBorder")]
- public bool? ShowBorder { get; set; }
+ [JsonPropertyName("size")]
+ public TextSize? Size { get; set; }
///
- /// Controls if the container should have rounded corners.
+ /// The weight of the text.
///
- [JsonPropertyName("roundedCorners")]
- public bool? RoundedCorners { get; set; }
+ [JsonPropertyName("weight")]
+ public TextWeight? Weight { 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.
+ /// The color of the text.
///
- [JsonPropertyName("layouts")]
- public IList? Layouts { get; set; }
+ [JsonPropertyName("color")]
+ public TextColor? Color { get; set; }
///
- /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding.
+ /// Controls whether the text should be renderer using a subtler variant of the select color.
///
- [JsonPropertyName("bleed")]
- public bool? Bleed { get; set; }
+ [JsonPropertyName("isSubtle")]
+ public bool? IsSubtle { get; set; }
///
- /// The minimum height, in pixels, of the container, in the `px` format.
+ /// The type of font to use for rendering.
///
- [JsonPropertyName("minHeight")]
- public string? MinHeight { get; set; }
+ [JsonPropertyName("fontType")]
+ public FontType? FontType { get; set; }
///
- /// Defines the container's background image.
+ /// Controls if the text should wrap.
///
- [JsonPropertyName("backgroundImage")]
- public IUnion? BackgroundImage { get; set; }
+ [JsonPropertyName("wrap")]
+ public bool? Wrap { get; set; } = false;
///
- /// Controls how the container's content should be vertically aligned.
+ /// The maximum number of lines to display.
///
- [JsonPropertyName("verticalContentAlignment")]
- public VerticalAlignment? VerticalContentAlignment { get; set; }
+ [JsonPropertyName("maxLines")]
+ public float? MaxLines { get; set; }
///
- /// Controls if the content of the card is to be rendered left-to-right or right-to-left.
+ /// The style of the text.
///
- [JsonPropertyName("rtl")]
- public bool? Rtl { get; set; }
+ [JsonPropertyName("style")]
+ public TextBlockStyle? Style { 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.
+ /// The Id of the input the TextBlock should act as the label of.
///
- [JsonPropertyName("maxHeight")]
- public string? MaxHeight { get; set; }
+ [JsonPropertyName("labelFor")]
+ public string? LabelFor { get; set; }
///
/// The area of a Layout.AreaGrid layout in which an element should be displayed.
@@ -4064,19 +6094,13 @@ public class Container : CardElement
[JsonPropertyName("fallback")]
public IUnion? Fallback { get; set; }
- ///
- /// The elements in the container.
- ///
- [JsonPropertyName("items")]
- public IList? Items { get; set; }
-
- public Container(params IList items)
+ public TextBlock(string text)
{
- this.Items = items;
+ this.Text = text;
}
///
- /// Serializes this Container into a JSON string.
+ /// Serializes this TextBlock into a JSON string.
///
public string Serialize()
{
@@ -4090,169 +6114,169 @@ public string Serialize()
);
}
- public Container WithId(string value)
+ public TextBlock WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public TextBlock WithId(string value)
{
this.Id = value;
return this;
}
- public Container WithRequires(HostCapabilities value)
+ public TextBlock WithRequires(HostCapabilities value)
{
this.Requires = value;
return this;
}
- public Container WithLang(string value)
+ public TextBlock WithLang(string value)
{
this.Lang = value;
return this;
}
- public Container WithIsVisible(bool value)
+ public TextBlock WithIsVisible(bool value)
{
this.IsVisible = value;
return this;
}
- public Container WithSeparator(bool value)
+ public TextBlock WithSeparator(bool value)
{
this.Separator = value;
return this;
}
- public Container WithHeight(ElementHeight value)
+ public TextBlock WithHeight(ElementHeight value)
{
this.Height = value;
return this;
}
- public Container WithHorizontalAlignment(HorizontalAlignment value)
+ public TextBlock WithHorizontalAlignment(HorizontalAlignment value)
{
this.HorizontalAlignment = value;
return this;
}
- public Container WithSpacing(Spacing value)
+ public TextBlock WithSpacing(Spacing value)
{
this.Spacing = value;
return this;
}
- public Container WithTargetWidth(TargetWidth value)
+ public TextBlock WithTargetWidth(TargetWidth value)
{
this.TargetWidth = value;
return this;
}
- public Container WithIsSortKey(bool value)
+ public TextBlock WithIsSortKey(bool value)
{
this.IsSortKey = value;
return this;
}
- public Container WithSelectAction(Action value)
- {
- this.SelectAction = value;
- return this;
- }
-
- public Container WithStyle(ContainerStyle value)
+ public TextBlock WithText(string value)
{
- this.Style = value;
+ this.Text = value;
return this;
}
- public Container WithShowBorder(bool value)
+ public TextBlock WithSize(TextSize value)
{
- this.ShowBorder = value;
+ this.Size = value;
return this;
}
- public Container WithRoundedCorners(bool value)
+ public TextBlock WithWeight(TextWeight value)
{
- this.RoundedCorners = value;
+ this.Weight = value;
return this;
}
- public Container WithLayouts(params IList value)
+ public TextBlock WithColor(TextColor value)
{
- this.Layouts = value;
+ this.Color = value;
return this;
}
- public Container WithBleed(bool value)
+ public TextBlock WithIsSubtle(bool value)
{
- this.Bleed = value;
+ this.IsSubtle = value;
return this;
}
- public Container WithMinHeight(string value)
+ public TextBlock WithFontType(FontType value)
{
- this.MinHeight = value;
+ this.FontType = value;
return this;
}
- public Container WithBackgroundImage(IUnion value)
+ public TextBlock WithWrap(bool value)
{
- this.BackgroundImage = value;
+ this.Wrap = value;
return this;
}
- public Container WithVerticalContentAlignment(VerticalAlignment value)
+ public TextBlock WithMaxLines(float value)
{
- this.VerticalContentAlignment = value;
+ this.MaxLines = value;
return this;
}
- public Container WithRtl(bool value)
+ public TextBlock WithStyle(TextBlockStyle value)
{
- this.Rtl = value;
+ this.Style = value;
return this;
}
- public Container WithMaxHeight(string value)
+ public TextBlock WithLabelFor(string value)
{
- this.MaxHeight = value;
+ this.LabelFor = value;
return this;
}
- public Container WithGridArea(string value)
+ public TextBlock WithGridArea(string value)
{
this.GridArea = value;
return this;
}
- public Container WithFallback(IUnion value)
+ public TextBlock WithFallback(IUnion value)
{
this.Fallback = value;
return this;
}
-
- public Container WithItems(params IList value)
- {
- this.Items = value;
- return this;
- }
}
///
-/// Displays a set of action, which can be placed anywhere in the card.
+/// A set of facts, displayed as a table or a vertical list when horizontal space is constrained.
///
-public class ActionSet : CardElement
+public class FactSet : CardElement
{
///
- /// Deserializes a JSON string into an object of type ActionSet.
+ /// Deserializes a JSON string into an object of type FactSet.
///
- public static ActionSet? Deserialize(string json)
+ public static FactSet? Deserialize(string json)
{
- return JsonSerializer.Deserialize(json);
+ return JsonSerializer.Deserialize(json);
}
///
- /// Must be **ActionSet**.
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
+ ///
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
+
+ ///
+ /// Must be **FactSet**.
///
[JsonPropertyName("type")]
- public string Type { get; } = "ActionSet";
+ public string Type { get; } = "FactSet";
///
/// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
@@ -4264,7 +6288,7 @@ public class ActionSet : CardElement
/// 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; }
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
///
/// The locale associated with the element.
@@ -4276,31 +6300,25 @@ public class ActionSet : CardElement
/// Controls the visibility of the element.
///
[JsonPropertyName("isVisible")]
- public bool? IsVisible { get; set; }
+ 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; }
+ 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; }
-
- ///
- /// Controls how the element should be horizontally aligned.
- ///
- [JsonPropertyName("horizontalAlignment")]
- public HorizontalAlignment? HorizontalAlignment { get; set; }
+ 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; }
+ 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).
@@ -4312,7 +6330,13 @@ public class ActionSet : CardElement
/// 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; }
+ public bool? IsSortKey { get; set; } = false;
+
+ ///
+ /// The facts in the set.
+ ///
+ [JsonPropertyName("facts")]
+ public IList? Facts { get; set; }
///
/// The area of a Layout.AreaGrid layout in which an element should be displayed.
@@ -4326,19 +6350,13 @@ public class ActionSet : CardElement
[JsonPropertyName("fallback")]
public IUnion? Fallback { get; set; }
- ///
- /// The actions in the set.
- ///
- [JsonPropertyName("actions")]
- public IList? Actions { get; set; }
-
- public ActionSet(params IList actions)
+ public FactSet(params IList facts)
{
- this.Actions = actions;
+ this.Facts = facts;
}
///
- /// Serializes this ActionSet into a JSON string.
+ /// Serializes this FactSet into a JSON string.
///
public string Serialize()
{
@@ -4352,103 +6370,180 @@ public string Serialize()
);
}
- public ActionSet WithId(string value)
+ public FactSet WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public FactSet WithId(string value)
{
this.Id = value;
return this;
}
- public ActionSet WithRequires(HostCapabilities value)
+ public FactSet WithRequires(HostCapabilities value)
{
this.Requires = value;
return this;
}
- public ActionSet WithLang(string value)
+ public FactSet WithLang(string value)
{
this.Lang = value;
return this;
}
- public ActionSet WithIsVisible(bool value)
+ public FactSet WithIsVisible(bool value)
{
this.IsVisible = value;
return this;
}
- public ActionSet WithSeparator(bool value)
+ public FactSet WithSeparator(bool value)
{
this.Separator = value;
return this;
}
- public ActionSet WithHeight(ElementHeight value)
+ public FactSet WithHeight(ElementHeight value)
{
this.Height = value;
return this;
}
- public ActionSet WithHorizontalAlignment(HorizontalAlignment value)
+ public FactSet WithSpacing(Spacing value)
{
- this.HorizontalAlignment = value;
+ this.Spacing = value;
return this;
}
- public ActionSet WithSpacing(Spacing value)
+ public FactSet WithTargetWidth(TargetWidth value)
{
- this.Spacing = value;
+ this.TargetWidth = value;
return this;
}
- public ActionSet WithTargetWidth(TargetWidth value)
+ public FactSet WithIsSortKey(bool value)
{
- this.TargetWidth = value;
+ this.IsSortKey = value;
return this;
}
- public ActionSet WithIsSortKey(bool value)
+ public FactSet WithFacts(params IList value)
{
- this.IsSortKey = value;
+ this.Facts = value;
return this;
}
- public ActionSet WithGridArea(string value)
+ public FactSet WithGridArea(string value)
{
this.GridArea = value;
return this;
}
- public ActionSet WithFallback(IUnion value)
+ public FactSet WithFallback(IUnion value)
{
this.Fallback = value;
return this;
}
+}
- public ActionSet WithActions(params IList value)
+///
+/// A fact in a FactSet element.
+///
+public class Fact : SerializableObject
+{
+ ///
+ /// Deserializes a JSON string into an object of type Fact.
+ ///
+ public static Fact? Deserialize(string json)
{
- this.Actions = value;
+ return JsonSerializer.Deserialize(json);
+ }
+
+ ///
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
+ ///
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
+
+ ///
+ /// The fact's title.
+ ///
+ [JsonPropertyName("title")]
+ public string? Title { get; set; }
+
+ ///
+ /// The fact's value.
+ ///
+ [JsonPropertyName("value")]
+ public string? Value { get; set; }
+
+ public Fact(string title, string value)
+ {
+ this.Title = title;
+ this.Value = value;
+ }
+
+ ///
+ /// Serializes this Fact into a JSON string.
+ ///
+ public string Serialize()
+ {
+ return JsonSerializer.Serialize(
+ this,
+ new JsonSerializerOptions
+ {
+ WriteIndented = true,
+ DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
+ }
+ );
+ }
+
+ public Fact WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public Fact WithTitle(string value)
+ {
+ this.Title = value;
+ return this;
+ }
+
+ public Fact WithValue(string value)
+ {
+ this.Value = value;
return this;
}
}
///
-/// Splits the available horizontal space into separate columns, so elements can be organized in a row.
+/// A set of images, displayed side-by-side and wrapped across multiple rows as needed.
///
-public class ColumnSet : CardElement
+public class ImageSet : CardElement
{
///
- /// Deserializes a JSON string into an object of type ColumnSet.
+ /// Deserializes a JSON string into an object of type ImageSet.
///
- public static ColumnSet? Deserialize(string json)
+ public static ImageSet? Deserialize(string json)
{
- return JsonSerializer.Deserialize(json);
+ return JsonSerializer.Deserialize(json);
}
///
- /// Must be **ColumnSet**.
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
+ ///
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
+
+ ///
+ /// Must be **ImageSet**.
///
[JsonPropertyName("type")]
- public string Type { get; } = "ColumnSet";
+ public string Type { get; } = "ImageSet";
///
/// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
@@ -4460,7 +6555,7 @@ public class ColumnSet : CardElement
/// 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; }
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
///
/// The locale associated with the element.
@@ -4472,19 +6567,19 @@ public class ColumnSet : CardElement
/// Controls the visibility of the element.
///
[JsonPropertyName("isVisible")]
- public bool? IsVisible { get; set; }
+ 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; }
+ 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; }
+ public ElementHeight? Height { get; set; } = ElementHeight.Auto;
///
/// Controls how the element should be horizontally aligned.
@@ -4496,7 +6591,7 @@ public class ColumnSet : CardElement
/// 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; }
+ 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).
@@ -4507,44 +6602,20 @@ public class ColumnSet : CardElement
///
/// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
///
- [JsonPropertyName("isSortKey")]
- public bool? IsSortKey { get; set; }
-
- ///
- /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported.
- ///
- [JsonPropertyName("selectAction")]
- public Action? SelectAction { get; set; }
-
- ///
- /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met.
- ///
- [JsonPropertyName("style")]
- public ContainerStyle? Style { get; set; }
-
- ///
- /// Controls if a border should be displayed around the container.
- ///
- [JsonPropertyName("showBorder")]
- public bool? ShowBorder { get; set; }
-
- ///
- /// Controls if the container should have rounded corners.
- ///
- [JsonPropertyName("roundedCorners")]
- public bool? RoundedCorners { get; set; }
+ [JsonPropertyName("isSortKey")]
+ public bool? IsSortKey { get; set; } = false;
///
- /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding.
+ /// The images in the set.
///
- [JsonPropertyName("bleed")]
- public bool? Bleed { get; set; }
+ [JsonPropertyName("images")]
+ public IList? Images { get; set; }
///
- /// The minimum height, in pixels, of the container, in the `px` format.
+ /// The size to use to render all images in the set.
///
- [JsonPropertyName("minHeight")]
- public string? MinHeight { get; set; }
+ [JsonPropertyName("imageSize")]
+ public ImageSize? ImageSize { get; set; } = ImageSize.Medium;
///
/// The area of a Layout.AreaGrid layout in which an element should be displayed.
@@ -4558,14 +6629,13 @@ public class ColumnSet : CardElement
[JsonPropertyName("fallback")]
public IUnion? Fallback { get; set; }
- ///
- /// The columns in the set.
- ///
- [JsonPropertyName("columns")]
- public IList? Columns { get; set; }
+ public ImageSet(params IList images)
+ {
+ this.Images = images;
+ }
///
- /// Serializes this ColumnSet into a JSON string.
+ /// Serializes this ImageSet into a JSON string.
///
public string Serialize()
{
@@ -4579,139 +6649,121 @@ public string Serialize()
);
}
- public ColumnSet WithId(string value)
+ public ImageSet WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public ImageSet WithId(string value)
{
this.Id = value;
return this;
}
- public ColumnSet WithRequires(HostCapabilities value)
+ public ImageSet WithRequires(HostCapabilities value)
{
this.Requires = value;
return this;
}
- public ColumnSet WithLang(string value)
+ public ImageSet WithLang(string value)
{
this.Lang = value;
return this;
}
- public ColumnSet WithIsVisible(bool value)
+ public ImageSet WithIsVisible(bool value)
{
this.IsVisible = value;
return this;
}
- public ColumnSet WithSeparator(bool value)
+ public ImageSet WithSeparator(bool value)
{
this.Separator = value;
return this;
}
- public ColumnSet WithHeight(ElementHeight value)
+ public ImageSet WithHeight(ElementHeight value)
{
this.Height = value;
return this;
}
- public ColumnSet WithHorizontalAlignment(HorizontalAlignment value)
+ public ImageSet WithHorizontalAlignment(HorizontalAlignment value)
{
this.HorizontalAlignment = value;
return this;
}
- public ColumnSet WithSpacing(Spacing value)
+ public ImageSet WithSpacing(Spacing value)
{
this.Spacing = value;
return this;
}
- public ColumnSet WithTargetWidth(TargetWidth value)
+ public ImageSet WithTargetWidth(TargetWidth value)
{
this.TargetWidth = value;
return this;
}
- public ColumnSet WithIsSortKey(bool value)
+ public ImageSet 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)
+ public ImageSet WithImages(params IList value)
{
- this.Bleed = value;
+ this.Images = value;
return this;
}
- public ColumnSet WithMinHeight(string value)
+ public ImageSet WithImageSize(ImageSize value)
{
- this.MinHeight = value;
+ this.ImageSize = value;
return this;
}
- public ColumnSet WithGridArea(string value)
+ public ImageSet WithGridArea(string value)
{
this.GridArea = value;
return this;
}
- public ColumnSet WithFallback(IUnion value)
+ public ImageSet WithFallback(IUnion value)
{
this.Fallback = value;
return this;
}
-
- public ColumnSet WithColumns(params IList value)
- {
- this.Columns = value;
- return this;
- }
}
///
-/// A media element, that makes it possible to embed videos inside a card.
+/// A standalone image element.
///
-public class Media : CardElement
+public class Image : CardElement
{
///
- /// Deserializes a JSON string into an object of type Media.
+ /// Deserializes a JSON string into an object of type Image.
///
- public static Media? Deserialize(string json)
+ public static Image? Deserialize(string json)
{
- return JsonSerializer.Deserialize(json);
+ return JsonSerializer.Deserialize(json);
}
///
- /// Must be **Media**.
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
+ ///
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
+
+ ///
+ /// Must be **Image**.
///
[JsonPropertyName("type")]
- public string Type { get; } = "Media";
+ public string Type { get; } = "Image";
///
/// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
@@ -4723,7 +6775,7 @@ public class Media : CardElement
/// 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; }
+ public HostCapabilities? Requires { get; set; } = new HostCapabilities();
///
/// The locale associated with the element.
@@ -4735,25 +6787,25 @@ public class Media : CardElement
/// Controls the visibility of the element.
///
[JsonPropertyName("isVisible")]
- public bool? IsVisible { get; set; }
+ 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; }
+ 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.
+ /// Controls how the element should be horizontally aligned.
///
- [JsonPropertyName("height")]
- public ElementHeight? Height { get; set; }
+ [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; }
+ 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).
@@ -4765,31 +6817,91 @@ public class Media : CardElement
/// 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; }
+ public bool? IsSortKey { get; set; } = false;
///
- /// The sources for the media. For YouTube, Dailymotion and Vimeo, only one source can be specified.
+ /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG.
///
- [JsonPropertyName("sources")]
- public IList? Sources { get; set; }
+ [JsonPropertyName("url")]
+ public string? Url { get; set; }
///
- /// The caption sources for the media. Caption sources are not used for YouTube, Dailymotion or Vimeo sources.
+ /// The alternate text for the image, used for accessibility purposes.
///
- [JsonPropertyName("captionSources")]
- public IList? CaptionSources { get; set; }
+ [JsonPropertyName("altText")]
+ public string? AltText { get; set; }
///
- /// The URL of the poster image to display.
+ /// The background color of the image.
///
- [JsonPropertyName("poster")]
- public string? Poster { get; set; }
+ [JsonPropertyName("backgroundColor")]
+ public string? BackgroundColor { get; set; }
///
- /// The alternate text for the media, used for accessibility purposes.
+ /// The style of the image.
///
- [JsonPropertyName("altText")]
- public string? AltText { get; set; }
+ [JsonPropertyName("style")]
+ public ImageStyle? Style { get; set; } = ImageStyle.Default;
+
+ ///
+ /// The size of the image.
+ ///
+ [JsonPropertyName("size")]
+ public Size? Size { get; set; } = Size.Auto;
+
+ ///
+ /// The width of the image.
+ ///
+ [JsonPropertyName("width")]
+ public string? Width { get; set; } = "auto";
+
+ ///
+ /// An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported.
+ ///
+ [JsonPropertyName("selectAction")]
+ public Action? SelectAction { get; set; }
+
+ ///
+ /// Controls if the image can be expanded to full screen.
+ ///
+ [JsonPropertyName("allowExpand")]
+ public bool? AllowExpand { get; set; } = false;
+
+ ///
+ /// Teams-specific metadata associated with the image.
+ ///
+ [JsonPropertyName("msteams")]
+ public TeamsImageProperties? Msteams { get; set; }
+
+ ///
+ /// A set of theme-specific image URLs.
+ ///
+ [JsonPropertyName("themedUrls")]
+ public IList? ThemedUrls { get; set; }
+
+ ///
+ /// Controls how the image should be fitted inside its bounding box. imageFit is only meaningful when both the width and height properties are set. When fitMode is set to contain, the default style is always used.
+ ///
+ [JsonPropertyName("fitMode")]
+ public ImageFitMode? FitMode { get; set; } = ImageFitMode.Fill;
+
+ ///
+ /// Controls the horizontal position of the image within its bounding box. horizontalContentAlignment is only meaningful when both the width and height properties are set and fitMode is set to either cover or contain.
+ ///
+ [JsonPropertyName("horizontalContentAlignment")]
+ public HorizontalAlignment? HorizontalContentAlignment { get; set; } = HorizontalAlignment.Left;
+
+ ///
+ /// Controls the vertical position of the image within its bounding box. verticalContentAlignment is only meaningful when both the width and height properties are set and fitMode is set to either cover or contain.
+ ///
+ [JsonPropertyName("verticalContentAlignment")]
+ public VerticalAlignment? VerticalContentAlignment { get; set; } = VerticalAlignment.Top;
+
+ ///
+ /// The height of the image.
+ ///
+ [JsonPropertyName("height")]
+ public string? Height { get; set; } = "auto";
///
/// The area of a Layout.AreaGrid layout in which an element should be displayed.
@@ -4803,8 +6915,13 @@ public class Media : CardElement
[JsonPropertyName("fallback")]
public IUnion? Fallback { get; set; }
+ public Image(string url)
+ {
+ this.Url = url;
+ }
+
///
- /// Serializes this Media into a JSON string.
+ /// Serializes this Image into a JSON string.
///
public string Serialize()
{
@@ -4818,183 +6935,190 @@ public string Serialize()
);
}
- public Media WithId(string value)
+ public Image WithKey(string value)
+ {
+ this.Key = value;
+ return this;
+ }
+
+ public Image WithId(string value)
{
this.Id = value;
return this;
}
- public Media WithRequires(HostCapabilities value)
+ public Image WithRequires(HostCapabilities value)
{
this.Requires = value;
return this;
}
- public Media WithLang(string value)
+ public Image WithLang(string value)
{
this.Lang = value;
return this;
}
- public Media WithIsVisible(bool value)
+ public Image WithIsVisible(bool value)
{
this.IsVisible = value;
return this;
}
- public Media WithSeparator(bool value)
+ public Image WithSeparator(bool value)
{
this.Separator = value;
return this;
}
- public Media WithHeight(ElementHeight value)
+ public Image WithHorizontalAlignment(HorizontalAlignment value)
{
- this.Height = value;
+ this.HorizontalAlignment = value;
return this;
}
- public Media WithSpacing(Spacing value)
+ public Image WithSpacing(Spacing value)
{
this.Spacing = value;
return this;
}
- public Media WithTargetWidth(TargetWidth value)
+ public Image WithTargetWidth(TargetWidth value)
{
this.TargetWidth = value;
return this;
}
- public Media WithIsSortKey(bool value)
+ public Image WithIsSortKey(bool value)
{
this.IsSortKey = value;
return this;
}
- public Media WithSources(params IList value)
+ public Image WithUrl(string value)
{
- this.Sources = value;
+ this.Url = value;
return this;
}
- public Media WithCaptionSources(params IList value)
+ public Image WithAltText(string value)
{
- this.CaptionSources = value;
+ this.AltText = value;
+ return this;
+ }
+
+ public Image WithBackgroundColor(string value)
+ {
+ this.BackgroundColor = value;
+ return this;
+ }
+
+ public Image WithStyle(ImageStyle value)
+ {
+ this.Style = value;
+ return this;
+ }
+
+ public Image WithSize(Size value)
+ {
+ this.Size = value;
+ return this;
+ }
+
+ public Image WithWidth(string value)
+ {
+ this.Width = value;
+ return this;
+ }
+
+ public Image WithSelectAction(Action value)
+ {
+ this.SelectAction = value;
+ return this;
+ }
+
+ public Image WithAllowExpand(bool value)
+ {
+ this.AllowExpand = value;
return this;
}
- public Media WithPoster(string value)
+ public Image WithMsteams(TeamsImageProperties value)
{
- this.Poster = value;
+ this.Msteams = value;
return this;
}
- public Media WithAltText(string value)
+ public Image WithThemedUrls(params IList value)
{
- this.AltText = value;
+ this.ThemedUrls = value;
return this;
}
- public Media WithGridArea(string value)
+ public Image WithFitMode(ImageFitMode value)
{
- this.GridArea = value;
+ this.FitMode = value;
return this;
}
- public Media WithFallback(IUnion value)
+ public Image WithHorizontalContentAlignment(HorizontalAlignment value)
{
- this.Fallback = value;
+ this.HorizontalContentAlignment = value;
return this;
}
-}
-///
-/// Defines the source URL of a media stream. YouTube, Dailymotion, Vimeo and Microsoft Stream URLs are supported.
-///
-public class MediaSource : SerializableObject
-{
- ///
- /// Deserializes a JSON string into an object of type MediaSource.
- ///
- public static MediaSource? Deserialize(string json)
+ public Image WithVerticalContentAlignment(VerticalAlignment value)
{
- return JsonSerializer.Deserialize(json);
+ this.VerticalContentAlignment = value;
+ return this;
}
- ///
- /// The MIME type of the source.
- ///
- [JsonPropertyName("mimeType")]
- public string? MimeType { get; set; }
-
- ///
- /// The URL of the source.
- ///
- [JsonPropertyName("url")]
- public string? Url { get; set; }
-
- ///
- /// Serializes this MediaSource into a JSON string.
- ///
- public string Serialize()
+ public Image WithHeight(string value)
{
- return JsonSerializer.Serialize(
- this,
- new JsonSerializerOptions
- {
- WriteIndented = true,
- DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
- }
- );
+ this.Height = value;
+ return this;
}
- public MediaSource WithMimeType(string value)
+ public Image WithGridArea(string value)
{
- this.MimeType = value;
+ this.GridArea = value;
return this;
}
- public MediaSource WithUrl(string value)
+ public Image WithFallback(IUnion value)
{
- this.Url = value;
+ this.Fallback = value;
return this;
}
}
///
-/// Defines a source URL for a video captions.
+/// Represents a set of Teams-specific properties on an image.
///
-public class CaptionSource : SerializableObject
+public class TeamsImageProperties : SerializableObject
{
///
- /// Deserializes a JSON string into an object of type CaptionSource.
+ /// Deserializes a JSON string into an object of type TeamsImageProperties.
///
- public static CaptionSource? Deserialize(string json)
+ public static TeamsImageProperties? Deserialize(string json)
{
- return JsonSerializer.Deserialize(json);
+ return JsonSerializer.Deserialize(json);
}
///
- /// The MIME type of the source.
- ///
- [JsonPropertyName("mimeType")]
- public string? MimeType { get; set; }
-
- ///
- /// The URL of the source.
+ /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
///
- [JsonPropertyName("url")]
- public string? Url { get; set; }
+ [JsonPropertyName("key")]
+ public string? Key { get; set; }
///
- /// The label of this caption source.
+ /// Controls if the image is expandable in Teams. This property is equivalent to the Image.allowExpand property.
///
- [JsonPropertyName("label")]
- public string? Label { get; set; }
+ [JsonPropertyName("allowExpand")]
+ public bool? AllowExpand { get; set; }
///
- /// Serializes this CaptionSource into a JSON string.
+ /// Serializes this TeamsImageProperties into a JSON string.
///
public string Serialize()
{
@@ -5008,43 +7132,43 @@ public string Serialize()
);
}
- public CaptionSource WithMimeType(string value)
- {
- this.MimeType = value;
- return this;
- }
-
- public CaptionSource WithUrl(string value)
+ public TeamsImageProperties WithKey(string value)
{
- this.Url = value;
+ this.Key = value;
return this;
}
- public CaptionSource WithLabel(string value)
+ public TeamsImageProperties WithAllowExpand(bool value)
{
- this.Label = value;
+ this.AllowExpand = value;
return this;
}
}
///
-/// A rich text block that displays formatted text.
+/// An input to allow the user to enter text.
///
-public class RichTextBlock : CardElement
+public class TextInput : CardElement
{
///
- /// Deserializes a JSON string into an object of type RichTextBlock.
+ /// Deserializes a JSON string into an object of type TextInput.
///
- public static RichTextBlock? Deserialize(string json)
+ public static TextInput? Deserialize(string json)
{
- return JsonSerializer.Deserialize(json);
+ return JsonSerializer.Deserialize