From 137404e323e812245fe6803542c53d41ce0c26b2 Mon Sep 17 00:00:00 2001 From: Corina Gum <> Date: Wed, 18 Mar 2026 12:17:23 -0700 Subject: [PATCH 01/10] Deprecate Adaptive Cards actions that now have generated replacements --- .../microsoft_teams/cards/actions/im_back_action.py | 11 ++++++++++- .../microsoft_teams/cards/actions/invoke_action.py | 10 ++++++++++ .../cards/actions/message_back_action.py | 10 ++++++++++ .../microsoft_teams/cards/actions/sign_in_action.py | 11 +++++++++++ .../cards/actions/task_fetch_action.py | 10 ++++++++++ 5 files changed, 51 insertions(+), 1 deletion(-) diff --git a/packages/cards/src/microsoft_teams/cards/actions/im_back_action.py b/packages/cards/src/microsoft_teams/cards/actions/im_back_action.py index d77cbe7e..de2df9eb 100644 --- a/packages/cards/src/microsoft_teams/cards/actions/im_back_action.py +++ b/packages/cards/src/microsoft_teams/cards/actions/im_back_action.py @@ -3,13 +3,22 @@ Licensed under the MIT License. """ +import warnings + from ..core import ImBackSubmitActionData, SubmitAction, SubmitActionData class IMBackAction(SubmitAction): - """Initial data that input fields will be combined with. These are essentially ‘hidden’ properties.""" + """This class is deprecated. Please use ImBackSubmitActionData instead. + This will be removed in a future version of the SDK.""" def __init__(self, value: str): + warnings.warn( + "IMBackAction is deprecated. Use ImBackSubmitActionData instead. " + "This will be removed in a future version of the SDK.", + DeprecationWarning, + stacklevel=2, + ) super().__init__() action_data = ImBackSubmitActionData().with_value(value) self.data = SubmitActionData(ms_teams=action_data.model_dump()) diff --git a/packages/cards/src/microsoft_teams/cards/actions/invoke_action.py b/packages/cards/src/microsoft_teams/cards/actions/invoke_action.py index 08af726f..a40741ae 100644 --- a/packages/cards/src/microsoft_teams/cards/actions/invoke_action.py +++ b/packages/cards/src/microsoft_teams/cards/actions/invoke_action.py @@ -3,13 +3,23 @@ Licensed under the MIT License. """ +import warnings from typing import Any, Dict from ..core import InvokeSubmitActionData, SubmitAction, SubmitActionData class InvokeAction(SubmitAction): + """This class is deprecated. Please use InvokeSubmitActionData instead. + This will be removed in a future version of the SDK.""" + def __init__(self, value: Dict[str, Any]): + warnings.warn( + "InvokeAction is deprecated. Use InvokeSubmitActionData instead. " + "This will be removed in a future version of the SDK.", + DeprecationWarning, + stacklevel=2, + ) super().__init__() action_data = InvokeSubmitActionData().with_value(value) self.data = SubmitActionData(ms_teams=action_data.model_dump()) diff --git a/packages/cards/src/microsoft_teams/cards/actions/message_back_action.py b/packages/cards/src/microsoft_teams/cards/actions/message_back_action.py index 627c70da..82b4c41d 100644 --- a/packages/cards/src/microsoft_teams/cards/actions/message_back_action.py +++ b/packages/cards/src/microsoft_teams/cards/actions/message_back_action.py @@ -3,13 +3,23 @@ Licensed under the MIT License. """ +import warnings from typing import Optional from ..core import MessageBackSubmitActionData, SubmitAction, SubmitActionData class MessageBackAction(SubmitAction): + """This class is deprecated. Please use MessageBackSubmitActionData instead. + This will be removed in a future version of the SDK.""" + def __init__(self, text: str, value: str, display_text: Optional[str] = None): + warnings.warn( + "MessageBackAction is deprecated. Use MessageBackSubmitActionData instead. " + "This will be removed in a future version of the SDK.", + DeprecationWarning, + stacklevel=2, + ) super().__init__() action_data = MessageBackSubmitActionData().with_value(value).with_text(text) diff --git a/packages/cards/src/microsoft_teams/cards/actions/sign_in_action.py b/packages/cards/src/microsoft_teams/cards/actions/sign_in_action.py index d81e8532..62a7fbc0 100644 --- a/packages/cards/src/microsoft_teams/cards/actions/sign_in_action.py +++ b/packages/cards/src/microsoft_teams/cards/actions/sign_in_action.py @@ -3,11 +3,22 @@ Licensed under the MIT License. """ +import warnings + from ..core import SigninSubmitActionData, SubmitAction, SubmitActionData class SignInAction(SubmitAction): + """This class is deprecated. Please use SigninSubmitActionData instead. + This will be removed in a future version of the SDK.""" + def __init__(self, value: str): + warnings.warn( + "SignInAction is deprecated. Use SigninSubmitActionData instead. " + "This will be removed in a future version of the SDK.", + DeprecationWarning, + stacklevel=2, + ) super().__init__() action_data = SigninSubmitActionData().with_value(value) self.data = SubmitActionData(ms_teams=action_data.model_dump()) diff --git a/packages/cards/src/microsoft_teams/cards/actions/task_fetch_action.py b/packages/cards/src/microsoft_teams/cards/actions/task_fetch_action.py index fc2cbd2d..1602ca9e 100644 --- a/packages/cards/src/microsoft_teams/cards/actions/task_fetch_action.py +++ b/packages/cards/src/microsoft_teams/cards/actions/task_fetch_action.py @@ -3,13 +3,23 @@ Licensed under the MIT License. """ +import warnings from typing import Any, Dict from ..core import SubmitAction, SubmitActionData, TaskFetchSubmitActionData class TaskFetchAction(SubmitAction): + """This class is deprecated. Please use TaskFetchSubmitActionData instead. + This will be removed in a future version of the SDK.""" + def __init__(self, value: Dict[str, Any]): + warnings.warn( + "TaskFetchAction is deprecated. Use TaskFetchSubmitActionData instead. " + "This will be removed in a future version of the SDK.", + DeprecationWarning, + stacklevel=2, + ) super().__init__() # For task/fetch, the action data actually goes in the SubmitActionData, not with # msteams. msteams simply contains { type: 'task/fetch' } From a59a310da5ccf436df23b0691b09e2820fe225f2 Mon Sep 17 00:00:00 2001 From: Corina Gum <> Date: Wed, 18 Mar 2026 16:04:03 -0700 Subject: [PATCH 02/10] Apply 3/18 generated core --- .../cards/src/microsoft_teams/cards/core.py | 3167 +++++++++++++---- 1 file changed, 2425 insertions(+), 742 deletions(-) diff --git a/packages/cards/src/microsoft_teams/cards/core.py b/packages/cards/src/microsoft_teams/cards/core.py index 2677ee58..79b7426e 100644 --- a/packages/cards/src/microsoft_teams/cards/core.py +++ b/packages/cards/src/microsoft_teams/cards/core.py @@ -1,14 +1,9 @@ -""" -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the MIT License. -""" - -# This file was automatically generated by a tool on 08/20/2025, 10:35 PM UTC. +# This file was automatically generated by a tool on 03/18/2026, 10:44 PM UTC. DO NOT UPDATE MANUALLY. # It includes declarations for Adaptive Card features available in Teams, Copilot, Outlook, Word, Excel, PowerPoint. from typing import Any, Dict, List, Literal, Optional, Self, Union -from pydantic import AliasGenerator, BaseModel, ConfigDict, Field, SerializeAsAny +from pydantic import AliasGenerator, BaseModel, ConfigDict, Field from pydantic.alias_generators import to_camel @@ -27,14 +22,6 @@ def validation_alias_generator(field: str) -> str: if field == "from_": return "from" - # Handle ms_teams field which should deserialize from msteams - if field == "ms_teams": - return "msteams" - - # Handle choices_data field which should deserialize from choices.data - if field == "choices_data": - return "choices.data" - # All other fields are converted to camelCase return to_camel(field) @@ -50,14 +37,6 @@ def serialization_alias_generator(field: str) -> str: if field == "from_": return "from" - # Handle ms_teams field which should serialize to msteams - if field == "ms_teams": - return "msteams" - - # Handle choices_data field which should serialize to choices.data - if field == "choices_data": - return "choices.data" - # All other fields are converted to camelCase return to_camel(field) @@ -70,24 +49,19 @@ def serialization_alias_generator(field: str) -> str: alias_generator=AliasGenerator( validation_alias=validation_alias_generator, serialization_alias=serialization_alias_generator ), - ) + ) class CardElement(SerializableObject): """Base class for CardElement.""" - pass - class Action(SerializableObject): """Base class for Action.""" - pass - class ContainerLayout(SerializableObject): """Base class for ContainerLayout.""" - pass @@ -95,47 +69,24 @@ class ContainerLayout(SerializableObject): ActionMode = Literal["primary", "secondary"] -AssociatedInputs = Literal["auto", "none"] +ThemeName = Literal["Light", "Dark"] -ImageInsertPosition = Literal["Selection", "Top", "Bottom"] +ElementHeight = Literal["auto", "stretch"] -FallbackAction = Literal["drop"] +HorizontalAlignment = Literal["Left", "Center", "Right"] -ContainerStyle = Literal["default", "emphasis", "accent", "good", "attention", "warning"] +Spacing = Literal["None", "ExtraSmall", "Small", "Default", "Medium", "Large", "ExtraLarge", "Padding"] -TargetWidth = Literal[ - "VeryNarrow", - "Narrow", - "Standard", - "Wide", - "atLeast:VeryNarrow", - "atMost:VeryNarrow", - "atLeast:Narrow", - "atMost:Narrow", - "atLeast:Standard", - "atMost:Standard", - "atLeast:Wide", - "atMost:Wide", -] +TargetWidth = Literal["VeryNarrow", "Narrow", "Standard", "Wide", "atLeast:VeryNarrow", "atMost:VeryNarrow", "atLeast:Narrow", "atMost:Narrow", "atLeast:Standard", "atMost:Standard", "atLeast:Wide", "atMost:Wide"] -HorizontalAlignment = Literal["Left", "Center", "Right"] +ContainerStyle = Literal["default", "emphasis", "accent", "good", "attention", "warning"] VerticalAlignment = Literal["Top", "Center", "Bottom"] FlowLayoutItemFit = Literal["Fit", "Fill"] -Spacing = Literal["None", "ExtraSmall", "Small", "Default", "Medium", "Large", "ExtraLarge", "Padding"] - FillMode = Literal["Cover", "RepeatHorizontally", "RepeatVertically", "Repeat"] -Version = Literal["1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6"] - -TeamsCardWidth = Literal["full"] - -MentionType = Literal["Person", "Tag"] - -ElementHeight = Literal["auto", "stretch"] - TextSize = Literal["Small", "Default", "Medium", "Large", "ExtraLarge"] TextWeight = Literal["Lighter", "Default", "Bolder"] @@ -144,14 +95,20 @@ class ContainerLayout(SerializableObject): FontType = Literal["Default", "Monospace"] -StyleEnum = Literal["compact", "expanded", "filtered"] +TextBlockStyle = Literal["default", "columnHeader", "heading"] ImageStyle = Literal["Default", "Person", "RoundedCorners"] Size = Literal["Auto", "Stretch", "Small", "Medium", "Large"] +ImageFitMode = Literal["Cover", "Contain", "Fill"] + InputTextStyle = Literal["Text", "Tel", "Url", "Email", "Password"] +AssociatedInputs = Literal["auto", "none"] + +ChoiceSetInputStyle = Literal["compact", "expanded", "filtered"] + RatingSize = Literal["Medium", "Large"] RatingColor = Literal["Neutral", "Marigold"] @@ -174,72 +131,27 @@ class ContainerLayout(SerializableObject): BadgeStyle = Literal["Default", "Subtle", "Informative", "Accent", "Good", "Attention", "Warning"] -ChartColorSet = Literal["categorical", "sequential", "diverging"] - -ChartColor = Literal[ - "good", - "warning", - "attention", - "neutral", - "categoricalRed", - "categoricalPurple", - "categoricalLavender", - "categoricalBlue", - "categoricalLightBlue", - "categoricalTeal", - "categoricalGreen", - "categoricalLime", - "categoricalMarigold", - "sequential1", - "sequential2", - "sequential3", - "sequential4", - "sequential5", - "sequential6", - "sequential7", - "sequential8", - "divergingBlue", - "divergingLightBlue", - "divergingCyan", - "divergingTeal", - "divergingYellow", - "divergingPeach", - "divergingLightRed", - "divergingRed", - "divergingMaroon", - "divergingGray", -] +ProgressRingLabelPosition = Literal["Before", "After", "Above", "Below"] + +ProgressRingSize = Literal["Tiny", "Small", "Medium", "Large"] + +ProgressBarColor = Literal["Accent", "Good", "Warning", "Attention"] + +ChartColorSet = Literal["categorical", "sequential", "sequentialred", "sequentialgreen", "sequentialyellow", "diverging"] + +ChartColor = Literal["good", "warning", "attention", "neutral", "categoricalRed", "categoricalPurple", "categoricalLavender", "categoricalBlue", "categoricalLightBlue", "categoricalTeal", "categoricalGreen", "categoricalLime", "categoricalMarigold", "sequential1", "sequential2", "sequential3", "sequential4", "sequential5", "sequential6", "sequential7", "sequential8", "divergingBlue", "divergingLightBlue", "divergingCyan", "divergingTeal", "divergingYellow", "divergingPeach", "divergingLightRed", "divergingRed", "divergingMaroon", "divergingGray", "sequentialRed1", "sequentialRed2", "sequentialRed3", "sequentialRed4", "sequentialRed5", "sequentialRed6", "sequentialRed7", "sequentialRed8", "sequentialGreen1", "sequentialGreen2", "sequentialGreen3", "sequentialGreen4", "sequentialGreen5", "sequentialGreen6", "sequentialGreen7", "sequentialGreen8", "sequentialYellow1", "sequentialYellow2", "sequentialYellow3", "sequentialYellow4", "sequentialYellow5", "sequentialYellow6", "sequentialYellow7", "sequentialYellow8"] + +DonutThickness = Literal["Thin", "Thick"] HorizontalBarChartDisplayMode = Literal["AbsoluteWithAxis", "AbsoluteNoAxis", "PartToWhole"] GaugeChartValueFormat = Literal["Percentage", "Fraction"] -CodeLanguage = Literal[ - "Bash", - "C", - "Cpp", - "CSharp", - "Css", - "Dos", - "Go", - "Graphql", - "Html", - "Java", - "JavaScript", - "Json", - "ObjectiveC", - "Perl", - "Php", - "PlainText", - "PowerShell", - "Python", - "Sql", - "TypeScript", - "VbNet", - "Verilog", - "Vhdl", - "Xml", -] +CodeLanguage = Literal["Bash", "C", "Cpp", "CSharp", "Css", "Dos", "Go", "Graphql", "Html", "Java", "JavaScript", "Json", "ObjectiveC", "Perl", "Php", "PlainText", "PowerShell", "Python", "Sql", "TypeScript", "VbNet", "Verilog", "Vhdl", "Xml"] + +PersonaIconStyle = Literal["profilePicture", "contactCard", "none"] + +PersonaDisplayStyle = Literal["iconAndName", "iconOnly", "nameOnly"] FallbackElement = Literal["drop"] @@ -247,28 +159,80 @@ class ContainerLayout(SerializableObject): SizeEnum = Literal["Small", "Default", "Medium", "Large", "ExtraLarge"] -ThemeName = Literal["Light", "Dark"] +PopoverPosition = Literal["Above", "Below", "Before", "After"] + +FallbackAction = Literal["drop"] + +ImageInsertPosition = Literal["Selection", "Top", "Bottom"] + +Version = Literal["1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6"] + +TeamsCardWidth = Literal["full"] + +MentionType = Literal["Person", "Tag"] class HostCapabilities(SerializableObject): """Represents a list of versioned capabilities a host application must support.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + + +class ThemedUrl(SerializableObject): + """Defines a theme-specific URL.""" + + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + theme: Optional[ThemeName] = "Light" + """ The theme this URL applies to. """ + + url: Optional[str] = None + """ The URL to use for the associated theme. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + + def with_theme(self, value: ThemeName) -> Self: + self.theme = value + return self + + def with_url(self, value: str) -> Self: + self.url = value + return self + class BackgroundImage(SerializableObject): """Defines a container's background image and the way it should be rendered.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + url: Optional[str] = None """ The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. """ - fill_mode: Optional[FillMode] = None + fill_mode: Optional[FillMode] = "Cover" """ Controls how the image should fill the area. """ - horizontal_alignment: Optional[HorizontalAlignment] = None + horizontal_alignment: Optional[HorizontalAlignment] = "Left" """ Controls how the image should be aligned if it must be cropped or if using repeat fill mode. """ - vertical_alignment: Optional[VerticalAlignment] = None + vertical_alignment: Optional[VerticalAlignment] = "Top" """ Controls how the image should be aligned if it must be cropped or if using repeat fill mode. """ + themed_urls: Optional[List[ThemedUrl]] = None + """ A set of theme-specific image URLs. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_url(self, value: str) -> Self: self.url = value return self @@ -285,26 +249,42 @@ def with_vertical_alignment(self, value: VerticalAlignment) -> Self: self.vertical_alignment = value return self + def with_themed_urls(self, value: List[ThemedUrl]) -> Self: + self.themed_urls = value + return self + class SubmitActionData(SerializableObject): - """Represents the data of an Action.Submit. This model can include arbitrary data""" + """Represents the data of an Action.Submit.""" - ms_teams: Optional[Dict[str, Any]] = None + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + msteams: Optional[Dict[str, Any]] = None """ Defines the optional Teams-specific portion of the action's data. """ - def with_ms_teams(self, value: Dict[str, Any]) -> Self: - self.ms_teams = value + ms_teams: Optional[Dict[str, Any]] = None + """ Defines the optional Teams-specific portion of the action's data. Equivalent to `msteams`. """ + + def with_key(self, value: str) -> Self: + self.key = value return self - def with_data(self, value: Dict[str, Any]) -> Self: - for k, v in value.items(): - setattr(self, k, v) + def with_msteams(self, value: Dict[str, Any]) -> Self: + self.msteams = value + return self + + def with_ms_teams(self, value: Dict[str, Any]) -> Self: + self.ms_teams = value return self class ExecuteAction(Action): """Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can respond synchronously and return an updated Adaptive Card to be displayed by the client. Action.Execute works in all Adaptive Card hosts.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Action.Execute"] = "Action.Execute" """ Must be **Action.Execute**. """ @@ -322,10 +302,10 @@ class ExecuteAction(Action): `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](topic:icon-catalog) instead of an image. """ - style: Optional[ActionStyle] = None + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - mode: Optional[ActionMode] = None + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ tooltip: Optional[str] = None @@ -334,7 +314,13 @@ class ExecuteAction(Action): is_enabled: Optional[bool] = True """ 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. """ - data: Optional[Union[str, Dict[str, Any], SubmitActionData]] = None + menu_actions: Optional[List[Action]] = None + """ The actions to display in the overflow menu of a Split action button. """ + + themed_icon_urls: Optional[List[ThemedUrl]] = None + """ A set of theme-specific icon URLs. """ + + data: Optional[Union[str, SubmitActionData]] = None """ 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. """ associated_inputs: Optional[AssociatedInputs] = None @@ -346,9 +332,13 @@ class ExecuteAction(Action): verb: Optional[str] = None """ The verb of the action. """ - fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None + fallback: Optional[Union[Action, FallbackAction]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -381,7 +371,15 @@ def with_is_enabled(self, value: bool) -> Self: self.is_enabled = value return self - def with_data(self, value: Union[str, Dict[str, Any], SubmitActionData]) -> Self: + def with_menu_actions(self, value: List[Action]) -> Self: + self.menu_actions = value + return self + + def with_themed_icon_urls(self, value: List[ThemedUrl]) -> Self: + self.themed_icon_urls = value + return self + + def with_data(self, value: Union[str, SubmitActionData]) -> Self: self.data = value return self @@ -405,12 +403,19 @@ def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: class RefreshDefinition(SerializableObject): """Defines how a card can be refreshed by making a request to the target Bot.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + action: Optional[ExecuteAction] = None """ The Action.Execute action to invoke to refresh the card. """ user_ids: Optional[List[str]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_action(self, value: ExecuteAction) -> Self: self.action = value return self @@ -423,6 +428,9 @@ def with_user_ids(self, value: List[str]) -> Self: class AuthCardButton(SerializableObject): """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).""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Optional[str] = None """ Must be **signin**. """ @@ -435,6 +443,10 @@ class AuthCardButton(SerializableObject): value: Optional[str] = None """ The value associated with the button. The meaning of value depends on the button’s type. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_type(self, value: str) -> Self: self.type = value return self @@ -455,6 +467,9 @@ def with_value(self, value: str) -> Self: class TokenExchangeResource(SerializableObject): """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)""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + id: Optional[str] = None """ The unique identified of this token exchange instance. """ @@ -464,6 +479,10 @@ class TokenExchangeResource(SerializableObject): provider_id: Optional[str] = None """ An identifier for the identity provider with which to attempt a token exchange. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -480,6 +499,9 @@ def with_provider_id(self, value: str) -> Self: class Authentication(SerializableObject): """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)""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + text: Optional[str] = None """ The text that can be displayed to the end user when prompting them to authenticate. """ @@ -492,6 +514,10 @@ class Authentication(SerializableObject): token_exchange_resource: Optional[TokenExchangeResource] = None """ Provides information required to enable on-behalf-of single sign-on user authentication. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_text(self, value: str) -> Self: self.text = value return self @@ -512,15 +538,22 @@ def with_token_exchange_resource(self, value: TokenExchangeResource) -> Self: class MentionedEntity(SerializableObject): """Represents a mentioned person or tag.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + id: Optional[str] = None """ The Id of a person (typically a Microsoft Entra user Id) or tag. """ name: Optional[str] = None """ The name of the mentioned entity. """ - mention_type: Optional[MentionType] = None + mention_type: Optional[MentionType] = "Person" """ The type of the mentioned entity. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -537,6 +570,9 @@ def with_mention_type(self, value: MentionType) -> Self: class Mention(SerializableObject): """Represents a mention to a person.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["mention"] = "mention" """ Must be **mention**. """ @@ -546,6 +582,10 @@ class Mention(SerializableObject): mentioned: Optional[MentionedEntity] = None """ Defines the entity being mentioned. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_text(self, value: str) -> Self: self.text = value return self @@ -558,6 +598,9 @@ def with_mentioned(self, value: MentionedEntity) -> Self: class TeamsCardProperties(SerializableObject): """Represents a set of Teams-specific properties on a card.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + width: Optional[TeamsCardWidth] = None """ Controls the width of the card in a Teams chat. @@ -566,6 +609,10 @@ class TeamsCardProperties(SerializableObject): entities: Optional[List[Mention]] = None """ The Teams-specific entities associated with the card. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_width(self, value: TeamsCardWidth) -> Self: self.width = value return self @@ -578,17 +625,70 @@ def with_entities(self, value: List[Mention]) -> Self: class CardMetadata(SerializableObject): """Card-level metadata.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + web_url: Optional[str] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_web_url(self, value: str) -> Self: self.web_url = value return self +class StringResource(SerializableObject): + """Defines the replacement string values.""" + + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + default_value: Optional[str] = None + """ The default value of the string, which is used when no matching localized value is found. """ + + localized_values: Optional[Dict[str, str]] = None + """ Localized values of the string, where keys represent the locale (e.g. `en-US`) in the `(-)` format. `` is the 2-letter language code and `` is the optional 2-letter country code. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + + def with_default_value(self, value: str) -> Self: + self.default_value = value + return self + + def with_localized_values(self, value: Dict[str, str]) -> Self: + self.localized_values = value + return self + + +class Resources(SerializableObject): + """The resources that can be used in the body of the card.""" + + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + strings: Optional[Dict[str, StringResource]] = None + """ String resources that can provide translations in multiple languages. String resources make it possible to craft cards that are automatically localized according to the language settings of the application that displays the card. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + + def with_strings(self, value: Dict[str, StringResource]) -> Self: + self.strings = value + return self + + class AdaptiveCard(CardElement): """An Adaptive Card, containing a free-form body of card elements, and an optional set of actions.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["AdaptiveCard"] = "AdaptiveCard" """ Must be **AdaptiveCard**. """ @@ -610,7 +710,7 @@ class AdaptiveCard(CardElement): style: Optional[ContainerStyle] = None """ 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. """ - layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None + layouts: Optional[List[ContainerLayout]] = None """ 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](topic:container-layouts) for more details. """ min_height: Optional[str] = None @@ -625,10 +725,10 @@ class AdaptiveCard(CardElement): rtl: Optional[bool] = None """ Controls if the content of the card is to be rendered left-to-right or right-to-left. """ - ac_schema: Optional[str] = Field(default=None, alias="schema") + ac_schema: Optional[str] = Field(None, alias="schema") """ A URL to the Adaptive Card schema the card is authored against. """ - version: Optional[Version] = None + version: Optional[Version] = "1.5" """ The Adaptive Card schema version the card is authored against. """ fallback_text: Optional[str] = None @@ -643,24 +743,34 @@ class AdaptiveCard(CardElement): authentication: Optional[Authentication] = None """ Defines authentication information to enable on-behalf-of single-sign-on or just-in-time OAuth. This information is used in conjunction with the refresh property and Action.Execute in general. """ - ms_teams: Optional[TeamsCardProperties] = None + msteams: Optional[TeamsCardProperties] = None """ Teams-specific metadata associated with the card. """ + ms_teams: Optional[TeamsCardProperties] = None + """ Teams-specific metadata associated with the card. Equivalent to `msteams`. """ + metadata: Optional[CardMetadata] = None """ Metadata associated with the card. """ + resources: Optional[Resources] = None + """ Resources card elements can reference. """ + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ - body: Optional[List[SerializeAsAny[CardElement]]] = None + body: Optional[List[CardElement]] = None """ The body of the card, comprised of a list of elements displayed according to the layouts property. If the layouts property is not specified, a Layout.Stack is used. """ - actions: Optional[List[SerializeAsAny[Action]]] = None + actions: Optional[List[Action]] = None """ The card level actions, which always appear at the bottom of the card. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -705,7 +815,7 @@ def with_rtl(self, value: bool) -> Self: self.rtl = value return self - def withac_schema(self, value: str) -> Self: + def with_schema(self, value: str) -> Self: self.ac_schema = value return self @@ -729,6 +839,10 @@ def with_authentication(self, value: Authentication) -> Self: self.authentication = value return self + def with_msteams(self, value: TeamsCardProperties) -> Self: + self.msteams = value + return self + def with_ms_teams(self, value: TeamsCardProperties) -> Self: self.ms_teams = value return self @@ -737,6 +851,10 @@ def with_metadata(self, value: CardMetadata) -> Self: self.metadata = value return self + def with_resources(self, value: Resources) -> Self: + self.resources = value + return self + def with_grid_area(self, value: str) -> Self: self.grid_area = value return self @@ -754,117 +872,128 @@ def with_actions(self, value: List[Action]) -> Self: return self -class ImBackSubmitActionData(SerializableObject): - """Represents Teams-specific data in an Action.Submit to send an Instant Message back to the Bot.""" +class InsertImageAction(Action): + """Inserts an image into the host application's canvas.""" - type: Literal["imBack"] = "imBack" - """ Must be **imBack**. """ + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - value: Optional[str] = None - """ The value that will be sent to the Bot. """ + type: Literal["Action.InsertImage"] = "Action.InsertImage" + """ Must be **Action.InsertImage**. """ - def with_value(self, value: str) -> Self: - self.value = value - return self + id: Optional[str] = None + """ 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. """ + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) + """ 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). """ -class InvokeSubmitActionData(SerializableObject): - """Represents Teams-specific data in an Action.Submit to make an Invoke request to the Bot.""" + title: Optional[str] = None + """ The title of the action, as it appears on buttons. """ - type: Literal["invoke"] = "invoke" - """ Must be **invoke**. """ + icon_url: Optional[str] = None + """ 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. - value: Optional[Dict[str, Any]] = None - """ The object to send to the Bot with the Invoke request. """ +`iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](topic:icon-catalog) instead of an image. """ - def with_value(self, value: Dict[str, Any]) -> Self: - self.value = value - return self + style: Optional[ActionStyle] = "default" + """ Control the style of the action, affecting its visual and spoken representations. """ + mode: Optional[ActionMode] = "primary" + """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ -class MessageBackSubmitActionData(SerializableObject): - """Represents Teams-specific data in an Action.Submit to send a message back to the Bot.""" + tooltip: Optional[str] = None + """ The tooltip text to display when the action is hovered over. """ - type: Literal["messageBack"] = "messageBack" - """ Must be **messageBack**. """ + is_enabled: Optional[bool] = True + """ 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. """ - text: Optional[str] = None - """ The text that will be sent to the Bot. """ + menu_actions: Optional[List[Action]] = None + """ The actions to display in the overflow menu of a Split action button. """ - display_text: Optional[str] = None - """ 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. """ + themed_icon_urls: Optional[List[ThemedUrl]] = None + """ A set of theme-specific icon URLs. """ - value: Optional[str] = None - """ 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. """ + url: Optional[str] = None + """ The URL of the image to insert. """ - def with_text(self, value: str) -> Self: - self.text = value + alt_text: Optional[str] = None + """ The alternate text for the image. """ + + insert_position: Optional[ImageInsertPosition] = "Selection" + """ The position at which to insert the image. """ + + fallback: Optional[Union[Action, FallbackAction]] = None + """ 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. """ + + def with_key(self, value: str) -> Self: + self.key = value return self - def with_display_text(self, value: str) -> Self: - self.display_text = value + def with_id(self, value: str) -> Self: + self.id = value return self - def with_value(self, value: str) -> Self: - self.value = value + def with_requires(self, value: HostCapabilities) -> Self: + self.requires = value return self + def with_title(self, value: str) -> Self: + self.title = value + return self -class SigninSubmitActionData(SerializableObject): - """Represents Teams-specific data in an Action.Submit to sign in a user.""" + def with_icon_url(self, value: str) -> Self: + self.icon_url = value + return self - type: Literal["signin"] = "signin" - """ Must be **signin**. """ + def with_style(self, value: ActionStyle) -> Self: + self.style = value + return self - value: Optional[str] = None - """ The URL to redirect the end-user for signing in. """ + def with_mode(self, value: ActionMode) -> Self: + self.mode = value + return self - def with_value(self, value: str) -> Self: - self.value = value + def with_tooltip(self, value: str) -> Self: + self.tooltip = value return self + def with_is_enabled(self, value: bool) -> Self: + self.is_enabled = value + return self -class TaskFetchSubmitActionData(SerializableObject): - """Represents Teams-specific data in an Action.Submit to open a task module.""" + def with_menu_actions(self, value: List[Action]) -> Self: + self.menu_actions = value + return self - type: Literal["task/fetch"] = "task/fetch" - """ Must be **task/fetch**. """ - - value: Optional[Dict[str, Any]] = None - """ The contextual data sent to the Bot to specify which task module to open. """ - - def with_value(self, value: Dict[str, Any]) -> Self: - self.value = value + def with_themed_icon_urls(self, value: List[ThemedUrl]) -> Self: + self.themed_icon_urls = value return self - -class TeamsSubmitActionFeedback(SerializableObject): - """Represents feedback options for an [Action.Submit](https://adaptivecards.microsoft.com/?topic=Action.Submit).""" - - hide: Optional[bool] = None - """ Defines if a feedback message should be displayed after the action is executed. """ - - def with_hide(self, value: bool) -> Self: - self.hide = value + def with_url(self, value: str) -> Self: + self.url = value return self + def with_alt_text(self, value: str) -> Self: + self.alt_text = value + return self -class TeamsSubmitActionProperties(SerializableObject): - """Teams-specific properties associated with the action.""" - - feedback: Optional[TeamsSubmitActionFeedback] = None - """ Defines how feedback is provided to the end-user when the action is executed. """ + def with_insert_position(self, value: ImageInsertPosition) -> Self: + self.insert_position = value + return self - def with_feedback(self, value: TeamsSubmitActionFeedback) -> Self: - self.feedback = value + def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: + self.fallback = value return self -class SubmitAction(Action): - """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.""" +class OpenUrlAction(Action): + """Opens the provided URL in either a separate browser tab or within the host application.""" - type: Literal["Action.Submit"] = "Action.Submit" - """ Must be **Action.Submit**. """ + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + type: Literal["Action.OpenUrl"] = "Action.OpenUrl" + """ Must be **Action.OpenUrl**. """ id: Optional[str] = None """ 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. """ @@ -880,10 +1009,10 @@ class SubmitAction(Action): `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](topic:icon-catalog) instead of an image. """ - style: Optional[ActionStyle] = None + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - mode: Optional[ActionMode] = None + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ tooltip: Optional[str] = None @@ -892,21 +1021,22 @@ class SubmitAction(Action): is_enabled: Optional[bool] = True """ 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. """ - data: Optional[Union[str, SubmitActionData]] = None - """ 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. """ - - associated_inputs: Optional[AssociatedInputs] = None - """ 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](topic:input-validation) for more details. """ + menu_actions: Optional[List[Action]] = None + """ The actions to display in the overflow menu of a Split action button. """ - conditionally_enabled: Optional[bool] = None - """ Controls if the action is enabled only if at least one required input has been filled by the user. """ + themed_icon_urls: Optional[List[ThemedUrl]] = None + """ A set of theme-specific icon URLs. """ - ms_teams: Optional[TeamsSubmitActionProperties] = None - """ Teams-specific metadata associated with the action. """ + url: Optional[str] = None + """ The URL to open. """ - fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None + fallback: Optional[Union[Action, FallbackAction]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -939,20 +1069,16 @@ def with_is_enabled(self, value: bool) -> Self: self.is_enabled = value return self - def with_data(self, value: Union[str, SubmitActionData]) -> Self: - self.data = value - return self - - def with_associated_inputs(self, value: AssociatedInputs) -> Self: - self.associated_inputs = value + def with_menu_actions(self, value: List[Action]) -> Self: + self.menu_actions = value return self - def with_conditionally_enabled(self, value: bool) -> Self: - self.conditionally_enabled = value + def with_themed_icon_urls(self, value: List[ThemedUrl]) -> Self: + self.themed_icon_urls = value return self - def with_ms_teams(self, value: TeamsSubmitActionProperties) -> Self: - self.ms_teams = value + def with_url(self, value: str) -> Self: + self.url = value return self def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: @@ -960,11 +1086,14 @@ def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: return self -class OpenUrlAction(Action): - """Opens the provided URL in either a separate browser tab or within the host application.""" +class OpenUrlDialogAction(Action): + """Opens a task module in a modal dialog hosting the content at a provided URL.""" - type: Literal["Action.OpenUrl"] = "Action.OpenUrl" - """ Must be **Action.OpenUrl**. """ + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + type: Literal["Action.OpenUrlDialog"] = "Action.OpenUrlDialog" + """ Must be **Action.OpenUrlDialog**. """ id: Optional[str] = None """ 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. """ @@ -980,10 +1109,10 @@ class OpenUrlAction(Action): `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](topic:icon-catalog) instead of an image. """ - style: Optional[ActionStyle] = None + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - mode: Optional[ActionMode] = None + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ tooltip: Optional[str] = None @@ -992,12 +1121,31 @@ class OpenUrlAction(Action): is_enabled: Optional[bool] = True """ 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. """ + menu_actions: Optional[List[Action]] = None + """ The actions to display in the overflow menu of a Split action button. """ + + themed_icon_urls: Optional[List[ThemedUrl]] = None + """ A set of theme-specific icon URLs. """ + + dialog_title: Optional[str] = None + """ The title of the dialog to be displayed in the dialog header. """ + + dialog_height: Optional[str] = None + """ The height of the dialog. To define height as a number of pixels, use the px format. """ + + dialog_width: Optional[str] = None + """ The width of the dialog. To define width as a number of pixels, use the px format. """ + url: Optional[str] = None """ The URL to open. """ - fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None + fallback: Optional[Union[Action, FallbackAction]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -1030,38 +1178,43 @@ def with_is_enabled(self, value: bool) -> Self: self.is_enabled = value return self - def with_url(self, value: str) -> Self: - self.url = value + def with_menu_actions(self, value: List[Action]) -> Self: + self.menu_actions = value return self - def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: - self.fallback = value + def with_themed_icon_urls(self, value: List[ThemedUrl]) -> Self: + self.themed_icon_urls = value return self + def with_dialog_title(self, value: str) -> Self: + self.dialog_title = value + return self -class TargetElement(SerializableObject): - """Defines a target element in an Action.ToggleVisibility.""" - - element_id: Optional[str] = None - """ The Id of the element to change the visibility of. """ + def with_dialog_height(self, value: str) -> Self: + self.dialog_height = value + return self - is_visible: Optional[bool] = None - """ The new visibility state of the element. """ + def with_dialog_width(self, value: str) -> Self: + self.dialog_width = value + return self - def with_element_id(self, value: str) -> Self: - self.element_id = value + def with_url(self, value: str) -> Self: + self.url = value return self - def with_is_visible(self, value: bool) -> Self: - self.is_visible = value + def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: + self.fallback = value return self -class ToggleVisibilityAction(Action): - """Toggles the visibility of a set of elements. Action.ToggleVisibility is useful for creating "Show more" type UI patterns.""" +class ResetInputsAction(Action): + """Resets the values of the inputs in the card.""" - type: Literal["Action.ToggleVisibility"] = "Action.ToggleVisibility" - """ Must be **Action.ToggleVisibility**. """ + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + type: Literal["Action.ResetInputs"] = "Action.ResetInputs" + """ Must be **Action.ResetInputs**. """ id: Optional[str] = None """ 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. """ @@ -1077,10 +1230,10 @@ class ToggleVisibilityAction(Action): `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](topic:icon-catalog) instead of an image. """ - style: Optional[ActionStyle] = None + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - mode: Optional[ActionMode] = None + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ tooltip: Optional[str] = None @@ -1089,12 +1242,22 @@ class ToggleVisibilityAction(Action): is_enabled: Optional[bool] = True """ 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. """ - target_elements: Optional[Union[List[str], List[TargetElement]]] = None - """ The Ids of the elements to toggle the visibility of. """ + menu_actions: Optional[List[Action]] = None + """ The actions to display in the overflow menu of a Split action button. """ + + themed_icon_urls: Optional[List[ThemedUrl]] = None + """ A set of theme-specific icon URLs. """ + + target_input_ids: Optional[List[str]] = None + """ The Ids of the inputs that should be reset. """ - fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None + fallback: Optional[Union[Action, FallbackAction]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -1127,8 +1290,16 @@ def with_is_enabled(self, value: bool) -> Self: self.is_enabled = value return self - def with_target_elements(self, value: Union[List[str], List[TargetElement]]) -> Self: - self.target_elements = value + def with_menu_actions(self, value: List[Action]) -> Self: + self.menu_actions = value + return self + + def with_themed_icon_urls(self, value: List[ThemedUrl]) -> Self: + self.themed_icon_urls = value + return self + + def with_target_input_ids(self, value: List[str]) -> Self: + self.target_input_ids = value return self def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: @@ -1136,11 +1307,50 @@ def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: return self -class ShowCardAction(Action): - """Expands or collapses an embedded card within the main card.""" +class TeamsSubmitActionFeedback(SerializableObject): + """Represents feedback options for an [Action.Submit](https://adaptivecards.microsoft.com/?topic=Action.Submit).""" - type: Literal["Action.ShowCard"] = "Action.ShowCard" - """ Must be **Action.ShowCard**. """ + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + hide: Optional[bool] = None + """ Defines if a feedback message should be displayed after the action is executed. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + + def with_hide(self, value: bool) -> Self: + self.hide = value + return self + + +class TeamsSubmitActionProperties(SerializableObject): + """Teams-specific properties associated with the action.""" + + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + feedback: Optional[TeamsSubmitActionFeedback] = None + """ Defines how feedback is provided to the end-user when the action is executed. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + + def with_feedback(self, value: TeamsSubmitActionFeedback) -> Self: + self.feedback = value + return self + + +class SubmitAction(Action): + """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.""" + + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + type: Literal["Action.Submit"] = "Action.Submit" + """ Must be **Action.Submit**. """ id: Optional[str] = None """ 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. """ @@ -1156,10 +1366,10 @@ class ShowCardAction(Action): `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](topic:icon-catalog) instead of an image. """ - style: Optional[ActionStyle] = None + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - mode: Optional[ActionMode] = None + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ tooltip: Optional[str] = None @@ -1168,11 +1378,33 @@ class ShowCardAction(Action): is_enabled: Optional[bool] = True """ 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. """ - fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None + menu_actions: Optional[List[Action]] = None + """ The actions to display in the overflow menu of a Split action button. """ + + themed_icon_urls: Optional[List[ThemedUrl]] = None + """ A set of theme-specific icon URLs. """ + + data: Optional[Union[str, SubmitActionData]] = None + """ 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. """ + + associated_inputs: Optional[AssociatedInputs] = None + """ 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](topic:input-validation) for more details. """ + + conditionally_enabled: Optional[bool] = None + """ Controls if the action is enabled only if at least one required input has been filled by the user. """ + + msteams: Optional[TeamsSubmitActionProperties] = None + """ Teams-specific metadata associated with the action. """ + + ms_teams: Optional[TeamsSubmitActionProperties] = None + """ Teams-specific metadata associated with the action. Equivalent to `msteams`. """ + + fallback: Optional[Union[Action, FallbackAction]] = None """ 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. """ - card: Optional[AdaptiveCard] = None - """ The card that should be displayed when the action is executed. """ + def with_key(self, value: str) -> Self: + self.key = value + return self def with_id(self, value: str) -> Self: self.id = value @@ -1206,20 +1438,65 @@ def with_is_enabled(self, value: bool) -> Self: self.is_enabled = value return self + def with_menu_actions(self, value: List[Action]) -> Self: + self.menu_actions = value + return self + + def with_themed_icon_urls(self, value: List[ThemedUrl]) -> Self: + self.themed_icon_urls = value + return self + + def with_data(self, value: Union[str, SubmitActionData]) -> Self: + self.data = value + return self + + def with_associated_inputs(self, value: AssociatedInputs) -> Self: + self.associated_inputs = value + return self + + def with_conditionally_enabled(self, value: bool) -> Self: + self.conditionally_enabled = value + return self + + def with_msteams(self, value: TeamsSubmitActionProperties) -> Self: + self.msteams = value + return self + + def with_ms_teams(self, value: TeamsSubmitActionProperties) -> Self: + self.ms_teams = value + return self + def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: self.fallback = value return self - def with_card(self, value: AdaptiveCard) -> Self: - self.card = value + +class TargetElement(SerializableObject): + """Defines a target element in an Action.ToggleVisibility.""" + + element_id: Optional[str] = None + """ The Id of the element to change the visibility of. """ + + is_visible: Optional[bool] = None + """ The new visibility state of the element. """ + + def with_element_id(self, value: str) -> Self: + self.element_id = value return self + def with_is_visible(self, value: bool) -> Self: + self.is_visible = value + return self -class ResetInputsAction(Action): - """Resets the values of the inputs in the card.""" - type: Literal["Action.ResetInputs"] = "Action.ResetInputs" - """ Must be **Action.ResetInputs**. """ +class ToggleVisibilityAction(Action): + """Toggles the visibility of a set of elements. Action.ToggleVisibility is useful for creating "Show more" type UI patterns.""" + + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + type: Literal["Action.ToggleVisibility"] = "Action.ToggleVisibility" + """ Must be **Action.ToggleVisibility**. """ id: Optional[str] = None """ 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. """ @@ -1235,10 +1512,10 @@ class ResetInputsAction(Action): `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](topic:icon-catalog) instead of an image. """ - style: Optional[ActionStyle] = None + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - mode: Optional[ActionMode] = None + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ tooltip: Optional[str] = None @@ -1247,12 +1524,22 @@ class ResetInputsAction(Action): is_enabled: Optional[bool] = True """ 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. """ - target_input_ids: Optional[List[str]] = None - """ The Ids of the inputs that should be reset. """ + menu_actions: Optional[List[Action]] = None + """ The actions to display in the overflow menu of a Split action button. """ + + themed_icon_urls: Optional[List[ThemedUrl]] = None + """ A set of theme-specific icon URLs. """ + + target_elements: Optional[Union[List[str], List[TargetElement]]] = None + """ The Ids of the elements to toggle the visibility of. """ - fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None + fallback: Optional[Union[Action, FallbackAction]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -1285,8 +1572,16 @@ def with_is_enabled(self, value: bool) -> Self: self.is_enabled = value return self - def with_target_input_ids(self, value: List[str]) -> Self: - self.target_input_ids = value + def with_menu_actions(self, value: List[Action]) -> Self: + self.menu_actions = value + return self + + def with_themed_icon_urls(self, value: List[ThemedUrl]) -> Self: + self.themed_icon_urls = value + return self + + def with_target_elements(self, value: Union[List[str], List[TargetElement]]) -> Self: + self.target_elements = value return self def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: @@ -1294,11 +1589,14 @@ def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: return self -class InsertImageAction(Action): - """Inserts an image into the host application's canvas.""" +class ShowCardAction(Action): + """Expands or collapses an embedded card within the main card.""" - type: Literal["Action.InsertImage"] = "Action.InsertImage" - """ Must be **Action.InsertImage**. """ + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + type: Literal["Action.ShowCard"] = "Action.ShowCard" + """ Must be **Action.ShowCard**. """ id: Optional[str] = None """ 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. """ @@ -1314,10 +1612,10 @@ class InsertImageAction(Action): `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](topic:icon-catalog) instead of an image. """ - style: Optional[ActionStyle] = None + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - mode: Optional[ActionMode] = None + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ tooltip: Optional[str] = None @@ -1326,18 +1624,22 @@ class InsertImageAction(Action): is_enabled: Optional[bool] = True """ 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. """ - url: Optional[str] = None - """ The URL of the image to insert. """ + menu_actions: Optional[List[Action]] = None + """ The actions to display in the overflow menu of a Split action button. """ - alt_text: Optional[str] = None - """ The alternate text for the image. """ - - insert_position: Optional[ImageInsertPosition] = None - """ The position at which to insert the image. """ + themed_icon_urls: Optional[List[ThemedUrl]] = None + """ A set of theme-specific icon URLs. """ - fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None + fallback: Optional[Union[Action, FallbackAction]] = None """ 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. """ + card: Optional[AdaptiveCard] = None + """ The card that should be displayed when the action is executed. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -1370,191 +1672,248 @@ def with_is_enabled(self, value: bool) -> Self: self.is_enabled = value return self - def with_url(self, value: str) -> Self: - self.url = value - return self - - def with_alt_text(self, value: str) -> Self: - self.alt_text = value + def with_menu_actions(self, value: List[Action]) -> Self: + self.menu_actions = value return self - def with_insert_position(self, value: ImageInsertPosition) -> Self: - self.insert_position = value + def with_themed_icon_urls(self, value: List[ThemedUrl]) -> Self: + self.themed_icon_urls = value return self def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: self.fallback = value return self + def with_card(self, value: AdaptiveCard) -> Self: + self.card = value + return self -class StackLayout(ContainerLayout): - """A layout that stacks elements on top of each other. Layout.Stack is the default layout used by AdaptiveCard and all containers.""" - type: Literal["Layout.Stack"] = "Layout.Stack" - """ Must be **Layout.Stack**. """ +class PopoverAction(Action): + """Shows a popover to display more information to the user.""" - target_width: Optional[TargetWidth] = None - """ Controls for which card width the layout should be used. """ + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - def with_target_width(self, value: TargetWidth) -> Self: - self.target_width = value - return self + type: Literal["Action.Popover"] = "Action.Popover" + """ Must be **Action.Popover**. """ + id: Optional[str] = None + """ 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. """ -class FlowLayout(ContainerLayout): - """A layout that spreads elements horizontally and wraps them across multiple rows, as needed.""" + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) + """ 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). """ - type: Literal["Layout.Flow"] = "Layout.Flow" - """ Must be **Layout.Flow**. """ + title: Optional[str] = None + """ The title of the action, as it appears on buttons. """ - target_width: Optional[TargetWidth] = None - """ Controls for which card width the layout should be used. """ + icon_url: Optional[str] = None + """ 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. - horizontal_items_alignment: Optional[HorizontalAlignment] = None - """ Controls how the content of the container should be horizontally aligned. """ +`iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](topic:icon-catalog) instead of an image. """ - vertical_items_alignment: Optional[VerticalAlignment] = None - """ Controls how the content of the container should be vertically aligned. """ + style: Optional[ActionStyle] = "default" + """ Control the style of the action, affecting its visual and spoken representations. """ - item_fit: Optional[FlowLayoutItemFit] = None - """ Controls how item should fit inside the container. """ + mode: Optional[ActionMode] = "primary" + """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - min_item_width: Optional[str] = None - """ The minimum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. """ + tooltip: Optional[str] = None + """ The tooltip text to display when the action is hovered over. """ - max_item_width: Optional[str] = None - """ The maximum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. """ + is_enabled: Optional[bool] = True + """ 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. """ - item_width: Optional[str] = None - """ The width, in pixels, of each item, in the `px` format. Should not be used if maxItemWidth and/or minItemWidth are set. """ + themed_icon_urls: Optional[List[ThemedUrl]] = None + """ A set of theme-specific icon URLs. """ - column_spacing: Optional[Spacing] = None - """ The space between items. """ + content: Optional[CardElement] = None + """ The content of the popover, which can be any element. """ - row_spacing: Optional[Spacing] = None - """ The space between rows of items. """ + display_arrow: Optional[bool] = True + """ Controls if an arrow should be displayed towards the element that triggered the popover. """ - def with_target_width(self, value: TargetWidth) -> Self: - self.target_width = value + position: Optional[PopoverPosition] = "Above" + """ Controls where the popover should be displayed with regards to the element that triggered it. """ + + max_popover_width: Optional[str] = None + """ The maximum width of the popover in pixels, in the `px` format """ + + fallback: Optional[Union[Action, FallbackAction]] = None + """ 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. """ + + def with_key(self, value: str) -> Self: + self.key = value return self - def with_horizontal_items_alignment(self, value: HorizontalAlignment) -> Self: - self.horizontal_items_alignment = value + def with_id(self, value: str) -> Self: + self.id = value return self - def with_vertical_items_alignment(self, value: VerticalAlignment) -> Self: - self.vertical_items_alignment = value + def with_requires(self, value: HostCapabilities) -> Self: + self.requires = value return self - def with_item_fit(self, value: FlowLayoutItemFit) -> Self: - self.item_fit = value + def with_title(self, value: str) -> Self: + self.title = value return self - def with_min_item_width(self, value: str) -> Self: - self.min_item_width = value + def with_icon_url(self, value: str) -> Self: + self.icon_url = value return self - def with_max_item_width(self, value: str) -> Self: - self.max_item_width = value + def with_style(self, value: ActionStyle) -> Self: + self.style = value return self - def with_item_width(self, value: str) -> Self: - self.item_width = value + def with_mode(self, value: ActionMode) -> Self: + self.mode = value return self - def with_column_spacing(self, value: Spacing) -> Self: - self.column_spacing = value + def with_tooltip(self, value: str) -> Self: + self.tooltip = value return self - def with_row_spacing(self, value: Spacing) -> Self: - self.row_spacing = value + def with_is_enabled(self, value: bool) -> Self: + self.is_enabled = value return self + def with_themed_icon_urls(self, value: List[ThemedUrl]) -> Self: + self.themed_icon_urls = value + return self -class GridArea(SerializableObject): - """Defines an area in a Layout.AreaGrid layout.""" + def with_content(self, value: CardElement) -> Self: + self.content = value + return self - name: Optional[str] = None - """ The name of the area. To place an element in this area, set its `grid.area` property to match the name of the area. """ + def with_display_arrow(self, value: bool) -> Self: + self.display_arrow = value + return self - column: Optional[float] = 1 - """ The start column index of the area. Column indices start at 1. """ + def with_position(self, value: PopoverPosition) -> Self: + self.position = value + return self - column_span: Optional[float] = 1 - """ Defines how many columns the area should span. """ + def with_max_popover_width(self, value: str) -> Self: + self.max_popover_width = value + return self - row: Optional[float] = 1 - """ The start row index of the area. Row indices start at 1. """ + def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: + self.fallback = value + return self - row_span: Optional[float] = 1 - """ Defines how many rows the area should span. """ - def with_name(self, value: str) -> Self: - self.name = value - return self +class ActionSet(CardElement): + """Displays a set of action, which can be placed anywhere in the card.""" - def with_column(self, value: float) -> Self: - self.column = value - return self + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - def with_column_span(self, value: float) -> Self: - self.column_span = value - return self + type: Literal["ActionSet"] = "ActionSet" + """ Must be **ActionSet**. """ - def with_row(self, value: float) -> Self: - self.row = value - return self + id: Optional[str] = None + """ 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. """ - def with_row_span(self, value: float) -> Self: - self.row_span = value - return self + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) + """ 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). """ + lang: Optional[str] = None + """ The locale associated with the element. """ -class AreaGridLayout(ContainerLayout): - """A layout that divides a container into named areas into which elements can be placed.""" + is_visible: Optional[bool] = True + """ Controls the visibility of the element. """ - type: Literal["Layout.AreaGrid"] = "Layout.AreaGrid" - """ Must be **Layout.AreaGrid**. """ + separator: Optional[bool] = None + """ 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. """ + + height: Optional[ElementHeight] = "auto" + """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ + + horizontal_alignment: Optional[HorizontalAlignment] = None + """ Controls how the element should be horizontally aligned. """ + + spacing: Optional[Spacing] = "Default" + """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None - """ Controls for which card width the layout should be used. """ + """ 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](topic:responsive-layout). """ - columns: Optional[Union[List[float], List[str]]] = None - """ The columns in the grid layout, defined as a percentage of the available width or in pixels using the `px` format. """ + is_sort_key: Optional[bool] = None + """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - areas: Optional[List[GridArea]] = None - """ The areas in the grid layout. """ + grid_area: Optional[str] = None + """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - column_spacing: Optional[Spacing] = None - """ The space between columns. """ + fallback: Optional[Union[CardElement, FallbackElement]] = None + """ 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. """ - row_spacing: Optional[Spacing] = None - """ The space between rows. """ + actions: Optional[List[Action]] = None + """ The actions in the set. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + + def with_id(self, value: str) -> Self: + self.id = value + return self + + def with_requires(self, value: HostCapabilities) -> Self: + self.requires = value + return self + + def with_lang(self, value: str) -> Self: + self.lang = value + return self + + def with_is_visible(self, value: bool) -> Self: + self.is_visible = value + return self + + def with_separator(self, value: bool) -> Self: + self.separator = value + return self + + def with_height(self, value: ElementHeight) -> Self: + self.height = value + return self + + def with_horizontal_alignment(self, value: HorizontalAlignment) -> Self: + self.horizontal_alignment = value + return self + + def with_spacing(self, value: Spacing) -> Self: + self.spacing = value + return self def with_target_width(self, value: TargetWidth) -> Self: self.target_width = value return self - def with_columns(self, value: Union[List[float], List[str]]) -> Self: - self.columns = value + def with_is_sort_key(self, value: bool) -> Self: + self.is_sort_key = value return self - def with_areas(self, value: List[GridArea]) -> Self: - self.areas = value + def with_grid_area(self, value: str) -> Self: + self.grid_area = value return self - def with_column_spacing(self, value: Spacing) -> Self: - self.column_spacing = value + def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: + self.fallback = value return self - def with_row_spacing(self, value: Spacing) -> Self: - self.row_spacing = value + def with_actions(self, value: List[Action]) -> Self: + self.actions = value return self class Container(CardElement): """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.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Container"] = "Container" """ Must be **Container**. """ @@ -1573,13 +1932,13 @@ class Container(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -1600,7 +1959,7 @@ class Container(CardElement): rounded_corners: Optional[bool] = None """ Controls if the container should have rounded corners. """ - layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None + layouts: Optional[List[ContainerLayout]] = None """ 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](topic:container-layouts) for more details. """ bleed: Optional[bool] = None @@ -1624,12 +1983,16 @@ class Container(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ - items: Optional[List[SerializeAsAny[CardElement]]] = None + items: Optional[List[CardElement]] = None """ The elements in the container. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -1727,107 +2090,205 @@ def with_items(self, value: List[CardElement]) -> Self: return self -class ActionSet(CardElement): - """Displays a set of action, which can be placed anywhere in the card.""" - - type: Literal["ActionSet"] = "ActionSet" - """ Must be **ActionSet**. """ +class StackLayout(ContainerLayout): + """A layout that stacks elements on top of each other. Layout.Stack is the default layout used by AdaptiveCard and all containers.""" - id: Optional[str] = None - """ 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. """ + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) - """ 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). """ + type: Literal["Layout.Stack"] = "Layout.Stack" + """ Must be **Layout.Stack**. """ - lang: Optional[str] = None - """ The locale associated with the element. """ + target_width: Optional[TargetWidth] = None + """ Controls for which card width the layout should be used. """ - is_visible: Optional[bool] = True - """ Controls the visibility of the element. """ + def with_key(self, value: str) -> Self: + self.key = value + return self - separator: Optional[bool] = None - """ 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. """ + def with_target_width(self, value: TargetWidth) -> Self: + self.target_width = value + return self - height: Optional[ElementHeight] = None - """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - horizontal_alignment: Optional[HorizontalAlignment] = None - """ Controls how the element should be horizontally aligned. """ +class FlowLayout(ContainerLayout): + """A layout that spreads elements horizontally and wraps them across multiple rows, as needed.""" - spacing: Optional[Spacing] = None - """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + type: Literal["Layout.Flow"] = "Layout.Flow" + """ Must be **Layout.Flow**. """ target_width: Optional[TargetWidth] = None - """ 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](topic:responsive-layout). """ + """ Controls for which card width the layout should be used. """ - is_sort_key: Optional[bool] = None - """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ + horizontal_items_alignment: Optional[HorizontalAlignment] = "Center" + """ Controls how the content of the container should be horizontally aligned. """ - grid_area: Optional[str] = None - """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ + vertical_items_alignment: Optional[VerticalAlignment] = "Top" + """ Controls how the content of the container should be vertically aligned. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None - """ 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. """ + item_fit: Optional[FlowLayoutItemFit] = "Fit" + """ Controls how item should fit inside the container. """ - actions: Optional[List[SerializeAsAny[Action]]] = None - """ The actions in the set. """ + min_item_width: Optional[str] = None + """ The minimum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. """ - def with_id(self, value: str) -> Self: - self.id = value + max_item_width: Optional[str] = None + """ The maximum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. """ + + item_width: Optional[str] = None + """ The width, in pixels, of each item, in the `px` format. Should not be used if maxItemWidth and/or minItemWidth are set. """ + + column_spacing: Optional[Spacing] = "Default" + """ The space between items. """ + + row_spacing: Optional[Spacing] = "Default" + """ The space between rows of items. """ + + def with_key(self, value: str) -> Self: + self.key = value return self - def with_requires(self, value: HostCapabilities) -> Self: - self.requires = value + def with_target_width(self, value: TargetWidth) -> Self: + self.target_width = value return self - def with_lang(self, value: str) -> Self: - self.lang = value + def with_horizontal_items_alignment(self, value: HorizontalAlignment) -> Self: + self.horizontal_items_alignment = value return self - def with_is_visible(self, value: bool) -> Self: - self.is_visible = value + def with_vertical_items_alignment(self, value: VerticalAlignment) -> Self: + self.vertical_items_alignment = value return self - def with_separator(self, value: bool) -> Self: - self.separator = value + def with_item_fit(self, value: FlowLayoutItemFit) -> Self: + self.item_fit = value return self - def with_height(self, value: ElementHeight) -> Self: - self.height = value + def with_min_item_width(self, value: str) -> Self: + self.min_item_width = value return self - def with_horizontal_alignment(self, value: HorizontalAlignment) -> Self: - self.horizontal_alignment = value + def with_max_item_width(self, value: str) -> Self: + self.max_item_width = value return self - def with_spacing(self, value: Spacing) -> Self: - self.spacing = value + def with_item_width(self, value: str) -> Self: + self.item_width = value + return self + + def with_column_spacing(self, value: Spacing) -> Self: + self.column_spacing = value + return self + + def with_row_spacing(self, value: Spacing) -> Self: + self.row_spacing = value + return self + + +class GridArea(SerializableObject): + """Defines an area in a Layout.AreaGrid layout.""" + + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + name: Optional[str] = None + """ The name of the area. To place an element in this area, set its `grid.area` property to match the name of the area. """ + + column: Optional[float] = 1 + """ The start column index of the area. Column indices start at 1. """ + + column_span: Optional[float] = 1 + """ Defines how many columns the area should span. """ + + row: Optional[float] = 1 + """ The start row index of the area. Row indices start at 1. """ + + row_span: Optional[float] = 1 + """ Defines how many rows the area should span. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + + def with_name(self, value: str) -> Self: + self.name = value + return self + + def with_column(self, value: float) -> Self: + self.column = value + return self + + def with_column_span(self, value: float) -> Self: + self.column_span = value + return self + + def with_row(self, value: float) -> Self: + self.row = value + return self + + def with_row_span(self, value: float) -> Self: + self.row_span = value + return self + + +class AreaGridLayout(ContainerLayout): + """A layout that divides a container into named areas into which elements can be placed.""" + + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + type: Literal["Layout.AreaGrid"] = "Layout.AreaGrid" + """ Must be **Layout.AreaGrid**. """ + + target_width: Optional[TargetWidth] = None + """ Controls for which card width the layout should be used. """ + + columns: Optional[Union[List[float], List[str]]] = None + """ The columns in the grid layout, defined as a percentage of the available width or in pixels using the `px` format. """ + + areas: Optional[List[GridArea]] = None + """ The areas in the grid layout. """ + + column_spacing: Optional[Spacing] = "Default" + """ The space between columns. """ + + row_spacing: Optional[Spacing] = "Default" + """ The space between rows. """ + + def with_key(self, value: str) -> Self: + self.key = value return self def with_target_width(self, value: TargetWidth) -> Self: self.target_width = value return self - def with_is_sort_key(self, value: bool) -> Self: - self.is_sort_key = value + def with_columns(self, value: Union[List[float], List[str]]) -> Self: + self.columns = value return self - def with_grid_area(self, value: str) -> Self: - self.grid_area = value + def with_areas(self, value: List[GridArea]) -> Self: + self.areas = value return self - def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: - self.fallback = value + def with_column_spacing(self, value: Spacing) -> Self: + self.column_spacing = value return self - def with_actions(self, value: List[Action]) -> Self: - self.actions = value + def with_row_spacing(self, value: Spacing) -> Self: + self.row_spacing = value return self class Column(CardElement): """A column in a ColumnSet element.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Column"] = "Column" """ Optional. If specified, must be **Column**. """ @@ -1846,13 +2307,13 @@ class Column(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -1873,7 +2334,7 @@ class Column(CardElement): rounded_corners: Optional[bool] = None """ Controls if the container should have rounded corners. """ - layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None + layouts: Optional[List[ContainerLayout]] = None """ 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](topic:container-layouts) for more details. """ bleed: Optional[bool] = None @@ -1894,18 +2355,22 @@ class Column(CardElement): max_height: Optional[str] = None """ 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. """ - width: Optional[Union[str, float]] = "stretch" + width: Optional[Union[str, float]] = None """ The width of the column. If expressed as a number, represents the relative weight of the column in the set. If expressed as a string, `auto` will automatically adjust the column's width according to its content, `stretch` will make the column use the remaining horizontal space (shared with other columns with width set to `stretch`) and using the `px` format will give the column an explicit width in pixels. """ grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ - items: Optional[List[SerializeAsAny[CardElement]]] = None + items: Optional[List[CardElement]] = None """ The elements in the column. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -2010,6 +2475,9 @@ def with_items(self, value: List[CardElement]) -> Self: class ColumnSet(CardElement): """Splits the available horizontal space into separate columns, so elements can be organized in a row.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["ColumnSet"] = "ColumnSet" """ Must be **ColumnSet**. """ @@ -2028,13 +2496,13 @@ class ColumnSet(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -2061,15 +2529,22 @@ class ColumnSet(CardElement): min_height: Optional[str] = None """ The minimum height, in pixels, of the container, in the `px` format. """ + min_width: Optional[str] = None + """ 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. """ + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ columns: Optional[List[Column]] = None """ The columns in the set. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -2134,6 +2609,10 @@ def with_min_height(self, value: str) -> Self: self.min_height = value return self + def with_min_width(self, value: str) -> Self: + self.min_width = value + return self + def with_grid_area(self, value: str) -> Self: self.grid_area = value return self @@ -2150,12 +2629,19 @@ def with_columns(self, value: List[Column]) -> Self: class MediaSource(SerializableObject): """Defines the source URL of a media stream. YouTube, Dailymotion, Vimeo and Microsoft Stream URLs are supported.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + mime_type: Optional[str] = None """ The MIME type of the source. """ url: Optional[str] = None """ The URL of the source. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_mime_type(self, value: str) -> Self: self.mime_type = value return self @@ -2168,6 +2654,9 @@ def with_url(self, value: str) -> Self: class CaptionSource(SerializableObject): """Defines a source URL for a video captions.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + mime_type: Optional[str] = None """ The MIME type of the source. """ @@ -2177,6 +2666,10 @@ class CaptionSource(SerializableObject): label: Optional[str] = None """ The label of this caption source. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_mime_type(self, value: str) -> Self: self.mime_type = value return self @@ -2193,6 +2686,9 @@ def with_label(self, value: str) -> Self: class Media(CardElement): """A media element, that makes it possible to embed videos inside a card.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Media"] = "Media" """ Must be **Media**. """ @@ -2211,10 +2707,10 @@ class Media(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -2238,9 +2734,13 @@ class Media(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -2305,6 +2805,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class RichTextBlock(CardElement): """A rich text block that displays formatted text.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["RichTextBlock"] = "RichTextBlock" """ Must be **RichTextBlock**. """ @@ -2323,13 +2826,13 @@ class RichTextBlock(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -2338,15 +2841,22 @@ class RichTextBlock(CardElement): is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ + label_for: Optional[str] = None + """ The Id of the input the RichTextBlock should act as the label of. """ + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ - inlines: Optional[Union[List[SerializeAsAny[CardElement]], List[str]]] = None + inlines: Optional[Union[List[CardElement], List[str]]] = None """ The inlines making up the rich text block. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -2387,6 +2897,10 @@ def with_is_sort_key(self, value: bool) -> Self: self.is_sort_key = value return self + def with_label_for(self, value: str) -> Self: + self.label_for = value + return self + def with_grid_area(self, value: str) -> Self: self.grid_area = value return self @@ -2403,6 +2917,9 @@ def with_inlines(self, value: Union[List[CardElement], List[str]]) -> Self: class ColumnDefinition(SerializableObject): """Defines a column in a Table element.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + horizontal_cell_content_alignment: Optional[HorizontalAlignment] = None """ 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. """ @@ -2410,7 +2927,11 @@ class ColumnDefinition(SerializableObject): """ 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. """ width: Optional[Union[str, float]] = None - """ The width of the column in the table, expressed as either a percentage of the available width or in pixels, using the `px` format. """ + """ 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. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self def with_horizontal_cell_content_alignment(self, value: HorizontalAlignment) -> Self: self.horizontal_cell_content_alignment = value @@ -2428,6 +2949,9 @@ def with_width(self, value: Union[str, float]) -> Self: class TableCell(CardElement): """Represents a cell in a table row.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["TableCell"] = "TableCell" """ Must be **TableCell**. """ @@ -2446,10 +2970,10 @@ class TableCell(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -2464,7 +2988,7 @@ class TableCell(CardElement): style: Optional[ContainerStyle] = None """ 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. """ - layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None + layouts: Optional[List[ContainerLayout]] = None """ 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](topic:container-layouts) for more details. """ bleed: Optional[bool] = None @@ -2488,12 +3012,16 @@ class TableCell(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ - items: Optional[List[SerializeAsAny[CardElement]]] = None + items: Optional[List[CardElement]] = None """ The items (elements) in the cell. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -2582,6 +3110,9 @@ def with_items(self, value: List[CardElement]) -> Self: class TableRow(CardElement): """Represents a row of cells in a table.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["TableRow"] = "TableRow" """ Must be **TableRow**. """ @@ -2600,13 +3131,13 @@ class TableRow(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -2633,12 +3164,16 @@ class TableRow(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ cells: Optional[List[TableCell]] = None """ The cells in the row. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -2715,6 +3250,9 @@ def with_cells(self, value: List[TableCell]) -> Self: class Table(CardElement): """Use tables to display data in a tabular way, with rows, columns and cells.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Table"] = "Table" """ Must be **Table**. """ @@ -2733,13 +3271,13 @@ class Table(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -2760,6 +3298,9 @@ class Table(CardElement): columns: Optional[List[ColumnDefinition]] = None """ The columns in the table. """ + min_width: Optional[str] = None + """ 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. """ + first_row_as_headers: Optional[bool] = True """ Controls whether the first row of the table should be treated as a header. """ @@ -2778,12 +3319,16 @@ class Table(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ rows: Optional[List[TableRow]] = None """ The rows of the table. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -2840,6 +3385,10 @@ def with_columns(self, value: List[ColumnDefinition]) -> Self: self.columns = value return self + def with_min_width(self, value: str) -> Self: + self.min_width = value + return self + def with_first_row_as_headers(self, value: bool) -> Self: self.first_row_as_headers = value return self @@ -2876,6 +3425,9 @@ def with_rows(self, value: List[TableRow]) -> Self: class TextBlock(CardElement): """A block of text, optionally formatted using Markdown.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["TextBlock"] = "TextBlock" """ Must be **TextBlock**. """ @@ -2894,13 +3446,13 @@ class TextBlock(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -2933,15 +3485,22 @@ class TextBlock(CardElement): max_lines: Optional[float] = None """ The maximum number of lines to display. """ - style: Optional[StyleEnum] = None + style: Optional[TextBlockStyle] = None """ The style of the text. """ + label_for: Optional[str] = None + """ The Id of the input the TextBlock should act as the label of. """ + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -3014,10 +3573,14 @@ def with_max_lines(self, value: float) -> Self: self.max_lines = value return self - def with_style(self, value: StyleEnum) -> Self: + def with_style(self, value: TextBlockStyle) -> Self: self.style = value return self + def with_label_for(self, value: str) -> Self: + self.label_for = value + return self + def with_grid_area(self, value: str) -> Self: self.grid_area = value return self @@ -3030,12 +3593,19 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class Fact(SerializableObject): """A fact in a FactSet element.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + title: Optional[str] = None """ The fact's title. """ value: Optional[str] = None """ The fact's value. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_title(self, value: str) -> Self: self.title = value return self @@ -3048,6 +3618,9 @@ def with_value(self, value: str) -> Self: class FactSet(CardElement): """A set of facts, displayed as a table or a vertical list when horizontal space is constrained.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["FactSet"] = "FactSet" """ Must be **FactSet**. """ @@ -3066,10 +3639,10 @@ class FactSet(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -3084,9 +3657,13 @@ class FactSet(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -3139,9 +3716,16 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class TeamsImageProperties(SerializableObject): """Represents a set of Teams-specific properties on an image.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + allow_expand: Optional[bool] = None """ Controls if the image is expandable in Teams. This property is equivalent to the Image.allowExpand property. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_allow_expand(self, value: bool) -> Self: self.allow_expand = value return self @@ -3150,6 +3734,9 @@ def with_allow_expand(self, value: bool) -> Self: class Image(CardElement): """A standalone image element.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Image"] = "Image" """ Must be **Image**. """ @@ -3171,7 +3758,7 @@ class Image(CardElement): horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -3189,10 +3776,10 @@ class Image(CardElement): background_color: Optional[str] = None """ The background color of the image. """ - style: Optional[ImageStyle] = None + style: Optional[ImageStyle] = "Default" """ The style of the image. """ - size: Optional[Size] = None + size: Optional[Size] = "Auto" """ The size of the image. """ width: Optional[str] = "auto" @@ -3204,18 +3791,37 @@ class Image(CardElement): allow_expand: Optional[bool] = None """ Controls if the image can be expanded to full screen. """ - ms_teams: Optional[TeamsImageProperties] = None + msteams: Optional[TeamsImageProperties] = None """ Teams-specific metadata associated with the image. """ + ms_teams: Optional[TeamsImageProperties] = None + """ Teams-specific metadata associated with the image. Equivalent to `msteams`. """ + + themed_urls: Optional[List[ThemedUrl]] = None + """ A set of theme-specific image URLs. """ + + fit_mode: Optional[ImageFitMode] = "Fill" + """ 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. """ + + horizontal_content_alignment: Optional[HorizontalAlignment] = "Left" + """ 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. """ + + vertical_content_alignment: Optional[VerticalAlignment] = "Top" + """ 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. """ + height: Optional[str] = "auto" """ The height of the image. """ grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -3284,10 +3890,30 @@ def with_allow_expand(self, value: bool) -> Self: self.allow_expand = value return self + def with_msteams(self, value: TeamsImageProperties) -> Self: + self.msteams = value + return self + def with_ms_teams(self, value: TeamsImageProperties) -> Self: self.ms_teams = value return self + def with_themed_urls(self, value: List[ThemedUrl]) -> Self: + self.themed_urls = value + return self + + def with_fit_mode(self, value: ImageFitMode) -> Self: + self.fit_mode = value + return self + + def with_horizontal_content_alignment(self, value: HorizontalAlignment) -> Self: + self.horizontal_content_alignment = value + return self + + def with_vertical_content_alignment(self, value: VerticalAlignment) -> Self: + self.vertical_content_alignment = value + return self + def with_height(self, value: str) -> Self: self.height = value return self @@ -3304,6 +3930,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class ImageSet(CardElement): """A set of images, displayed side-by-side and wrapped across multiple rows as needed.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["ImageSet"] = "ImageSet" """ Must be **ImageSet**. """ @@ -3322,13 +3951,13 @@ class ImageSet(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -3340,15 +3969,19 @@ class ImageSet(CardElement): images: Optional[List[Image]] = None """ The images in the set. """ - image_size: Optional[ImageSize] = None + image_size: Optional[ImageSize] = "Medium" """ The size to use to render all images in the set. """ grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -3409,6 +4042,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class TextInput(CardElement): """An input to allow the user to enter text.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Input.Text"] = "Input.Text" """ Must be **Input.Text**. """ @@ -3427,10 +4063,10 @@ class TextInput(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -3450,7 +4086,7 @@ class TextInput(CardElement): error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - value_changed_action: Optional[ResetInputsAction] = None + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ value: Optional[str] = None @@ -3465,7 +4101,7 @@ class TextInput(CardElement): placeholder: Optional[str] = None """ The text to display as a placeholder when the user hasn't entered a value. """ - style: Optional[InputTextStyle] = None + style: Optional[InputTextStyle] = "Text" """ The style of the input. """ inline_action: Optional[Action] = None @@ -3477,9 +4113,13 @@ class TextInput(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -3528,7 +4168,7 @@ def with_error_message(self, value: str) -> Self: self.error_message = value return self - def with_value_changed_action(self, value: ResetInputsAction) -> Self: + def with_value_changed_action(self, value: Action) -> Self: self.value_changed_action = value return self @@ -3572,6 +4212,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class DateInput(CardElement): """An input to allow the user to select a date.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Input.Date"] = "Input.Date" """ Must be **Input.Date**. """ @@ -3590,10 +4233,10 @@ class DateInput(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -3613,7 +4256,7 @@ class DateInput(CardElement): error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - value_changed_action: Optional[ResetInputsAction] = None + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ value: Optional[str] = None @@ -3631,9 +4274,13 @@ class DateInput(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -3682,7 +4329,7 @@ def with_error_message(self, value: str) -> Self: self.error_message = value return self - def with_value_changed_action(self, value: ResetInputsAction) -> Self: + def with_value_changed_action(self, value: Action) -> Self: self.value_changed_action = value return self @@ -3714,6 +4361,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class TimeInput(CardElement): """An input to allow the user to select a time.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Input.Time"] = "Input.Time" """ Must be **Input.Time**. """ @@ -3732,10 +4382,10 @@ class TimeInput(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -3755,7 +4405,7 @@ class TimeInput(CardElement): error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - value_changed_action: Optional[ResetInputsAction] = None + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ value: Optional[str] = None @@ -3773,9 +4423,13 @@ class TimeInput(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -3824,7 +4478,7 @@ def with_error_message(self, value: str) -> Self: self.error_message = value return self - def with_value_changed_action(self, value: ResetInputsAction) -> Self: + def with_value_changed_action(self, value: Action) -> Self: self.value_changed_action = value return self @@ -3856,6 +4510,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class NumberInput(CardElement): """An input to allow the user to enter a number.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Input.Number"] = "Input.Number" """ Must be **Input.Number**. """ @@ -3874,10 +4531,10 @@ class NumberInput(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -3897,7 +4554,7 @@ class NumberInput(CardElement): error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - value_changed_action: Optional[ResetInputsAction] = None + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ value: Optional[float] = None @@ -3915,9 +4572,13 @@ class NumberInput(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -3966,7 +4627,7 @@ def with_error_message(self, value: str) -> Self: self.error_message = value return self - def with_value_changed_action(self, value: ResetInputsAction) -> Self: + def with_value_changed_action(self, value: Action) -> Self: self.value_changed_action = value return self @@ -3998,6 +4659,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class ToggleInput(CardElement): """An input to allow the user to select between on/off states.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Input.Toggle"] = "Input.Toggle" """ Must be **Input.Toggle**. """ @@ -4016,10 +4680,10 @@ class ToggleInput(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -4039,7 +4703,7 @@ class ToggleInput(CardElement): error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - value_changed_action: Optional[ResetInputsAction] = None + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ value: Optional[str] = "false" @@ -4057,12 +4721,19 @@ class ToggleInput(CardElement): wrap: Optional[bool] = True """ Controls if the title should wrap. """ + show_title: Optional[bool] = True + """ Controls whether the title is visually displayed. When set to false, the title is hidden from view but remains accessible to screen readers for accessibility purposes. """ + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -4111,7 +4782,7 @@ def with_error_message(self, value: str) -> Self: self.error_message = value return self - def with_value_changed_action(self, value: ResetInputsAction) -> Self: + def with_value_changed_action(self, value: Action) -> Self: self.value_changed_action = value return self @@ -4135,6 +4806,10 @@ def with_wrap(self, value: bool) -> Self: self.wrap = value return self + def with_show_title(self, value: bool) -> Self: + self.show_title = value + return self + def with_grid_area(self, value: str) -> Self: self.grid_area = value return self @@ -4147,12 +4822,19 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class Choice(SerializableObject): """A choice as used by the Input.ChoiceSet input.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + title: Optional[str] = None """ The text to display for the choice. """ value: Optional[str] = None """ The value associated with the choice, as sent to the Bot when an Action.Submit or Action.Execute is invoked """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_title(self, value: str) -> Self: self.title = value return self @@ -4165,6 +4847,9 @@ def with_value(self, value: str) -> Self: class QueryData(SerializableObject): """Defines a query to dynamically fetch data from a Bot.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Data.Query"] = "Data.Query" """ Must be **Data.Query**. """ @@ -4180,6 +4865,10 @@ class QueryData(SerializableObject): skip: Optional[float] = None """ The number of data items to be skipped by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_dataset(self, value: str) -> Self: self.dataset = value return self @@ -4200,6 +4889,9 @@ def with_skip(self, value: float) -> Self: class ChoiceSetInput(CardElement): """An input to allow the user to select one or more values.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Input.ChoiceSet"] = "Input.ChoiceSet" """ Must be **Input.ChoiceSet**. """ @@ -4218,10 +4910,10 @@ class ChoiceSetInput(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -4241,7 +4933,7 @@ class ChoiceSetInput(CardElement): error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - value_changed_action: Optional[ResetInputsAction] = None + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ value: Optional[str] = None @@ -4253,7 +4945,7 @@ class ChoiceSetInput(CardElement): choices_data: Optional[QueryData] = None """ A Data.Query object that defines the dataset from which to dynamically fetch the choices for the input. """ - style: Optional[StyleEnum] = None + style: Optional[ChoiceSetInputStyle] = "compact" """ Controls whether the input should be displayed as a dropdown (compact) or a list of radio buttons or checkboxes (expanded). """ is_multi_select: Optional[bool] = None @@ -4265,12 +4957,22 @@ class ChoiceSetInput(CardElement): wrap: Optional[bool] = True """ Controls if choice titles should wrap. """ + use_multiple_columns: Optional[bool] = None + """ Controls whether choice items are arranged in multiple columns in expanded mode, or in a single column. Default is false. """ + + min_column_width: Optional[str] = None + """ The minimum width, in pixels, for each column when using a multi-column layout. This ensures that choice items remain readable even when horizontal space is limited. Default is 100 pixels. """ + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -4319,7 +5021,7 @@ def with_error_message(self, value: str) -> Self: self.error_message = value return self - def with_value_changed_action(self, value: ResetInputsAction) -> Self: + def with_value_changed_action(self, value: Action) -> Self: self.value_changed_action = value return self @@ -4335,7 +5037,7 @@ def with_choices_data(self, value: QueryData) -> Self: self.choices_data = value return self - def with_style(self, value: StyleEnum) -> Self: + def with_style(self, value: ChoiceSetInputStyle) -> Self: self.style = value return self @@ -4351,6 +5053,14 @@ def with_wrap(self, value: bool) -> Self: self.wrap = value return self + def with_use_multiple_columns(self, value: bool) -> Self: + self.use_multiple_columns = value + return self + + def with_min_column_width(self, value: str) -> Self: + self.min_column_width = value + return self + def with_grid_area(self, value: str) -> Self: self.grid_area = value return self @@ -4363,6 +5073,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class RatingInput(CardElement): """An input to allow the user to rate something using stars.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Input.Rating"] = "Input.Rating" """ Must be **Input.Rating**. """ @@ -4381,10 +5094,10 @@ class RatingInput(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -4404,7 +5117,7 @@ class RatingInput(CardElement): error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - value_changed_action: Optional[ResetInputsAction] = None + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ value: Optional[float] = None @@ -4416,18 +5129,22 @@ class RatingInput(CardElement): allow_half_steps: Optional[bool] = None """ Controls if the user can select half stars. """ - size: Optional[RatingSize] = None + size: Optional[RatingSize] = "Large" """ The size of the stars. """ - color: Optional[RatingColor] = None + color: Optional[RatingColor] = "Neutral" """ The color of the stars. """ grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -4476,7 +5193,7 @@ def with_error_message(self, value: str) -> Self: self.error_message = value return self - def with_value_changed_action(self, value: ResetInputsAction) -> Self: + def with_value_changed_action(self, value: Action) -> Self: self.value_changed_action = value return self @@ -4512,6 +5229,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class Rating(CardElement): """A read-only star rating element, to display the rating of something.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Rating"] = "Rating" """ Must be **Rating**. """ @@ -4530,13 +5250,13 @@ class Rating(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -4554,21 +5274,25 @@ class Rating(CardElement): max: Optional[float] = 5 """ The number of stars to display. """ - size: Optional[RatingSize] = None + size: Optional[RatingSize] = "Large" """ The size of the stars. """ - color: Optional[RatingColor] = None + color: Optional[RatingColor] = "Neutral" """ The color of the stars. """ - style: Optional[RatingStyle] = None + style: Optional[RatingStyle] = "Default" """ The style of the stars. """ grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -4645,18 +5369,25 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class IconInfo(SerializableObject): """Defines information about a Fluent icon and how it should be rendered.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + name: Optional[str] = None """ The name of the icon to display. """ - size: Optional[IconSize] = None + size: Optional[IconSize] = "xSmall" """ The size of the icon. """ - style: Optional[IconStyle] = None + style: Optional[IconStyle] = "Regular" """ The style of the icon. """ - color: Optional[TextColor] = None + color: Optional[TextColor] = "Default" """ The color of the icon. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_name(self, value: str) -> Self: self.name = value return self @@ -4677,6 +5408,9 @@ def with_color(self, value: TextColor) -> Self: class CompoundButton(CardElement): """A special type of button with an icon, title and description.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["CompoundButton"] = "CompoundButton" """ Must be **CompoundButton**. """ @@ -4695,13 +5429,13 @@ class CompoundButton(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -4728,9 +5462,13 @@ class CompoundButton(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -4803,6 +5541,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class Icon(CardElement): """A standalone icon element. Icons can be picked from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog).""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Icon"] = "Icon" """ Must be **Icon**. """ @@ -4824,7 +5565,7 @@ class Icon(CardElement): horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -4836,13 +5577,13 @@ class Icon(CardElement): name: Optional[str] = None """ The name of the icon to display. """ - size: Optional[IconSize] = None + size: Optional[IconSize] = "Standard" """ The size of the icon. """ - style: Optional[IconStyle] = None + style: Optional[IconStyle] = "Regular" """ The style of the icon. """ - color: Optional[TextColor] = None + color: Optional[TextColor] = "Default" """ The color of the icon. """ select_action: Optional[Action] = None @@ -4851,9 +5592,13 @@ class Icon(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -4922,6 +5667,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class CarouselPage(CardElement): """A page inside a Carousel element.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["CarouselPage"] = "CarouselPage" """ Must be **CarouselPage**. """ @@ -4937,7 +5685,7 @@ class CarouselPage(CardElement): is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ target_width: Optional[TargetWidth] = None @@ -4958,7 +5706,7 @@ class CarouselPage(CardElement): rounded_corners: Optional[bool] = None """ Controls if the container should have rounded corners. """ - layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None + layouts: Optional[List[ContainerLayout]] = None """ 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](topic:container-layouts) for more details. """ min_height: Optional[str] = None @@ -4979,12 +5727,16 @@ class CarouselPage(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ - items: Optional[List[SerializeAsAny[CardElement]]] = None + items: Optional[List[CardElement]] = None """ The elements in the page. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -5045,12 +5797,289 @@ def with_vertical_content_alignment(self, value: VerticalAlignment) -> Self: self.vertical_content_alignment = value return self - def with_rtl(self, value: bool) -> Self: - self.rtl = value + def with_rtl(self, value: bool) -> Self: + self.rtl = value + return self + + def with_max_height(self, value: str) -> Self: + self.max_height = value + return self + + def with_grid_area(self, value: str) -> Self: + self.grid_area = value + return self + + def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: + self.fallback = value + return self + + def with_items(self, value: List[CardElement]) -> Self: + self.items = value + return self + + +class Carousel(CardElement): + """A carousel with sliding pages.""" + + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + type: Literal["Carousel"] = "Carousel" + """ Must be **Carousel**. """ + + id: Optional[str] = None + """ 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. """ + + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) + """ 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). """ + + lang: Optional[str] = None + """ The locale associated with the element. """ + + is_visible: Optional[bool] = True + """ Controls the visibility of the element. """ + + separator: Optional[bool] = None + """ 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. """ + + height: Optional[ElementHeight] = "auto" + """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ + + spacing: Optional[Spacing] = "Default" + """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ + + target_width: Optional[TargetWidth] = None + """ 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](topic:responsive-layout). """ + + is_sort_key: Optional[bool] = None + """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ + + bleed: Optional[bool] = None + """ Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. """ + + min_height: Optional[str] = None + """ The minimum height, in pixels, of the container, in the `px` format. """ + + page_animation: Optional[CarouselPageAnimation] = "Slide" + """ Controls the type of animation to use to navigate between pages. """ + + grid_area: Optional[str] = None + """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ + + fallback: Optional[Union[CardElement, FallbackElement]] = None + """ 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. """ + + pages: Optional[List[CarouselPage]] = None + """ The pages in the carousel. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + + def with_id(self, value: str) -> Self: + self.id = value + return self + + def with_requires(self, value: HostCapabilities) -> Self: + self.requires = value + return self + + def with_lang(self, value: str) -> Self: + self.lang = value + return self + + def with_is_visible(self, value: bool) -> Self: + self.is_visible = value + return self + + def with_separator(self, value: bool) -> Self: + self.separator = value + return self + + def with_height(self, value: ElementHeight) -> Self: + self.height = value + return self + + def with_spacing(self, value: Spacing) -> Self: + self.spacing = value + return self + + def with_target_width(self, value: TargetWidth) -> Self: + self.target_width = value + return self + + def with_is_sort_key(self, value: bool) -> Self: + self.is_sort_key = value + return self + + def with_bleed(self, value: bool) -> Self: + self.bleed = value + return self + + def with_min_height(self, value: str) -> Self: + self.min_height = value + return self + + def with_page_animation(self, value: CarouselPageAnimation) -> Self: + self.page_animation = value + return self + + def with_grid_area(self, value: str) -> Self: + self.grid_area = value + return self + + def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: + self.fallback = value + return self + + def with_pages(self, value: List[CarouselPage]) -> Self: + self.pages = value + return self + + +class Badge(CardElement): + """A badge element to show an icon and/or text in a compact form over a colored background.""" + + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + type: Literal["Badge"] = "Badge" + """ Must be **Badge**. """ + + id: Optional[str] = None + """ 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. """ + + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) + """ 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). """ + + lang: Optional[str] = None + """ The locale associated with the element. """ + + is_visible: Optional[bool] = True + """ Controls the visibility of the element. """ + + separator: Optional[bool] = None + """ 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. """ + + height: Optional[ElementHeight] = "auto" + """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ + + horizontal_alignment: Optional[HorizontalAlignment] = None + """ Controls how the element should be horizontally aligned. """ + + spacing: Optional[Spacing] = "Default" + """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ + + target_width: Optional[TargetWidth] = None + """ 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](topic:responsive-layout). """ + + is_sort_key: Optional[bool] = None + """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ + + text: Optional[str] = None + """ The text to display. """ + + icon: Optional[str] = None + """ The name of an icon from the [Adaptive Card icon catalog](topic:icon-catalog) to display, in the `[,regular|filled]` format. If the style is not specified, the regular style is used. """ + + icon_position: Optional[BadgeIconPosition] = "Before" + """ Controls the position of the icon. """ + + appearance: Optional[BadgeAppearance] = "Filled" + """ Controls the strength of the background color. """ + + size: Optional[BadgeSize] = "Medium" + """ The size of the badge. """ + + shape: Optional[BadgeShape] = "Circular" + """ Controls the shape of the badge. """ + + style: Optional[BadgeStyle] = "Default" + """ The style of the badge. """ + + tooltip: Optional[str] = None + """ Controls the tooltip text to display when the badge is hovered over. """ + + grid_area: Optional[str] = None + """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ + + fallback: Optional[Union[CardElement, FallbackElement]] = None + """ 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. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + + def with_id(self, value: str) -> Self: + self.id = value + return self + + def with_requires(self, value: HostCapabilities) -> Self: + self.requires = value + return self + + def with_lang(self, value: str) -> Self: + self.lang = value + return self + + def with_is_visible(self, value: bool) -> Self: + self.is_visible = value + return self + + def with_separator(self, value: bool) -> Self: + self.separator = value + return self + + def with_height(self, value: ElementHeight) -> Self: + self.height = value + return self + + def with_horizontal_alignment(self, value: HorizontalAlignment) -> Self: + self.horizontal_alignment = value + return self + + def with_spacing(self, value: Spacing) -> Self: + self.spacing = value + return self + + def with_target_width(self, value: TargetWidth) -> Self: + self.target_width = value + return self + + def with_is_sort_key(self, value: bool) -> Self: + self.is_sort_key = value + return self + + def with_text(self, value: str) -> Self: + self.text = value + return self + + def with_icon(self, value: str) -> Self: + self.icon = value + return self + + def with_icon_position(self, value: BadgeIconPosition) -> Self: + self.icon_position = value + return self + + def with_appearance(self, value: BadgeAppearance) -> Self: + self.appearance = value + return self + + def with_size(self, value: BadgeSize) -> Self: + self.size = value + return self + + def with_shape(self, value: BadgeShape) -> Self: + self.shape = value + return self + + def with_style(self, value: BadgeStyle) -> Self: + self.style = value return self - def with_max_height(self, value: str) -> Self: - self.max_height = value + def with_tooltip(self, value: str) -> Self: + self.tooltip = value return self def with_grid_area(self, value: str) -> Self: @@ -5061,16 +6090,15 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - def with_items(self, value: List[CardElement]) -> Self: - self.items = value - return self +class ProgressRing(CardElement): + """A spinning ring element, to indicate progress.""" -class Carousel(CardElement): - """A carousel with sliding pages.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - type: Literal["Carousel"] = "Carousel" - """ Must be **Carousel**. """ + type: Literal["ProgressRing"] = "ProgressRing" + """ Must be **ProgressRing**. """ id: Optional[str] = None """ 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. """ @@ -5087,10 +6115,13 @@ class Carousel(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - spacing: Optional[Spacing] = None + horizontal_alignment: Optional[HorizontalAlignment] = None + """ Controls how the element should be horizontally aligned. """ + + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -5099,23 +6130,24 @@ class Carousel(CardElement): is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - bleed: Optional[bool] = None - """ Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. """ + label: Optional[str] = None + """ The label of the progress ring. """ - min_height: Optional[str] = None - """ The minimum height, in pixels, of the container, in the `px` format. """ + label_position: Optional[ProgressRingLabelPosition] = "Below" + """ Controls the relative position of the label to the progress ring. """ - page_animation: Optional[CarouselPageAnimation] = None - """ Controls the type of animation to use to navigate between pages. """ + size: Optional[ProgressRingSize] = "Medium" + """ The size of the progress ring. """ grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ - pages: Optional[List[CarouselPage]] = None - """ The pages in the carousel. """ + def with_key(self, value: str) -> Self: + self.key = value + return self def with_id(self, value: str) -> Self: self.id = value @@ -5141,6 +6173,10 @@ def with_height(self, value: ElementHeight) -> Self: self.height = value return self + def with_horizontal_alignment(self, value: HorizontalAlignment) -> Self: + self.horizontal_alignment = value + return self + def with_spacing(self, value: Spacing) -> Self: self.spacing = value return self @@ -5153,16 +6189,16 @@ def with_is_sort_key(self, value: bool) -> Self: self.is_sort_key = value return self - def with_bleed(self, value: bool) -> Self: - self.bleed = value + def with_label(self, value: str) -> Self: + self.label = value return self - def with_min_height(self, value: str) -> Self: - self.min_height = value + def with_label_position(self, value: ProgressRingLabelPosition) -> Self: + self.label_position = value return self - def with_page_animation(self, value: CarouselPageAnimation) -> Self: - self.page_animation = value + def with_size(self, value: ProgressRingSize) -> Self: + self.size = value return self def with_grid_area(self, value: str) -> Self: @@ -5173,16 +6209,15 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - def with_pages(self, value: List[CarouselPage]) -> Self: - self.pages = value - return self +class ProgressBar(CardElement): + """A progress bar element, to represent a value within a range.""" -class Badge(CardElement): - """A badge element to show an icon and/or text in a compact form over a colored background.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - type: Literal["Badge"] = "Badge" - """ Must be **Badge**. """ + type: Literal["ProgressBar"] = "ProgressBar" + """ Must be **ProgressBar**. """ id: Optional[str] = None """ 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. """ @@ -5199,13 +6234,13 @@ class Badge(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -5214,36 +6249,25 @@ class Badge(CardElement): is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - text: Optional[str] = None - """ The text to display. """ - - icon: Optional[str] = None - """ The name of an icon from the [Adaptive Card icon catalog](topic:icon-catalog) to display, in the `[,regular|filled]` format. If the style is not specified, the regular style is used. """ - - icon_position: Optional[BadgeIconPosition] = None - """ Controls the position of the icon. """ - - appearance: Optional[BadgeAppearance] = None - """ Controls the strength of the background color. """ - - size: Optional[BadgeSize] = None - """ The size of the badge. """ - - shape: Optional[BadgeShape] = None - """ Controls the shape of the badge. """ + value: Optional[float] = None + """ The value of the progress bar. Must be between 0 and max. """ - style: Optional[BadgeStyle] = None - """ The style of the badge. """ + max: Optional[float] = 100 + """ The maximum value of the progress bar. """ - tooltip: Optional[str] = None - """ Controls the tooltip text to display when the badge is hovered over. """ + color: Optional[ProgressBarColor] = "Accent" + """ The color of the progress bar. `color` has no effect when the `ProgressBar` is in indeterminate mode, in which case the "accent" color is always used. """ grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -5284,36 +6308,16 @@ def with_is_sort_key(self, value: bool) -> Self: self.is_sort_key = value return self - def with_text(self, value: str) -> Self: - self.text = value - return self - - def with_icon(self, value: str) -> Self: - self.icon = value - return self - - def with_icon_position(self, value: BadgeIconPosition) -> Self: - self.icon_position = value - return self - - def with_appearance(self, value: BadgeAppearance) -> Self: - self.appearance = value - return self - - def with_size(self, value: BadgeSize) -> Self: - self.size = value - return self - - def with_shape(self, value: BadgeShape) -> Self: - self.shape = value + def with_value(self, value: float) -> Self: + self.value = value return self - def with_style(self, value: BadgeStyle) -> Self: - self.style = value + def with_max(self, value: float) -> Self: + self.max = value return self - def with_tooltip(self, value: str) -> Self: - self.tooltip = value + def with_color(self, value: ProgressBarColor) -> Self: + self.color = value return self def with_grid_area(self, value: str) -> Self: @@ -5328,6 +6332,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class DonutChartData(SerializableObject): """A data point in a Donut chart.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + legend: Optional[str] = None """ The legend of the chart. """ @@ -5337,6 +6344,10 @@ class DonutChartData(SerializableObject): color: Optional[ChartColor] = None """ The color to use for the data point. See [Chart colors reference](topic:chart-colors-reference). """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_legend(self, value: str) -> Self: self.legend = value return self @@ -5353,6 +6364,9 @@ def with_color(self, value: ChartColor) -> Self: class DonutChart(CardElement): """A donut chart.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Chart.Donut"] = "Chart.Donut" """ Must be **Chart.Donut**. """ @@ -5371,13 +6385,13 @@ class DonutChart(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -5389,18 +6403,43 @@ class DonutChart(CardElement): title: Optional[str] = None """ The title of the chart. """ + show_title: Optional[bool] = None + """ Controls whether the chart's title should be displayed. Defaults to `false`. """ + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ + max_width: Optional[str] = None + """ The maximum width, in pixels, of the chart, in the `px` format. """ + + show_legend: Optional[bool] = True + """ Controls whether the chart's legend should be displayed. """ + data: Optional[List[DonutChartData]] = None """ The data to display in the chart. """ + value: Optional[str] = None + """ The value that should be displayed in the center of a Donut chart. `value` is ignored for Pie charts. """ + + value_color: Optional[ChartColor] = None + """ Controls the color of the value displayed in the center of a Donut chart. """ + + thickness: Optional[DonutThickness] = None + """ Controls the thickness of the donut segments. Default is **Thick**. """ + + show_outlines: Optional[bool] = True + """ Controls whether the outlines of the donut segments are displayed. """ + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -5445,14 +6484,42 @@ def with_title(self, value: str) -> Self: self.title = value return self + def with_show_title(self, value: bool) -> Self: + self.show_title = value + return self + def with_color_set(self, value: ChartColorSet) -> Self: self.color_set = value return self + def with_max_width(self, value: str) -> Self: + self.max_width = value + return self + + def with_show_legend(self, value: bool) -> Self: + self.show_legend = value + return self + def with_data(self, value: List[DonutChartData]) -> Self: self.data = value return self + def with_value(self, value: str) -> Self: + self.value = value + return self + + def with_value_color(self, value: ChartColor) -> Self: + self.value_color = value + return self + + def with_thickness(self, value: DonutThickness) -> Self: + self.thickness = value + return self + + def with_show_outlines(self, value: bool) -> Self: + self.show_outlines = value + return self + def with_grid_area(self, value: str) -> Self: self.grid_area = value return self @@ -5465,6 +6532,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class PieChart(CardElement): """A pie chart.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Chart.Pie"] = "Chart.Pie" """ Must be **Chart.Pie**. """ @@ -5483,13 +6553,13 @@ class PieChart(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -5501,18 +6571,43 @@ class PieChart(CardElement): title: Optional[str] = None """ The title of the chart. """ + show_title: Optional[bool] = None + """ Controls whether the chart's title should be displayed. Defaults to `false`. """ + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ + max_width: Optional[str] = None + """ The maximum width, in pixels, of the chart, in the `px` format. """ + + show_legend: Optional[bool] = True + """ Controls whether the chart's legend should be displayed. """ + data: Optional[List[DonutChartData]] = None """ The data to display in the chart. """ + value: Optional[str] = None + """ The value that should be displayed in the center of a Donut chart. `value` is ignored for Pie charts. """ + + value_color: Optional[ChartColor] = None + """ Controls the color of the value displayed in the center of a Donut chart. """ + + thickness: Optional[DonutThickness] = None + """ Controls the thickness of the donut segments. Default is **Thick**. """ + + show_outlines: Optional[bool] = True + """ Controls whether the outlines of the donut segments are displayed. """ + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -5557,14 +6652,42 @@ def with_title(self, value: str) -> Self: self.title = value return self + def with_show_title(self, value: bool) -> Self: + self.show_title = value + return self + def with_color_set(self, value: ChartColorSet) -> Self: self.color_set = value return self + def with_max_width(self, value: str) -> Self: + self.max_width = value + return self + + def with_show_legend(self, value: bool) -> Self: + self.show_legend = value + return self + def with_data(self, value: List[DonutChartData]) -> Self: self.data = value return self + def with_value(self, value: str) -> Self: + self.value = value + return self + + def with_value_color(self, value: ChartColor) -> Self: + self.value_color = value + return self + + def with_thickness(self, value: DonutThickness) -> Self: + self.thickness = value + return self + + def with_show_outlines(self, value: bool) -> Self: + self.show_outlines = value + return self + def with_grid_area(self, value: str) -> Self: self.grid_area = value return self @@ -5577,12 +6700,19 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class BarChartDataValue(SerializableObject): """A single data point in a bar chart.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + x: Optional[str] = None """ The x axis value of the data point. """ y: Optional[float] = None """ The y axis value of the data point. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_x(self, value: str) -> Self: self.x = value return self @@ -5595,6 +6725,9 @@ def with_y(self, value: float) -> Self: class GroupedVerticalBarChartData(SerializableObject): """Represents a series of data points.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + legend: Optional[str] = None """ The legend of the chart. """ @@ -5604,6 +6737,10 @@ class GroupedVerticalBarChartData(SerializableObject): color: Optional[ChartColor] = None """ The color to use for all data points in the series. See [Chart colors reference](topic:chart-colors-reference). """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_legend(self, value: str) -> Self: self.legend = value return self @@ -5620,6 +6757,9 @@ def with_color(self, value: ChartColor) -> Self: class GroupedVerticalBarChart(CardElement): """A grouped vertical bar chart.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Chart.VerticalBar.Grouped"] = "Chart.VerticalBar.Grouped" """ Must be **Chart.VerticalBar.Grouped**. """ @@ -5638,13 +6778,13 @@ class GroupedVerticalBarChart(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -5656,9 +6796,18 @@ class GroupedVerticalBarChart(CardElement): title: Optional[str] = None """ The title of the chart. """ + show_title: Optional[bool] = None + """ Controls whether the chart's title should be displayed. Defaults to `false`. """ + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ + max_width: Optional[str] = None + """ The maximum width, in pixels, of the chart, in the `px` format. """ + + show_legend: Optional[bool] = True + """ Controls whether the chart's legend should be displayed. """ + x_axis_title: Optional[str] = None """ The title of the x axis. """ @@ -5669,7 +6818,9 @@ class GroupedVerticalBarChart(CardElement): """ The color to use for all data points. See [Chart colors reference](topic:chart-colors-reference). """ stacked: Optional[bool] = None - """ Controls if bars in the chart should be displayed as stacked instead of grouped. """ + """ Controls if bars in the chart should be displayed as stacks instead of groups. + +**Note:** stacked vertical bar charts do not support custom Y ranges nor negative Y values. """ data: Optional[List[GroupedVerticalBarChartData]] = None """ The data points in a series. """ @@ -5677,12 +6828,26 @@ class GroupedVerticalBarChart(CardElement): show_bar_values: Optional[bool] = None """ Controls if values should be displayed on each bar. """ + y_min: Optional[float] = None + """ The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation. + +`yMin` is ignored if `stacked` is set to `true`. """ + + y_max: Optional[float] = None + """ The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation. + +`yMax` is ignored if `stacked` is set to `true`. """ + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -5727,10 +6892,22 @@ def with_title(self, value: str) -> Self: self.title = value return self + def with_show_title(self, value: bool) -> Self: + self.show_title = value + return self + def with_color_set(self, value: ChartColorSet) -> Self: self.color_set = value return self + def with_max_width(self, value: str) -> Self: + self.max_width = value + return self + + def with_show_legend(self, value: bool) -> Self: + self.show_legend = value + return self + def with_x_axis_title(self, value: str) -> Self: self.x_axis_title = value return self @@ -5755,6 +6932,14 @@ def with_show_bar_values(self, value: bool) -> Self: self.show_bar_values = value return self + def with_y_min(self, value: float) -> Self: + self.y_min = value + return self + + def with_y_max(self, value: float) -> Self: + self.y_max = value + return self + def with_grid_area(self, value: str) -> Self: self.grid_area = value return self @@ -5767,6 +6952,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class VerticalBarChartDataValue(SerializableObject): """Represents a data point in a vertical bar chart.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + x: Optional[Union[str, float]] = None """ The x axis value of the data point. """ @@ -5776,6 +6964,10 @@ class VerticalBarChartDataValue(SerializableObject): color: Optional[ChartColor] = None """ The color to use for the bar associated with the data point. See [Chart colors reference](topic:chart-colors-reference). """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_x(self, value: Union[str, float]) -> Self: self.x = value return self @@ -5792,6 +6984,9 @@ def with_color(self, value: ChartColor) -> Self: class VerticalBarChart(CardElement): """A vertical bar chart.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Chart.VerticalBar"] = "Chart.VerticalBar" """ Must be **Chart.VerticalBar**. """ @@ -5810,13 +7005,13 @@ class VerticalBarChart(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -5828,9 +7023,18 @@ class VerticalBarChart(CardElement): title: Optional[str] = None """ The title of the chart. """ + show_title: Optional[bool] = None + """ Controls whether the chart's title should be displayed. Defaults to `false`. """ + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ + max_width: Optional[str] = None + """ The maximum width, in pixels, of the chart, in the `px` format. """ + + show_legend: Optional[bool] = True + """ Controls whether the chart's legend should be displayed. """ + x_axis_title: Optional[str] = None """ The title of the x axis. """ @@ -5846,12 +7050,22 @@ class VerticalBarChart(CardElement): show_bar_values: Optional[bool] = None """ Controls if the bar values should be displayed. """ + y_min: Optional[float] = None + """ The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation. """ + + y_max: Optional[float] = None + """ The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation. """ + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -5896,10 +7110,22 @@ def with_title(self, value: str) -> Self: self.title = value return self + def with_show_title(self, value: bool) -> Self: + self.show_title = value + return self + def with_color_set(self, value: ChartColorSet) -> Self: self.color_set = value return self + def with_max_width(self, value: str) -> Self: + self.max_width = value + return self + + def with_show_legend(self, value: bool) -> Self: + self.show_legend = value + return self + def with_x_axis_title(self, value: str) -> Self: self.x_axis_title = value return self @@ -5920,6 +7146,14 @@ def with_show_bar_values(self, value: bool) -> Self: self.show_bar_values = value return self + def with_y_min(self, value: float) -> Self: + self.y_min = value + return self + + def with_y_max(self, value: float) -> Self: + self.y_max = value + return self + def with_grid_area(self, value: str) -> Self: self.grid_area = value return self @@ -5932,6 +7166,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class HorizontalBarChartDataValue(SerializableObject): """Represents a single data point in a horizontal bar chart.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + x: Optional[str] = None """ The x axis value of the data point. """ @@ -5941,6 +7178,10 @@ class HorizontalBarChartDataValue(SerializableObject): color: Optional[ChartColor] = None """ The color of the bar associated with the data point. See [Chart colors reference](topic:chart-colors-reference). """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_x(self, value: str) -> Self: self.x = value return self @@ -5957,6 +7198,9 @@ def with_color(self, value: ChartColor) -> Self: class HorizontalBarChart(CardElement): """A horizontal bar chart.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Chart.HorizontalBar"] = "Chart.HorizontalBar" """ Must be **Chart.HorizontalBar**. """ @@ -5975,13 +7219,13 @@ class HorizontalBarChart(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -5993,9 +7237,18 @@ class HorizontalBarChart(CardElement): title: Optional[str] = None """ The title of the chart. """ + show_title: Optional[bool] = None + """ Controls whether the chart's title should be displayed. Defaults to `false`. """ + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ + max_width: Optional[str] = None + """ The maximum width, in pixels, of the chart, in the `px` format. """ + + show_legend: Optional[bool] = True + """ Controls whether the chart's legend should be displayed. """ + x_axis_title: Optional[str] = None """ The title of the x axis. """ @@ -6008,15 +7261,19 @@ class HorizontalBarChart(CardElement): data: Optional[List[HorizontalBarChartDataValue]] = None """ The data points in the chart. """ - display_mode: Optional[HorizontalBarChartDisplayMode] = None + display_mode: Optional[HorizontalBarChartDisplayMode] = "AbsoluteWithAxis" """ Controls how the chart should be visually laid out. """ grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -6061,10 +7318,22 @@ def with_title(self, value: str) -> Self: self.title = value return self + def with_show_title(self, value: bool) -> Self: + self.show_title = value + return self + def with_color_set(self, value: ChartColorSet) -> Self: self.color_set = value return self + def with_max_width(self, value: str) -> Self: + self.max_width = value + return self + + def with_show_legend(self, value: bool) -> Self: + self.show_legend = value + return self + def with_x_axis_title(self, value: str) -> Self: self.x_axis_title = value return self @@ -6097,6 +7366,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class StackedHorizontalBarChartDataPoint(SerializableObject): """A data point in a series.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + legend: Optional[str] = None """ The legend associated with the data point. """ @@ -6106,6 +7378,10 @@ class StackedHorizontalBarChartDataPoint(SerializableObject): color: Optional[ChartColor] = None """ The color to use to render the bar associated with the data point. See [Chart colors reference](topic:chart-colors-reference). """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_legend(self, value: str) -> Self: self.legend = value return self @@ -6122,12 +7398,19 @@ def with_color(self, value: ChartColor) -> Self: class StackedHorizontalBarChartData(SerializableObject): """Defines the collection of data series to display in as a stacked horizontal bar chart.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + title: Optional[str] = None """ The title of the series. """ data: Optional[List[StackedHorizontalBarChartDataPoint]] = None """ The data points in the series. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_title(self, value: str) -> Self: self.title = value return self @@ -6140,6 +7423,9 @@ def with_data(self, value: List[StackedHorizontalBarChartDataPoint]) -> Self: class StackedHorizontalBarChart(CardElement): """A stacked horizontal bar chart.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Chart.HorizontalBar.Stacked"] = "Chart.HorizontalBar.Stacked" """ Must be **Chart.HorizontalBar.Stacked**. """ @@ -6158,13 +7444,13 @@ class StackedHorizontalBarChart(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -6176,9 +7462,18 @@ class StackedHorizontalBarChart(CardElement): title: Optional[str] = None """ The title of the chart. """ + show_title: Optional[bool] = None + """ Controls whether the chart's title should be displayed. Defaults to `false`. """ + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ + max_width: Optional[str] = None + """ The maximum width, in pixels, of the chart, in the `px` format. """ + + show_legend: Optional[bool] = True + """ Controls whether the chart's legend should be displayed. """ + x_axis_title: Optional[str] = None """ The title of the x axis. """ @@ -6194,9 +7489,13 @@ class StackedHorizontalBarChart(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -6241,10 +7540,22 @@ def with_title(self, value: str) -> Self: self.title = value return self + def with_show_title(self, value: bool) -> Self: + self.show_title = value + return self + def with_color_set(self, value: ChartColorSet) -> Self: self.color_set = value return self + def with_max_width(self, value: str) -> Self: + self.max_width = value + return self + + def with_show_legend(self, value: bool) -> Self: + self.show_legend = value + return self + def with_x_axis_title(self, value: str) -> Self: self.x_axis_title = value return self @@ -6273,6 +7584,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class LineChartValue(SerializableObject): """Represents a single data point in a line chart.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + x: Optional[Union[float, str]] = None """ The x axis value of the data point. @@ -6283,6 +7597,10 @@ class LineChartValue(SerializableObject): y: Optional[float] = None """ The y axis value of the data point. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_x(self, value: Union[float, str]) -> Self: self.x = value return self @@ -6295,6 +7613,9 @@ def with_y(self, value: float) -> Self: class LineChartData(SerializableObject): """Represents a collection of data points series in a line chart.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + legend: Optional[str] = None """ The legend of the chart. """ @@ -6304,6 +7625,10 @@ class LineChartData(SerializableObject): color: Optional[ChartColor] = None """ The color all data points in the series. See [Chart colors reference](topic:chart-colors-reference). """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_legend(self, value: str) -> Self: self.legend = value return self @@ -6320,6 +7645,9 @@ def with_color(self, value: ChartColor) -> Self: class LineChart(CardElement): """A line chart.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Chart.Line"] = "Chart.Line" """ Must be **Chart.Line**. """ @@ -6338,13 +7666,13 @@ class LineChart(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -6356,9 +7684,18 @@ class LineChart(CardElement): title: Optional[str] = None """ The title of the chart. """ + show_title: Optional[bool] = None + """ Controls whether the chart's title should be displayed. Defaults to `false`. """ + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ + max_width: Optional[str] = None + """ The maximum width, in pixels, of the chart, in the `px` format. """ + + show_legend: Optional[bool] = True + """ Controls whether the chart's legend should be displayed. """ + x_axis_title: Optional[str] = None """ The title of the x axis. """ @@ -6380,9 +7717,13 @@ class LineChart(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -6427,10 +7768,22 @@ def with_title(self, value: str) -> Self: self.title = value return self + def with_show_title(self, value: bool) -> Self: + self.show_title = value + return self + def with_color_set(self, value: ChartColorSet) -> Self: self.color_set = value return self + def with_max_width(self, value: str) -> Self: + self.max_width = value + return self + + def with_show_legend(self, value: bool) -> Self: + self.show_legend = value + return self + def with_x_axis_title(self, value: str) -> Self: self.x_axis_title = value return self @@ -6467,6 +7820,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class GaugeChartLegend(SerializableObject): """The legend of the chart.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + size: Optional[float] = None """ The size of the segment. """ @@ -6476,6 +7832,10 @@ class GaugeChartLegend(SerializableObject): color: Optional[ChartColor] = None """ The color to use for the segment. See [Chart colors reference](topic:chart-colors-reference). """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_size(self, value: float) -> Self: self.size = value return self @@ -6492,6 +7852,9 @@ def with_color(self, value: ChartColor) -> Self: class GaugeChart(CardElement): """A gauge chart.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Chart.Gauge"] = "Chart.Gauge" """ Must be **Chart.Gauge**. """ @@ -6510,13 +7873,13 @@ class GaugeChart(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -6528,9 +7891,18 @@ class GaugeChart(CardElement): title: Optional[str] = None """ The title of the chart. """ + show_title: Optional[bool] = None + """ Controls whether the chart's title should be displayed. Defaults to `false`. """ + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ + max_width: Optional[str] = None + """ The maximum width, in pixels, of the chart, in the `px` format. """ + + show_legend: Optional[bool] = True + """ Controls whether the chart's legend should be displayed. """ + min: Optional[float] = None """ The minimum value of the gauge. """ @@ -6541,10 +7913,13 @@ class GaugeChart(CardElement): """ The sub-label of the gauge. """ show_min_max: Optional[bool] = True - """ Controls if the min/max values should be displayed. """ + """ Controls whether the min/max values should be displayed. """ - show_legend: Optional[bool] = True - """ Controls if the legend should be displayed. """ + show_needle: Optional[bool] = True + """ Controls whether the gauge's needle is displayed. Default is **true**. """ + + show_outlines: Optional[bool] = True + """ Controls whether the outlines of the gauge segments are displayed. """ segments: Optional[List[GaugeChartLegend]] = None """ The segments to display in the gauge. """ @@ -6552,15 +7927,19 @@ class GaugeChart(CardElement): value: Optional[float] = None """ The value of the gauge. """ - value_format: Optional[GaugeChartValueFormat] = None + value_format: Optional[GaugeChartValueFormat] = "Percentage" """ The format used to display the gauge's value. """ grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -6605,10 +7984,22 @@ def with_title(self, value: str) -> Self: self.title = value return self + def with_show_title(self, value: bool) -> Self: + self.show_title = value + return self + def with_color_set(self, value: ChartColorSet) -> Self: self.color_set = value return self + def with_max_width(self, value: str) -> Self: + self.max_width = value + return self + + def with_show_legend(self, value: bool) -> Self: + self.show_legend = value + return self + def with_min(self, value: float) -> Self: self.min = value return self @@ -6625,8 +8016,12 @@ def with_show_min_max(self, value: bool) -> Self: self.show_min_max = value return self - def with_show_legend(self, value: bool) -> Self: - self.show_legend = value + def with_show_needle(self, value: bool) -> Self: + self.show_needle = value + return self + + def with_show_outlines(self, value: bool) -> Self: + self.show_outlines = value return self def with_segments(self, value: List[GaugeChartLegend]) -> Self: @@ -6653,6 +8048,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class CodeBlock(CardElement): """A formatted and syntax-colored code block.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["CodeBlock"] = "CodeBlock" """ Must be **CodeBlock**. """ @@ -6671,13 +8069,13 @@ class CodeBlock(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -6689,7 +8087,7 @@ class CodeBlock(CardElement): code_snippet: Optional[str] = None """ The code snippet to display. """ - language: Optional[CodeLanguage] = None + language: Optional[CodeLanguage] = "PlainText" """ The language the code snippet is expressed in. """ start_line_number: Optional[float] = 1 @@ -6698,9 +8096,13 @@ class CodeBlock(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -6765,12 +8167,32 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class PersonaProperties(SerializableObject): """Represents the properties of a Persona component.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + id: Optional[str] = None + """ The Id of the persona. """ + user_principal_name: Optional[str] = None """ The UPN of the persona. """ display_name: Optional[str] = None """ The display name of the persona. """ + icon_style: Optional[PersonaIconStyle] = None + """ Defines the style of the icon for the persona. """ + + style: Optional[PersonaDisplayStyle] = None + """ Defines how the persona should be displayed. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + + def with_id(self, value: str) -> Self: + self.id = value + return self + def with_user_principal_name(self, value: str) -> Self: self.user_principal_name = value return self @@ -6779,10 +8201,21 @@ def with_display_name(self, value: str) -> Self: self.display_name = value return self + def with_icon_style(self, value: PersonaIconStyle) -> Self: + self.icon_style = value + return self + + def with_style(self, value: PersonaDisplayStyle) -> Self: + self.style = value + return self + class ComUserMicrosoftGraphComponent(CardElement): """Displays a user's information, including their profile picture.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Component"] = "Component" """ Must be **Component**. """ @@ -6801,13 +8234,13 @@ class ComUserMicrosoftGraphComponent(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -6820,14 +8253,18 @@ class ComUserMicrosoftGraphComponent(CardElement): """ Must be **graph.microsoft.com/user**. """ properties: Optional[PersonaProperties] = None - """ The properties of the user. """ + """ The properties of the Persona component. """ grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -6884,17 +8321,41 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class PersonaSetProperties(SerializableObject): """Represents the properties of a PersonaSet component.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + users: Optional[List[PersonaProperties]] = None """ The users a PersonaSet component should display. """ + icon_style: Optional[PersonaIconStyle] = None + """ Defines the style of the icon for the personas in the set. """ + + style: Optional[PersonaDisplayStyle] = None + """ Defines how each persona in the set should be displayed. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_users(self, value: List[PersonaProperties]) -> Self: self.users = value return self + def with_icon_style(self, value: PersonaIconStyle) -> Self: + self.icon_style = value + return self + + def with_style(self, value: PersonaDisplayStyle) -> Self: + self.style = value + return self + class ComUsersMicrosoftGraphComponent(CardElement): """Displays multiple users' information, including their profile pictures.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Component"] = "Component" """ Must be **Component**. """ @@ -6913,13 +8374,13 @@ class ComUsersMicrosoftGraphComponent(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -6932,14 +8393,18 @@ class ComUsersMicrosoftGraphComponent(CardElement): """ Must be **graph.microsoft.com/users**. """ properties: Optional[PersonaSetProperties] = None - """ The properties of the set. """ + """ The properties of the PersonaSet component. """ grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -6996,9 +8461,16 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class ResourceVisualization(SerializableObject): """Represents a visualization of a resource.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + media: Optional[str] = None """ The media associated with the resource. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_media(self, value: str) -> Self: self.media = value return self @@ -7007,6 +8479,9 @@ def with_media(self, value: str) -> Self: class ResourceProperties(SerializableObject): """Represents the properties of a resource component.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + id: Optional[str] = None """ The Id of the resource. """ @@ -7016,6 +8491,10 @@ class ResourceProperties(SerializableObject): resource_visualization: Optional[ResourceVisualization] = None """ The visualization of the resource. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -7032,6 +8511,9 @@ def with_resource_visualization(self, value: ResourceVisualization) -> Self: class ComResourceMicrosoftGraphComponent(CardElement): """Displays information about a generic graph resource.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Component"] = "Component" """ Must be **Component**. """ @@ -7050,13 +8532,13 @@ class ComResourceMicrosoftGraphComponent(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -7074,9 +8556,13 @@ class ComResourceMicrosoftGraphComponent(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -7133,6 +8619,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class FileProperties(SerializableObject): """Represents the properties of a file component.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + name: Optional[str] = None """ The name of the file. """ @@ -7142,6 +8631,10 @@ class FileProperties(SerializableObject): url: Optional[str] = None """ The URL of the file. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_name(self, value: str) -> Self: self.name = value return self @@ -7158,6 +8651,9 @@ def with_url(self, value: str) -> Self: class ComFileMicrosoftGraphComponent(CardElement): """Displays information about a file resource.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Component"] = "Component" """ Must be **Component**. """ @@ -7176,13 +8672,13 @@ class ComFileMicrosoftGraphComponent(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -7200,9 +8696,13 @@ class ComFileMicrosoftGraphComponent(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -7259,6 +8759,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class CalendarEventAttendee(SerializableObject): """Represents a calendar event attendee.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + name: Optional[str] = None """ The name of the attendee. """ @@ -7274,6 +8777,10 @@ class CalendarEventAttendee(SerializableObject): status: Optional[str] = None """ The status of the attendee. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_name(self, value: str) -> Self: self.name = value return self @@ -7298,6 +8805,9 @@ def with_status(self, value: str) -> Self: class CalendarEventProperties(SerializableObject): """The properties of a calendar event.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + id: Optional[str] = None """ The ID of the event. """ @@ -7334,6 +8844,10 @@ class CalendarEventProperties(SerializableObject): organizer: Optional[CalendarEventAttendee] = None """ The organizer of the event. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -7386,6 +8900,9 @@ def with_organizer(self, value: CalendarEventAttendee) -> Self: class ComEventMicrosoftGraphComponent(CardElement): """Displays information about a calendar event.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["Component"] = "Component" """ Must be **Component**. """ @@ -7404,13 +8921,13 @@ class ComEventMicrosoftGraphComponent(CardElement): separator: Optional[bool] = None """ 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. """ - height: Optional[ElementHeight] = None + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - spacing: Optional[Spacing] = None + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ target_width: Optional[TargetWidth] = None @@ -7428,9 +8945,13 @@ class ComEventMicrosoftGraphComponent(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -7487,6 +9008,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class TextRun(CardElement): """A block of text inside a RichTextBlock element.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["TextRun"] = "TextRun" """ Must be **TextRun**. """ @@ -7538,9 +9062,13 @@ class TextRun(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -7613,6 +9141,9 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: class IconRun(CardElement): """An inline icon inside a RichTextBlock element.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["IconRun"] = "IconRun" """ Must be **IconRun**. """ @@ -7631,13 +9162,13 @@ class IconRun(CardElement): name: Optional[str] = None """ The name of the inline icon to display. """ - size: Optional[SizeEnum] = None + size: Optional[SizeEnum] = "Default" """ The size of the inline icon. """ - style: Optional[IconStyle] = None + style: Optional[IconStyle] = "Regular" """ The style of the inline icon. """ - color: Optional[TextColor] = None + color: Optional[TextColor] = "Default" """ The color of the inline icon. """ select_action: Optional[Action] = None @@ -7646,9 +9177,13 @@ class IconRun(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -7694,27 +9229,12 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: return self -class ThemedUrl(SerializableObject): - """Defines a theme-specific URL.""" - - theme: Optional[ThemeName] = None - """ The theme this URL applies to. """ - - url: Optional[str] = None - """ The URL to use for the associated theme. """ - - def with_theme(self, value: ThemeName) -> Self: - self.theme = value - return self - - def with_url(self, value: str) -> Self: - self.url = value - return self - - class ImageRun(CardElement): """An inline image inside a RichTextBlock element.""" + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + type: Literal["ImageRun"] = "ImageRun" """ Must be **ImageRun**. """ @@ -7733,10 +9253,10 @@ class ImageRun(CardElement): url: Optional[str] = None """ The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. """ - size: Optional[SizeEnum] = None + size: Optional[SizeEnum] = "Default" """ The size of the inline image. """ - style: Optional[ImageStyle] = None + style: Optional[ImageStyle] = "Default" """ The style of the inline image. """ select_action: Optional[Action] = None @@ -7748,9 +9268,13 @@ class ImageRun(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ + def with_key(self, value: str) -> Self: + self.key = value + return self + def with_id(self, value: str) -> Self: self.id = value return self @@ -7794,3 +9318,162 @@ def with_grid_area(self, value: str) -> Self: def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self + + +class ImBackSubmitActionData(SerializableObject): + """Represents Teams-specific data in an Action.Submit to send an Instant Message back to the Bot.""" + + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + type: Literal["imBack"] = "imBack" + """ Must be **imBack**. """ + + value: Optional[str] = None + """ The value that will be sent to the Bot. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + + def with_value(self, value: str) -> Self: + self.value = value + return self + + +class TabInfo(SerializableObject): + """Represents information about the iFrame content, rendered in the collab stage popout window.""" + + name: Optional[str] = None + """ The name for the content. This will be displayed as the title of the window hosting the iFrame. """ + + content_url: Optional[str] = None + """ The URL to open in an iFrame. """ + + entity_id: Optional[str] = None + """ The unique entity id for this content (e.g., random UUID). """ + + website_url: Optional[str] = None + """ An optional website URL to the content, allowing users to open this content in the browser (if they prefer). """ + + def with_name(self, value: str) -> Self: + self.name = value + return self + + def with_content_url(self, value: str) -> Self: + self.content_url = value + return self + + def with_entity_id(self, value: str) -> Self: + self.entity_id = value + return self + + def with_website_url(self, value: str) -> Self: + self.website_url = value + return self + + +class CollabStageInvokeDataValue(SerializableObject): + """Data for invoking a collaboration stage action.""" + + type: Literal["tab/tabInfoAction"] = "tab/tabInfoAction" + """ Must be **tab/tabInfoAction**. """ + + tab_info: Optional[TabInfo] = None + """ Provides information about the iFrame content, rendered in the collab stage popout window. """ + + def with_tab_info(self, value: TabInfo) -> Self: + self.tab_info = value + return self + + +class InvokeSubmitActionData(SerializableObject): + """Represents Teams-specific data in an Action.Submit to make an Invoke request to the Bot.""" + + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + type: Literal["invoke"] = "invoke" + """ Must be **invoke**. """ + + value: Optional[Union[Dict[str, Any], CollabStageInvokeDataValue]] = None + """ The object to send to the Bot with the Invoke request. Can be strongly typed as one of the below values to trigger a specific action in Teams. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + + def with_value(self, value: Union[Dict[str, Any], CollabStageInvokeDataValue]) -> Self: + self.value = value + return self + + +class MessageBackSubmitActionData(SerializableObject): + """Represents Teams-specific data in an Action.Submit to send a message back to the Bot.""" + + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + type: Literal["messageBack"] = "messageBack" + """ Must be **messageBack**. """ + + text: Optional[str] = None + """ The text that will be sent to the Bot. """ + + display_text: Optional[str] = None + """ 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. """ + + value: Optional[Dict[str, Any]] = None + """ 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. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + + def with_text(self, value: str) -> Self: + self.text = value + return self + + def with_display_text(self, value: str) -> Self: + self.display_text = value + return self + + def with_value(self, value: Dict[str, Any]) -> Self: + self.value = value + return self + + +class SigninSubmitActionData(SerializableObject): + """Represents Teams-specific data in an Action.Submit to sign in a user.""" + + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + type: Literal["signin"] = "signin" + """ Must be **signin**. """ + + value: Optional[str] = None + """ The URL to redirect the end-user for signing in. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + + def with_value(self, value: str) -> Self: + self.value = value + return self + + +class TaskFetchSubmitActionData(SerializableObject): + """Represents Teams-specific data in an Action.Submit to open a task module.""" + + key: Optional[str] = None + """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ + + type: Literal["task/fetch"] = "task/fetch" + """ Must be **task/fetch**. """ + + def with_key(self, value: str) -> Self: + self.key = value + return self + From 0b4fa612ad9262d7f7d8110a1042d78ecd0d2019 Mon Sep 17 00:00:00 2001 From: Corina Gum <> Date: Wed, 18 Mar 2026 16:07:56 -0700 Subject: [PATCH 03/10] Apply manual fixes --- .../cards/src/microsoft_teams/cards/core.py | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/packages/cards/src/microsoft_teams/cards/core.py b/packages/cards/src/microsoft_teams/cards/core.py index 79b7426e..5b9c71d6 100644 --- a/packages/cards/src/microsoft_teams/cards/core.py +++ b/packages/cards/src/microsoft_teams/cards/core.py @@ -22,6 +22,14 @@ def validation_alias_generator(field: str) -> str: if field == "from_": return "from" + # Handle ms_teams field which should deserialize from msteams + if field == "ms_teams": + return "msteams" + + # Handle choices_data field which should deserialize from choices.data + if field == "choices_data": + return "choices.data" + # All other fields are converted to camelCase return to_camel(field) @@ -37,6 +45,14 @@ def serialization_alias_generator(field: str) -> str: if field == "from_": return "from" + # Handle ms_teams field which should serialize to msteams + if field == "ms_teams": + return "msteams" + + # Handle choices_data field which should serialize to choices.data + if field == "choices_data": + return "choices.data" + # All other fields are converted to camelCase return to_camel(field) @@ -255,7 +271,7 @@ def with_themed_urls(self, value: List[ThemedUrl]) -> Self: class SubmitActionData(SerializableObject): - """Represents the data of an Action.Submit.""" + """Represents the data of an Action.Submit. This model can include arbitrary data""" key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ @@ -278,6 +294,11 @@ def with_ms_teams(self, value: Dict[str, Any]) -> Self: self.ms_teams = value return self + def with_data(self, value: Dict[str, Any]) -> Self: + for k, v in value.items(): + setattr(self, k, v) + return self + class ExecuteAction(Action): """Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can respond synchronously and return an updated Adaptive Card to be displayed by the client. Action.Execute works in all Adaptive Card hosts.""" From 8d7ff8794012983e81ba1f6dde5cdb4ef8eb7601 Mon Sep 17 00:00:00 2001 From: Corina Gum <> Date: Wed, 18 Mar 2026 16:29:27 -0700 Subject: [PATCH 04/10] Fixes --- examples/cards/src/main.py | 11 ++++++----- .../cards/actions/message_back_action.py | 7 ++++--- packages/cards/src/microsoft_teams/cards/core.py | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/examples/cards/src/main.py b/examples/cards/src/main.py index efee8699..a8fcfb4e 100644 --- a/examples/cards/src/main.py +++ b/examples/cards/src/main.py @@ -20,6 +20,7 @@ ExecuteAction, NumberInput, OpenUrlAction, + SubmitActionData, TextBlock, ToggleInput, ) @@ -37,7 +38,7 @@ def create_basic_adaptive_card() -> AdaptiveCard: ToggleInput(label="Notify me").with_id("notify"), ActionSet( actions=[ - ExecuteAction(title="Submit").with_data({"action": "submit_basic"}).with_associated_inputs("auto") + ExecuteAction(title="Submit").with_data(SubmitActionData().with_data({"action": "submit_basic"})).with_associated_inputs("auto") ] ), ], @@ -110,7 +111,7 @@ def create_profile_card() -> AdaptiveCard: ActionSet( actions=[ ExecuteAction(title="Save") - .with_data({"action": "save_profile", "entity_id": "12345"}) + .with_data(SubmitActionData().with_data({"action": "save_profile", "entity_id": "12345"})) .with_associated_inputs("auto"), OpenUrlAction(url="https://adaptivecards.microsoft.com").with_title("Learn More"), ] @@ -134,7 +135,7 @@ def create_profile_card_input_validation() -> AdaptiveCard: TextInput(id="location").with_label("Location"), ActionSet( actions=[ - ExecuteAction(title="Save").with_data({"action": "save_profile"}).with_associated_inputs("auto") + ExecuteAction(title="Save").with_data(SubmitActionData().with_data({"action": "save_profile"})).with_associated_inputs("auto") ] ), ], @@ -156,7 +157,7 @@ def create_feedback_card() -> AdaptiveCard: ActionSet( actions=[ ExecuteAction(title="Submit Feedback") - .with_data({"action": "submit_feedback"}) + .with_data(SubmitActionData().with_data({"action": "submit_feedback"})) .with_associated_inputs("auto") ] ), @@ -207,7 +208,7 @@ async def handle_form(ctx: ActivityContext[MessageActivity]): ActionSet( actions=[ ExecuteAction(title="Create Task") - .with_data({"action": "create_task"}) + .with_data(SubmitActionData().with_data({"action": "create_task"})) .with_associated_inputs("auto") .with_style("positive") ] diff --git a/packages/cards/src/microsoft_teams/cards/actions/message_back_action.py b/packages/cards/src/microsoft_teams/cards/actions/message_back_action.py index 82b4c41d..ae60dcd5 100644 --- a/packages/cards/src/microsoft_teams/cards/actions/message_back_action.py +++ b/packages/cards/src/microsoft_teams/cards/actions/message_back_action.py @@ -4,7 +4,7 @@ """ import warnings -from typing import Optional +from typing import Any, Dict, Optional, Union from ..core import MessageBackSubmitActionData, SubmitAction, SubmitActionData @@ -13,7 +13,7 @@ class MessageBackAction(SubmitAction): """This class is deprecated. Please use MessageBackSubmitActionData instead. This will be removed in a future version of the SDK.""" - def __init__(self, text: str, value: str, display_text: Optional[str] = None): + def __init__(self, text: str, value: Union[str, Dict[str, Any]], display_text: Optional[str] = None): warnings.warn( "MessageBackAction is deprecated. Use MessageBackSubmitActionData instead. " "This will be removed in a future version of the SDK.", @@ -21,7 +21,8 @@ def __init__(self, text: str, value: str, display_text: Optional[str] = None): stacklevel=2, ) super().__init__() - action_data = MessageBackSubmitActionData().with_value(value).with_text(text) + action_value = {"value": value} if isinstance(value, str) else value + action_data = MessageBackSubmitActionData().with_value(action_value).with_text(text) if display_text: action_data = action_data.with_display_text(display_text) diff --git a/packages/cards/src/microsoft_teams/cards/core.py b/packages/cards/src/microsoft_teams/cards/core.py index 5b9c71d6..a39bdfb2 100644 --- a/packages/cards/src/microsoft_teams/cards/core.py +++ b/packages/cards/src/microsoft_teams/cards/core.py @@ -746,7 +746,7 @@ class AdaptiveCard(CardElement): rtl: Optional[bool] = None """ Controls if the content of the card is to be rendered left-to-right or right-to-left. """ - ac_schema: Optional[str] = Field(None, alias="schema") + ac_schema: Optional[str] = Field(default=None, alias="schema") """ A URL to the Adaptive Card schema the card is authored against. """ version: Optional[Version] = "1.5" From d4d379ea990300e5d517f94055d0030ff5dfdc97 Mon Sep 17 00:00:00 2001 From: Corina Gum <> Date: Wed, 18 Mar 2026 16:35:23 -0700 Subject: [PATCH 05/10] Lint --- examples/cards/src/main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/cards/src/main.py b/examples/cards/src/main.py index a8fcfb4e..3dc5f9c5 100644 --- a/examples/cards/src/main.py +++ b/examples/cards/src/main.py @@ -38,7 +38,9 @@ def create_basic_adaptive_card() -> AdaptiveCard: ToggleInput(label="Notify me").with_id("notify"), ActionSet( actions=[ - ExecuteAction(title="Submit").with_data(SubmitActionData().with_data({"action": "submit_basic"})).with_associated_inputs("auto") + ExecuteAction(title="Submit") + .with_data(SubmitActionData().with_data({"action": "submit_basic"})) + .with_associated_inputs("auto") ] ), ], @@ -135,7 +137,9 @@ def create_profile_card_input_validation() -> AdaptiveCard: TextInput(id="location").with_label("Location"), ActionSet( actions=[ - ExecuteAction(title="Save").with_data(SubmitActionData().with_data({"action": "save_profile"})).with_associated_inputs("auto") + ExecuteAction(title="Save") + .with_data(SubmitActionData().with_data({"action": "save_profile"})) + .with_associated_inputs("auto") ] ), ], From 5711f7354b3837e77977e2085f501b171bf17f16 Mon Sep 17 00:00:00 2001 From: Corina Gum <> Date: Thu, 19 Mar 2026 11:14:18 -0700 Subject: [PATCH 06/10] Re-add SerializeAsAny manual change --- .../cards/src/microsoft_teams/cards/core.py | 154 +++++++++--------- .../cards/tests/test_message_back_action.py | 2 +- 2 files changed, 78 insertions(+), 78 deletions(-) diff --git a/packages/cards/src/microsoft_teams/cards/core.py b/packages/cards/src/microsoft_teams/cards/core.py index a39bdfb2..213637c6 100644 --- a/packages/cards/src/microsoft_teams/cards/core.py +++ b/packages/cards/src/microsoft_teams/cards/core.py @@ -3,7 +3,7 @@ from typing import Any, Dict, List, Literal, Optional, Self, Union -from pydantic import AliasGenerator, BaseModel, ConfigDict, Field +from pydantic import AliasGenerator, BaseModel, ConfigDict, Field, SerializeAsAny from pydantic.alias_generators import to_camel @@ -335,7 +335,7 @@ class ExecuteAction(Action): is_enabled: Optional[bool] = True """ 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. """ - menu_actions: Optional[List[Action]] = None + menu_actions: Optional[List[SerializeAsAny[Action]]] = None """ The actions to display in the overflow menu of a Split action button. """ themed_icon_urls: Optional[List[ThemedUrl]] = None @@ -353,7 +353,7 @@ class ExecuteAction(Action): verb: Optional[str] = None """ The verb of the action. """ - fallback: Optional[Union[Action, FallbackAction]] = None + fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -731,7 +731,7 @@ class AdaptiveCard(CardElement): style: Optional[ContainerStyle] = None """ 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. """ - layouts: Optional[List[ContainerLayout]] = None + layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None """ 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](topic:container-layouts) for more details. """ min_height: Optional[str] = None @@ -779,13 +779,13 @@ class AdaptiveCard(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ - body: Optional[List[CardElement]] = None + body: Optional[List[SerializeAsAny[CardElement]]] = None """ The body of the card, comprised of a list of elements displayed according to the layouts property. If the layouts property is not specified, a Layout.Stack is used. """ - actions: Optional[List[Action]] = None + actions: Optional[List[SerializeAsAny[Action]]] = None """ The card level actions, which always appear at the bottom of the card. """ def with_key(self, value: str) -> Self: @@ -928,7 +928,7 @@ class InsertImageAction(Action): is_enabled: Optional[bool] = True """ 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. """ - menu_actions: Optional[List[Action]] = None + menu_actions: Optional[List[SerializeAsAny[Action]]] = None """ The actions to display in the overflow menu of a Split action button. """ themed_icon_urls: Optional[List[ThemedUrl]] = None @@ -943,7 +943,7 @@ class InsertImageAction(Action): insert_position: Optional[ImageInsertPosition] = "Selection" """ The position at which to insert the image. """ - fallback: Optional[Union[Action, FallbackAction]] = None + fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1042,7 +1042,7 @@ class OpenUrlAction(Action): is_enabled: Optional[bool] = True """ 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. """ - menu_actions: Optional[List[Action]] = None + menu_actions: Optional[List[SerializeAsAny[Action]]] = None """ The actions to display in the overflow menu of a Split action button. """ themed_icon_urls: Optional[List[ThemedUrl]] = None @@ -1051,7 +1051,7 @@ class OpenUrlAction(Action): url: Optional[str] = None """ The URL to open. """ - fallback: Optional[Union[Action, FallbackAction]] = None + fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1142,7 +1142,7 @@ class OpenUrlDialogAction(Action): is_enabled: Optional[bool] = True """ 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. """ - menu_actions: Optional[List[Action]] = None + menu_actions: Optional[List[SerializeAsAny[Action]]] = None """ The actions to display in the overflow menu of a Split action button. """ themed_icon_urls: Optional[List[ThemedUrl]] = None @@ -1160,7 +1160,7 @@ class OpenUrlDialogAction(Action): url: Optional[str] = None """ The URL to open. """ - fallback: Optional[Union[Action, FallbackAction]] = None + fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1263,7 +1263,7 @@ class ResetInputsAction(Action): is_enabled: Optional[bool] = True """ 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. """ - menu_actions: Optional[List[Action]] = None + menu_actions: Optional[List[SerializeAsAny[Action]]] = None """ The actions to display in the overflow menu of a Split action button. """ themed_icon_urls: Optional[List[ThemedUrl]] = None @@ -1272,7 +1272,7 @@ class ResetInputsAction(Action): target_input_ids: Optional[List[str]] = None """ The Ids of the inputs that should be reset. """ - fallback: Optional[Union[Action, FallbackAction]] = None + fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1399,7 +1399,7 @@ class SubmitAction(Action): is_enabled: Optional[bool] = True """ 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. """ - menu_actions: Optional[List[Action]] = None + menu_actions: Optional[List[SerializeAsAny[Action]]] = None """ The actions to display in the overflow menu of a Split action button. """ themed_icon_urls: Optional[List[ThemedUrl]] = None @@ -1420,7 +1420,7 @@ class SubmitAction(Action): ms_teams: Optional[TeamsSubmitActionProperties] = None """ Teams-specific metadata associated with the action. Equivalent to `msteams`. """ - fallback: Optional[Union[Action, FallbackAction]] = None + fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1545,7 +1545,7 @@ class ToggleVisibilityAction(Action): is_enabled: Optional[bool] = True """ 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. """ - menu_actions: Optional[List[Action]] = None + menu_actions: Optional[List[SerializeAsAny[Action]]] = None """ The actions to display in the overflow menu of a Split action button. """ themed_icon_urls: Optional[List[ThemedUrl]] = None @@ -1554,7 +1554,7 @@ class ToggleVisibilityAction(Action): target_elements: Optional[Union[List[str], List[TargetElement]]] = None """ The Ids of the elements to toggle the visibility of. """ - fallback: Optional[Union[Action, FallbackAction]] = None + fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1645,13 +1645,13 @@ class ShowCardAction(Action): is_enabled: Optional[bool] = True """ 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. """ - menu_actions: Optional[List[Action]] = None + menu_actions: Optional[List[SerializeAsAny[Action]]] = None """ The actions to display in the overflow menu of a Split action button. """ themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - fallback: Optional[Union[Action, FallbackAction]] = None + fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None """ 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. """ card: Optional[AdaptiveCard] = None @@ -1760,7 +1760,7 @@ class PopoverAction(Action): max_popover_width: Optional[str] = None """ The maximum width of the popover in pixels, in the `px` format """ - fallback: Optional[Union[Action, FallbackAction]] = None + fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1866,10 +1866,10 @@ class ActionSet(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ - actions: Optional[List[Action]] = None + actions: Optional[List[SerializeAsAny[Action]]] = None """ The actions in the set. """ def with_key(self, value: str) -> Self: @@ -1980,7 +1980,7 @@ class Container(CardElement): rounded_corners: Optional[bool] = None """ Controls if the container should have rounded corners. """ - layouts: Optional[List[ContainerLayout]] = None + layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None """ 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](topic:container-layouts) for more details. """ bleed: Optional[bool] = None @@ -2004,10 +2004,10 @@ class Container(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ - items: Optional[List[CardElement]] = None + items: Optional[List[SerializeAsAny[CardElement]]] = None """ The elements in the container. """ def with_key(self, value: str) -> Self: @@ -2355,7 +2355,7 @@ class Column(CardElement): rounded_corners: Optional[bool] = None """ Controls if the container should have rounded corners. """ - layouts: Optional[List[ContainerLayout]] = None + layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None """ 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](topic:container-layouts) for more details. """ bleed: Optional[bool] = None @@ -2382,10 +2382,10 @@ class Column(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ - items: Optional[List[CardElement]] = None + items: Optional[List[SerializeAsAny[CardElement]]] = None """ The elements in the column. """ def with_key(self, value: str) -> Self: @@ -2556,7 +2556,7 @@ class ColumnSet(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ columns: Optional[List[Column]] = None @@ -2755,7 +2755,7 @@ class Media(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -2868,10 +2868,10 @@ class RichTextBlock(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ - inlines: Optional[Union[List[CardElement], List[str]]] = None + inlines: Optional[Union[List[SerializeAsAny[CardElement]], List[str]]] = None """ The inlines making up the rich text block. """ def with_key(self, value: str) -> Self: @@ -3009,7 +3009,7 @@ class TableCell(CardElement): style: Optional[ContainerStyle] = None """ 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. """ - layouts: Optional[List[ContainerLayout]] = None + layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None """ 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](topic:container-layouts) for more details. """ bleed: Optional[bool] = None @@ -3033,10 +3033,10 @@ class TableCell(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ - items: Optional[List[CardElement]] = None + items: Optional[List[SerializeAsAny[CardElement]]] = None """ The items (elements) in the cell. """ def with_key(self, value: str) -> Self: @@ -3185,7 +3185,7 @@ class TableRow(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ cells: Optional[List[TableCell]] = None @@ -3340,7 +3340,7 @@ class Table(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ rows: Optional[List[TableRow]] = None @@ -3515,7 +3515,7 @@ class TextBlock(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -3678,7 +3678,7 @@ class FactSet(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -3836,7 +3836,7 @@ class Image(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -3996,7 +3996,7 @@ class ImageSet(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -4134,7 +4134,7 @@ class TextInput(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -4295,7 +4295,7 @@ class DateInput(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -4444,7 +4444,7 @@ class TimeInput(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -4593,7 +4593,7 @@ class NumberInput(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -4748,7 +4748,7 @@ class ToggleInput(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -4987,7 +4987,7 @@ class ChoiceSetInput(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -5159,7 +5159,7 @@ class RatingInput(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -5307,7 +5307,7 @@ class Rating(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -5483,7 +5483,7 @@ class CompoundButton(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -5613,7 +5613,7 @@ class Icon(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -5727,7 +5727,7 @@ class CarouselPage(CardElement): rounded_corners: Optional[bool] = None """ Controls if the container should have rounded corners. """ - layouts: Optional[List[ContainerLayout]] = None + layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None """ 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](topic:container-layouts) for more details. """ min_height: Optional[str] = None @@ -5748,10 +5748,10 @@ class CarouselPage(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ - items: Optional[List[CardElement]] = None + items: Optional[List[SerializeAsAny[CardElement]]] = None """ The elements in the page. """ def with_key(self, value: str) -> Self: @@ -5887,7 +5887,7 @@ class Carousel(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ pages: Optional[List[CarouselPage]] = None @@ -6024,7 +6024,7 @@ class Badge(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -6163,7 +6163,7 @@ class ProgressRing(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -6282,7 +6282,7 @@ class ProgressBar(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -6454,7 +6454,7 @@ class DonutChart(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -6622,7 +6622,7 @@ class PieChart(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -6862,7 +6862,7 @@ class GroupedVerticalBarChart(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -7080,7 +7080,7 @@ class VerticalBarChart(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -7288,7 +7288,7 @@ class HorizontalBarChart(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -7510,7 +7510,7 @@ class StackedHorizontalBarChart(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -7738,7 +7738,7 @@ class LineChart(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -7954,7 +7954,7 @@ class GaugeChart(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8117,7 +8117,7 @@ class CodeBlock(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8279,7 +8279,7 @@ class ComUserMicrosoftGraphComponent(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8419,7 +8419,7 @@ class ComUsersMicrosoftGraphComponent(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8577,7 +8577,7 @@ class ComResourceMicrosoftGraphComponent(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8717,7 +8717,7 @@ class ComFileMicrosoftGraphComponent(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8966,7 +8966,7 @@ class ComEventMicrosoftGraphComponent(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -9083,7 +9083,7 @@ class TextRun(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -9198,7 +9198,7 @@ class IconRun(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -9289,7 +9289,7 @@ class ImageRun(CardElement): grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - fallback: Optional[Union[CardElement, FallbackElement]] = None + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: diff --git a/packages/cards/tests/test_message_back_action.py b/packages/cards/tests/test_message_back_action.py index 321891c5..5a62e805 100644 --- a/packages/cards/tests/test_message_back_action.py +++ b/packages/cards/tests/test_message_back_action.py @@ -10,6 +10,6 @@ def test_message_back_action_initialization(): action = MessageBackAction(text="Message Back Test", value="Test Value", display_text="Test Text") assert isinstance(action.data, SubmitActionData) assert action.data.ms_teams is not None - assert action.data.ms_teams["value"] == "Test Value" + assert action.data.ms_teams["value"] == {"value": "Test Value"} assert action.data.ms_teams["text"] == "Message Back Test" assert action.data.ms_teams["displayText"] == "Test Text" From 69f343b15aafe396d50d8cfe662c64e94f91d699 Mon Sep 17 00:00:00 2001 From: Corina Gum <> Date: Thu, 19 Mar 2026 14:49:39 -0700 Subject: [PATCH 07/10] Remove MsTeams --- .../cards/src/microsoft_teams/cards/core.py | 3179 ++++++++--------- 1 file changed, 1565 insertions(+), 1614 deletions(-) diff --git a/packages/cards/src/microsoft_teams/cards/core.py b/packages/cards/src/microsoft_teams/cards/core.py index 213637c6..da94e434 100644 --- a/packages/cards/src/microsoft_teams/cards/core.py +++ b/packages/cards/src/microsoft_teams/cards/core.py @@ -1,9 +1,8 @@ -# This file was automatically generated by a tool on 03/18/2026, 10:44 PM UTC. DO NOT UPDATE MANUALLY. +# This file was automatically generated by a tool on 03/19/2026, 9:27 PM UTC. DO NOT UPDATE MANUALLY. # It includes declarations for Adaptive Card features available in Teams, Copilot, Outlook, Word, Excel, PowerPoint. -from typing import Any, Dict, List, Literal, Optional, Self, Union - -from pydantic import AliasGenerator, BaseModel, ConfigDict, Field, SerializeAsAny +from typing import Dict, List, Any, Optional, Union, Literal, Self +from pydantic import AliasGenerator, BaseModel, ConfigDict, Field from pydantic.alias_generators import to_camel @@ -13,46 +12,30 @@ class SerializableObject(BaseModel): @staticmethod def validation_alias_generator(field: str) -> str: "Handles deserialization aliasing" - + # Handle parameters that start with "@" if field.startswith("at_"): return f"@{field[3:]}" - + # Handles from field which is a duplicate reserved internal name if field == "from_": return "from" - - # Handle ms_teams field which should deserialize from msteams - if field == "ms_teams": - return "msteams" - - # Handle choices_data field which should deserialize from choices.data - if field == "choices_data": - return "choices.data" - + # All other fields are converted to camelCase return to_camel(field) - + @staticmethod def serialization_alias_generator(field: str) -> str: "Handles serialization aliasing and casing" - + # Handle parameters that start with "@" if field.startswith("at_"): return f"@{field[3:]}" - + # Handles from field which is a duplicate reserved internal name if field == "from_": return "from" - - # Handle ms_teams field which should serialize to msteams - if field == "ms_teams": - return "msteams" - - # Handle choices_data field which should serialize to choices.data - if field == "choices_data": - return "choices.data" - + # All other fields are converted to camelCase return to_camel(field) @@ -190,7 +173,7 @@ class ContainerLayout(SerializableObject): class HostCapabilities(SerializableObject): """Represents a list of versioned capabilities a host application must support.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ @@ -198,16 +181,16 @@ def with_key(self, value: str) -> Self: self.key = value return self - + class ThemedUrl(SerializableObject): """Defines a theme-specific URL.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + theme: Optional[ThemeName] = "Light" """ The theme this URL applies to. """ - + url: Optional[str] = None """ The URL to use for the associated theme. """ @@ -223,25 +206,25 @@ def with_url(self, value: str) -> Self: self.url = value return self - + class BackgroundImage(SerializableObject): """Defines a container's background image and the way it should be rendered.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + url: Optional[str] = None """ The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. """ - + fill_mode: Optional[FillMode] = "Cover" """ Controls how the image should fill the area. """ - + horizontal_alignment: Optional[HorizontalAlignment] = "Left" """ Controls how the image should be aligned if it must be cropped or if using repeat fill mode. """ - + vertical_alignment: Optional[VerticalAlignment] = "Top" """ Controls how the image should be aligned if it must be cropped or if using repeat fill mode. """ - + themed_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific image URLs. """ @@ -269,19 +252,16 @@ def with_themed_urls(self, value: List[ThemedUrl]) -> Self: self.themed_urls = value return self - + class SubmitActionData(SerializableObject): - """Represents the data of an Action.Submit. This model can include arbitrary data""" - + """Represents the data of an Action.Submit.""" + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + msteams: Optional[Dict[str, Any]] = None """ Defines the optional Teams-specific portion of the action's data. """ - ms_teams: Optional[Dict[str, Any]] = None - """ Defines the optional Teams-specific portion of the action's data. Equivalent to `msteams`. """ - def with_key(self, value: str) -> Self: self.key = value return self @@ -290,70 +270,61 @@ def with_msteams(self, value: Dict[str, Any]) -> Self: self.msteams = value return self - def with_ms_teams(self, value: Dict[str, Any]) -> Self: - self.ms_teams = value - return self - - def with_data(self, value: Dict[str, Any]) -> Self: - for k, v in value.items(): - setattr(self, k, v) - return self - - + class ExecuteAction(Action): """Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can respond synchronously and return an updated Adaptive Card to be displayed by the client. Action.Execute works in all Adaptive Card hosts.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Action.Execute"] = "Action.Execute" + + type: Literal['Action.Execute'] = 'Action.Execute' """ Must be **Action.Execute**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + title: Optional[str] = None """ The title of the action, as it appears on buttons. """ - + icon_url: Optional[str] = None """ 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](topic:icon-catalog) instead of an image. """ - + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - + tooltip: Optional[str] = None """ The tooltip text to display when the action is hovered over. """ - + is_enabled: Optional[bool] = True """ 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. """ - - menu_actions: Optional[List[SerializeAsAny[Action]]] = None + + menu_actions: Optional[List[Action]] = None """ The actions to display in the overflow menu of a Split action button. """ - + themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - + data: Optional[Union[str, SubmitActionData]] = None """ 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. """ - + associated_inputs: Optional[AssociatedInputs] = None """ 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](topic:input-validation) for more details. """ - + conditionally_enabled: Optional[bool] = None """ Controls if the action is enabled only if at least one required input has been filled by the user. """ - + verb: Optional[str] = None """ The verb of the action. """ - - fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None + + fallback: Optional[Union[Action, FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -420,16 +391,16 @@ def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: self.fallback = value return self - + class RefreshDefinition(SerializableObject): """Defines how a card can be refreshed by making a request to the target Bot.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + action: Optional[ExecuteAction] = None """ The Action.Execute action to invoke to refresh the card. """ - + user_ids: Optional[List[str]] = None """ 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. """ @@ -445,22 +416,22 @@ def with_user_ids(self, value: List[str]) -> Self: self.user_ids = value return self - + class AuthCardButton(SerializableObject): """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).""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + type: Optional[str] = None """ Must be **signin**. """ - + title: Optional[str] = None """ The caption of the button. """ - + image: Optional[str] = None """ A URL to an image to display alongside the button’s caption. """ - + value: Optional[str] = None """ The value associated with the button. The meaning of value depends on the button’s type. """ @@ -484,19 +455,19 @@ def with_value(self, value: str) -> Self: self.value = value return self - + class TokenExchangeResource(SerializableObject): """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)""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + id: Optional[str] = None """ The unique identified of this token exchange instance. """ - + uri: Optional[str] = None """ An application ID or resource identifier with which to exchange a token on behalf of. This property is identity provider- and application-specific. """ - + provider_id: Optional[str] = None """ An identifier for the identity provider with which to attempt a token exchange. """ @@ -516,22 +487,22 @@ def with_provider_id(self, value: str) -> Self: self.provider_id = value return self - + class Authentication(SerializableObject): """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)""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + text: Optional[str] = None """ The text that can be displayed to the end user when prompting them to authenticate. """ - + connection_name: Optional[str] = None """ The identifier for registered OAuth connection setting information. """ - + buttons: Optional[List[AuthCardButton]] = None """ 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. """ - + token_exchange_resource: Optional[TokenExchangeResource] = None """ Provides information required to enable on-behalf-of single sign-on user authentication. """ @@ -555,19 +526,19 @@ def with_token_exchange_resource(self, value: TokenExchangeResource) -> Self: self.token_exchange_resource = value return self - + class MentionedEntity(SerializableObject): """Represents a mentioned person or tag.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + id: Optional[str] = None """ The Id of a person (typically a Microsoft Entra user Id) or tag. """ - + name: Optional[str] = None """ The name of the mentioned entity. """ - + mention_type: Optional[MentionType] = "Person" """ The type of the mentioned entity. """ @@ -587,19 +558,19 @@ def with_mention_type(self, value: MentionType) -> Self: self.mention_type = value return self - + class Mention(SerializableObject): """Represents a mention to a person.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["mention"] = "mention" + + type: Literal['mention'] = 'mention' """ Must be **mention**. """ - + text: Optional[str] = None """ The text that will be substituted with the mention. """ - + mentioned: Optional[MentionedEntity] = None """ Defines the entity being mentioned. """ @@ -615,18 +586,18 @@ def with_mentioned(self, value: MentionedEntity) -> Self: self.mentioned = value return self - + class TeamsCardProperties(SerializableObject): """Represents a set of Teams-specific properties on a card.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + width: Optional[TeamsCardWidth] = None """ 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. """ - + entities: Optional[List[Mention]] = None """ The Teams-specific entities associated with the card. """ @@ -642,13 +613,13 @@ def with_entities(self, value: List[Mention]) -> Self: self.entities = value return self - + class CardMetadata(SerializableObject): """Card-level metadata.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + web_url: Optional[str] = None """ 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. """ @@ -660,16 +631,16 @@ def with_web_url(self, value: str) -> Self: self.web_url = value return self - + class StringResource(SerializableObject): """Defines the replacement string values.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + default_value: Optional[str] = None """ The default value of the string, which is used when no matching localized value is found. """ - + localized_values: Optional[Dict[str, str]] = None """ Localized values of the string, where keys represent the locale (e.g. `en-US`) in the `(-)` format. `` is the 2-letter language code and `` is the optional 2-letter country code. """ @@ -685,13 +656,13 @@ def with_localized_values(self, value: Dict[str, str]) -> Self: self.localized_values = value return self - + class Resources(SerializableObject): """The resources that can be used in the body of the card.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + strings: Optional[Dict[str, StringResource]] = None """ String resources that can provide translations in multiple languages. String resources make it possible to craft cards that are automatically localized according to the language settings of the application that displays the card. """ @@ -703,89 +674,86 @@ def with_strings(self, value: Dict[str, StringResource]) -> Self: self.strings = value return self - + class AdaptiveCard(CardElement): """An Adaptive Card, containing a free-form body of card elements, and an optional set of actions.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["AdaptiveCard"] = "AdaptiveCard" + + type: Literal['AdaptiveCard'] = 'AdaptiveCard' """ Must be **AdaptiveCard**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. """ - + style: Optional[ContainerStyle] = None """ 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. """ - - layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None + + layouts: Optional[List[ContainerLayout]] = None """ 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](topic:container-layouts) for more details. """ - + min_height: Optional[str] = None """ The minimum height, in pixels, of the container, in the `px` format. """ - + background_image: Optional[Union[str, BackgroundImage]] = None """ Defines the container's background image. """ - + vertical_content_alignment: Optional[VerticalAlignment] = None """ Controls how the container's content should be vertically aligned. """ - + rtl: Optional[bool] = None """ Controls if the content of the card is to be rendered left-to-right or right-to-left. """ - - ac_schema: Optional[str] = Field(default=None, alias="schema") + + ac_schema: Optional[str] = Field(None, alias="schema") """ A URL to the Adaptive Card schema the card is authored against. """ - + version: Optional[Version] = "1.5" """ The Adaptive Card schema version the card is authored against. """ - + fallback_text: Optional[str] = None """ The text that should be displayed if the client is not able to render the card. """ - + speak: Optional[str] = None """ The text that should be spoken for the entire card. """ - + refresh: Optional[RefreshDefinition] = None """ Defines how the card can be refreshed by making a request to the target Bot. """ - + authentication: Optional[Authentication] = None """ Defines authentication information to enable on-behalf-of single-sign-on or just-in-time OAuth. This information is used in conjunction with the refresh property and Action.Execute in general. """ - + msteams: Optional[TeamsCardProperties] = None """ Teams-specific metadata associated with the card. """ - - ms_teams: Optional[TeamsCardProperties] = None - """ Teams-specific metadata associated with the card. Equivalent to `msteams`. """ - + metadata: Optional[CardMetadata] = None """ Metadata associated with the card. """ - + resources: Optional[Resources] = None """ Resources card elements can reference. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ - - body: Optional[List[SerializeAsAny[CardElement]]] = None + + body: Optional[List[CardElement]] = None """ The body of the card, comprised of a list of elements displayed according to the layouts property. If the layouts property is not specified, a Layout.Stack is used. """ - - actions: Optional[List[SerializeAsAny[Action]]] = None + + actions: Optional[List[Action]] = None """ The card level actions, which always appear at the bottom of the card. """ def with_key(self, value: str) -> Self: @@ -864,10 +832,6 @@ def with_msteams(self, value: TeamsCardProperties) -> Self: self.msteams = value return self - def with_ms_teams(self, value: TeamsCardProperties) -> Self: - self.ms_teams = value - return self - def with_metadata(self, value: CardMetadata) -> Self: self.metadata = value return self @@ -892,58 +856,58 @@ def with_actions(self, value: List[Action]) -> Self: self.actions = value return self - + class InsertImageAction(Action): """Inserts an image into the host application's canvas.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Action.InsertImage"] = "Action.InsertImage" + + type: Literal['Action.InsertImage'] = 'Action.InsertImage' """ Must be **Action.InsertImage**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + title: Optional[str] = None """ The title of the action, as it appears on buttons. """ - + icon_url: Optional[str] = None """ 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](topic:icon-catalog) instead of an image. """ - + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - + tooltip: Optional[str] = None """ The tooltip text to display when the action is hovered over. """ - + is_enabled: Optional[bool] = True """ 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. """ - - menu_actions: Optional[List[SerializeAsAny[Action]]] = None + + menu_actions: Optional[List[Action]] = None """ The actions to display in the overflow menu of a Split action button. """ - + themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - + url: Optional[str] = None """ The URL of the image to insert. """ - + alt_text: Optional[str] = None """ The alternate text for the image. """ - + insert_position: Optional[ImageInsertPosition] = "Selection" """ The position at which to insert the image. """ - - fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None + + fallback: Optional[Union[Action, FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1006,52 +970,52 @@ def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: self.fallback = value return self - + class OpenUrlAction(Action): """Opens the provided URL in either a separate browser tab or within the host application.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Action.OpenUrl"] = "Action.OpenUrl" + + type: Literal['Action.OpenUrl'] = 'Action.OpenUrl' """ Must be **Action.OpenUrl**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + title: Optional[str] = None """ The title of the action, as it appears on buttons. """ - + icon_url: Optional[str] = None """ 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](topic:icon-catalog) instead of an image. """ - + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - + tooltip: Optional[str] = None """ The tooltip text to display when the action is hovered over. """ - + is_enabled: Optional[bool] = True """ 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. """ - - menu_actions: Optional[List[SerializeAsAny[Action]]] = None + + menu_actions: Optional[List[Action]] = None """ The actions to display in the overflow menu of a Split action button. """ - + themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - + url: Optional[str] = None """ The URL to open. """ - - fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None + + fallback: Optional[Union[Action, FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1106,61 +1070,61 @@ def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: self.fallback = value return self - + class OpenUrlDialogAction(Action): """Opens a task module in a modal dialog hosting the content at a provided URL.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Action.OpenUrlDialog"] = "Action.OpenUrlDialog" + + type: Literal['Action.OpenUrlDialog'] = 'Action.OpenUrlDialog' """ Must be **Action.OpenUrlDialog**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + title: Optional[str] = None """ The title of the action, as it appears on buttons. """ - + icon_url: Optional[str] = None """ 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](topic:icon-catalog) instead of an image. """ - + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - + tooltip: Optional[str] = None """ The tooltip text to display when the action is hovered over. """ - + is_enabled: Optional[bool] = True """ 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. """ - - menu_actions: Optional[List[SerializeAsAny[Action]]] = None + + menu_actions: Optional[List[Action]] = None """ The actions to display in the overflow menu of a Split action button. """ - + themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - + dialog_title: Optional[str] = None """ The title of the dialog to be displayed in the dialog header. """ - + dialog_height: Optional[str] = None """ The height of the dialog. To define height as a number of pixels, use the px format. """ - + dialog_width: Optional[str] = None """ The width of the dialog. To define width as a number of pixels, use the px format. """ - + url: Optional[str] = None """ The URL to open. """ - - fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None + + fallback: Optional[Union[Action, FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1227,52 +1191,52 @@ def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: self.fallback = value return self - + class ResetInputsAction(Action): """Resets the values of the inputs in the card.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Action.ResetInputs"] = "Action.ResetInputs" + + type: Literal['Action.ResetInputs'] = 'Action.ResetInputs' """ Must be **Action.ResetInputs**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + title: Optional[str] = None """ The title of the action, as it appears on buttons. """ - + icon_url: Optional[str] = None """ 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](topic:icon-catalog) instead of an image. """ - + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - + tooltip: Optional[str] = None """ The tooltip text to display when the action is hovered over. """ - + is_enabled: Optional[bool] = True """ 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. """ - - menu_actions: Optional[List[SerializeAsAny[Action]]] = None + + menu_actions: Optional[List[Action]] = None """ The actions to display in the overflow menu of a Split action button. """ - + themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - + target_input_ids: Optional[List[str]] = None """ The Ids of the inputs that should be reset. """ - - fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None + + fallback: Optional[Union[Action, FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1327,13 +1291,13 @@ def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: self.fallback = value return self - + class TeamsSubmitActionFeedback(SerializableObject): """Represents feedback options for an [Action.Submit](https://adaptivecards.microsoft.com/?topic=Action.Submit).""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + hide: Optional[bool] = None """ Defines if a feedback message should be displayed after the action is executed. """ @@ -1345,13 +1309,13 @@ def with_hide(self, value: bool) -> Self: self.hide = value return self - + class TeamsSubmitActionProperties(SerializableObject): """Teams-specific properties associated with the action.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + feedback: Optional[TeamsSubmitActionFeedback] = None """ Defines how feedback is provided to the end-user when the action is executed. """ @@ -1363,64 +1327,61 @@ def with_feedback(self, value: TeamsSubmitActionFeedback) -> Self: self.feedback = value return self - + class SubmitAction(Action): """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.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Action.Submit"] = "Action.Submit" + + type: Literal['Action.Submit'] = 'Action.Submit' """ Must be **Action.Submit**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + title: Optional[str] = None """ The title of the action, as it appears on buttons. """ - + icon_url: Optional[str] = None """ 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](topic:icon-catalog) instead of an image. """ - + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - + tooltip: Optional[str] = None """ The tooltip text to display when the action is hovered over. """ - + is_enabled: Optional[bool] = True """ 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. """ - - menu_actions: Optional[List[SerializeAsAny[Action]]] = None + + menu_actions: Optional[List[Action]] = None """ The actions to display in the overflow menu of a Split action button. """ - + themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - + data: Optional[Union[str, SubmitActionData]] = None """ 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. """ - + associated_inputs: Optional[AssociatedInputs] = None """ 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](topic:input-validation) for more details. """ - + conditionally_enabled: Optional[bool] = None """ Controls if the action is enabled only if at least one required input has been filled by the user. """ - + msteams: Optional[TeamsSubmitActionProperties] = None """ Teams-specific metadata associated with the action. """ - - ms_teams: Optional[TeamsSubmitActionProperties] = None - """ Teams-specific metadata associated with the action. Equivalent to `msteams`. """ - - fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None + + fallback: Optional[Union[Action, FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1483,21 +1444,17 @@ def with_msteams(self, value: TeamsSubmitActionProperties) -> Self: self.msteams = value return self - def with_ms_teams(self, value: TeamsSubmitActionProperties) -> Self: - self.ms_teams = value - return self - def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: self.fallback = value return self - + class TargetElement(SerializableObject): """Defines a target element in an Action.ToggleVisibility.""" - + element_id: Optional[str] = None """ The Id of the element to change the visibility of. """ - + is_visible: Optional[bool] = None """ The new visibility state of the element. """ @@ -1509,52 +1466,52 @@ def with_is_visible(self, value: bool) -> Self: self.is_visible = value return self - + class ToggleVisibilityAction(Action): """Toggles the visibility of a set of elements. Action.ToggleVisibility is useful for creating "Show more" type UI patterns.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Action.ToggleVisibility"] = "Action.ToggleVisibility" + + type: Literal['Action.ToggleVisibility'] = 'Action.ToggleVisibility' """ Must be **Action.ToggleVisibility**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + title: Optional[str] = None """ The title of the action, as it appears on buttons. """ - + icon_url: Optional[str] = None """ 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](topic:icon-catalog) instead of an image. """ - + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - + tooltip: Optional[str] = None """ The tooltip text to display when the action is hovered over. """ - + is_enabled: Optional[bool] = True """ 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. """ - - menu_actions: Optional[List[SerializeAsAny[Action]]] = None + + menu_actions: Optional[List[Action]] = None """ The actions to display in the overflow menu of a Split action button. """ - + themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - + target_elements: Optional[Union[List[str], List[TargetElement]]] = None """ The Ids of the elements to toggle the visibility of. """ - - fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None + + fallback: Optional[Union[Action, FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1609,51 +1566,51 @@ def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: self.fallback = value return self - + class ShowCardAction(Action): """Expands or collapses an embedded card within the main card.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Action.ShowCard"] = "Action.ShowCard" + + type: Literal['Action.ShowCard'] = 'Action.ShowCard' """ Must be **Action.ShowCard**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + title: Optional[str] = None """ The title of the action, as it appears on buttons. """ - + icon_url: Optional[str] = None """ 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](topic:icon-catalog) instead of an image. """ - + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - + tooltip: Optional[str] = None """ The tooltip text to display when the action is hovered over. """ - + is_enabled: Optional[bool] = True """ 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. """ - - menu_actions: Optional[List[SerializeAsAny[Action]]] = None + + menu_actions: Optional[List[Action]] = None """ The actions to display in the overflow menu of a Split action button. """ - + themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - - fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None + + fallback: Optional[Union[Action, FallbackAction]] = None """ 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. """ - + card: Optional[AdaptiveCard] = None """ The card that should be displayed when the action is executed. """ @@ -1709,58 +1666,58 @@ def with_card(self, value: AdaptiveCard) -> Self: self.card = value return self - + class PopoverAction(Action): """Shows a popover to display more information to the user.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Action.Popover"] = "Action.Popover" + + type: Literal['Action.Popover'] = 'Action.Popover' """ Must be **Action.Popover**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + title: Optional[str] = None """ The title of the action, as it appears on buttons. """ - + icon_url: Optional[str] = None """ 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](topic:icon-catalog) instead of an image. """ - + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - + tooltip: Optional[str] = None """ The tooltip text to display when the action is hovered over. """ - + is_enabled: Optional[bool] = True """ 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. """ - + themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - + content: Optional[CardElement] = None """ The content of the popover, which can be any element. """ - + display_arrow: Optional[bool] = True """ Controls if an arrow should be displayed towards the element that triggered the popover. """ - + position: Optional[PopoverPosition] = "Above" """ Controls where the popover should be displayed with regards to the element that triggered it. """ - + max_popover_width: Optional[str] = None """ The maximum width of the popover in pixels, in the `px` format """ - - fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None + + fallback: Optional[Union[Action, FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1823,53 +1780,53 @@ def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: self.fallback = value return self - + class ActionSet(CardElement): """Displays a set of action, which can be placed anywhere in the card.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["ActionSet"] = "ActionSet" + + type: Literal['ActionSet'] = 'ActionSet' """ Must be **ActionSet**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ - - actions: Optional[List[SerializeAsAny[Action]]] = None + + actions: Optional[List[Action]] = None """ The actions in the set. """ def with_key(self, value: str) -> Self: @@ -1928,86 +1885,86 @@ def with_actions(self, value: List[Action]) -> Self: self.actions = value return self - + class Container(CardElement): """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.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Container"] = "Container" + + type: Literal['Container'] = 'Container' """ Must be **Container**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. """ - + style: Optional[ContainerStyle] = None """ 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. """ - + show_border: Optional[bool] = None """ Controls if a border should be displayed around the container. """ - + rounded_corners: Optional[bool] = None """ Controls if the container should have rounded corners. """ - - layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None + + layouts: Optional[List[ContainerLayout]] = None """ 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](topic:container-layouts) for more details. """ - + bleed: Optional[bool] = None """ Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. """ - + min_height: Optional[str] = None """ The minimum height, in pixels, of the container, in the `px` format. """ - + background_image: Optional[Union[str, BackgroundImage]] = None """ Defines the container's background image. """ - + vertical_content_alignment: Optional[VerticalAlignment] = None """ Controls how the container's content should be vertically aligned. """ - + rtl: Optional[bool] = None """ Controls if the content of the card is to be rendered left-to-right or right-to-left. """ - + max_height: Optional[str] = None """ 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. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ - - items: Optional[List[SerializeAsAny[CardElement]]] = None + + items: Optional[List[CardElement]] = None """ The elements in the container. """ def with_key(self, value: str) -> Self: @@ -2110,16 +2067,16 @@ def with_items(self, value: List[CardElement]) -> Self: self.items = value return self - + class StackLayout(ContainerLayout): """A layout that stacks elements on top of each other. Layout.Stack is the default layout used by AdaptiveCard and all containers.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Layout.Stack"] = "Layout.Stack" + + type: Literal['Layout.Stack'] = 'Layout.Stack' """ Must be **Layout.Stack**. """ - + target_width: Optional[TargetWidth] = None """ Controls for which card width the layout should be used. """ @@ -2131,40 +2088,40 @@ def with_target_width(self, value: TargetWidth) -> Self: self.target_width = value return self - + class FlowLayout(ContainerLayout): """A layout that spreads elements horizontally and wraps them across multiple rows, as needed.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Layout.Flow"] = "Layout.Flow" + + type: Literal['Layout.Flow'] = 'Layout.Flow' """ Must be **Layout.Flow**. """ - + target_width: Optional[TargetWidth] = None """ Controls for which card width the layout should be used. """ - + horizontal_items_alignment: Optional[HorizontalAlignment] = "Center" """ Controls how the content of the container should be horizontally aligned. """ - + vertical_items_alignment: Optional[VerticalAlignment] = "Top" """ Controls how the content of the container should be vertically aligned. """ - + item_fit: Optional[FlowLayoutItemFit] = "Fit" """ Controls how item should fit inside the container. """ - + min_item_width: Optional[str] = None """ The minimum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. """ - + max_item_width: Optional[str] = None """ The maximum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. """ - + item_width: Optional[str] = None """ The width, in pixels, of each item, in the `px` format. Should not be used if maxItemWidth and/or minItemWidth are set. """ - + column_spacing: Optional[Spacing] = "Default" """ The space between items. """ - + row_spacing: Optional[Spacing] = "Default" """ The space between rows of items. """ @@ -2208,25 +2165,25 @@ def with_row_spacing(self, value: Spacing) -> Self: self.row_spacing = value return self - + class GridArea(SerializableObject): """Defines an area in a Layout.AreaGrid layout.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + name: Optional[str] = None """ The name of the area. To place an element in this area, set its `grid.area` property to match the name of the area. """ - + column: Optional[float] = 1 """ The start column index of the area. Column indices start at 1. """ - + column_span: Optional[float] = 1 """ Defines how many columns the area should span. """ - + row: Optional[float] = 1 """ The start row index of the area. Row indices start at 1. """ - + row_span: Optional[float] = 1 """ Defines how many rows the area should span. """ @@ -2254,28 +2211,28 @@ def with_row_span(self, value: float) -> Self: self.row_span = value return self - + class AreaGridLayout(ContainerLayout): """A layout that divides a container into named areas into which elements can be placed.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Layout.AreaGrid"] = "Layout.AreaGrid" + + type: Literal['Layout.AreaGrid'] = 'Layout.AreaGrid' """ Must be **Layout.AreaGrid**. """ - + target_width: Optional[TargetWidth] = None """ Controls for which card width the layout should be used. """ - + columns: Optional[Union[List[float], List[str]]] = None """ The columns in the grid layout, defined as a percentage of the available width or in pixels using the `px` format. """ - + areas: Optional[List[GridArea]] = None """ The areas in the grid layout. """ - + column_spacing: Optional[Spacing] = "Default" """ The space between columns. """ - + row_spacing: Optional[Spacing] = "Default" """ The space between rows. """ @@ -2303,89 +2260,89 @@ def with_row_spacing(self, value: Spacing) -> Self: self.row_spacing = value return self - + class Column(CardElement): """A column in a ColumnSet element.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Column"] = "Column" + + type: Literal['Column'] = 'Column' """ Optional. If specified, must be **Column**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. """ - + style: Optional[ContainerStyle] = None """ 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. """ - + show_border: Optional[bool] = None """ Controls if a border should be displayed around the container. """ - + rounded_corners: Optional[bool] = None """ Controls if the container should have rounded corners. """ - - layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None + + layouts: Optional[List[ContainerLayout]] = None """ 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](topic:container-layouts) for more details. """ - + bleed: Optional[bool] = None """ Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. """ - + min_height: Optional[str] = None """ The minimum height, in pixels, of the container, in the `px` format. """ - + background_image: Optional[Union[str, BackgroundImage]] = None """ Defines the container's background image. """ - + vertical_content_alignment: Optional[VerticalAlignment] = None """ Controls how the container's content should be vertically aligned. """ - + rtl: Optional[bool] = None """ Controls if the content of the card is to be rendered left-to-right or right-to-left. """ - + max_height: Optional[str] = None """ 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. """ - + width: Optional[Union[str, float]] = None """ The width of the column. If expressed as a number, represents the relative weight of the column in the set. If expressed as a string, `auto` will automatically adjust the column's width according to its content, `stretch` will make the column use the remaining horizontal space (shared with other columns with width set to `stretch`) and using the `px` format will give the column an explicit width in pixels. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ - - items: Optional[List[SerializeAsAny[CardElement]]] = None + + items: Optional[List[CardElement]] = None """ The elements in the column. """ def with_key(self, value: str) -> Self: @@ -2492,73 +2449,73 @@ def with_items(self, value: List[CardElement]) -> Self: self.items = value return self - + class ColumnSet(CardElement): """Splits the available horizontal space into separate columns, so elements can be organized in a row.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["ColumnSet"] = "ColumnSet" + + type: Literal['ColumnSet'] = 'ColumnSet' """ Must be **ColumnSet**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. """ - + style: Optional[ContainerStyle] = None """ 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. """ - + show_border: Optional[bool] = None """ Controls if a border should be displayed around the container. """ - + rounded_corners: Optional[bool] = None """ Controls if the container should have rounded corners. """ - + bleed: Optional[bool] = None """ Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. """ - + min_height: Optional[str] = None """ The minimum height, in pixels, of the container, in the `px` format. """ - + min_width: Optional[str] = None """ 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. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ - + columns: Optional[List[Column]] = None """ The columns in the set. """ @@ -2646,16 +2603,16 @@ def with_columns(self, value: List[Column]) -> Self: self.columns = value return self - + class MediaSource(SerializableObject): """Defines the source URL of a media stream. YouTube, Dailymotion, Vimeo and Microsoft Stream URLs are supported.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + mime_type: Optional[str] = None """ The MIME type of the source. """ - + url: Optional[str] = None """ The URL of the source. """ @@ -2671,19 +2628,19 @@ def with_url(self, value: str) -> Self: self.url = value return self - + class CaptionSource(SerializableObject): """Defines a source URL for a video captions.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + mime_type: Optional[str] = None """ The MIME type of the source. """ - + url: Optional[str] = None """ The URL of the source. """ - + label: Optional[str] = None """ The label of this caption source. """ @@ -2703,59 +2660,59 @@ def with_label(self, value: str) -> Self: self.label = value return self - + class Media(CardElement): """A media element, that makes it possible to embed videos inside a card.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Media"] = "Media" + + type: Literal['Media'] = 'Media' """ Must be **Media**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + sources: Optional[List[MediaSource]] = None """ The sources for the media. For YouTube, Dailymotion and Vimeo, only one source can be specified. """ - + caption_sources: Optional[List[CaptionSource]] = None """ The caption sources for the media. Caption sources are not used for YouTube, Dailymotion or Vimeo sources. """ - + poster: Optional[str] = None """ The URL of the poster image to display. """ - + alt_text: Optional[str] = None """ The alternate text for the media, used for accessibility purposes. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -2822,56 +2779,56 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class RichTextBlock(CardElement): """A rich text block that displays formatted text.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["RichTextBlock"] = "RichTextBlock" + + type: Literal['RichTextBlock'] = 'RichTextBlock' """ Must be **RichTextBlock**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + label_for: Optional[str] = None """ The Id of the input the RichTextBlock should act as the label of. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ - - inlines: Optional[Union[List[SerializeAsAny[CardElement]], List[str]]] = None + + inlines: Optional[Union[List[CardElement], List[str]]] = None """ The inlines making up the rich text block. """ def with_key(self, value: str) -> Self: @@ -2934,19 +2891,19 @@ def with_inlines(self, value: Union[List[CardElement], List[str]]) -> Self: self.inlines = value return self - + class ColumnDefinition(SerializableObject): """Defines a column in a Table element.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + horizontal_cell_content_alignment: Optional[HorizontalAlignment] = None """ 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. """ - + vertical_cell_content_alignment: Optional[VerticalAlignment] = None """ 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. """ - + width: Optional[Union[str, float]] = None """ 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. """ @@ -2966,77 +2923,77 @@ def with_width(self, value: Union[str, float]) -> Self: self.width = value return self - + class TableCell(CardElement): """Represents a cell in a table row.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["TableCell"] = "TableCell" + + type: Literal['TableCell'] = 'TableCell' """ Must be **TableCell**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. """ - + style: Optional[ContainerStyle] = None """ 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. """ - - layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None + + layouts: Optional[List[ContainerLayout]] = None """ 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](topic:container-layouts) for more details. """ - + bleed: Optional[bool] = None """ Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. """ - + min_height: Optional[str] = None """ The minimum height, in pixels, of the container, in the `px` format. """ - + background_image: Optional[Union[str, BackgroundImage]] = None """ Defines the container's background image. """ - + vertical_content_alignment: Optional[VerticalAlignment] = None """ Controls how the container's content should be vertically aligned. """ - + rtl: Optional[bool] = None """ Controls if the content of the card is to be rendered left-to-right or right-to-left. """ - + max_height: Optional[str] = None """ 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. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ - - items: Optional[List[SerializeAsAny[CardElement]]] = None + + items: Optional[List[CardElement]] = None """ The items (elements) in the cell. """ def with_key(self, value: str) -> Self: @@ -3127,67 +3084,67 @@ def with_items(self, value: List[CardElement]) -> Self: self.items = value return self - + class TableRow(CardElement): """Represents a row of cells in a table.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["TableRow"] = "TableRow" + + type: Literal['TableRow'] = 'TableRow' """ Must be **TableRow**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + show_border: Optional[bool] = None """ Controls if a border should be displayed around the container. """ - + rounded_corners: Optional[bool] = None """ Controls if the container should have rounded corners. """ - + style: Optional[ContainerStyle] = None """ 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. """ - + horizontal_cell_content_alignment: Optional[HorizontalAlignment] = None """ Controls how the content of every cell in the row should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table and columns. """ - + vertical_cell_content_alignment: Optional[VerticalAlignment] = None """ Controls how the content of every cell in the row should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table and columns. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ - + cells: Optional[List[TableCell]] = None """ The cells in the row. """ @@ -3267,82 +3224,82 @@ def with_cells(self, value: List[TableCell]) -> Self: self.cells = value return self - + class Table(CardElement): """Use tables to display data in a tabular way, with rows, columns and cells.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Table"] = "Table" + + type: Literal['Table'] = 'Table' """ Must be **Table**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + style: Optional[ContainerStyle] = None """ 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. """ - + show_border: Optional[bool] = None """ Controls if a border should be displayed around the container. """ - + rounded_corners: Optional[bool] = None """ Controls if the container should have rounded corners. """ - + columns: Optional[List[ColumnDefinition]] = None """ The columns in the table. """ - + min_width: Optional[str] = None """ 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. """ - + first_row_as_headers: Optional[bool] = True """ Controls whether the first row of the table should be treated as a header. """ - + show_grid_lines: Optional[bool] = True """ Controls if grid lines should be displayed. """ - + grid_style: Optional[ContainerStyle] = None """ The style of the grid lines between cells. """ - + horizontal_cell_content_alignment: Optional[HorizontalAlignment] = None """ Controls how the content of every cell in the table should be horizontally aligned by default. """ - + vertical_cell_content_alignment: Optional[VerticalAlignment] = None """ Controls how the content of every cell in the table should be vertically aligned by default. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ - + rows: Optional[List[TableRow]] = None """ The rows of the table. """ @@ -3442,80 +3399,80 @@ def with_rows(self, value: List[TableRow]) -> Self: self.rows = value return self - + class TextBlock(CardElement): """A block of text, optionally formatted using Markdown.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["TextBlock"] = "TextBlock" + + type: Literal['TextBlock'] = 'TextBlock' """ Must be **TextBlock**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + text: Optional[str] = None """ The text to display. A subset of markdown is supported. """ - + size: Optional[TextSize] = None """ The size of the text. """ - + weight: Optional[TextWeight] = None """ The weight of the text. """ - + color: Optional[TextColor] = None """ The color of the text. """ - + is_subtle: Optional[bool] = None """ Controls whether the text should be renderer using a subtler variant of the select color. """ - + font_type: Optional[FontType] = None """ The type of font to use for rendering. """ - + wrap: Optional[bool] = None """ Controls if the text should wrap. """ - + max_lines: Optional[float] = None """ The maximum number of lines to display. """ - + style: Optional[TextBlockStyle] = None """ The style of the text. """ - + label_for: Optional[str] = None """ The Id of the input the TextBlock should act as the label of. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -3610,16 +3567,16 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class Fact(SerializableObject): """A fact in a FactSet element.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + title: Optional[str] = None """ The fact's title. """ - + value: Optional[str] = None """ The fact's value. """ @@ -3635,50 +3592,50 @@ def with_value(self, value: str) -> Self: self.value = value return self - + class FactSet(CardElement): """A set of facts, displayed as a table or a vertical list when horizontal space is constrained.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["FactSet"] = "FactSet" + + type: Literal['FactSet'] = 'FactSet' """ Must be **FactSet**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + facts: Optional[List[Fact]] = None """ The facts in the set. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -3733,13 +3690,13 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class TeamsImageProperties(SerializableObject): """Represents a set of Teams-specific properties on an image.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + allow_expand: Optional[bool] = None """ Controls if the image is expandable in Teams. This property is equivalent to the Image.allowExpand property. """ @@ -3751,92 +3708,89 @@ def with_allow_expand(self, value: bool) -> Self: self.allow_expand = value return self - + class Image(CardElement): """A standalone image element.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Image"] = "Image" + + type: Literal['Image'] = 'Image' """ Must be **Image**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + url: Optional[str] = None """ The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. """ - + alt_text: Optional[str] = None """ The alternate text for the image, used for accessibility purposes. """ - + background_color: Optional[str] = None """ The background color of the image. """ - + style: Optional[ImageStyle] = "Default" """ The style of the image. """ - + size: Optional[Size] = "Auto" """ The size of the image. """ - + width: Optional[str] = "auto" """ The width of the image. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. """ - + allow_expand: Optional[bool] = None """ Controls if the image can be expanded to full screen. """ - + msteams: Optional[TeamsImageProperties] = None """ Teams-specific metadata associated with the image. """ - - ms_teams: Optional[TeamsImageProperties] = None - """ Teams-specific metadata associated with the image. Equivalent to `msteams`. """ - + themed_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific image URLs. """ - + fit_mode: Optional[ImageFitMode] = "Fill" """ 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. """ - + horizontal_content_alignment: Optional[HorizontalAlignment] = "Left" """ 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. """ - + vertical_content_alignment: Optional[VerticalAlignment] = "Top" """ 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. """ - + height: Optional[str] = "auto" """ The height of the image. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -3915,10 +3869,6 @@ def with_msteams(self, value: TeamsImageProperties) -> Self: self.msteams = value return self - def with_ms_teams(self, value: TeamsImageProperties) -> Self: - self.ms_teams = value - return self - def with_themed_urls(self, value: List[ThemedUrl]) -> Self: self.themed_urls = value return self @@ -3947,56 +3897,56 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class ImageSet(CardElement): """A set of images, displayed side-by-side and wrapped across multiple rows as needed.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["ImageSet"] = "ImageSet" + + type: Literal['ImageSet'] = 'ImageSet' """ Must be **ImageSet**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + images: Optional[List[Image]] = None """ The images in the set. """ - + image_size: Optional[ImageSize] = "Medium" """ The size to use to render all images in the set. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -4059,82 +4009,82 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class TextInput(CardElement): """An input to allow the user to enter text.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Input.Text"] = "Input.Text" + + type: Literal['Input.Text'] = 'Input.Text' """ Must be **Input.Text**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + label: Optional[str] = None """ The label of the input. A label should **always** be provided to ensure the best user experience especially for users of assistive technology. """ - + is_required: Optional[bool] = None """ Controls whether the input is required. See [Input validation](topic:input-validation) for more details. """ - + error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ - + value: Optional[str] = None """ The default value of the input. """ - + max_length: Optional[float] = None """ The maximum length of the text in the input. """ - + is_multiline: Optional[bool] = None """ Controls if the input should allow multiple lines of text. """ - + placeholder: Optional[str] = None """ The text to display as a placeholder when the user hasn't entered a value. """ - + style: Optional[InputTextStyle] = "Text" """ The style of the input. """ - + inline_action: Optional[Action] = None """ The action that should be displayed as a button alongside the input. Action.ShowCard is not supported. """ - + regex: Optional[str] = None """ The regular expression to validate the input. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -4229,73 +4179,73 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class DateInput(CardElement): """An input to allow the user to select a date.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Input.Date"] = "Input.Date" + + type: Literal['Input.Date'] = 'Input.Date' """ Must be **Input.Date**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + label: Optional[str] = None """ The label of the input. A label should **always** be provided to ensure the best user experience especially for users of assistive technology. """ - + is_required: Optional[bool] = None """ Controls whether the input is required. See [Input validation](topic:input-validation) for more details. """ - + error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ - + value: Optional[str] = None """ The default value of the input, in the `YYYY-MM-DD` format. """ - + placeholder: Optional[str] = None """ The text to display as a placeholder when the user has not selected a date. """ - + min: Optional[str] = None """ The minimum date that can be selected. """ - + max: Optional[str] = None """ The maximum date that can be selected. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -4378,73 +4328,73 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class TimeInput(CardElement): """An input to allow the user to select a time.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Input.Time"] = "Input.Time" + + type: Literal['Input.Time'] = 'Input.Time' """ Must be **Input.Time**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + label: Optional[str] = None """ The label of the input. A label should **always** be provided to ensure the best user experience especially for users of assistive technology. """ - + is_required: Optional[bool] = None """ Controls whether the input is required. See [Input validation](topic:input-validation) for more details. """ - + error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ - + value: Optional[str] = None """ The default value of the input, in the `HH:MM` format. """ - + placeholder: Optional[str] = None """ The text to display as a placeholder when the user hasn't entered a value. """ - + min: Optional[str] = None """ The minimum time that can be selected, in the `HH:MM` format. """ - + max: Optional[str] = None """ The maximum time that can be selected, in the `HH:MM` format. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -4527,73 +4477,73 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class NumberInput(CardElement): """An input to allow the user to enter a number.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Input.Number"] = "Input.Number" + + type: Literal['Input.Number'] = 'Input.Number' """ Must be **Input.Number**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + label: Optional[str] = None """ The label of the input. A label should **always** be provided to ensure the best user experience especially for users of assistive technology. """ - + is_required: Optional[bool] = None """ Controls whether the input is required. See [Input validation](topic:input-validation) for more details. """ - + error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ - + value: Optional[float] = None """ The default value of the input. """ - + placeholder: Optional[str] = None """ The text to display as a placeholder when the user hasn't entered a value. """ - + min: Optional[float] = None """ The minimum value that can be entered. """ - + max: Optional[float] = None """ The maximum value that can be entered. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -4676,79 +4626,79 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class ToggleInput(CardElement): """An input to allow the user to select between on/off states.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Input.Toggle"] = "Input.Toggle" + + type: Literal['Input.Toggle'] = 'Input.Toggle' """ Must be **Input.Toggle**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + label: Optional[str] = None """ The label of the input. A label should **always** be provided to ensure the best user experience especially for users of assistive technology. """ - + is_required: Optional[bool] = None """ Controls whether the input is required. See [Input validation](topic:input-validation) for more details. """ - + error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ - + value: Optional[str] = "false" """ The default value of the input. """ - + title: Optional[str] = None """ The title (caption) to display next to the toggle. """ - + value_on: Optional[str] = "true" """ The value to send to the Bot when the toggle is on. """ - + value_off: Optional[str] = "false" """ The value to send to the Bot when the toggle is off. """ - + wrap: Optional[bool] = True """ Controls if the title should wrap. """ - + show_title: Optional[bool] = True """ Controls whether the title is visually displayed. When set to false, the title is hidden from view but remains accessible to screen readers for accessibility purposes. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -4839,16 +4789,16 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class Choice(SerializableObject): """A choice as used by the Input.ChoiceSet input.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + title: Optional[str] = None """ The text to display for the choice. """ - + value: Optional[str] = None """ The value associated with the choice, as sent to the Bot when an Action.Submit or Action.Execute is invoked """ @@ -4864,25 +4814,25 @@ def with_value(self, value: str) -> Self: self.value = value return self - + class QueryData(SerializableObject): """Defines a query to dynamically fetch data from a Bot.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Data.Query"] = "Data.Query" + + type: Literal['Data.Query'] = 'Data.Query' """ Must be **Data.Query**. """ - + dataset: Optional[str] = None """ The dataset from which to fetch the data. """ - + associated_inputs: Optional[AssociatedInputs] = None """ Controls which inputs are associated with the Data.Query. When a Data.Query is executed, the values of the associated inputs are sent to the Bot, allowing it to perform filtering operations based on the user's input. """ - + count: Optional[float] = None """ The maximum number of data items that should be returned by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. """ - + skip: Optional[float] = None """ The number of data items to be skipped by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. """ @@ -4906,88 +4856,88 @@ def with_skip(self, value: float) -> Self: self.skip = value return self - + class ChoiceSetInput(CardElement): """An input to allow the user to select one or more values.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Input.ChoiceSet"] = "Input.ChoiceSet" + + type: Literal['Input.ChoiceSet'] = 'Input.ChoiceSet' """ Must be **Input.ChoiceSet**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + label: Optional[str] = None """ The label of the input. A label should **always** be provided to ensure the best user experience especially for users of assistive technology. """ - + is_required: Optional[bool] = None """ Controls whether the input is required. See [Input validation](topic:input-validation) for more details. """ - + error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ - + value: Optional[str] = None """ The default value of the input. """ - + choices: Optional[List[Choice]] = None """ The choices associated with the input. """ - + choices_data: Optional[QueryData] = None """ A Data.Query object that defines the dataset from which to dynamically fetch the choices for the input. """ - + style: Optional[ChoiceSetInputStyle] = "compact" """ Controls whether the input should be displayed as a dropdown (compact) or a list of radio buttons or checkboxes (expanded). """ - + is_multi_select: Optional[bool] = None """ Controls whether multiple choices can be selected. """ - + placeholder: Optional[str] = None """ The text to display as a placeholder when the user has not entered any value. """ - + wrap: Optional[bool] = True """ Controls if choice titles should wrap. """ - + use_multiple_columns: Optional[bool] = None """ Controls whether choice items are arranged in multiple columns in expanded mode, or in a single column. Default is false. """ - + min_column_width: Optional[str] = None """ The minimum width, in pixels, for each column when using a multi-column layout. This ensures that choice items remain readable even when horizontal space is limited. Default is 100 pixels. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -5090,76 +5040,76 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class RatingInput(CardElement): """An input to allow the user to rate something using stars.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Input.Rating"] = "Input.Rating" + + type: Literal['Input.Rating'] = 'Input.Rating' """ Must be **Input.Rating**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + label: Optional[str] = None """ The label of the input. A label should **always** be provided to ensure the best user experience especially for users of assistive technology. """ - + is_required: Optional[bool] = None """ Controls whether the input is required. See [Input validation](topic:input-validation) for more details. """ - + error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ - + value: Optional[float] = None """ The default value of the input. """ - + max: Optional[float] = 5 """ The number of stars to display. """ - + allow_half_steps: Optional[bool] = None """ Controls if the user can select half stars. """ - + size: Optional[RatingSize] = "Large" """ The size of the stars. """ - + color: Optional[RatingColor] = "Neutral" """ The color of the stars. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -5246,68 +5196,68 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class Rating(CardElement): """A read-only star rating element, to display the rating of something.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Rating"] = "Rating" + + type: Literal['Rating'] = 'Rating' """ Must be **Rating**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + value: Optional[float] = None """ The value of the rating. Must be between 0 and max. """ - + count: Optional[float] = None """ The number of "votes" associated with the rating. """ - + max: Optional[float] = 5 """ The number of stars to display. """ - + size: Optional[RatingSize] = "Large" """ The size of the stars. """ - + color: Optional[RatingColor] = "Neutral" """ The color of the stars. """ - + style: Optional[RatingStyle] = "Default" """ The style of the stars. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -5386,22 +5336,22 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class IconInfo(SerializableObject): """Defines information about a Fluent icon and how it should be rendered.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + name: Optional[str] = None """ The name of the icon to display. """ - + size: Optional[IconSize] = "xSmall" """ The size of the icon. """ - + style: Optional[IconStyle] = "Regular" """ The style of the icon. """ - + color: Optional[TextColor] = "Default" """ The color of the icon. """ @@ -5425,65 +5375,65 @@ def with_color(self, value: TextColor) -> Self: self.color = value return self - + class CompoundButton(CardElement): """A special type of button with an icon, title and description.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["CompoundButton"] = "CompoundButton" + + type: Literal['CompoundButton'] = 'CompoundButton' """ Must be **CompoundButton**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + icon: Optional[IconInfo] = None """ The icon to show on the button. """ - + badge: Optional[str] = None """ The badge to show on the button. """ - + title: Optional[str] = None """ The title of the button. """ - + description: Optional[str] = None """ The description text of the button. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the button is tapped or clicked. Action.ShowCard is not supported. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -5558,62 +5508,62 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class Icon(CardElement): """A standalone icon element. Icons can be picked from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog).""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Icon"] = "Icon" + + type: Literal['Icon'] = 'Icon' """ Must be **Icon**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + name: Optional[str] = None """ The name of the icon to display. """ - + size: Optional[IconSize] = "Standard" """ The size of the icon. """ - + style: Optional[IconStyle] = "Regular" """ The style of the icon. """ - + color: Optional[TextColor] = "Default" """ The color of the icon. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the icon is tapped or clicked. Action.ShowCard is not supported. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -5684,74 +5634,74 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class CarouselPage(CardElement): """A page inside a Carousel element.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["CarouselPage"] = "CarouselPage" + + type: Literal['CarouselPage'] = 'CarouselPage' """ Must be **CarouselPage**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. """ - + style: Optional[ContainerStyle] = None """ 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. """ - + show_border: Optional[bool] = None """ Controls if a border should be displayed around the container. """ - + rounded_corners: Optional[bool] = None """ Controls if the container should have rounded corners. """ - - layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None + + layouts: Optional[List[ContainerLayout]] = None """ 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](topic:container-layouts) for more details. """ - + min_height: Optional[str] = None """ The minimum height, in pixels, of the container, in the `px` format. """ - + background_image: Optional[Union[str, BackgroundImage]] = None """ Defines the container's background image. """ - + vertical_content_alignment: Optional[VerticalAlignment] = None """ Controls how the container's content should be vertically aligned. """ - + rtl: Optional[bool] = None """ Controls if the content of the card is to be rendered left-to-right or right-to-left. """ - + max_height: Optional[str] = None """ 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. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ - - items: Optional[List[SerializeAsAny[CardElement]]] = None + + items: Optional[List[CardElement]] = None """ The elements in the page. """ def with_key(self, value: str) -> Self: @@ -5838,58 +5788,58 @@ def with_items(self, value: List[CardElement]) -> Self: self.items = value return self - + class Carousel(CardElement): """A carousel with sliding pages.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Carousel"] = "Carousel" + + type: Literal['Carousel'] = 'Carousel' """ Must be **Carousel**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + bleed: Optional[bool] = None """ Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. """ - + min_height: Optional[str] = None """ The minimum height, in pixels, of the container, in the `px` format. """ - + page_animation: Optional[CarouselPageAnimation] = "Slide" """ Controls the type of animation to use to navigate between pages. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ - + pages: Optional[List[CarouselPage]] = None """ The pages in the carousel. """ @@ -5957,74 +5907,74 @@ def with_pages(self, value: List[CarouselPage]) -> Self: self.pages = value return self - + class Badge(CardElement): """A badge element to show an icon and/or text in a compact form over a colored background.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Badge"] = "Badge" + + type: Literal['Badge'] = 'Badge' """ Must be **Badge**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + text: Optional[str] = None """ The text to display. """ - + icon: Optional[str] = None """ The name of an icon from the [Adaptive Card icon catalog](topic:icon-catalog) to display, in the `[,regular|filled]` format. If the style is not specified, the regular style is used. """ - + icon_position: Optional[BadgeIconPosition] = "Before" """ Controls the position of the icon. """ - + appearance: Optional[BadgeAppearance] = "Filled" """ Controls the strength of the background color. """ - + size: Optional[BadgeSize] = "Medium" """ The size of the badge. """ - + shape: Optional[BadgeShape] = "Circular" """ Controls the shape of the badge. """ - + style: Optional[BadgeStyle] = "Default" """ The style of the badge. """ - + tooltip: Optional[str] = None """ Controls the tooltip text to display when the badge is hovered over. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -6111,59 +6061,59 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class ProgressRing(CardElement): """A spinning ring element, to indicate progress.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["ProgressRing"] = "ProgressRing" + + type: Literal['ProgressRing'] = 'ProgressRing' """ Must be **ProgressRing**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + label: Optional[str] = None """ The label of the progress ring. """ - + label_position: Optional[ProgressRingLabelPosition] = "Below" """ Controls the relative position of the label to the progress ring. """ - + size: Optional[ProgressRingSize] = "Medium" """ The size of the progress ring. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -6230,59 +6180,59 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class ProgressBar(CardElement): """A progress bar element, to represent a value within a range.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["ProgressBar"] = "ProgressBar" + + type: Literal['ProgressBar'] = 'ProgressBar' """ Must be **ProgressBar**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + value: Optional[float] = None """ The value of the progress bar. Must be between 0 and max. """ - + max: Optional[float] = 100 """ The maximum value of the progress bar. """ - + color: Optional[ProgressBarColor] = "Accent" """ The color of the progress bar. `color` has no effect when the `ProgressBar` is in indeterminate mode, in which case the "accent" color is always used. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -6349,19 +6299,19 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class DonutChartData(SerializableObject): """A data point in a Donut chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + legend: Optional[str] = None """ The legend of the chart. """ - + value: Optional[float] = None """ The value associated with the data point. """ - + color: Optional[ChartColor] = None """ The color to use for the data point. See [Chart colors reference](topic:chart-colors-reference). """ @@ -6381,80 +6331,80 @@ def with_color(self, value: ChartColor) -> Self: self.color = value return self - + class DonutChart(CardElement): """A donut chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Chart.Donut"] = "Chart.Donut" + + type: Literal['Chart.Donut'] = 'Chart.Donut' """ Must be **Chart.Donut**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + title: Optional[str] = None """ The title of the chart. """ - + show_title: Optional[bool] = None """ Controls whether the chart's title should be displayed. Defaults to `false`. """ - + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ - + max_width: Optional[str] = None """ The maximum width, in pixels, of the chart, in the `px` format. """ - + show_legend: Optional[bool] = True """ Controls whether the chart's legend should be displayed. """ - + data: Optional[List[DonutChartData]] = None """ The data to display in the chart. """ - + value: Optional[str] = None """ The value that should be displayed in the center of a Donut chart. `value` is ignored for Pie charts. """ - + value_color: Optional[ChartColor] = None """ Controls the color of the value displayed in the center of a Donut chart. """ - + thickness: Optional[DonutThickness] = None """ Controls the thickness of the donut segments. Default is **Thick**. """ - + show_outlines: Optional[bool] = True """ Controls whether the outlines of the donut segments are displayed. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -6549,80 +6499,80 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class PieChart(CardElement): """A pie chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Chart.Pie"] = "Chart.Pie" + + type: Literal['Chart.Pie'] = 'Chart.Pie' """ Must be **Chart.Pie**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + title: Optional[str] = None """ The title of the chart. """ - + show_title: Optional[bool] = None """ Controls whether the chart's title should be displayed. Defaults to `false`. """ - + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ - + max_width: Optional[str] = None """ The maximum width, in pixels, of the chart, in the `px` format. """ - + show_legend: Optional[bool] = True """ Controls whether the chart's legend should be displayed. """ - + data: Optional[List[DonutChartData]] = None """ The data to display in the chart. """ - + value: Optional[str] = None """ The value that should be displayed in the center of a Donut chart. `value` is ignored for Pie charts. """ - + value_color: Optional[ChartColor] = None """ Controls the color of the value displayed in the center of a Donut chart. """ - + thickness: Optional[DonutThickness] = None """ Controls the thickness of the donut segments. Default is **Thick**. """ - + show_outlines: Optional[bool] = True """ Controls whether the outlines of the donut segments are displayed. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -6717,16 +6667,16 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class BarChartDataValue(SerializableObject): """A single data point in a bar chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + x: Optional[str] = None """ The x axis value of the data point. """ - + y: Optional[float] = None """ The y axis value of the data point. """ @@ -6742,19 +6692,19 @@ def with_y(self, value: float) -> Self: self.y = value return self - + class GroupedVerticalBarChartData(SerializableObject): """Represents a series of data points.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + legend: Optional[str] = None """ The legend of the chart. """ - + values: Optional[List[BarChartDataValue]] = None """ The data points in the series. """ - + color: Optional[ChartColor] = None """ The color to use for all data points in the series. See [Chart colors reference](topic:chart-colors-reference). """ @@ -6774,95 +6724,95 @@ def with_color(self, value: ChartColor) -> Self: self.color = value return self - + class GroupedVerticalBarChart(CardElement): """A grouped vertical bar chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Chart.VerticalBar.Grouped"] = "Chart.VerticalBar.Grouped" + + type: Literal['Chart.VerticalBar.Grouped'] = 'Chart.VerticalBar.Grouped' """ Must be **Chart.VerticalBar.Grouped**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + title: Optional[str] = None """ The title of the chart. """ - + show_title: Optional[bool] = None """ Controls whether the chart's title should be displayed. Defaults to `false`. """ - + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ - + max_width: Optional[str] = None """ The maximum width, in pixels, of the chart, in the `px` format. """ - + show_legend: Optional[bool] = True """ Controls whether the chart's legend should be displayed. """ - + x_axis_title: Optional[str] = None """ The title of the x axis. """ - + y_axis_title: Optional[str] = None """ The title of the y axis. """ - + color: Optional[ChartColor] = None """ The color to use for all data points. See [Chart colors reference](topic:chart-colors-reference). """ - + stacked: Optional[bool] = None """ Controls if bars in the chart should be displayed as stacks instead of groups. **Note:** stacked vertical bar charts do not support custom Y ranges nor negative Y values. """ - + data: Optional[List[GroupedVerticalBarChartData]] = None """ The data points in a series. """ - + show_bar_values: Optional[bool] = None """ Controls if values should be displayed on each bar. """ - + y_min: Optional[float] = None """ The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation. `yMin` is ignored if `stacked` is set to `true`. """ - + y_max: Optional[float] = None """ The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation. `yMax` is ignored if `stacked` is set to `true`. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -6969,19 +6919,19 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class VerticalBarChartDataValue(SerializableObject): """Represents a data point in a vertical bar chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + x: Optional[Union[str, float]] = None """ The x axis value of the data point. """ - + y: Optional[float] = None """ The y axis value of the data point. """ - + color: Optional[ChartColor] = None """ The color to use for the bar associated with the data point. See [Chart colors reference](topic:chart-colors-reference). """ @@ -7001,86 +6951,86 @@ def with_color(self, value: ChartColor) -> Self: self.color = value return self - + class VerticalBarChart(CardElement): """A vertical bar chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Chart.VerticalBar"] = "Chart.VerticalBar" + + type: Literal['Chart.VerticalBar'] = 'Chart.VerticalBar' """ Must be **Chart.VerticalBar**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + title: Optional[str] = None """ The title of the chart. """ - + show_title: Optional[bool] = None """ Controls whether the chart's title should be displayed. Defaults to `false`. """ - + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ - + max_width: Optional[str] = None """ The maximum width, in pixels, of the chart, in the `px` format. """ - + show_legend: Optional[bool] = True """ Controls whether the chart's legend should be displayed. """ - + x_axis_title: Optional[str] = None """ The title of the x axis. """ - + y_axis_title: Optional[str] = None """ The title of the y axis. """ - + data: Optional[List[VerticalBarChartDataValue]] = None """ The data to display in the chart. """ - + color: Optional[ChartColor] = None """ The color to use for all data points. See [Chart colors reference](topic:chart-colors-reference). """ - + show_bar_values: Optional[bool] = None """ Controls if the bar values should be displayed. """ - + y_min: Optional[float] = None """ The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation. """ - + y_max: Optional[float] = None """ The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -7183,19 +7133,19 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class HorizontalBarChartDataValue(SerializableObject): """Represents a single data point in a horizontal bar chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + x: Optional[str] = None """ The x axis value of the data point. """ - + y: Optional[float] = None """ The y axis value of the data point. """ - + color: Optional[ChartColor] = None """ The color of the bar associated with the data point. See [Chart colors reference](topic:chart-colors-reference). """ @@ -7215,80 +7165,80 @@ def with_color(self, value: ChartColor) -> Self: self.color = value return self - + class HorizontalBarChart(CardElement): """A horizontal bar chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Chart.HorizontalBar"] = "Chart.HorizontalBar" + + type: Literal['Chart.HorizontalBar'] = 'Chart.HorizontalBar' """ Must be **Chart.HorizontalBar**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + title: Optional[str] = None """ The title of the chart. """ - + show_title: Optional[bool] = None """ Controls whether the chart's title should be displayed. Defaults to `false`. """ - + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ - + max_width: Optional[str] = None """ The maximum width, in pixels, of the chart, in the `px` format. """ - + show_legend: Optional[bool] = True """ Controls whether the chart's legend should be displayed. """ - + x_axis_title: Optional[str] = None """ The title of the x axis. """ - + y_axis_title: Optional[str] = None """ The title of the y axis. """ - + color: Optional[ChartColor] = None """ The color to use for all data points. See [Chart colors reference](topic:chart-colors-reference). """ - + data: Optional[List[HorizontalBarChartDataValue]] = None """ The data points in the chart. """ - + display_mode: Optional[HorizontalBarChartDisplayMode] = "AbsoluteWithAxis" """ Controls how the chart should be visually laid out. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -7383,19 +7333,19 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class StackedHorizontalBarChartDataPoint(SerializableObject): """A data point in a series.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + legend: Optional[str] = None """ The legend associated with the data point. """ - + value: Optional[float] = None """ The value of the data point. """ - + color: Optional[ChartColor] = None """ The color to use to render the bar associated with the data point. See [Chart colors reference](topic:chart-colors-reference). """ @@ -7415,16 +7365,16 @@ def with_color(self, value: ChartColor) -> Self: self.color = value return self - + class StackedHorizontalBarChartData(SerializableObject): """Defines the collection of data series to display in as a stacked horizontal bar chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + title: Optional[str] = None """ The title of the series. """ - + data: Optional[List[StackedHorizontalBarChartDataPoint]] = None """ The data points in the series. """ @@ -7440,77 +7390,77 @@ def with_data(self, value: List[StackedHorizontalBarChartDataPoint]) -> Self: self.data = value return self - + class StackedHorizontalBarChart(CardElement): """A stacked horizontal bar chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Chart.HorizontalBar.Stacked"] = "Chart.HorizontalBar.Stacked" + + type: Literal['Chart.HorizontalBar.Stacked'] = 'Chart.HorizontalBar.Stacked' """ Must be **Chart.HorizontalBar.Stacked**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + title: Optional[str] = None """ The title of the chart. """ - + show_title: Optional[bool] = None """ Controls whether the chart's title should be displayed. Defaults to `false`. """ - + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ - + max_width: Optional[str] = None """ The maximum width, in pixels, of the chart, in the `px` format. """ - + show_legend: Optional[bool] = True """ Controls whether the chart's legend should be displayed. """ - + x_axis_title: Optional[str] = None """ The title of the x axis. """ - + y_axis_title: Optional[str] = None """ The title of the y axis. """ - + color: Optional[ChartColor] = None """ The color to use for all data points. See [Chart colors reference](topic:chart-colors-reference). """ - + data: Optional[List[StackedHorizontalBarChartData]] = None """ The data to display in the chart. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -7601,20 +7551,20 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class LineChartValue(SerializableObject): """Represents a single data point in a line chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + x: Optional[Union[float, str]] = None """ The x axis value of the data point. If all x values of the x [Chart.Line](topic:Chart.Line) are expressed as a number, or if all x values are expressed as a date string in the `YYYY-MM-DD` format, the chart will be rendered as a time series chart, i.e. x axis values will span across the minimum x value to maximum x value range. Otherwise, if x values are represented as a mix of numbers and strings or if at least one x value isn't in the `YYYY-MM-DD` format, the chart will be rendered as a categorical chart, i.e. x axis values will be displayed as categories. """ - + y: Optional[float] = None """ The y axis value of the data point. """ @@ -7630,19 +7580,19 @@ def with_y(self, value: float) -> Self: self.y = value return self - + class LineChartData(SerializableObject): """Represents a collection of data points series in a line chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + legend: Optional[str] = None """ The legend of the chart. """ - + values: Optional[List[LineChartValue]] = None """ The data points in the series. """ - + color: Optional[ChartColor] = None """ The color all data points in the series. See [Chart colors reference](topic:chart-colors-reference). """ @@ -7662,83 +7612,83 @@ def with_color(self, value: ChartColor) -> Self: self.color = value return self - + class LineChart(CardElement): """A line chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Chart.Line"] = "Chart.Line" + + type: Literal['Chart.Line'] = 'Chart.Line' """ Must be **Chart.Line**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + title: Optional[str] = None """ The title of the chart. """ - + show_title: Optional[bool] = None """ Controls whether the chart's title should be displayed. Defaults to `false`. """ - + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ - + max_width: Optional[str] = None """ The maximum width, in pixels, of the chart, in the `px` format. """ - + show_legend: Optional[bool] = True """ Controls whether the chart's legend should be displayed. """ - + x_axis_title: Optional[str] = None """ The title of the x axis. """ - + y_axis_title: Optional[str] = None """ The title of the y axis. """ - + color: Optional[ChartColor] = None """ The color to use for all data points. See [Chart colors reference](topic:chart-colors-reference). """ - + data: Optional[List[LineChartData]] = None """ The data point series in the line chart. """ - + y_min: Optional[float] = None """ The maximum y range. """ - + y_max: Optional[float] = None """ The minimum y range. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -7837,19 +7787,19 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class GaugeChartLegend(SerializableObject): """The legend of the chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + size: Optional[float] = None """ The size of the segment. """ - + legend: Optional[str] = None """ The legend text associated with the segment. """ - + color: Optional[ChartColor] = None """ The color to use for the segment. See [Chart colors reference](topic:chart-colors-reference). """ @@ -7869,92 +7819,92 @@ def with_color(self, value: ChartColor) -> Self: self.color = value return self - + class GaugeChart(CardElement): """A gauge chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Chart.Gauge"] = "Chart.Gauge" + + type: Literal['Chart.Gauge'] = 'Chart.Gauge' """ Must be **Chart.Gauge**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + title: Optional[str] = None """ The title of the chart. """ - + show_title: Optional[bool] = None """ Controls whether the chart's title should be displayed. Defaults to `false`. """ - + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ - + max_width: Optional[str] = None """ The maximum width, in pixels, of the chart, in the `px` format. """ - + show_legend: Optional[bool] = True """ Controls whether the chart's legend should be displayed. """ - + min: Optional[float] = None """ The minimum value of the gauge. """ - + max: Optional[float] = None """ The maximum value of the gauge. """ - + sub_label: Optional[str] = None """ The sub-label of the gauge. """ - + show_min_max: Optional[bool] = True """ Controls whether the min/max values should be displayed. """ - + show_needle: Optional[bool] = True """ Controls whether the gauge's needle is displayed. Default is **true**. """ - + show_outlines: Optional[bool] = True """ Controls whether the outlines of the gauge segments are displayed. """ - + segments: Optional[List[GaugeChartLegend]] = None """ The segments to display in the gauge. """ - + value: Optional[float] = None """ The value of the gauge. """ - + value_format: Optional[GaugeChartValueFormat] = "Percentage" """ The format used to display the gauge's value. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8065,59 +8015,59 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class CodeBlock(CardElement): """A formatted and syntax-colored code block.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["CodeBlock"] = "CodeBlock" + + type: Literal['CodeBlock'] = 'CodeBlock' """ Must be **CodeBlock**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + code_snippet: Optional[str] = None """ The code snippet to display. """ - + language: Optional[CodeLanguage] = "PlainText" """ The language the code snippet is expressed in. """ - + start_line_number: Optional[float] = 1 """ A number that represents the line in the file from where the code snippet was extracted. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8184,25 +8134,25 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class PersonaProperties(SerializableObject): """Represents the properties of a Persona component.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + id: Optional[str] = None """ The Id of the persona. """ - + user_principal_name: Optional[str] = None """ The UPN of the persona. """ - + display_name: Optional[str] = None """ The display name of the persona. """ - + icon_style: Optional[PersonaIconStyle] = None """ Defines the style of the icon for the persona. """ - + style: Optional[PersonaDisplayStyle] = None """ Defines how the persona should be displayed. """ @@ -8230,56 +8180,56 @@ def with_style(self, value: PersonaDisplayStyle) -> Self: self.style = value return self - + class ComUserMicrosoftGraphComponent(CardElement): """Displays a user's information, including their profile picture.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Component"] = "Component" + + type: Literal['Component'] = 'Component' """ Must be **Component**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - - name: Literal["graph.microsoft.com/user"] = "graph.microsoft.com/user" + + name: Literal['graph.microsoft.com/user'] = 'graph.microsoft.com/user' """ Must be **graph.microsoft.com/user**. """ - + properties: Optional[PersonaProperties] = None """ The properties of the Persona component. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8338,19 +8288,19 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class PersonaSetProperties(SerializableObject): """Represents the properties of a PersonaSet component.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + users: Optional[List[PersonaProperties]] = None """ The users a PersonaSet component should display. """ - + icon_style: Optional[PersonaIconStyle] = None """ Defines the style of the icon for the personas in the set. """ - + style: Optional[PersonaDisplayStyle] = None """ Defines how each persona in the set should be displayed. """ @@ -8370,56 +8320,56 @@ def with_style(self, value: PersonaDisplayStyle) -> Self: self.style = value return self - + class ComUsersMicrosoftGraphComponent(CardElement): """Displays multiple users' information, including their profile pictures.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Component"] = "Component" + + type: Literal['Component'] = 'Component' """ Must be **Component**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - - name: Literal["graph.microsoft.com/users"] = "graph.microsoft.com/users" + + name: Literal['graph.microsoft.com/users'] = 'graph.microsoft.com/users' """ Must be **graph.microsoft.com/users**. """ - + properties: Optional[PersonaSetProperties] = None """ The properties of the PersonaSet component. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8478,13 +8428,13 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class ResourceVisualization(SerializableObject): """Represents a visualization of a resource.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + media: Optional[str] = None """ The media associated with the resource. """ @@ -8496,19 +8446,19 @@ def with_media(self, value: str) -> Self: self.media = value return self - + class ResourceProperties(SerializableObject): """Represents the properties of a resource component.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + id: Optional[str] = None """ The Id of the resource. """ - + resource_reference: Optional[Dict[str, str]] = None """ The reference to the resource. """ - + resource_visualization: Optional[ResourceVisualization] = None """ The visualization of the resource. """ @@ -8528,56 +8478,56 @@ def with_resource_visualization(self, value: ResourceVisualization) -> Self: self.resource_visualization = value return self - + class ComResourceMicrosoftGraphComponent(CardElement): """Displays information about a generic graph resource.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Component"] = "Component" + + type: Literal['Component'] = 'Component' """ Must be **Component**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - - name: Literal["graph.microsoft.com/resource"] = "graph.microsoft.com/resource" + + name: Literal['graph.microsoft.com/resource'] = 'graph.microsoft.com/resource' """ Must be **graph.microsoft.com/resource**. """ - + properties: Optional[ResourceProperties] = None """ The properties of the resource. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8636,19 +8586,19 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class FileProperties(SerializableObject): """Represents the properties of a file component.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + name: Optional[str] = None """ The name of the file. """ - + extension: Optional[str] = None """ The file extension. """ - + url: Optional[str] = None """ The URL of the file. """ @@ -8668,56 +8618,56 @@ def with_url(self, value: str) -> Self: self.url = value return self - + class ComFileMicrosoftGraphComponent(CardElement): """Displays information about a file resource.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Component"] = "Component" + + type: Literal['Component'] = 'Component' """ Must be **Component**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - - name: Literal["graph.microsoft.com/file"] = "graph.microsoft.com/file" + + name: Literal['graph.microsoft.com/file'] = 'graph.microsoft.com/file' """ Must be **graph.microsoft.com/file**. """ - + properties: Optional[FileProperties] = None """ The properties of the file. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8776,25 +8726,25 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class CalendarEventAttendee(SerializableObject): """Represents a calendar event attendee.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + name: Optional[str] = None """ The name of the attendee. """ - + email: Optional[str] = None """ The email address of the attendee. """ - + title: Optional[str] = None """ The title of the attendee. """ - + type: Optional[str] = None """ The type of the attendee. """ - + status: Optional[str] = None """ The status of the attendee. """ @@ -8822,46 +8772,46 @@ def with_status(self, value: str) -> Self: self.status = value return self - + class CalendarEventProperties(SerializableObject): """The properties of a calendar event.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + id: Optional[str] = None """ The ID of the event. """ - + title: Optional[str] = None """ The title of the event. """ - + start: Optional[str] = None """ The start date and time of the event. """ - + end: Optional[str] = None """ The end date and time of the event. """ - + status: Optional[str] = None """ The status of the event. """ - + locations: Optional[List[str]] = None """ The locations of the event. """ - + online_meeting_url: Optional[str] = None """ The URL of the online meeting. """ - + is_all_day: Optional[bool] = None """ Indicates if the event is all day. """ - + extension: Optional[str] = None """ The extension of the event. """ - + url: Optional[str] = None """ The URL of the event. """ - + attendees: Optional[List[CalendarEventAttendee]] = None """ The attendees of the event. """ - + organizer: Optional[CalendarEventAttendee] = None """ The organizer of the event. """ @@ -8917,56 +8867,56 @@ def with_organizer(self, value: CalendarEventAttendee) -> Self: self.organizer = value return self - + class ComEventMicrosoftGraphComponent(CardElement): """Displays information about a calendar event.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["Component"] = "Component" + + type: Literal['Component'] = 'Component' """ Must be **Component**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - - name: Literal["graph.microsoft.com/event"] = "graph.microsoft.com/event" + + name: Literal['graph.microsoft.com/event'] = 'graph.microsoft.com/event' """ Must be **graph.microsoft.com/event**. """ - + properties: Optional[CalendarEventProperties] = None """ The properties of the event. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -9025,65 +8975,65 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class TextRun(CardElement): """A block of text inside a RichTextBlock element.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["TextRun"] = "TextRun" + + type: Literal['TextRun'] = 'TextRun' """ Must be **TextRun**. """ - + id: Optional[str] = None """ 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. """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + text: Optional[str] = None """ The text to display. A subset of markdown is supported. """ - + size: Optional[TextSize] = None """ The size of the text. """ - + weight: Optional[TextWeight] = None """ The weight of the text. """ - + color: Optional[TextColor] = None """ The color of the text. """ - + is_subtle: Optional[bool] = None """ Controls whether the text should be renderer using a subtler variant of the select color. """ - + font_type: Optional[FontType] = None """ The type of font to use for rendering. """ - + italic: Optional[bool] = None """ Controls if the text should be italicized. """ - + strikethrough: Optional[bool] = None """ Controls if the text should be struck through. """ - + highlight: Optional[bool] = None """ Controls if the text should be highlighted. """ - + underline: Optional[bool] = None """ Controls if the text should be underlined. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the text is tapped or clicked. Action.ShowCard is not supported. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -9158,47 +9108,47 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class IconRun(CardElement): """An inline icon inside a RichTextBlock element.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["IconRun"] = "IconRun" + + type: Literal['IconRun'] = 'IconRun' """ Must be **IconRun**. """ - + id: Optional[str] = None """ 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. """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + name: Optional[str] = None """ The name of the inline icon to display. """ - + size: Optional[SizeEnum] = "Default" """ The size of the inline icon. """ - + style: Optional[IconStyle] = "Regular" """ The style of the inline icon. """ - + color: Optional[TextColor] = "Default" """ The color of the inline icon. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the inline icon is tapped or clicked. Action.ShowCard is not supported. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -9249,47 +9199,47 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class ImageRun(CardElement): """An inline image inside a RichTextBlock element.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["ImageRun"] = "ImageRun" + + type: Literal['ImageRun'] = 'ImageRun' """ Must be **ImageRun**. """ - + id: Optional[str] = None """ 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. """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + url: Optional[str] = None """ The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. """ - + size: Optional[SizeEnum] = "Default" """ The size of the inline image. """ - + style: Optional[ImageStyle] = "Default" """ The style of the inline image. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. """ - + themed_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific image URLs. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None + + fallback: Optional[Union[CardElement, FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -9340,16 +9290,16 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class ImBackSubmitActionData(SerializableObject): """Represents Teams-specific data in an Action.Submit to send an Instant Message back to the Bot.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["imBack"] = "imBack" + + type: Literal['imBack'] = 'imBack' """ Must be **imBack**. """ - + value: Optional[str] = None """ The value that will be sent to the Bot. """ @@ -9361,19 +9311,19 @@ def with_value(self, value: str) -> Self: self.value = value return self - + class TabInfo(SerializableObject): """Represents information about the iFrame content, rendered in the collab stage popout window.""" - + name: Optional[str] = None """ The name for the content. This will be displayed as the title of the window hosting the iFrame. """ - + content_url: Optional[str] = None """ The URL to open in an iFrame. """ - + entity_id: Optional[str] = None """ The unique entity id for this content (e.g., random UUID). """ - + website_url: Optional[str] = None """ An optional website URL to the content, allowing users to open this content in the browser (if they prefer). """ @@ -9393,13 +9343,13 @@ def with_website_url(self, value: str) -> Self: self.website_url = value return self - + class CollabStageInvokeDataValue(SerializableObject): """Data for invoking a collaboration stage action.""" - - type: Literal["tab/tabInfoAction"] = "tab/tabInfoAction" + + type: Literal['tab/tabInfoAction'] = 'tab/tabInfoAction' """ Must be **tab/tabInfoAction**. """ - + tab_info: Optional[TabInfo] = None """ Provides information about the iFrame content, rendered in the collab stage popout window. """ @@ -9407,16 +9357,16 @@ def with_tab_info(self, value: TabInfo) -> Self: self.tab_info = value return self - + class InvokeSubmitActionData(SerializableObject): """Represents Teams-specific data in an Action.Submit to make an Invoke request to the Bot.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["invoke"] = "invoke" + + type: Literal['invoke'] = 'invoke' """ Must be **invoke**. """ - + value: Optional[Union[Dict[str, Any], CollabStageInvokeDataValue]] = None """ The object to send to the Bot with the Invoke request. Can be strongly typed as one of the below values to trigger a specific action in Teams. """ @@ -9428,22 +9378,22 @@ def with_value(self, value: Union[Dict[str, Any], CollabStageInvokeDataValue]) - self.value = value return self - + class MessageBackSubmitActionData(SerializableObject): """Represents Teams-specific data in an Action.Submit to send a message back to the Bot.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["messageBack"] = "messageBack" + + type: Literal['messageBack'] = 'messageBack' """ Must be **messageBack**. """ - + text: Optional[str] = None """ The text that will be sent to the Bot. """ - + display_text: Optional[str] = None """ 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. """ - + value: Optional[Dict[str, Any]] = None """ 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. """ @@ -9463,16 +9413,16 @@ def with_value(self, value: Dict[str, Any]) -> Self: self.value = value return self - + class SigninSubmitActionData(SerializableObject): """Represents Teams-specific data in an Action.Submit to sign in a user.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["signin"] = "signin" + + type: Literal['signin'] = 'signin' """ Must be **signin**. """ - + value: Optional[str] = None """ The URL to redirect the end-user for signing in. """ @@ -9484,17 +9434,18 @@ def with_value(self, value: str) -> Self: self.value = value return self - + class TaskFetchSubmitActionData(SerializableObject): """Represents Teams-specific data in an Action.Submit to open a task module.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal["task/fetch"] = "task/fetch" + + type: Literal['task/fetch'] = 'task/fetch' """ Must be **task/fetch**. """ def with_key(self, value: str) -> Self: self.key = value return self + \ No newline at end of file From 912fa0cc100c47ce82607997e924e43aea76263a Mon Sep 17 00:00:00 2001 From: Corina Gum <> Date: Thu, 19 Mar 2026 15:03:18 -0700 Subject: [PATCH 08/10] Apply manual fixes --- .../cards/src/microsoft_teams/cards/core.py | 3285 +++++++++-------- 1 file changed, 1703 insertions(+), 1582 deletions(-) diff --git a/packages/cards/src/microsoft_teams/cards/core.py b/packages/cards/src/microsoft_teams/cards/core.py index da94e434..cca7452e 100644 --- a/packages/cards/src/microsoft_teams/cards/core.py +++ b/packages/cards/src/microsoft_teams/cards/core.py @@ -1,8 +1,9 @@ # This file was automatically generated by a tool on 03/19/2026, 9:27 PM UTC. DO NOT UPDATE MANUALLY. # It includes declarations for Adaptive Card features available in Teams, Copilot, Outlook, Word, Excel, PowerPoint. -from typing import Dict, List, Any, Optional, Union, Literal, Self -from pydantic import AliasGenerator, BaseModel, ConfigDict, Field +from typing import Any, Dict, List, Literal, Optional, Self, Union + +from pydantic import AliasGenerator, BaseModel, ConfigDict, Field, SerializeAsAny from pydantic.alias_generators import to_camel @@ -12,30 +13,46 @@ class SerializableObject(BaseModel): @staticmethod def validation_alias_generator(field: str) -> str: "Handles deserialization aliasing" - + # Handle parameters that start with "@" if field.startswith("at_"): return f"@{field[3:]}" - + # Handles from field which is a duplicate reserved internal name if field == "from_": return "from" - + + # Handle ms_teams field which should deserialize from msteams + if field == "ms_teams": + return "msteams" + + # Handle choices_data field which should deserialize from choices.data + if field == "choices_data": + return "choices.data" + # All other fields are converted to camelCase return to_camel(field) - + @staticmethod def serialization_alias_generator(field: str) -> str: "Handles serialization aliasing and casing" - + # Handle parameters that start with "@" if field.startswith("at_"): return f"@{field[3:]}" - + # Handles from field which is a duplicate reserved internal name if field == "from_": return "from" - + + # Handle ms_teams field which should serialize to msteams + if field == "ms_teams": + return "msteams" + + # Handle choices_data field which should serialize to choices.data + if field == "choices_data": + return "choices.data" + # All other fields are converted to camelCase return to_camel(field) @@ -48,19 +65,24 @@ def serialization_alias_generator(field: str) -> str: alias_generator=AliasGenerator( validation_alias=validation_alias_generator, serialization_alias=serialization_alias_generator ), - ) + ) class CardElement(SerializableObject): """Base class for CardElement.""" + pass + class Action(SerializableObject): """Base class for Action.""" + pass + class ContainerLayout(SerializableObject): """Base class for ContainerLayout.""" + pass @@ -76,7 +98,20 @@ class ContainerLayout(SerializableObject): Spacing = Literal["None", "ExtraSmall", "Small", "Default", "Medium", "Large", "ExtraLarge", "Padding"] -TargetWidth = Literal["VeryNarrow", "Narrow", "Standard", "Wide", "atLeast:VeryNarrow", "atMost:VeryNarrow", "atLeast:Narrow", "atMost:Narrow", "atLeast:Standard", "atMost:Standard", "atLeast:Wide", "atMost:Wide"] +TargetWidth = Literal[ + "VeryNarrow", + "Narrow", + "Standard", + "Wide", + "atLeast:VeryNarrow", + "atMost:VeryNarrow", + "atLeast:Narrow", + "atMost:Narrow", + "atLeast:Standard", + "atMost:Standard", + "atLeast:Wide", + "atMost:Wide", +] ContainerStyle = Literal["default", "emphasis", "accent", "good", "attention", "warning"] @@ -136,9 +171,67 @@ class ContainerLayout(SerializableObject): ProgressBarColor = Literal["Accent", "Good", "Warning", "Attention"] -ChartColorSet = Literal["categorical", "sequential", "sequentialred", "sequentialgreen", "sequentialyellow", "diverging"] - -ChartColor = Literal["good", "warning", "attention", "neutral", "categoricalRed", "categoricalPurple", "categoricalLavender", "categoricalBlue", "categoricalLightBlue", "categoricalTeal", "categoricalGreen", "categoricalLime", "categoricalMarigold", "sequential1", "sequential2", "sequential3", "sequential4", "sequential5", "sequential6", "sequential7", "sequential8", "divergingBlue", "divergingLightBlue", "divergingCyan", "divergingTeal", "divergingYellow", "divergingPeach", "divergingLightRed", "divergingRed", "divergingMaroon", "divergingGray", "sequentialRed1", "sequentialRed2", "sequentialRed3", "sequentialRed4", "sequentialRed5", "sequentialRed6", "sequentialRed7", "sequentialRed8", "sequentialGreen1", "sequentialGreen2", "sequentialGreen3", "sequentialGreen4", "sequentialGreen5", "sequentialGreen6", "sequentialGreen7", "sequentialGreen8", "sequentialYellow1", "sequentialYellow2", "sequentialYellow3", "sequentialYellow4", "sequentialYellow5", "sequentialYellow6", "sequentialYellow7", "sequentialYellow8"] +ChartColorSet = Literal[ + "categorical", "sequential", "sequentialred", "sequentialgreen", "sequentialyellow", "diverging" +] + +ChartColor = Literal[ + "good", + "warning", + "attention", + "neutral", + "categoricalRed", + "categoricalPurple", + "categoricalLavender", + "categoricalBlue", + "categoricalLightBlue", + "categoricalTeal", + "categoricalGreen", + "categoricalLime", + "categoricalMarigold", + "sequential1", + "sequential2", + "sequential3", + "sequential4", + "sequential5", + "sequential6", + "sequential7", + "sequential8", + "divergingBlue", + "divergingLightBlue", + "divergingCyan", + "divergingTeal", + "divergingYellow", + "divergingPeach", + "divergingLightRed", + "divergingRed", + "divergingMaroon", + "divergingGray", + "sequentialRed1", + "sequentialRed2", + "sequentialRed3", + "sequentialRed4", + "sequentialRed5", + "sequentialRed6", + "sequentialRed7", + "sequentialRed8", + "sequentialGreen1", + "sequentialGreen2", + "sequentialGreen3", + "sequentialGreen4", + "sequentialGreen5", + "sequentialGreen6", + "sequentialGreen7", + "sequentialGreen8", + "sequentialYellow1", + "sequentialYellow2", + "sequentialYellow3", + "sequentialYellow4", + "sequentialYellow5", + "sequentialYellow6", + "sequentialYellow7", + "sequentialYellow8", +] DonutThickness = Literal["Thin", "Thick"] @@ -146,7 +239,32 @@ class ContainerLayout(SerializableObject): GaugeChartValueFormat = Literal["Percentage", "Fraction"] -CodeLanguage = Literal["Bash", "C", "Cpp", "CSharp", "Css", "Dos", "Go", "Graphql", "Html", "Java", "JavaScript", "Json", "ObjectiveC", "Perl", "Php", "PlainText", "PowerShell", "Python", "Sql", "TypeScript", "VbNet", "Verilog", "Vhdl", "Xml"] +CodeLanguage = Literal[ + "Bash", + "C", + "Cpp", + "CSharp", + "Css", + "Dos", + "Go", + "Graphql", + "Html", + "Java", + "JavaScript", + "Json", + "ObjectiveC", + "Perl", + "Php", + "PlainText", + "PowerShell", + "Python", + "Sql", + "TypeScript", + "VbNet", + "Verilog", + "Vhdl", + "Xml", +] PersonaIconStyle = Literal["profilePicture", "contactCard", "none"] @@ -173,7 +291,7 @@ class ContainerLayout(SerializableObject): class HostCapabilities(SerializableObject): """Represents a list of versioned capabilities a host application must support.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ @@ -181,16 +299,16 @@ def with_key(self, value: str) -> Self: self.key = value return self - + class ThemedUrl(SerializableObject): """Defines a theme-specific URL.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + theme: Optional[ThemeName] = "Light" """ The theme this URL applies to. """ - + url: Optional[str] = None """ The URL to use for the associated theme. """ @@ -206,25 +324,25 @@ def with_url(self, value: str) -> Self: self.url = value return self - + class BackgroundImage(SerializableObject): """Defines a container's background image and the way it should be rendered.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + url: Optional[str] = None """ The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. """ - + fill_mode: Optional[FillMode] = "Cover" """ Controls how the image should fill the area. """ - + horizontal_alignment: Optional[HorizontalAlignment] = "Left" """ Controls how the image should be aligned if it must be cropped or if using repeat fill mode. """ - + vertical_alignment: Optional[VerticalAlignment] = "Top" """ Controls how the image should be aligned if it must be cropped or if using repeat fill mode. """ - + themed_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific image URLs. """ @@ -252,79 +370,84 @@ def with_themed_urls(self, value: List[ThemedUrl]) -> Self: self.themed_urls = value return self - + class SubmitActionData(SerializableObject): - """Represents the data of an Action.Submit.""" - + """Represents the data of an Action.Submit. This model can include arbitrary data""" + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - msteams: Optional[Dict[str, Any]] = None + + ms_teams: Optional[Dict[str, Any]] = None """ Defines the optional Teams-specific portion of the action's data. """ def with_key(self, value: str) -> Self: self.key = value return self - def with_msteams(self, value: Dict[str, Any]) -> Self: - self.msteams = value + def with_ms_teams(self, value: Dict[str, Any]) -> Self: + self.ms_teams = value + return self + + def with_data(self, value: Dict[str, Any]) -> Self: + for k, v in value.items(): + setattr(self, k, v) return self - + class ExecuteAction(Action): """Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can respond synchronously and return an updated Adaptive Card to be displayed by the client. Action.Execute works in all Adaptive Card hosts.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Action.Execute'] = 'Action.Execute' + + type: Literal["Action.Execute"] = "Action.Execute" """ Must be **Action.Execute**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + title: Optional[str] = None """ The title of the action, as it appears on buttons. """ - + icon_url: Optional[str] = None """ 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](topic:icon-catalog) instead of an image. """ - + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - + tooltip: Optional[str] = None """ The tooltip text to display when the action is hovered over. """ - + is_enabled: Optional[bool] = True """ 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. """ - - menu_actions: Optional[List[Action]] = None + + menu_actions: Optional[List[SerializeAsAny[Action]]] = None """ The actions to display in the overflow menu of a Split action button. """ - + themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - + data: Optional[Union[str, SubmitActionData]] = None """ 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. """ - + associated_inputs: Optional[AssociatedInputs] = None """ 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](topic:input-validation) for more details. """ - + conditionally_enabled: Optional[bool] = None """ Controls if the action is enabled only if at least one required input has been filled by the user. """ - + verb: Optional[str] = None """ The verb of the action. """ - - fallback: Optional[Union[Action, FallbackAction]] = None + + fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -391,16 +514,16 @@ def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: self.fallback = value return self - + class RefreshDefinition(SerializableObject): """Defines how a card can be refreshed by making a request to the target Bot.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + action: Optional[ExecuteAction] = None """ The Action.Execute action to invoke to refresh the card. """ - + user_ids: Optional[List[str]] = None """ 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. """ @@ -416,22 +539,22 @@ def with_user_ids(self, value: List[str]) -> Self: self.user_ids = value return self - + class AuthCardButton(SerializableObject): """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).""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + type: Optional[str] = None """ Must be **signin**. """ - + title: Optional[str] = None """ The caption of the button. """ - + image: Optional[str] = None """ A URL to an image to display alongside the button’s caption. """ - + value: Optional[str] = None """ The value associated with the button. The meaning of value depends on the button’s type. """ @@ -455,19 +578,19 @@ def with_value(self, value: str) -> Self: self.value = value return self - + class TokenExchangeResource(SerializableObject): """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)""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + id: Optional[str] = None """ The unique identified of this token exchange instance. """ - + uri: Optional[str] = None """ An application ID or resource identifier with which to exchange a token on behalf of. This property is identity provider- and application-specific. """ - + provider_id: Optional[str] = None """ An identifier for the identity provider with which to attempt a token exchange. """ @@ -487,22 +610,22 @@ def with_provider_id(self, value: str) -> Self: self.provider_id = value return self - + class Authentication(SerializableObject): """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)""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + text: Optional[str] = None """ The text that can be displayed to the end user when prompting them to authenticate. """ - + connection_name: Optional[str] = None """ The identifier for registered OAuth connection setting information. """ - + buttons: Optional[List[AuthCardButton]] = None """ 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. """ - + token_exchange_resource: Optional[TokenExchangeResource] = None """ Provides information required to enable on-behalf-of single sign-on user authentication. """ @@ -526,19 +649,19 @@ def with_token_exchange_resource(self, value: TokenExchangeResource) -> Self: self.token_exchange_resource = value return self - + class MentionedEntity(SerializableObject): """Represents a mentioned person or tag.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + id: Optional[str] = None """ The Id of a person (typically a Microsoft Entra user Id) or tag. """ - + name: Optional[str] = None """ The name of the mentioned entity. """ - + mention_type: Optional[MentionType] = "Person" """ The type of the mentioned entity. """ @@ -558,19 +681,19 @@ def with_mention_type(self, value: MentionType) -> Self: self.mention_type = value return self - + class Mention(SerializableObject): """Represents a mention to a person.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['mention'] = 'mention' + + type: Literal["mention"] = "mention" """ Must be **mention**. """ - + text: Optional[str] = None """ The text that will be substituted with the mention. """ - + mentioned: Optional[MentionedEntity] = None """ Defines the entity being mentioned. """ @@ -586,18 +709,18 @@ def with_mentioned(self, value: MentionedEntity) -> Self: self.mentioned = value return self - + class TeamsCardProperties(SerializableObject): """Represents a set of Teams-specific properties on a card.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + width: Optional[TeamsCardWidth] = None """ 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. """ - + entities: Optional[List[Mention]] = None """ The Teams-specific entities associated with the card. """ @@ -613,13 +736,13 @@ def with_entities(self, value: List[Mention]) -> Self: self.entities = value return self - + class CardMetadata(SerializableObject): """Card-level metadata.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + web_url: Optional[str] = None """ 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. """ @@ -631,16 +754,16 @@ def with_web_url(self, value: str) -> Self: self.web_url = value return self - + class StringResource(SerializableObject): """Defines the replacement string values.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + default_value: Optional[str] = None """ The default value of the string, which is used when no matching localized value is found. """ - + localized_values: Optional[Dict[str, str]] = None """ Localized values of the string, where keys represent the locale (e.g. `en-US`) in the `(-)` format. `` is the 2-letter language code and `` is the optional 2-letter country code. """ @@ -656,13 +779,13 @@ def with_localized_values(self, value: Dict[str, str]) -> Self: self.localized_values = value return self - + class Resources(SerializableObject): """The resources that can be used in the body of the card.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + strings: Optional[Dict[str, StringResource]] = None """ String resources that can provide translations in multiple languages. String resources make it possible to craft cards that are automatically localized according to the language settings of the application that displays the card. """ @@ -674,86 +797,86 @@ def with_strings(self, value: Dict[str, StringResource]) -> Self: self.strings = value return self - + class AdaptiveCard(CardElement): """An Adaptive Card, containing a free-form body of card elements, and an optional set of actions.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['AdaptiveCard'] = 'AdaptiveCard' + + type: Literal["AdaptiveCard"] = "AdaptiveCard" """ Must be **AdaptiveCard**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. """ - + style: Optional[ContainerStyle] = None """ 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. """ - - layouts: Optional[List[ContainerLayout]] = None + + layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None """ 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](topic:container-layouts) for more details. """ - + min_height: Optional[str] = None """ The minimum height, in pixels, of the container, in the `px` format. """ - + background_image: Optional[Union[str, BackgroundImage]] = None """ Defines the container's background image. """ - + vertical_content_alignment: Optional[VerticalAlignment] = None """ Controls how the container's content should be vertically aligned. """ - + rtl: Optional[bool] = None """ Controls if the content of the card is to be rendered left-to-right or right-to-left. """ - + ac_schema: Optional[str] = Field(None, alias="schema") """ A URL to the Adaptive Card schema the card is authored against. """ - + version: Optional[Version] = "1.5" """ The Adaptive Card schema version the card is authored against. """ - + fallback_text: Optional[str] = None """ The text that should be displayed if the client is not able to render the card. """ - + speak: Optional[str] = None """ The text that should be spoken for the entire card. """ - + refresh: Optional[RefreshDefinition] = None """ Defines how the card can be refreshed by making a request to the target Bot. """ - + authentication: Optional[Authentication] = None """ Defines authentication information to enable on-behalf-of single-sign-on or just-in-time OAuth. This information is used in conjunction with the refresh property and Action.Execute in general. """ - - msteams: Optional[TeamsCardProperties] = None + + ms_teams: Optional[TeamsCardProperties] = None """ Teams-specific metadata associated with the card. """ - + metadata: Optional[CardMetadata] = None """ Metadata associated with the card. """ - + resources: Optional[Resources] = None """ Resources card elements can reference. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ - - body: Optional[List[CardElement]] = None + + body: Optional[List[SerializeAsAny[CardElement]]] = None """ The body of the card, comprised of a list of elements displayed according to the layouts property. If the layouts property is not specified, a Layout.Stack is used. """ - - actions: Optional[List[Action]] = None + + actions: Optional[List[SerializeAsAny[Action]]] = None """ The card level actions, which always appear at the bottom of the card. """ def with_key(self, value: str) -> Self: @@ -828,8 +951,8 @@ def with_authentication(self, value: Authentication) -> Self: self.authentication = value return self - def with_msteams(self, value: TeamsCardProperties) -> Self: - self.msteams = value + def with_ms_teams(self, value: TeamsCardProperties) -> Self: + self.ms_teams = value return self def with_metadata(self, value: CardMetadata) -> Self: @@ -856,58 +979,58 @@ def with_actions(self, value: List[Action]) -> Self: self.actions = value return self - + class InsertImageAction(Action): """Inserts an image into the host application's canvas.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Action.InsertImage'] = 'Action.InsertImage' + + type: Literal["Action.InsertImage"] = "Action.InsertImage" """ Must be **Action.InsertImage**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + title: Optional[str] = None """ The title of the action, as it appears on buttons. """ - + icon_url: Optional[str] = None """ 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](topic:icon-catalog) instead of an image. """ - + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - + tooltip: Optional[str] = None """ The tooltip text to display when the action is hovered over. """ - + is_enabled: Optional[bool] = True """ 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. """ - - menu_actions: Optional[List[Action]] = None + + menu_actions: Optional[List[SerializeAsAny[Action]]] = None """ The actions to display in the overflow menu of a Split action button. """ - + themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - + url: Optional[str] = None """ The URL of the image to insert. """ - + alt_text: Optional[str] = None """ The alternate text for the image. """ - + insert_position: Optional[ImageInsertPosition] = "Selection" """ The position at which to insert the image. """ - - fallback: Optional[Union[Action, FallbackAction]] = None + + fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -970,52 +1093,52 @@ def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: self.fallback = value return self - + class OpenUrlAction(Action): """Opens the provided URL in either a separate browser tab or within the host application.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Action.OpenUrl'] = 'Action.OpenUrl' + + type: Literal["Action.OpenUrl"] = "Action.OpenUrl" """ Must be **Action.OpenUrl**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + title: Optional[str] = None """ The title of the action, as it appears on buttons. """ - + icon_url: Optional[str] = None """ 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](topic:icon-catalog) instead of an image. """ - + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - + tooltip: Optional[str] = None """ The tooltip text to display when the action is hovered over. """ - + is_enabled: Optional[bool] = True """ 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. """ - - menu_actions: Optional[List[Action]] = None + + menu_actions: Optional[List[SerializeAsAny[Action]]] = None """ The actions to display in the overflow menu of a Split action button. """ - + themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - + url: Optional[str] = None """ The URL to open. """ - - fallback: Optional[Union[Action, FallbackAction]] = None + + fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1070,61 +1193,61 @@ def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: self.fallback = value return self - + class OpenUrlDialogAction(Action): """Opens a task module in a modal dialog hosting the content at a provided URL.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Action.OpenUrlDialog'] = 'Action.OpenUrlDialog' + + type: Literal["Action.OpenUrlDialog"] = "Action.OpenUrlDialog" """ Must be **Action.OpenUrlDialog**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + title: Optional[str] = None """ The title of the action, as it appears on buttons. """ - + icon_url: Optional[str] = None """ 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](topic:icon-catalog) instead of an image. """ - + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - + tooltip: Optional[str] = None """ The tooltip text to display when the action is hovered over. """ - + is_enabled: Optional[bool] = True """ 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. """ - - menu_actions: Optional[List[Action]] = None + + menu_actions: Optional[List[SerializeAsAny[Action]]] = None """ The actions to display in the overflow menu of a Split action button. """ - + themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - + dialog_title: Optional[str] = None """ The title of the dialog to be displayed in the dialog header. """ - + dialog_height: Optional[str] = None """ The height of the dialog. To define height as a number of pixels, use the px format. """ - + dialog_width: Optional[str] = None """ The width of the dialog. To define width as a number of pixels, use the px format. """ - + url: Optional[str] = None """ The URL to open. """ - - fallback: Optional[Union[Action, FallbackAction]] = None + + fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1191,52 +1314,52 @@ def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: self.fallback = value return self - + class ResetInputsAction(Action): """Resets the values of the inputs in the card.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Action.ResetInputs'] = 'Action.ResetInputs' + + type: Literal["Action.ResetInputs"] = "Action.ResetInputs" """ Must be **Action.ResetInputs**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + title: Optional[str] = None """ The title of the action, as it appears on buttons. """ - + icon_url: Optional[str] = None """ 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](topic:icon-catalog) instead of an image. """ - + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - + tooltip: Optional[str] = None """ The tooltip text to display when the action is hovered over. """ - + is_enabled: Optional[bool] = True """ 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. """ - - menu_actions: Optional[List[Action]] = None + + menu_actions: Optional[List[SerializeAsAny[Action]]] = None """ The actions to display in the overflow menu of a Split action button. """ - + themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - + target_input_ids: Optional[List[str]] = None """ The Ids of the inputs that should be reset. """ - - fallback: Optional[Union[Action, FallbackAction]] = None + + fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1291,13 +1414,13 @@ def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: self.fallback = value return self - + class TeamsSubmitActionFeedback(SerializableObject): """Represents feedback options for an [Action.Submit](https://adaptivecards.microsoft.com/?topic=Action.Submit).""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + hide: Optional[bool] = None """ Defines if a feedback message should be displayed after the action is executed. """ @@ -1309,13 +1432,13 @@ def with_hide(self, value: bool) -> Self: self.hide = value return self - + class TeamsSubmitActionProperties(SerializableObject): """Teams-specific properties associated with the action.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + feedback: Optional[TeamsSubmitActionFeedback] = None """ Defines how feedback is provided to the end-user when the action is executed. """ @@ -1327,61 +1450,61 @@ def with_feedback(self, value: TeamsSubmitActionFeedback) -> Self: self.feedback = value return self - + class SubmitAction(Action): """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.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Action.Submit'] = 'Action.Submit' + + type: Literal["Action.Submit"] = "Action.Submit" """ Must be **Action.Submit**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + title: Optional[str] = None """ The title of the action, as it appears on buttons. """ - + icon_url: Optional[str] = None """ 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](topic:icon-catalog) instead of an image. """ - + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - + tooltip: Optional[str] = None """ The tooltip text to display when the action is hovered over. """ - + is_enabled: Optional[bool] = True """ 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. """ - - menu_actions: Optional[List[Action]] = None + + menu_actions: Optional[List[SerializeAsAny[Action]]] = None """ The actions to display in the overflow menu of a Split action button. """ - + themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - + data: Optional[Union[str, SubmitActionData]] = None """ 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. """ - + associated_inputs: Optional[AssociatedInputs] = None """ 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](topic:input-validation) for more details. """ - + conditionally_enabled: Optional[bool] = None """ Controls if the action is enabled only if at least one required input has been filled by the user. """ - - msteams: Optional[TeamsSubmitActionProperties] = None + + ms_teams: Optional[TeamsSubmitActionProperties] = None """ Teams-specific metadata associated with the action. """ - - fallback: Optional[Union[Action, FallbackAction]] = None + + fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1440,21 +1563,21 @@ def with_conditionally_enabled(self, value: bool) -> Self: self.conditionally_enabled = value return self - def with_msteams(self, value: TeamsSubmitActionProperties) -> Self: - self.msteams = value + def with_ms_teams(self, value: TeamsSubmitActionProperties) -> Self: + self.ms_teams = value return self def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: self.fallback = value return self - + class TargetElement(SerializableObject): """Defines a target element in an Action.ToggleVisibility.""" - + element_id: Optional[str] = None """ The Id of the element to change the visibility of. """ - + is_visible: Optional[bool] = None """ The new visibility state of the element. """ @@ -1466,52 +1589,52 @@ def with_is_visible(self, value: bool) -> Self: self.is_visible = value return self - + class ToggleVisibilityAction(Action): """Toggles the visibility of a set of elements. Action.ToggleVisibility is useful for creating "Show more" type UI patterns.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Action.ToggleVisibility'] = 'Action.ToggleVisibility' + + type: Literal["Action.ToggleVisibility"] = "Action.ToggleVisibility" """ Must be **Action.ToggleVisibility**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + title: Optional[str] = None """ The title of the action, as it appears on buttons. """ - + icon_url: Optional[str] = None """ 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](topic:icon-catalog) instead of an image. """ - + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - + tooltip: Optional[str] = None """ The tooltip text to display when the action is hovered over. """ - + is_enabled: Optional[bool] = True """ 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. """ - - menu_actions: Optional[List[Action]] = None + + menu_actions: Optional[List[SerializeAsAny[Action]]] = None """ The actions to display in the overflow menu of a Split action button. """ - + themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - + target_elements: Optional[Union[List[str], List[TargetElement]]] = None """ The Ids of the elements to toggle the visibility of. """ - - fallback: Optional[Union[Action, FallbackAction]] = None + + fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1566,51 +1689,51 @@ def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: self.fallback = value return self - + class ShowCardAction(Action): """Expands or collapses an embedded card within the main card.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Action.ShowCard'] = 'Action.ShowCard' + + type: Literal["Action.ShowCard"] = "Action.ShowCard" """ Must be **Action.ShowCard**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + title: Optional[str] = None """ The title of the action, as it appears on buttons. """ - + icon_url: Optional[str] = None """ 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](topic:icon-catalog) instead of an image. """ - + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - + tooltip: Optional[str] = None """ The tooltip text to display when the action is hovered over. """ - + is_enabled: Optional[bool] = True """ 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. """ - - menu_actions: Optional[List[Action]] = None + + menu_actions: Optional[List[SerializeAsAny[Action]]] = None """ The actions to display in the overflow menu of a Split action button. """ - + themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - - fallback: Optional[Union[Action, FallbackAction]] = None + + fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None """ 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. """ - + card: Optional[AdaptiveCard] = None """ The card that should be displayed when the action is executed. """ @@ -1666,58 +1789,58 @@ def with_card(self, value: AdaptiveCard) -> Self: self.card = value return self - + class PopoverAction(Action): """Shows a popover to display more information to the user.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Action.Popover'] = 'Action.Popover' + + type: Literal["Action.Popover"] = "Action.Popover" """ Must be **Action.Popover**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + title: Optional[str] = None """ The title of the action, as it appears on buttons. """ - + icon_url: Optional[str] = None """ 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](topic:icon-catalog) instead of an image. """ - + style: Optional[ActionStyle] = "default" """ Control the style of the action, affecting its visual and spoken representations. """ - + mode: Optional[ActionMode] = "primary" """ Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. """ - + tooltip: Optional[str] = None """ The tooltip text to display when the action is hovered over. """ - + is_enabled: Optional[bool] = True """ 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. """ - + themed_icon_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific icon URLs. """ - + content: Optional[CardElement] = None """ The content of the popover, which can be any element. """ - + display_arrow: Optional[bool] = True """ Controls if an arrow should be displayed towards the element that triggered the popover. """ - + position: Optional[PopoverPosition] = "Above" """ Controls where the popover should be displayed with regards to the element that triggered it. """ - + max_popover_width: Optional[str] = None """ The maximum width of the popover in pixels, in the `px` format """ - - fallback: Optional[Union[Action, FallbackAction]] = None + + fallback: Optional[Union[SerializeAsAny[Action], FallbackAction]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -1780,53 +1903,53 @@ def with_fallback(self, value: Union[Action, FallbackAction]) -> Self: self.fallback = value return self - + class ActionSet(CardElement): """Displays a set of action, which can be placed anywhere in the card.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['ActionSet'] = 'ActionSet' + + type: Literal["ActionSet"] = "ActionSet" """ Must be **ActionSet**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ - - actions: Optional[List[Action]] = None + + actions: Optional[List[SerializeAsAny[Action]]] = None """ The actions in the set. """ def with_key(self, value: str) -> Self: @@ -1885,86 +2008,86 @@ def with_actions(self, value: List[Action]) -> Self: self.actions = value return self - + class Container(CardElement): """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.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Container'] = 'Container' + + type: Literal["Container"] = "Container" """ Must be **Container**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. """ - + style: Optional[ContainerStyle] = None """ 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. """ - + show_border: Optional[bool] = None """ Controls if a border should be displayed around the container. """ - + rounded_corners: Optional[bool] = None """ Controls if the container should have rounded corners. """ - - layouts: Optional[List[ContainerLayout]] = None + + layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None """ 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](topic:container-layouts) for more details. """ - + bleed: Optional[bool] = None """ Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. """ - + min_height: Optional[str] = None """ The minimum height, in pixels, of the container, in the `px` format. """ - + background_image: Optional[Union[str, BackgroundImage]] = None """ Defines the container's background image. """ - + vertical_content_alignment: Optional[VerticalAlignment] = None """ Controls how the container's content should be vertically aligned. """ - + rtl: Optional[bool] = None """ Controls if the content of the card is to be rendered left-to-right or right-to-left. """ - + max_height: Optional[str] = None """ 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. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ - - items: Optional[List[CardElement]] = None + + items: Optional[List[SerializeAsAny[CardElement]]] = None """ The elements in the container. """ def with_key(self, value: str) -> Self: @@ -2067,16 +2190,16 @@ def with_items(self, value: List[CardElement]) -> Self: self.items = value return self - + class StackLayout(ContainerLayout): """A layout that stacks elements on top of each other. Layout.Stack is the default layout used by AdaptiveCard and all containers.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Layout.Stack'] = 'Layout.Stack' + + type: Literal["Layout.Stack"] = "Layout.Stack" """ Must be **Layout.Stack**. """ - + target_width: Optional[TargetWidth] = None """ Controls for which card width the layout should be used. """ @@ -2088,40 +2211,40 @@ def with_target_width(self, value: TargetWidth) -> Self: self.target_width = value return self - + class FlowLayout(ContainerLayout): """A layout that spreads elements horizontally and wraps them across multiple rows, as needed.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Layout.Flow'] = 'Layout.Flow' + + type: Literal["Layout.Flow"] = "Layout.Flow" """ Must be **Layout.Flow**. """ - + target_width: Optional[TargetWidth] = None """ Controls for which card width the layout should be used. """ - + horizontal_items_alignment: Optional[HorizontalAlignment] = "Center" """ Controls how the content of the container should be horizontally aligned. """ - + vertical_items_alignment: Optional[VerticalAlignment] = "Top" """ Controls how the content of the container should be vertically aligned. """ - + item_fit: Optional[FlowLayoutItemFit] = "Fit" """ Controls how item should fit inside the container. """ - + min_item_width: Optional[str] = None """ The minimum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. """ - + max_item_width: Optional[str] = None """ The maximum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. """ - + item_width: Optional[str] = None """ The width, in pixels, of each item, in the `px` format. Should not be used if maxItemWidth and/or minItemWidth are set. """ - + column_spacing: Optional[Spacing] = "Default" """ The space between items. """ - + row_spacing: Optional[Spacing] = "Default" """ The space between rows of items. """ @@ -2165,25 +2288,25 @@ def with_row_spacing(self, value: Spacing) -> Self: self.row_spacing = value return self - + class GridArea(SerializableObject): """Defines an area in a Layout.AreaGrid layout.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + name: Optional[str] = None """ The name of the area. To place an element in this area, set its `grid.area` property to match the name of the area. """ - + column: Optional[float] = 1 """ The start column index of the area. Column indices start at 1. """ - + column_span: Optional[float] = 1 """ Defines how many columns the area should span. """ - + row: Optional[float] = 1 """ The start row index of the area. Row indices start at 1. """ - + row_span: Optional[float] = 1 """ Defines how many rows the area should span. """ @@ -2211,28 +2334,28 @@ def with_row_span(self, value: float) -> Self: self.row_span = value return self - + class AreaGridLayout(ContainerLayout): """A layout that divides a container into named areas into which elements can be placed.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Layout.AreaGrid'] = 'Layout.AreaGrid' + + type: Literal["Layout.AreaGrid"] = "Layout.AreaGrid" """ Must be **Layout.AreaGrid**. """ - + target_width: Optional[TargetWidth] = None """ Controls for which card width the layout should be used. """ - + columns: Optional[Union[List[float], List[str]]] = None """ The columns in the grid layout, defined as a percentage of the available width or in pixels using the `px` format. """ - + areas: Optional[List[GridArea]] = None """ The areas in the grid layout. """ - + column_spacing: Optional[Spacing] = "Default" """ The space between columns. """ - + row_spacing: Optional[Spacing] = "Default" """ The space between rows. """ @@ -2260,89 +2383,89 @@ def with_row_spacing(self, value: Spacing) -> Self: self.row_spacing = value return self - + class Column(CardElement): """A column in a ColumnSet element.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Column'] = 'Column' + + type: Literal["Column"] = "Column" """ Optional. If specified, must be **Column**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. """ - + style: Optional[ContainerStyle] = None """ 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. """ - + show_border: Optional[bool] = None """ Controls if a border should be displayed around the container. """ - + rounded_corners: Optional[bool] = None """ Controls if the container should have rounded corners. """ - - layouts: Optional[List[ContainerLayout]] = None + + layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None """ 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](topic:container-layouts) for more details. """ - + bleed: Optional[bool] = None """ Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. """ - + min_height: Optional[str] = None """ The minimum height, in pixels, of the container, in the `px` format. """ - + background_image: Optional[Union[str, BackgroundImage]] = None """ Defines the container's background image. """ - + vertical_content_alignment: Optional[VerticalAlignment] = None """ Controls how the container's content should be vertically aligned. """ - + rtl: Optional[bool] = None """ Controls if the content of the card is to be rendered left-to-right or right-to-left. """ - + max_height: Optional[str] = None """ 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. """ - + width: Optional[Union[str, float]] = None """ The width of the column. If expressed as a number, represents the relative weight of the column in the set. If expressed as a string, `auto` will automatically adjust the column's width according to its content, `stretch` will make the column use the remaining horizontal space (shared with other columns with width set to `stretch`) and using the `px` format will give the column an explicit width in pixels. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ - - items: Optional[List[CardElement]] = None + + items: Optional[List[SerializeAsAny[CardElement]]] = None """ The elements in the column. """ def with_key(self, value: str) -> Self: @@ -2449,73 +2572,73 @@ def with_items(self, value: List[CardElement]) -> Self: self.items = value return self - + class ColumnSet(CardElement): """Splits the available horizontal space into separate columns, so elements can be organized in a row.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['ColumnSet'] = 'ColumnSet' + + type: Literal["ColumnSet"] = "ColumnSet" """ Must be **ColumnSet**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. """ - + style: Optional[ContainerStyle] = None """ 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. """ - + show_border: Optional[bool] = None """ Controls if a border should be displayed around the container. """ - + rounded_corners: Optional[bool] = None """ Controls if the container should have rounded corners. """ - + bleed: Optional[bool] = None """ Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. """ - + min_height: Optional[str] = None """ The minimum height, in pixels, of the container, in the `px` format. """ - + min_width: Optional[str] = None """ 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. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ - + columns: Optional[List[Column]] = None """ The columns in the set. """ @@ -2603,16 +2726,16 @@ def with_columns(self, value: List[Column]) -> Self: self.columns = value return self - + class MediaSource(SerializableObject): """Defines the source URL of a media stream. YouTube, Dailymotion, Vimeo and Microsoft Stream URLs are supported.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + mime_type: Optional[str] = None """ The MIME type of the source. """ - + url: Optional[str] = None """ The URL of the source. """ @@ -2628,19 +2751,19 @@ def with_url(self, value: str) -> Self: self.url = value return self - + class CaptionSource(SerializableObject): """Defines a source URL for a video captions.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + mime_type: Optional[str] = None """ The MIME type of the source. """ - + url: Optional[str] = None """ The URL of the source. """ - + label: Optional[str] = None """ The label of this caption source. """ @@ -2660,59 +2783,59 @@ def with_label(self, value: str) -> Self: self.label = value return self - + class Media(CardElement): """A media element, that makes it possible to embed videos inside a card.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Media'] = 'Media' + + type: Literal["Media"] = "Media" """ Must be **Media**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + sources: Optional[List[MediaSource]] = None """ The sources for the media. For YouTube, Dailymotion and Vimeo, only one source can be specified. """ - + caption_sources: Optional[List[CaptionSource]] = None """ The caption sources for the media. Caption sources are not used for YouTube, Dailymotion or Vimeo sources. """ - + poster: Optional[str] = None """ The URL of the poster image to display. """ - + alt_text: Optional[str] = None """ The alternate text for the media, used for accessibility purposes. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -2779,56 +2902,56 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class RichTextBlock(CardElement): """A rich text block that displays formatted text.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['RichTextBlock'] = 'RichTextBlock' + + type: Literal["RichTextBlock"] = "RichTextBlock" """ Must be **RichTextBlock**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + label_for: Optional[str] = None """ The Id of the input the RichTextBlock should act as the label of. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ - - inlines: Optional[Union[List[CardElement], List[str]]] = None + + inlines: Optional[Union[List[SerializeAsAny[CardElement]], List[str]]] = None """ The inlines making up the rich text block. """ def with_key(self, value: str) -> Self: @@ -2891,19 +3014,19 @@ def with_inlines(self, value: Union[List[CardElement], List[str]]) -> Self: self.inlines = value return self - + class ColumnDefinition(SerializableObject): """Defines a column in a Table element.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + horizontal_cell_content_alignment: Optional[HorizontalAlignment] = None """ 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. """ - + vertical_cell_content_alignment: Optional[VerticalAlignment] = None """ 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. """ - + width: Optional[Union[str, float]] = None """ 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. """ @@ -2923,77 +3046,77 @@ def with_width(self, value: Union[str, float]) -> Self: self.width = value return self - + class TableCell(CardElement): """Represents a cell in a table row.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['TableCell'] = 'TableCell' + + type: Literal["TableCell"] = "TableCell" """ Must be **TableCell**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. """ - + style: Optional[ContainerStyle] = None """ 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. """ - - layouts: Optional[List[ContainerLayout]] = None + + layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None """ 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](topic:container-layouts) for more details. """ - + bleed: Optional[bool] = None """ Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. """ - + min_height: Optional[str] = None """ The minimum height, in pixels, of the container, in the `px` format. """ - + background_image: Optional[Union[str, BackgroundImage]] = None """ Defines the container's background image. """ - + vertical_content_alignment: Optional[VerticalAlignment] = None """ Controls how the container's content should be vertically aligned. """ - + rtl: Optional[bool] = None """ Controls if the content of the card is to be rendered left-to-right or right-to-left. """ - + max_height: Optional[str] = None """ 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. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ - - items: Optional[List[CardElement]] = None + + items: Optional[List[SerializeAsAny[CardElement]]] = None """ The items (elements) in the cell. """ def with_key(self, value: str) -> Self: @@ -3084,67 +3207,67 @@ def with_items(self, value: List[CardElement]) -> Self: self.items = value return self - + class TableRow(CardElement): """Represents a row of cells in a table.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['TableRow'] = 'TableRow' + + type: Literal["TableRow"] = "TableRow" """ Must be **TableRow**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + show_border: Optional[bool] = None """ Controls if a border should be displayed around the container. """ - + rounded_corners: Optional[bool] = None """ Controls if the container should have rounded corners. """ - + style: Optional[ContainerStyle] = None """ 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. """ - + horizontal_cell_content_alignment: Optional[HorizontalAlignment] = None """ Controls how the content of every cell in the row should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table and columns. """ - + vertical_cell_content_alignment: Optional[VerticalAlignment] = None """ Controls how the content of every cell in the row should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table and columns. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ - + cells: Optional[List[TableCell]] = None """ The cells in the row. """ @@ -3224,82 +3347,82 @@ def with_cells(self, value: List[TableCell]) -> Self: self.cells = value return self - + class Table(CardElement): """Use tables to display data in a tabular way, with rows, columns and cells.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Table'] = 'Table' + + type: Literal["Table"] = "Table" """ Must be **Table**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + style: Optional[ContainerStyle] = None """ 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. """ - + show_border: Optional[bool] = None """ Controls if a border should be displayed around the container. """ - + rounded_corners: Optional[bool] = None """ Controls if the container should have rounded corners. """ - + columns: Optional[List[ColumnDefinition]] = None """ The columns in the table. """ - + min_width: Optional[str] = None """ 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. """ - + first_row_as_headers: Optional[bool] = True """ Controls whether the first row of the table should be treated as a header. """ - + show_grid_lines: Optional[bool] = True """ Controls if grid lines should be displayed. """ - + grid_style: Optional[ContainerStyle] = None """ The style of the grid lines between cells. """ - + horizontal_cell_content_alignment: Optional[HorizontalAlignment] = None """ Controls how the content of every cell in the table should be horizontally aligned by default. """ - + vertical_cell_content_alignment: Optional[VerticalAlignment] = None """ Controls how the content of every cell in the table should be vertically aligned by default. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ - + rows: Optional[List[TableRow]] = None """ The rows of the table. """ @@ -3399,80 +3522,80 @@ def with_rows(self, value: List[TableRow]) -> Self: self.rows = value return self - + class TextBlock(CardElement): """A block of text, optionally formatted using Markdown.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['TextBlock'] = 'TextBlock' + + type: Literal["TextBlock"] = "TextBlock" """ Must be **TextBlock**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + text: Optional[str] = None """ The text to display. A subset of markdown is supported. """ - + size: Optional[TextSize] = None """ The size of the text. """ - + weight: Optional[TextWeight] = None """ The weight of the text. """ - + color: Optional[TextColor] = None """ The color of the text. """ - + is_subtle: Optional[bool] = None """ Controls whether the text should be renderer using a subtler variant of the select color. """ - + font_type: Optional[FontType] = None """ The type of font to use for rendering. """ - + wrap: Optional[bool] = None """ Controls if the text should wrap. """ - + max_lines: Optional[float] = None """ The maximum number of lines to display. """ - + style: Optional[TextBlockStyle] = None """ The style of the text. """ - + label_for: Optional[str] = None """ The Id of the input the TextBlock should act as the label of. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -3567,16 +3690,16 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class Fact(SerializableObject): """A fact in a FactSet element.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + title: Optional[str] = None """ The fact's title. """ - + value: Optional[str] = None """ The fact's value. """ @@ -3592,50 +3715,50 @@ def with_value(self, value: str) -> Self: self.value = value return self - + class FactSet(CardElement): """A set of facts, displayed as a table or a vertical list when horizontal space is constrained.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['FactSet'] = 'FactSet' + + type: Literal["FactSet"] = "FactSet" """ Must be **FactSet**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + facts: Optional[List[Fact]] = None """ The facts in the set. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -3690,13 +3813,13 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class TeamsImageProperties(SerializableObject): """Represents a set of Teams-specific properties on an image.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + allow_expand: Optional[bool] = None """ Controls if the image is expandable in Teams. This property is equivalent to the Image.allowExpand property. """ @@ -3708,89 +3831,89 @@ def with_allow_expand(self, value: bool) -> Self: self.allow_expand = value return self - + class Image(CardElement): """A standalone image element.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Image'] = 'Image' + + type: Literal["Image"] = "Image" """ Must be **Image**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + url: Optional[str] = None """ The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. """ - + alt_text: Optional[str] = None """ The alternate text for the image, used for accessibility purposes. """ - + background_color: Optional[str] = None """ The background color of the image. """ - + style: Optional[ImageStyle] = "Default" """ The style of the image. """ - + size: Optional[Size] = "Auto" """ The size of the image. """ - + width: Optional[str] = "auto" """ The width of the image. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. """ - + allow_expand: Optional[bool] = None """ Controls if the image can be expanded to full screen. """ - - msteams: Optional[TeamsImageProperties] = None + + ms_teams: Optional[TeamsImageProperties] = None """ Teams-specific metadata associated with the image. """ - + themed_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific image URLs. """ - + fit_mode: Optional[ImageFitMode] = "Fill" """ 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. """ - + horizontal_content_alignment: Optional[HorizontalAlignment] = "Left" """ 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. """ - + vertical_content_alignment: Optional[VerticalAlignment] = "Top" """ 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. """ - + height: Optional[str] = "auto" """ The height of the image. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -3865,8 +3988,8 @@ def with_allow_expand(self, value: bool) -> Self: self.allow_expand = value return self - def with_msteams(self, value: TeamsImageProperties) -> Self: - self.msteams = value + def with_ms_teams(self, value: TeamsImageProperties) -> Self: + self.ms_teams = value return self def with_themed_urls(self, value: List[ThemedUrl]) -> Self: @@ -3897,56 +4020,56 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class ImageSet(CardElement): """A set of images, displayed side-by-side and wrapped across multiple rows as needed.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['ImageSet'] = 'ImageSet' + + type: Literal["ImageSet"] = "ImageSet" """ Must be **ImageSet**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + images: Optional[List[Image]] = None """ The images in the set. """ - + image_size: Optional[ImageSize] = "Medium" """ The size to use to render all images in the set. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -4009,82 +4132,82 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class TextInput(CardElement): """An input to allow the user to enter text.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Input.Text'] = 'Input.Text' + + type: Literal["Input.Text"] = "Input.Text" """ Must be **Input.Text**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + label: Optional[str] = None """ The label of the input. A label should **always** be provided to ensure the best user experience especially for users of assistive technology. """ - + is_required: Optional[bool] = None """ Controls whether the input is required. See [Input validation](topic:input-validation) for more details. """ - + error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ - + value: Optional[str] = None """ The default value of the input. """ - + max_length: Optional[float] = None """ The maximum length of the text in the input. """ - + is_multiline: Optional[bool] = None """ Controls if the input should allow multiple lines of text. """ - + placeholder: Optional[str] = None """ The text to display as a placeholder when the user hasn't entered a value. """ - + style: Optional[InputTextStyle] = "Text" """ The style of the input. """ - + inline_action: Optional[Action] = None """ The action that should be displayed as a button alongside the input. Action.ShowCard is not supported. """ - + regex: Optional[str] = None """ The regular expression to validate the input. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -4179,73 +4302,73 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class DateInput(CardElement): """An input to allow the user to select a date.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Input.Date'] = 'Input.Date' + + type: Literal["Input.Date"] = "Input.Date" """ Must be **Input.Date**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + label: Optional[str] = None """ The label of the input. A label should **always** be provided to ensure the best user experience especially for users of assistive technology. """ - + is_required: Optional[bool] = None """ Controls whether the input is required. See [Input validation](topic:input-validation) for more details. """ - + error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ - + value: Optional[str] = None """ The default value of the input, in the `YYYY-MM-DD` format. """ - + placeholder: Optional[str] = None """ The text to display as a placeholder when the user has not selected a date. """ - + min: Optional[str] = None """ The minimum date that can be selected. """ - + max: Optional[str] = None """ The maximum date that can be selected. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -4328,73 +4451,73 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class TimeInput(CardElement): """An input to allow the user to select a time.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Input.Time'] = 'Input.Time' + + type: Literal["Input.Time"] = "Input.Time" """ Must be **Input.Time**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + label: Optional[str] = None """ The label of the input. A label should **always** be provided to ensure the best user experience especially for users of assistive technology. """ - + is_required: Optional[bool] = None """ Controls whether the input is required. See [Input validation](topic:input-validation) for more details. """ - + error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ - + value: Optional[str] = None """ The default value of the input, in the `HH:MM` format. """ - + placeholder: Optional[str] = None """ The text to display as a placeholder when the user hasn't entered a value. """ - + min: Optional[str] = None """ The minimum time that can be selected, in the `HH:MM` format. """ - + max: Optional[str] = None """ The maximum time that can be selected, in the `HH:MM` format. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -4477,73 +4600,73 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class NumberInput(CardElement): """An input to allow the user to enter a number.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Input.Number'] = 'Input.Number' + + type: Literal["Input.Number"] = "Input.Number" """ Must be **Input.Number**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + label: Optional[str] = None """ The label of the input. A label should **always** be provided to ensure the best user experience especially for users of assistive technology. """ - + is_required: Optional[bool] = None """ Controls whether the input is required. See [Input validation](topic:input-validation) for more details. """ - + error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ - + value: Optional[float] = None """ The default value of the input. """ - + placeholder: Optional[str] = None """ The text to display as a placeholder when the user hasn't entered a value. """ - + min: Optional[float] = None """ The minimum value that can be entered. """ - + max: Optional[float] = None """ The maximum value that can be entered. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -4626,79 +4749,79 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class ToggleInput(CardElement): """An input to allow the user to select between on/off states.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Input.Toggle'] = 'Input.Toggle' + + type: Literal["Input.Toggle"] = "Input.Toggle" """ Must be **Input.Toggle**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + label: Optional[str] = None """ The label of the input. A label should **always** be provided to ensure the best user experience especially for users of assistive technology. """ - + is_required: Optional[bool] = None """ Controls whether the input is required. See [Input validation](topic:input-validation) for more details. """ - + error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ - + value: Optional[str] = "false" """ The default value of the input. """ - + title: Optional[str] = None """ The title (caption) to display next to the toggle. """ - + value_on: Optional[str] = "true" """ The value to send to the Bot when the toggle is on. """ - + value_off: Optional[str] = "false" """ The value to send to the Bot when the toggle is off. """ - + wrap: Optional[bool] = True """ Controls if the title should wrap. """ - + show_title: Optional[bool] = True """ Controls whether the title is visually displayed. When set to false, the title is hidden from view but remains accessible to screen readers for accessibility purposes. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -4789,16 +4912,16 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class Choice(SerializableObject): """A choice as used by the Input.ChoiceSet input.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + title: Optional[str] = None """ The text to display for the choice. """ - + value: Optional[str] = None """ The value associated with the choice, as sent to the Bot when an Action.Submit or Action.Execute is invoked """ @@ -4814,25 +4937,25 @@ def with_value(self, value: str) -> Self: self.value = value return self - + class QueryData(SerializableObject): """Defines a query to dynamically fetch data from a Bot.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Data.Query'] = 'Data.Query' + + type: Literal["Data.Query"] = "Data.Query" """ Must be **Data.Query**. """ - + dataset: Optional[str] = None """ The dataset from which to fetch the data. """ - + associated_inputs: Optional[AssociatedInputs] = None """ Controls which inputs are associated with the Data.Query. When a Data.Query is executed, the values of the associated inputs are sent to the Bot, allowing it to perform filtering operations based on the user's input. """ - + count: Optional[float] = None """ The maximum number of data items that should be returned by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. """ - + skip: Optional[float] = None """ The number of data items to be skipped by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. """ @@ -4856,88 +4979,88 @@ def with_skip(self, value: float) -> Self: self.skip = value return self - + class ChoiceSetInput(CardElement): """An input to allow the user to select one or more values.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Input.ChoiceSet'] = 'Input.ChoiceSet' + + type: Literal["Input.ChoiceSet"] = "Input.ChoiceSet" """ Must be **Input.ChoiceSet**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + label: Optional[str] = None """ The label of the input. A label should **always** be provided to ensure the best user experience especially for users of assistive technology. """ - + is_required: Optional[bool] = None """ Controls whether the input is required. See [Input validation](topic:input-validation) for more details. """ - + error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ - + value: Optional[str] = None """ The default value of the input. """ - + choices: Optional[List[Choice]] = None """ The choices associated with the input. """ - + choices_data: Optional[QueryData] = None """ A Data.Query object that defines the dataset from which to dynamically fetch the choices for the input. """ - + style: Optional[ChoiceSetInputStyle] = "compact" """ Controls whether the input should be displayed as a dropdown (compact) or a list of radio buttons or checkboxes (expanded). """ - + is_multi_select: Optional[bool] = None """ Controls whether multiple choices can be selected. """ - + placeholder: Optional[str] = None """ The text to display as a placeholder when the user has not entered any value. """ - + wrap: Optional[bool] = True """ Controls if choice titles should wrap. """ - + use_multiple_columns: Optional[bool] = None """ Controls whether choice items are arranged in multiple columns in expanded mode, or in a single column. Default is false. """ - + min_column_width: Optional[str] = None """ The minimum width, in pixels, for each column when using a multi-column layout. This ensures that choice items remain readable even when horizontal space is limited. Default is 100 pixels. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -5040,76 +5163,76 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class RatingInput(CardElement): """An input to allow the user to rate something using stars.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Input.Rating'] = 'Input.Rating' + + type: Literal["Input.Rating"] = "Input.Rating" """ Must be **Input.Rating**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + label: Optional[str] = None """ The label of the input. A label should **always** be provided to ensure the best user experience especially for users of assistive technology. """ - + is_required: Optional[bool] = None """ Controls whether the input is required. See [Input validation](topic:input-validation) for more details. """ - + error_message: Optional[str] = None """ The error message to display when the input fails validation. See [Input validation](topic:input-validation) for more details. """ - + value_changed_action: Optional[Action] = None """ An Action.ResetInputs action that will be executed when the value of the input changes. """ - + value: Optional[float] = None """ The default value of the input. """ - + max: Optional[float] = 5 """ The number of stars to display. """ - + allow_half_steps: Optional[bool] = None """ Controls if the user can select half stars. """ - + size: Optional[RatingSize] = "Large" """ The size of the stars. """ - + color: Optional[RatingColor] = "Neutral" """ The color of the stars. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -5196,68 +5319,68 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class Rating(CardElement): """A read-only star rating element, to display the rating of something.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Rating'] = 'Rating' + + type: Literal["Rating"] = "Rating" """ Must be **Rating**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + value: Optional[float] = None """ The value of the rating. Must be between 0 and max. """ - + count: Optional[float] = None """ The number of "votes" associated with the rating. """ - + max: Optional[float] = 5 """ The number of stars to display. """ - + size: Optional[RatingSize] = "Large" """ The size of the stars. """ - + color: Optional[RatingColor] = "Neutral" """ The color of the stars. """ - + style: Optional[RatingStyle] = "Default" """ The style of the stars. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -5336,22 +5459,22 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class IconInfo(SerializableObject): """Defines information about a Fluent icon and how it should be rendered.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + name: Optional[str] = None """ The name of the icon to display. """ - + size: Optional[IconSize] = "xSmall" """ The size of the icon. """ - + style: Optional[IconStyle] = "Regular" """ The style of the icon. """ - + color: Optional[TextColor] = "Default" """ The color of the icon. """ @@ -5375,65 +5498,65 @@ def with_color(self, value: TextColor) -> Self: self.color = value return self - + class CompoundButton(CardElement): """A special type of button with an icon, title and description.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['CompoundButton'] = 'CompoundButton' + + type: Literal["CompoundButton"] = "CompoundButton" """ Must be **CompoundButton**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + icon: Optional[IconInfo] = None """ The icon to show on the button. """ - + badge: Optional[str] = None """ The badge to show on the button. """ - + title: Optional[str] = None """ The title of the button. """ - + description: Optional[str] = None """ The description text of the button. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the button is tapped or clicked. Action.ShowCard is not supported. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -5508,62 +5631,62 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class Icon(CardElement): """A standalone icon element. Icons can be picked from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog).""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Icon'] = 'Icon' + + type: Literal["Icon"] = "Icon" """ Must be **Icon**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + name: Optional[str] = None """ The name of the icon to display. """ - + size: Optional[IconSize] = "Standard" """ The size of the icon. """ - + style: Optional[IconStyle] = "Regular" """ The style of the icon. """ - + color: Optional[TextColor] = "Default" """ The color of the icon. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the icon is tapped or clicked. Action.ShowCard is not supported. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -5634,74 +5757,74 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class CarouselPage(CardElement): """A page inside a Carousel element.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['CarouselPage'] = 'CarouselPage' + + type: Literal["CarouselPage"] = "CarouselPage" """ Must be **CarouselPage**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. """ - + style: Optional[ContainerStyle] = None """ 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. """ - + show_border: Optional[bool] = None """ Controls if a border should be displayed around the container. """ - + rounded_corners: Optional[bool] = None """ Controls if the container should have rounded corners. """ - - layouts: Optional[List[ContainerLayout]] = None + + layouts: Optional[List[SerializeAsAny[ContainerLayout]]] = None """ 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](topic:container-layouts) for more details. """ - + min_height: Optional[str] = None """ The minimum height, in pixels, of the container, in the `px` format. """ - + background_image: Optional[Union[str, BackgroundImage]] = None """ Defines the container's background image. """ - + vertical_content_alignment: Optional[VerticalAlignment] = None """ Controls how the container's content should be vertically aligned. """ - + rtl: Optional[bool] = None """ Controls if the content of the card is to be rendered left-to-right or right-to-left. """ - + max_height: Optional[str] = None """ 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. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ - - items: Optional[List[CardElement]] = None + + items: Optional[List[SerializeAsAny[CardElement]]] = None """ The elements in the page. """ def with_key(self, value: str) -> Self: @@ -5788,58 +5911,58 @@ def with_items(self, value: List[CardElement]) -> Self: self.items = value return self - + class Carousel(CardElement): """A carousel with sliding pages.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Carousel'] = 'Carousel' + + type: Literal["Carousel"] = "Carousel" """ Must be **Carousel**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + bleed: Optional[bool] = None """ Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. """ - + min_height: Optional[str] = None """ The minimum height, in pixels, of the container, in the `px` format. """ - + page_animation: Optional[CarouselPageAnimation] = "Slide" """ Controls the type of animation to use to navigate between pages. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ - + pages: Optional[List[CarouselPage]] = None """ The pages in the carousel. """ @@ -5907,74 +6030,74 @@ def with_pages(self, value: List[CarouselPage]) -> Self: self.pages = value return self - + class Badge(CardElement): """A badge element to show an icon and/or text in a compact form over a colored background.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Badge'] = 'Badge' + + type: Literal["Badge"] = "Badge" """ Must be **Badge**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + text: Optional[str] = None """ The text to display. """ - + icon: Optional[str] = None """ The name of an icon from the [Adaptive Card icon catalog](topic:icon-catalog) to display, in the `[,regular|filled]` format. If the style is not specified, the regular style is used. """ - + icon_position: Optional[BadgeIconPosition] = "Before" """ Controls the position of the icon. """ - + appearance: Optional[BadgeAppearance] = "Filled" """ Controls the strength of the background color. """ - + size: Optional[BadgeSize] = "Medium" """ The size of the badge. """ - + shape: Optional[BadgeShape] = "Circular" """ Controls the shape of the badge. """ - + style: Optional[BadgeStyle] = "Default" """ The style of the badge. """ - + tooltip: Optional[str] = None """ Controls the tooltip text to display when the badge is hovered over. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -6061,59 +6184,59 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class ProgressRing(CardElement): """A spinning ring element, to indicate progress.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['ProgressRing'] = 'ProgressRing' + + type: Literal["ProgressRing"] = "ProgressRing" """ Must be **ProgressRing**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + label: Optional[str] = None """ The label of the progress ring. """ - + label_position: Optional[ProgressRingLabelPosition] = "Below" """ Controls the relative position of the label to the progress ring. """ - + size: Optional[ProgressRingSize] = "Medium" """ The size of the progress ring. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -6180,59 +6303,59 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class ProgressBar(CardElement): """A progress bar element, to represent a value within a range.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['ProgressBar'] = 'ProgressBar' + + type: Literal["ProgressBar"] = "ProgressBar" """ Must be **ProgressBar**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + value: Optional[float] = None """ The value of the progress bar. Must be between 0 and max. """ - + max: Optional[float] = 100 """ The maximum value of the progress bar. """ - + color: Optional[ProgressBarColor] = "Accent" """ The color of the progress bar. `color` has no effect when the `ProgressBar` is in indeterminate mode, in which case the "accent" color is always used. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -6299,19 +6422,19 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class DonutChartData(SerializableObject): """A data point in a Donut chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + legend: Optional[str] = None """ The legend of the chart. """ - + value: Optional[float] = None """ The value associated with the data point. """ - + color: Optional[ChartColor] = None """ The color to use for the data point. See [Chart colors reference](topic:chart-colors-reference). """ @@ -6331,80 +6454,80 @@ def with_color(self, value: ChartColor) -> Self: self.color = value return self - + class DonutChart(CardElement): """A donut chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Chart.Donut'] = 'Chart.Donut' + + type: Literal["Chart.Donut"] = "Chart.Donut" """ Must be **Chart.Donut**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + title: Optional[str] = None """ The title of the chart. """ - + show_title: Optional[bool] = None """ Controls whether the chart's title should be displayed. Defaults to `false`. """ - + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ - + max_width: Optional[str] = None """ The maximum width, in pixels, of the chart, in the `px` format. """ - + show_legend: Optional[bool] = True """ Controls whether the chart's legend should be displayed. """ - + data: Optional[List[DonutChartData]] = None """ The data to display in the chart. """ - + value: Optional[str] = None """ The value that should be displayed in the center of a Donut chart. `value` is ignored for Pie charts. """ - + value_color: Optional[ChartColor] = None """ Controls the color of the value displayed in the center of a Donut chart. """ - + thickness: Optional[DonutThickness] = None """ Controls the thickness of the donut segments. Default is **Thick**. """ - + show_outlines: Optional[bool] = True """ Controls whether the outlines of the donut segments are displayed. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -6499,80 +6622,80 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class PieChart(CardElement): """A pie chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Chart.Pie'] = 'Chart.Pie' + + type: Literal["Chart.Pie"] = "Chart.Pie" """ Must be **Chart.Pie**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + title: Optional[str] = None """ The title of the chart. """ - + show_title: Optional[bool] = None """ Controls whether the chart's title should be displayed. Defaults to `false`. """ - + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ - + max_width: Optional[str] = None """ The maximum width, in pixels, of the chart, in the `px` format. """ - + show_legend: Optional[bool] = True """ Controls whether the chart's legend should be displayed. """ - + data: Optional[List[DonutChartData]] = None """ The data to display in the chart. """ - + value: Optional[str] = None """ The value that should be displayed in the center of a Donut chart. `value` is ignored for Pie charts. """ - + value_color: Optional[ChartColor] = None """ Controls the color of the value displayed in the center of a Donut chart. """ - + thickness: Optional[DonutThickness] = None """ Controls the thickness of the donut segments. Default is **Thick**. """ - + show_outlines: Optional[bool] = True """ Controls whether the outlines of the donut segments are displayed. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -6667,16 +6790,16 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class BarChartDataValue(SerializableObject): """A single data point in a bar chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + x: Optional[str] = None """ The x axis value of the data point. """ - + y: Optional[float] = None """ The y axis value of the data point. """ @@ -6692,19 +6815,19 @@ def with_y(self, value: float) -> Self: self.y = value return self - + class GroupedVerticalBarChartData(SerializableObject): """Represents a series of data points.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + legend: Optional[str] = None """ The legend of the chart. """ - + values: Optional[List[BarChartDataValue]] = None """ The data points in the series. """ - + color: Optional[ChartColor] = None """ The color to use for all data points in the series. See [Chart colors reference](topic:chart-colors-reference). """ @@ -6724,95 +6847,95 @@ def with_color(self, value: ChartColor) -> Self: self.color = value return self - + class GroupedVerticalBarChart(CardElement): """A grouped vertical bar chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Chart.VerticalBar.Grouped'] = 'Chart.VerticalBar.Grouped' + + type: Literal["Chart.VerticalBar.Grouped"] = "Chart.VerticalBar.Grouped" """ Must be **Chart.VerticalBar.Grouped**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + title: Optional[str] = None """ The title of the chart. """ - + show_title: Optional[bool] = None """ Controls whether the chart's title should be displayed. Defaults to `false`. """ - + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ - + max_width: Optional[str] = None """ The maximum width, in pixels, of the chart, in the `px` format. """ - + show_legend: Optional[bool] = True """ Controls whether the chart's legend should be displayed. """ - + x_axis_title: Optional[str] = None """ The title of the x axis. """ - + y_axis_title: Optional[str] = None """ The title of the y axis. """ - + color: Optional[ChartColor] = None """ The color to use for all data points. See [Chart colors reference](topic:chart-colors-reference). """ - + stacked: Optional[bool] = None """ Controls if bars in the chart should be displayed as stacks instead of groups. **Note:** stacked vertical bar charts do not support custom Y ranges nor negative Y values. """ - + data: Optional[List[GroupedVerticalBarChartData]] = None """ The data points in a series. """ - + show_bar_values: Optional[bool] = None """ Controls if values should be displayed on each bar. """ - + y_min: Optional[float] = None """ The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation. `yMin` is ignored if `stacked` is set to `true`. """ - + y_max: Optional[float] = None """ The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation. `yMax` is ignored if `stacked` is set to `true`. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -6919,19 +7042,19 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class VerticalBarChartDataValue(SerializableObject): """Represents a data point in a vertical bar chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + x: Optional[Union[str, float]] = None """ The x axis value of the data point. """ - + y: Optional[float] = None """ The y axis value of the data point. """ - + color: Optional[ChartColor] = None """ The color to use for the bar associated with the data point. See [Chart colors reference](topic:chart-colors-reference). """ @@ -6951,86 +7074,86 @@ def with_color(self, value: ChartColor) -> Self: self.color = value return self - + class VerticalBarChart(CardElement): """A vertical bar chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Chart.VerticalBar'] = 'Chart.VerticalBar' + + type: Literal["Chart.VerticalBar"] = "Chart.VerticalBar" """ Must be **Chart.VerticalBar**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + title: Optional[str] = None """ The title of the chart. """ - + show_title: Optional[bool] = None """ Controls whether the chart's title should be displayed. Defaults to `false`. """ - + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ - + max_width: Optional[str] = None """ The maximum width, in pixels, of the chart, in the `px` format. """ - + show_legend: Optional[bool] = True """ Controls whether the chart's legend should be displayed. """ - + x_axis_title: Optional[str] = None """ The title of the x axis. """ - + y_axis_title: Optional[str] = None """ The title of the y axis. """ - + data: Optional[List[VerticalBarChartDataValue]] = None """ The data to display in the chart. """ - + color: Optional[ChartColor] = None """ The color to use for all data points. See [Chart colors reference](topic:chart-colors-reference). """ - + show_bar_values: Optional[bool] = None """ Controls if the bar values should be displayed. """ - + y_min: Optional[float] = None """ The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation. """ - + y_max: Optional[float] = None """ The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -7133,19 +7256,19 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class HorizontalBarChartDataValue(SerializableObject): """Represents a single data point in a horizontal bar chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + x: Optional[str] = None """ The x axis value of the data point. """ - + y: Optional[float] = None """ The y axis value of the data point. """ - + color: Optional[ChartColor] = None """ The color of the bar associated with the data point. See [Chart colors reference](topic:chart-colors-reference). """ @@ -7165,80 +7288,80 @@ def with_color(self, value: ChartColor) -> Self: self.color = value return self - + class HorizontalBarChart(CardElement): """A horizontal bar chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Chart.HorizontalBar'] = 'Chart.HorizontalBar' + + type: Literal["Chart.HorizontalBar"] = "Chart.HorizontalBar" """ Must be **Chart.HorizontalBar**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + title: Optional[str] = None """ The title of the chart. """ - + show_title: Optional[bool] = None """ Controls whether the chart's title should be displayed. Defaults to `false`. """ - + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ - + max_width: Optional[str] = None """ The maximum width, in pixels, of the chart, in the `px` format. """ - + show_legend: Optional[bool] = True """ Controls whether the chart's legend should be displayed. """ - + x_axis_title: Optional[str] = None """ The title of the x axis. """ - + y_axis_title: Optional[str] = None """ The title of the y axis. """ - + color: Optional[ChartColor] = None """ The color to use for all data points. See [Chart colors reference](topic:chart-colors-reference). """ - + data: Optional[List[HorizontalBarChartDataValue]] = None """ The data points in the chart. """ - + display_mode: Optional[HorizontalBarChartDisplayMode] = "AbsoluteWithAxis" """ Controls how the chart should be visually laid out. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -7333,19 +7456,19 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class StackedHorizontalBarChartDataPoint(SerializableObject): """A data point in a series.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + legend: Optional[str] = None """ The legend associated with the data point. """ - + value: Optional[float] = None """ The value of the data point. """ - + color: Optional[ChartColor] = None """ The color to use to render the bar associated with the data point. See [Chart colors reference](topic:chart-colors-reference). """ @@ -7365,16 +7488,16 @@ def with_color(self, value: ChartColor) -> Self: self.color = value return self - + class StackedHorizontalBarChartData(SerializableObject): """Defines the collection of data series to display in as a stacked horizontal bar chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + title: Optional[str] = None """ The title of the series. """ - + data: Optional[List[StackedHorizontalBarChartDataPoint]] = None """ The data points in the series. """ @@ -7390,77 +7513,77 @@ def with_data(self, value: List[StackedHorizontalBarChartDataPoint]) -> Self: self.data = value return self - + class StackedHorizontalBarChart(CardElement): """A stacked horizontal bar chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Chart.HorizontalBar.Stacked'] = 'Chart.HorizontalBar.Stacked' + + type: Literal["Chart.HorizontalBar.Stacked"] = "Chart.HorizontalBar.Stacked" """ Must be **Chart.HorizontalBar.Stacked**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + title: Optional[str] = None """ The title of the chart. """ - + show_title: Optional[bool] = None """ Controls whether the chart's title should be displayed. Defaults to `false`. """ - + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ - + max_width: Optional[str] = None """ The maximum width, in pixels, of the chart, in the `px` format. """ - + show_legend: Optional[bool] = True """ Controls whether the chart's legend should be displayed. """ - + x_axis_title: Optional[str] = None """ The title of the x axis. """ - + y_axis_title: Optional[str] = None """ The title of the y axis. """ - + color: Optional[ChartColor] = None """ The color to use for all data points. See [Chart colors reference](topic:chart-colors-reference). """ - + data: Optional[List[StackedHorizontalBarChartData]] = None """ The data to display in the chart. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -7551,20 +7674,20 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class LineChartValue(SerializableObject): """Represents a single data point in a line chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + x: Optional[Union[float, str]] = None """ The x axis value of the data point. If all x values of the x [Chart.Line](topic:Chart.Line) are expressed as a number, or if all x values are expressed as a date string in the `YYYY-MM-DD` format, the chart will be rendered as a time series chart, i.e. x axis values will span across the minimum x value to maximum x value range. Otherwise, if x values are represented as a mix of numbers and strings or if at least one x value isn't in the `YYYY-MM-DD` format, the chart will be rendered as a categorical chart, i.e. x axis values will be displayed as categories. """ - + y: Optional[float] = None """ The y axis value of the data point. """ @@ -7580,19 +7703,19 @@ def with_y(self, value: float) -> Self: self.y = value return self - + class LineChartData(SerializableObject): """Represents a collection of data points series in a line chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + legend: Optional[str] = None """ The legend of the chart. """ - + values: Optional[List[LineChartValue]] = None """ The data points in the series. """ - + color: Optional[ChartColor] = None """ The color all data points in the series. See [Chart colors reference](topic:chart-colors-reference). """ @@ -7612,83 +7735,83 @@ def with_color(self, value: ChartColor) -> Self: self.color = value return self - + class LineChart(CardElement): """A line chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Chart.Line'] = 'Chart.Line' + + type: Literal["Chart.Line"] = "Chart.Line" """ Must be **Chart.Line**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + title: Optional[str] = None """ The title of the chart. """ - + show_title: Optional[bool] = None """ Controls whether the chart's title should be displayed. Defaults to `false`. """ - + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ - + max_width: Optional[str] = None """ The maximum width, in pixels, of the chart, in the `px` format. """ - + show_legend: Optional[bool] = True """ Controls whether the chart's legend should be displayed. """ - + x_axis_title: Optional[str] = None """ The title of the x axis. """ - + y_axis_title: Optional[str] = None """ The title of the y axis. """ - + color: Optional[ChartColor] = None """ The color to use for all data points. See [Chart colors reference](topic:chart-colors-reference). """ - + data: Optional[List[LineChartData]] = None """ The data point series in the line chart. """ - + y_min: Optional[float] = None """ The maximum y range. """ - + y_max: Optional[float] = None """ The minimum y range. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -7787,19 +7910,19 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class GaugeChartLegend(SerializableObject): """The legend of the chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + size: Optional[float] = None """ The size of the segment. """ - + legend: Optional[str] = None """ The legend text associated with the segment. """ - + color: Optional[ChartColor] = None """ The color to use for the segment. See [Chart colors reference](topic:chart-colors-reference). """ @@ -7819,92 +7942,92 @@ def with_color(self, value: ChartColor) -> Self: self.color = value return self - + class GaugeChart(CardElement): """A gauge chart.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Chart.Gauge'] = 'Chart.Gauge' + + type: Literal["Chart.Gauge"] = "Chart.Gauge" """ Must be **Chart.Gauge**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + title: Optional[str] = None """ The title of the chart. """ - + show_title: Optional[bool] = None """ Controls whether the chart's title should be displayed. Defaults to `false`. """ - + color_set: Optional[ChartColorSet] = None """ The name of the set of colors to use to render the chart. See [Chart colors reference](topic:chart-colors-reference). """ - + max_width: Optional[str] = None """ The maximum width, in pixels, of the chart, in the `px` format. """ - + show_legend: Optional[bool] = True """ Controls whether the chart's legend should be displayed. """ - + min: Optional[float] = None """ The minimum value of the gauge. """ - + max: Optional[float] = None """ The maximum value of the gauge. """ - + sub_label: Optional[str] = None """ The sub-label of the gauge. """ - + show_min_max: Optional[bool] = True """ Controls whether the min/max values should be displayed. """ - + show_needle: Optional[bool] = True """ Controls whether the gauge's needle is displayed. Default is **true**. """ - + show_outlines: Optional[bool] = True """ Controls whether the outlines of the gauge segments are displayed. """ - + segments: Optional[List[GaugeChartLegend]] = None """ The segments to display in the gauge. """ - + value: Optional[float] = None """ The value of the gauge. """ - + value_format: Optional[GaugeChartValueFormat] = "Percentage" """ The format used to display the gauge's value. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8015,59 +8138,59 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class CodeBlock(CardElement): """A formatted and syntax-colored code block.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['CodeBlock'] = 'CodeBlock' + + type: Literal["CodeBlock"] = "CodeBlock" """ Must be **CodeBlock**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + code_snippet: Optional[str] = None """ The code snippet to display. """ - + language: Optional[CodeLanguage] = "PlainText" """ The language the code snippet is expressed in. """ - + start_line_number: Optional[float] = 1 """ A number that represents the line in the file from where the code snippet was extracted. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8134,25 +8257,25 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class PersonaProperties(SerializableObject): """Represents the properties of a Persona component.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + id: Optional[str] = None """ The Id of the persona. """ - + user_principal_name: Optional[str] = None """ The UPN of the persona. """ - + display_name: Optional[str] = None """ The display name of the persona. """ - + icon_style: Optional[PersonaIconStyle] = None """ Defines the style of the icon for the persona. """ - + style: Optional[PersonaDisplayStyle] = None """ Defines how the persona should be displayed. """ @@ -8180,56 +8303,56 @@ def with_style(self, value: PersonaDisplayStyle) -> Self: self.style = value return self - + class ComUserMicrosoftGraphComponent(CardElement): """Displays a user's information, including their profile picture.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Component'] = 'Component' + + type: Literal["Component"] = "Component" """ Must be **Component**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - - name: Literal['graph.microsoft.com/user'] = 'graph.microsoft.com/user' + + name: Literal["graph.microsoft.com/user"] = "graph.microsoft.com/user" """ Must be **graph.microsoft.com/user**. """ - + properties: Optional[PersonaProperties] = None """ The properties of the Persona component. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8288,19 +8411,19 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class PersonaSetProperties(SerializableObject): """Represents the properties of a PersonaSet component.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + users: Optional[List[PersonaProperties]] = None """ The users a PersonaSet component should display. """ - + icon_style: Optional[PersonaIconStyle] = None """ Defines the style of the icon for the personas in the set. """ - + style: Optional[PersonaDisplayStyle] = None """ Defines how each persona in the set should be displayed. """ @@ -8320,56 +8443,56 @@ def with_style(self, value: PersonaDisplayStyle) -> Self: self.style = value return self - + class ComUsersMicrosoftGraphComponent(CardElement): """Displays multiple users' information, including their profile pictures.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Component'] = 'Component' + + type: Literal["Component"] = "Component" """ Must be **Component**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - - name: Literal['graph.microsoft.com/users'] = 'graph.microsoft.com/users' + + name: Literal["graph.microsoft.com/users"] = "graph.microsoft.com/users" """ Must be **graph.microsoft.com/users**. """ - + properties: Optional[PersonaSetProperties] = None """ The properties of the PersonaSet component. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8428,13 +8551,13 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class ResourceVisualization(SerializableObject): """Represents a visualization of a resource.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + media: Optional[str] = None """ The media associated with the resource. """ @@ -8446,19 +8569,19 @@ def with_media(self, value: str) -> Self: self.media = value return self - + class ResourceProperties(SerializableObject): """Represents the properties of a resource component.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + id: Optional[str] = None """ The Id of the resource. """ - + resource_reference: Optional[Dict[str, str]] = None """ The reference to the resource. """ - + resource_visualization: Optional[ResourceVisualization] = None """ The visualization of the resource. """ @@ -8478,56 +8601,56 @@ def with_resource_visualization(self, value: ResourceVisualization) -> Self: self.resource_visualization = value return self - + class ComResourceMicrosoftGraphComponent(CardElement): """Displays information about a generic graph resource.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Component'] = 'Component' + + type: Literal["Component"] = "Component" """ Must be **Component**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - - name: Literal['graph.microsoft.com/resource'] = 'graph.microsoft.com/resource' + + name: Literal["graph.microsoft.com/resource"] = "graph.microsoft.com/resource" """ Must be **graph.microsoft.com/resource**. """ - + properties: Optional[ResourceProperties] = None """ The properties of the resource. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8586,19 +8709,19 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class FileProperties(SerializableObject): """Represents the properties of a file component.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + name: Optional[str] = None """ The name of the file. """ - + extension: Optional[str] = None """ The file extension. """ - + url: Optional[str] = None """ The URL of the file. """ @@ -8618,56 +8741,56 @@ def with_url(self, value: str) -> Self: self.url = value return self - + class ComFileMicrosoftGraphComponent(CardElement): """Displays information about a file resource.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Component'] = 'Component' + + type: Literal["Component"] = "Component" """ Must be **Component**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - - name: Literal['graph.microsoft.com/file'] = 'graph.microsoft.com/file' + + name: Literal["graph.microsoft.com/file"] = "graph.microsoft.com/file" """ Must be **graph.microsoft.com/file**. """ - + properties: Optional[FileProperties] = None """ The properties of the file. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8726,25 +8849,25 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class CalendarEventAttendee(SerializableObject): """Represents a calendar event attendee.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + name: Optional[str] = None """ The name of the attendee. """ - + email: Optional[str] = None """ The email address of the attendee. """ - + title: Optional[str] = None """ The title of the attendee. """ - + type: Optional[str] = None """ The type of the attendee. """ - + status: Optional[str] = None """ The status of the attendee. """ @@ -8772,46 +8895,46 @@ def with_status(self, value: str) -> Self: self.status = value return self - + class CalendarEventProperties(SerializableObject): """The properties of a calendar event.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - + id: Optional[str] = None """ The ID of the event. """ - + title: Optional[str] = None """ The title of the event. """ - + start: Optional[str] = None """ The start date and time of the event. """ - + end: Optional[str] = None """ The end date and time of the event. """ - + status: Optional[str] = None """ The status of the event. """ - + locations: Optional[List[str]] = None """ The locations of the event. """ - + online_meeting_url: Optional[str] = None """ The URL of the online meeting. """ - + is_all_day: Optional[bool] = None """ Indicates if the event is all day. """ - + extension: Optional[str] = None """ The extension of the event. """ - + url: Optional[str] = None """ The URL of the event. """ - + attendees: Optional[List[CalendarEventAttendee]] = None """ The attendees of the event. """ - + organizer: Optional[CalendarEventAttendee] = None """ The organizer of the event. """ @@ -8867,56 +8990,56 @@ def with_organizer(self, value: CalendarEventAttendee) -> Self: self.organizer = value return self - + class ComEventMicrosoftGraphComponent(CardElement): """Displays information about a calendar event.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['Component'] = 'Component' + + type: Literal["Component"] = "Component" """ Must be **Component**. """ - + id: Optional[str] = None """ 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. """ - + requires: Optional[HostCapabilities] = Field(default_factory=HostCapabilities) """ 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). """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + separator: Optional[bool] = None """ 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. """ - + height: Optional[ElementHeight] = "auto" """ The height of the element. When set to stretch, the element will use the remaining vertical space in its container. """ - + horizontal_alignment: Optional[HorizontalAlignment] = None """ Controls how the element should be horizontally aligned. """ - + spacing: Optional[Spacing] = "Default" """ Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. """ - + target_width: Optional[TargetWidth] = None """ 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](topic:responsive-layout). """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - - name: Literal['graph.microsoft.com/event'] = 'graph.microsoft.com/event' + + name: Literal["graph.microsoft.com/event"] = "graph.microsoft.com/event" """ Must be **graph.microsoft.com/event**. """ - + properties: Optional[CalendarEventProperties] = None """ The properties of the event. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -8975,65 +9098,65 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class TextRun(CardElement): """A block of text inside a RichTextBlock element.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['TextRun'] = 'TextRun' + + type: Literal["TextRun"] = "TextRun" """ Must be **TextRun**. """ - + id: Optional[str] = None """ 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. """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + text: Optional[str] = None """ The text to display. A subset of markdown is supported. """ - + size: Optional[TextSize] = None """ The size of the text. """ - + weight: Optional[TextWeight] = None """ The weight of the text. """ - + color: Optional[TextColor] = None """ The color of the text. """ - + is_subtle: Optional[bool] = None """ Controls whether the text should be renderer using a subtler variant of the select color. """ - + font_type: Optional[FontType] = None """ The type of font to use for rendering. """ - + italic: Optional[bool] = None """ Controls if the text should be italicized. """ - + strikethrough: Optional[bool] = None """ Controls if the text should be struck through. """ - + highlight: Optional[bool] = None """ Controls if the text should be highlighted. """ - + underline: Optional[bool] = None """ Controls if the text should be underlined. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the text is tapped or clicked. Action.ShowCard is not supported. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -9108,47 +9231,47 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class IconRun(CardElement): """An inline icon inside a RichTextBlock element.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['IconRun'] = 'IconRun' + + type: Literal["IconRun"] = "IconRun" """ Must be **IconRun**. """ - + id: Optional[str] = None """ 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. """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + name: Optional[str] = None """ The name of the inline icon to display. """ - + size: Optional[SizeEnum] = "Default" """ The size of the inline icon. """ - + style: Optional[IconStyle] = "Regular" """ The style of the inline icon. """ - + color: Optional[TextColor] = "Default" """ The color of the inline icon. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the inline icon is tapped or clicked. Action.ShowCard is not supported. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -9199,47 +9322,47 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class ImageRun(CardElement): """An inline image inside a RichTextBlock element.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['ImageRun'] = 'ImageRun' + + type: Literal["ImageRun"] = "ImageRun" """ Must be **ImageRun**. """ - + id: Optional[str] = None """ 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. """ - + lang: Optional[str] = None """ The locale associated with the element. """ - + is_visible: Optional[bool] = True """ Controls the visibility of the element. """ - + is_sort_key: Optional[bool] = None """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """ - + url: Optional[str] = None """ The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. """ - + size: Optional[SizeEnum] = "Default" """ The size of the inline image. """ - + style: Optional[ImageStyle] = "Default" """ The style of the inline image. """ - + select_action: Optional[Action] = None """ An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. """ - + themed_urls: Optional[List[ThemedUrl]] = None """ A set of theme-specific image URLs. """ - + grid_area: Optional[str] = None """ The area of a Layout.AreaGrid layout in which an element should be displayed. """ - - fallback: Optional[Union[CardElement, FallbackElement]] = None + + fallback: Optional[Union[SerializeAsAny[CardElement], FallbackElement]] = None """ 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. """ def with_key(self, value: str) -> Self: @@ -9290,16 +9413,16 @@ def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self: self.fallback = value return self - + class ImBackSubmitActionData(SerializableObject): """Represents Teams-specific data in an Action.Submit to send an Instant Message back to the Bot.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['imBack'] = 'imBack' + + type: Literal["imBack"] = "imBack" """ Must be **imBack**. """ - + value: Optional[str] = None """ The value that will be sent to the Bot. """ @@ -9311,19 +9434,19 @@ def with_value(self, value: str) -> Self: self.value = value return self - + class TabInfo(SerializableObject): """Represents information about the iFrame content, rendered in the collab stage popout window.""" - + name: Optional[str] = None """ The name for the content. This will be displayed as the title of the window hosting the iFrame. """ - + content_url: Optional[str] = None """ The URL to open in an iFrame. """ - + entity_id: Optional[str] = None """ The unique entity id for this content (e.g., random UUID). """ - + website_url: Optional[str] = None """ An optional website URL to the content, allowing users to open this content in the browser (if they prefer). """ @@ -9343,13 +9466,13 @@ def with_website_url(self, value: str) -> Self: self.website_url = value return self - + class CollabStageInvokeDataValue(SerializableObject): """Data for invoking a collaboration stage action.""" - - type: Literal['tab/tabInfoAction'] = 'tab/tabInfoAction' + + type: Literal["tab/tabInfoAction"] = "tab/tabInfoAction" """ Must be **tab/tabInfoAction**. """ - + tab_info: Optional[TabInfo] = None """ Provides information about the iFrame content, rendered in the collab stage popout window. """ @@ -9357,16 +9480,16 @@ def with_tab_info(self, value: TabInfo) -> Self: self.tab_info = value return self - + class InvokeSubmitActionData(SerializableObject): """Represents Teams-specific data in an Action.Submit to make an Invoke request to the Bot.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['invoke'] = 'invoke' + + type: Literal["invoke"] = "invoke" """ Must be **invoke**. """ - + value: Optional[Union[Dict[str, Any], CollabStageInvokeDataValue]] = None """ The object to send to the Bot with the Invoke request. Can be strongly typed as one of the below values to trigger a specific action in Teams. """ @@ -9378,22 +9501,22 @@ def with_value(self, value: Union[Dict[str, Any], CollabStageInvokeDataValue]) - self.value = value return self - + class MessageBackSubmitActionData(SerializableObject): """Represents Teams-specific data in an Action.Submit to send a message back to the Bot.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['messageBack'] = 'messageBack' + + type: Literal["messageBack"] = "messageBack" """ Must be **messageBack**. """ - + text: Optional[str] = None """ The text that will be sent to the Bot. """ - + display_text: Optional[str] = None """ 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. """ - + value: Optional[Dict[str, Any]] = None """ 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. """ @@ -9413,16 +9536,16 @@ def with_value(self, value: Dict[str, Any]) -> Self: self.value = value return self - + class SigninSubmitActionData(SerializableObject): """Represents Teams-specific data in an Action.Submit to sign in a user.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['signin'] = 'signin' + + type: Literal["signin"] = "signin" """ Must be **signin**. """ - + value: Optional[str] = None """ The URL to redirect the end-user for signing in. """ @@ -9434,18 +9557,16 @@ def with_value(self, value: str) -> Self: self.value = value return self - + class TaskFetchSubmitActionData(SerializableObject): """Represents Teams-specific data in an Action.Submit to open a task module.""" - + key: Optional[str] = None """ Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. """ - - type: Literal['task/fetch'] = 'task/fetch' + + type: Literal["task/fetch"] = "task/fetch" """ Must be **task/fetch**. """ def with_key(self, value: str) -> Self: self.key = value return self - - \ No newline at end of file From 8711edeee4dea444b3ea6cd87e085c70d279b717 Mon Sep 17 00:00:00 2001 From: Corina Gum <> Date: Thu, 19 Mar 2026 15:15:08 -0700 Subject: [PATCH 09/10] Manual fix --- packages/cards/src/microsoft_teams/cards/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cards/src/microsoft_teams/cards/core.py b/packages/cards/src/microsoft_teams/cards/core.py index cca7452e..04d3e1e6 100644 --- a/packages/cards/src/microsoft_teams/cards/core.py +++ b/packages/cards/src/microsoft_teams/cards/core.py @@ -840,7 +840,7 @@ class AdaptiveCard(CardElement): rtl: Optional[bool] = None """ Controls if the content of the card is to be rendered left-to-right or right-to-left. """ - ac_schema: Optional[str] = Field(None, alias="schema") + ac_schema: Optional[str] = Field(default=None, alias="schema") """ A URL to the Adaptive Card schema the card is authored against. """ version: Optional[Version] = "1.5" From 1d1fb5527b8394dda28b990e3377fdc51bb030a4 Mon Sep 17 00:00:00 2001 From: Corina Gum <> Date: Mon, 23 Mar 2026 09:33:16 -0700 Subject: [PATCH 10/10] Update verbiage --- .../cards/src/microsoft_teams/cards/actions/im_back_action.py | 4 ++-- .../cards/src/microsoft_teams/cards/actions/invoke_action.py | 4 ++-- .../src/microsoft_teams/cards/actions/message_back_action.py | 4 ++-- .../cards/src/microsoft_teams/cards/actions/sign_in_action.py | 4 ++-- .../src/microsoft_teams/cards/actions/task_fetch_action.py | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/cards/src/microsoft_teams/cards/actions/im_back_action.py b/packages/cards/src/microsoft_teams/cards/actions/im_back_action.py index de2df9eb..2e0ded70 100644 --- a/packages/cards/src/microsoft_teams/cards/actions/im_back_action.py +++ b/packages/cards/src/microsoft_teams/cards/actions/im_back_action.py @@ -10,12 +10,12 @@ class IMBackAction(SubmitAction): """This class is deprecated. Please use ImBackSubmitActionData instead. - This will be removed in a future version of the SDK.""" + This will be removed in version 2.0.0 GA.""" def __init__(self, value: str): warnings.warn( "IMBackAction is deprecated. Use ImBackSubmitActionData instead. " - "This will be removed in a future version of the SDK.", + "This will be removed in version 2.0.0 GA.", DeprecationWarning, stacklevel=2, ) diff --git a/packages/cards/src/microsoft_teams/cards/actions/invoke_action.py b/packages/cards/src/microsoft_teams/cards/actions/invoke_action.py index a40741ae..b34eb64c 100644 --- a/packages/cards/src/microsoft_teams/cards/actions/invoke_action.py +++ b/packages/cards/src/microsoft_teams/cards/actions/invoke_action.py @@ -11,12 +11,12 @@ class InvokeAction(SubmitAction): """This class is deprecated. Please use InvokeSubmitActionData instead. - This will be removed in a future version of the SDK.""" + This will be removed in version 2.0.0 GA.""" def __init__(self, value: Dict[str, Any]): warnings.warn( "InvokeAction is deprecated. Use InvokeSubmitActionData instead. " - "This will be removed in a future version of the SDK.", + "This will be removed in version 2.0.0 GA.", DeprecationWarning, stacklevel=2, ) diff --git a/packages/cards/src/microsoft_teams/cards/actions/message_back_action.py b/packages/cards/src/microsoft_teams/cards/actions/message_back_action.py index ae60dcd5..62eb23b8 100644 --- a/packages/cards/src/microsoft_teams/cards/actions/message_back_action.py +++ b/packages/cards/src/microsoft_teams/cards/actions/message_back_action.py @@ -11,12 +11,12 @@ class MessageBackAction(SubmitAction): """This class is deprecated. Please use MessageBackSubmitActionData instead. - This will be removed in a future version of the SDK.""" + This will be removed in version 2.0.0 GA.""" def __init__(self, text: str, value: Union[str, Dict[str, Any]], display_text: Optional[str] = None): warnings.warn( "MessageBackAction is deprecated. Use MessageBackSubmitActionData instead. " - "This will be removed in a future version of the SDK.", + "This will be removed in version 2.0.0 GA.", DeprecationWarning, stacklevel=2, ) diff --git a/packages/cards/src/microsoft_teams/cards/actions/sign_in_action.py b/packages/cards/src/microsoft_teams/cards/actions/sign_in_action.py index 62a7fbc0..811b44d1 100644 --- a/packages/cards/src/microsoft_teams/cards/actions/sign_in_action.py +++ b/packages/cards/src/microsoft_teams/cards/actions/sign_in_action.py @@ -10,12 +10,12 @@ class SignInAction(SubmitAction): """This class is deprecated. Please use SigninSubmitActionData instead. - This will be removed in a future version of the SDK.""" + This will be removed in version 2.0.0 GA.""" def __init__(self, value: str): warnings.warn( "SignInAction is deprecated. Use SigninSubmitActionData instead. " - "This will be removed in a future version of the SDK.", + "This will be removed in version 2.0.0 GA.", DeprecationWarning, stacklevel=2, ) diff --git a/packages/cards/src/microsoft_teams/cards/actions/task_fetch_action.py b/packages/cards/src/microsoft_teams/cards/actions/task_fetch_action.py index 1602ca9e..e50acafd 100644 --- a/packages/cards/src/microsoft_teams/cards/actions/task_fetch_action.py +++ b/packages/cards/src/microsoft_teams/cards/actions/task_fetch_action.py @@ -11,12 +11,12 @@ class TaskFetchAction(SubmitAction): """This class is deprecated. Please use TaskFetchSubmitActionData instead. - This will be removed in a future version of the SDK.""" + This will be removed in version 2.0.0 GA.""" def __init__(self, value: Dict[str, Any]): warnings.warn( "TaskFetchAction is deprecated. Use TaskFetchSubmitActionData instead. " - "This will be removed in a future version of the SDK.", + "This will be removed in version 2.0.0 GA.", DeprecationWarning, stacklevel=2, )