# This file was automatically generated by a tool on 04/02/2026, 8:47 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.alias_generators import to_camel


class SerializableObject(BaseModel):
    """Base class for all serializable objects."""

    @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)

    model_config = ConfigDict(
        populate_by_name=True,
        serialize_by_alias=True,
        validate_by_alias=True,
        arbitrary_types_allowed=True,
        extra="allow",
        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


ActionStyle = Literal["default", "positive", "destructive"]

ActionMode = Literal["primary", "secondary"]

ThemeName = Literal["Light", "Dark"]

ElementHeight = Literal["auto", "stretch"]

HorizontalAlignment = Literal["Left", "Center", "Right"]

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",
]

ContainerStyle = Literal["default", "emphasis", "accent", "good", "attention", "warning"]

VerticalAlignment = Literal["Top", "Center", "Bottom"]

FlowLayoutItemFit = Literal["Fit", "Fill"]

FillMode = Literal["Cover", "RepeatHorizontally", "RepeatVertically", "Repeat"]

TextSize = Literal["Small", "Default", "Medium", "Large", "ExtraLarge"]

TextWeight = Literal["Lighter", "Default", "Bolder"]

TextColor = Literal["Default", "Dark", "Light", "Accent", "Good", "Warning", "Attention"]

FontType = Literal["Default", "Monospace"]

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"]

RatingStyle = Literal["Default", "Compact"]

IconSize = Literal["xxSmall", "xSmall", "Small", "Standard", "Medium", "Large", "xLarge", "xxLarge"]

IconStyle = Literal["Regular", "Filled"]

CarouselPageAnimation = Literal["Slide", "CrossFade", "None"]

BadgeIconPosition = Literal["Before", "After"]

BadgeAppearance = Literal["Filled", "Tint"]

BadgeSize = Literal["Medium", "Large", "ExtraLarge"]

BadgeShape = Literal["Square", "Rounded", "Circular"]

BadgeStyle = Literal["Default", "Subtle", "Informative", "Accent", "Good", "Attention", "Warning"]

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",
]

PersonaIconStyle = Literal["profilePicture", "contactCard", "none"]

PersonaDisplayStyle = Literal["iconAndName", "iconOnly", "nameOnly"]

FallbackElement = Literal["drop"]

ImageSize = Literal["Small", "Medium", "Large"]

SizeEnum = Literal["Small", "Default", "Medium", "Large", "ExtraLarge"]

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] = "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. """

    def with_key(self, value: str) -> Self:
        self.key = value
        return self

    def with_url(self, value: str) -> Self:
        self.url = value
        return self

    def with_fill_mode(self, value: FillMode) -> Self:
        self.fill_mode = value
        return self

    def with_horizontal_alignment(self, value: HorizontalAlignment) -> Self:
        self.horizontal_alignment = value
        return self

    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."""

    key: Optional[str] = None
    """ Defines an 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_key(self, value: str) -> Self:
        self.key = value
        return self

    def with_msteams(self, value: Dict[str, Any]) -> Self:
        self.msteams = 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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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 `<icon-name>[,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
    """ 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, Dict[str, Any]]] = 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] = False
    """ 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
    """ 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

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> Self:
        self.requires = value
        return self

    def with_title(self, value: str) -> Self:
        self.title = value
        return self

    def with_icon_url(self, value: str) -> Self:
        self.icon_url = value
        return self

    def with_style(self, value: ActionStyle) -> Self:
        self.style = value
        return self

    def with_mode(self, value: ActionMode) -> Self:
        self.mode = value
        return self

    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

    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, Dict[str, Any]]) -> 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_verb(self, value: str) -> Self:
        self.verb = value
        return self

    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. """

    def with_key(self, value: str) -> Self:
        self.key = value
        return self

    def with_action(self, value: ExecuteAction) -> Self:
        self.action = value
        return self

    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. """

    def with_key(self, value: str) -> Self:
        self.key = value
        return self

    def with_type(self, value: str) -> Self:
        self.type = value
        return self

    def with_title(self, value: str) -> Self:
        self.title = value
        return self

    def with_image(self, value: str) -> Self:
        self.image = value
        return self

    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. """

    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_uri(self, value: str) -> Self:
        self.uri = value
        return self

    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. """

    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_connection_name(self, value: str) -> Self:
        self.connection_name = value
        return self

    def with_buttons(self, value: List[AuthCardButton]) -> Self:
        self.buttons = value
        return self

    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. """

    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_name(self, value: str) -> Self:
        self.name = value
        return self

    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"
    """ 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. """

    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_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. """

    def with_key(self, value: str) -> Self:
        self.key = value
        return self

    def with_width(self, value: TeamsCardWidth) -> Self:
        self.width = value
        return self

    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. """

    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 `<ISO 639-1>(-<ISO 3166-1 alpha-2>)` format. `<ISO 639-1>` is the 2-letter language code and `<ISO 3166-1 alpha-2>` 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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """
    select_action: Optional[SerializeAsAny[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
    """ 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 `<number>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")
    """ 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. """
    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
    """ An alternate element to render 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
    """ 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
    """ 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

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> Self:
        self.requires = value
        return self

    def with_lang(self, value: str) -> Self:
        self.lang = value
        return self

    def with_is_sort_key(self, value: bool) -> Self:
        self.is_sort_key = value
        return self

    def with_select_action(self, value: Action) -> Self:
        self.select_action = value
        return self

    def with_style(self, value: ContainerStyle) -> Self:
        self.style = value
        return self

    def with_layouts(self, value: List[ContainerLayout]) -> Self:
        self.layouts = value
        return self

    def with_min_height(self, value: str) -> Self:
        self.min_height = value
        return self

    def with_background_image(self, value: Union[str, BackgroundImage]) -> Self:
        self.background_image = value
        return self

    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
        return self

    def with_schema(self, value: str) -> Self:
        self.ac_schema = value
        return self

    def with_version(self, value: Version) -> Self:
        self.version = value
        return self

    def with_fallback_text(self, value: str) -> Self:
        self.fallback_text = value
        return self

    def with_speak(self, value: str) -> Self:
        self.speak = value
        return self

    def with_refresh(self, value: RefreshDefinition) -> Self:
        self.refresh = value
        return self

    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_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

    def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self:
        self.fallback = value
        return self

    def with_body(self, value: List[CardElement]) -> Self:
        self.body = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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 `<icon-name>[,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
    """ 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
    """ 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

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> Self:
        self.requires = value
        return self

    def with_title(self, value: str) -> Self:
        self.title = value
        return self

    def with_icon_url(self, value: str) -> Self:
        self.icon_url = value
        return self

    def with_style(self, value: ActionStyle) -> Self:
        self.style = value
        return self

    def with_mode(self, value: ActionMode) -> Self:
        self.mode = value
        return self

    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

    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_url(self, value: str) -> Self:
        self.url = value
        return self

    def with_alt_text(self, value: str) -> Self:
        self.alt_text = value
        return self

    def with_insert_position(self, value: ImageInsertPosition) -> Self:
        self.insert_position = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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 `<icon-name>[,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
    """ 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
    """ 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

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> Self:
        self.requires = value
        return self

    def with_title(self, value: str) -> Self:
        self.title = value
        return self

    def with_icon_url(self, value: str) -> Self:
        self.icon_url = value
        return self

    def with_style(self, value: ActionStyle) -> Self:
        self.style = value
        return self

    def with_mode(self, value: ActionMode) -> Self:
        self.mode = value
        return self

    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

    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_url(self, value: str) -> Self:
        self.url = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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 `<icon-name>[,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
    """ 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 <number>px format. """
    dialog_width: Optional[str] = None
    """ The width of the dialog. To define width as a number of pixels, use the <number>px format. """
    url: Optional[str] = None
    """ The URL to open. """
    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:
        self.key = value
        return self

    def with_id(self, value: str) -> Self:
        self.id = value
        return self

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> Self:
        self.requires = value
        return self

    def with_title(self, value: str) -> Self:
        self.title = value
        return self

    def with_icon_url(self, value: str) -> Self:
        self.icon_url = value
        return self

    def with_style(self, value: ActionStyle) -> Self:
        self.style = value
        return self

    def with_mode(self, value: ActionMode) -> Self:
        self.mode = value
        return self

    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

    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_dialog_title(self, value: str) -> Self:
        self.dialog_title = value
        return self

    def with_dialog_height(self, value: str) -> Self:
        self.dialog_height = value
        return self

    def with_dialog_width(self, value: str) -> Self:
        self.dialog_width = value
        return self

    def with_url(self, value: str) -> Self:
        self.url = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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 `<icon-name>[,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
    """ 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
    """ 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

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> Self:
        self.requires = value
        return self

    def with_title(self, value: str) -> Self:
        self.title = value
        return self

    def with_icon_url(self, value: str) -> Self:
        self.icon_url = value
        return self

    def with_style(self, value: ActionStyle) -> Self:
        self.style = value
        return self

    def with_mode(self, value: ActionMode) -> Self:
        self.mode = value
        return self

    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

    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:
        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. """

    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. """
    requires: Optional[Union[HostCapabilities, Dict[str, Any]]] = 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 `<icon-name>[,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
    """ 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, Dict[str, Any]]] = 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] = False
    """ 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. """
    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:
        self.key = value
        return self

    def with_id(self, value: str) -> Self:
        self.id = value
        return self

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> Self:
        self.requires = value
        return self

    def with_title(self, value: str) -> Self:
        self.title = value
        return self

    def with_icon_url(self, value: str) -> Self:
        self.icon_url = value
        return self

    def with_style(self, value: ActionStyle) -> Self:
        self.style = value
        return self

    def with_mode(self, value: ActionMode) -> Self:
        self.mode = value
        return self

    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

    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, Dict[str, Any]]) -> 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_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. """

    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 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. """
    requires: Optional[Union[HostCapabilities, Dict[str, Any]]] = 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 `<icon-name>[,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
    """ 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
    """ 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

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> Self:
        self.requires = value
        return self

    def with_title(self, value: str) -> Self:
        self.title = value
        return self

    def with_icon_url(self, value: str) -> Self:
        self.icon_url = value
        return self

    def with_style(self, value: ActionStyle) -> Self:
        self.style = value
        return self

    def with_mode(self, value: ActionMode) -> Self:
        self.mode = value
        return self

    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

    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:
        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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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 `<icon-name>[,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
    """ 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
    """ 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

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> Self:
        self.requires = value
        return self

    def with_title(self, value: str) -> Self:
        self.title = value
        return self

    def with_icon_url(self, value: str) -> Self:
        self.icon_url = value
        return self

    def with_style(self, value: ActionStyle) -> Self:
        self.style = value
        return self

    def with_mode(self, value: ActionMode) -> Self:
        self.mode = value
        return self

    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

    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_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 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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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 `<icon-name>[,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[SerializeAsAny[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 `<number>px` format """
    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:
        self.key = value
        return self

    def with_id(self, value: str) -> Self:
        self.id = value
        return self

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> Self:
        self.requires = value
        return self

    def with_title(self, value: str) -> Self:
        self.title = value
        return self

    def with_icon_url(self, value: str) -> Self:
        self.icon_url = value
        return self

    def with_style(self, value: ActionStyle) -> Self:
        self.style = value
        return self

    def with_mode(self, value: ActionMode) -> Self:
        self.mode = value
        return self

    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

    def with_themed_icon_urls(self, value: List[ThemedUrl]) -> Self:
        self.themed_icon_urls = value
        return self

    def with_content(self, value: CardElement) -> Self:
        self.content = value
        return self

    def with_display_arrow(self, value: bool) -> Self:
        self.display_arrow = value
        return self

    def with_position(self, value: PopoverPosition) -> Self:
        self.position = value
        return self

    def with_max_popover_width(self, value: str) -> Self:
        self.max_popover_width = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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
    """ An alternate element to render 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
    """ 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_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_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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """
    select_action: Optional[SerializeAsAny[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] = False
    """ Controls if a border should be displayed around the container. """
    rounded_corners: Optional[bool] = False
    """ Controls if the container should have rounded corners. """
    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] = False
    """ 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 `<number>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 `<number>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
    """ An alternate element to render 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
    """ 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

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> 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_select_action(self, value: Action) -> Self:
        self.select_action = value
        return self

    def with_style(self, value: ContainerStyle) -> Self:
        self.style = value
        return self

    def with_show_border(self, value: bool) -> Self:
        self.show_border = value
        return self

    def with_rounded_corners(self, value: bool) -> Self:
        self.rounded_corners = value
        return self

    def with_layouts(self, value: List[ContainerLayout]) -> Self:
        self.layouts = 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_background_image(self, value: Union[str, BackgroundImage]) -> Self:
        self.background_image = value
        return self

    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
        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 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"
    """ Must be **Layout.Stack**. """
    target_width: Optional[TargetWidth] = None
    """ Controls for which card width the layout should be used. """

    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


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"
    """ 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 `<number>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 `<number>px` format. Should not be used if itemWidth is set. """
    item_width: Optional[str] = None
    """ The width, in pixels, of each item, in the `<number>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_target_width(self, value: TargetWidth) -> Self:
        self.target_width = value
        return self

    def with_horizontal_items_alignment(self, value: HorizontalAlignment) -> Self:
        self.horizontal_items_alignment = value
        return self

    def with_vertical_items_alignment(self, value: VerticalAlignment) -> Self:
        self.vertical_items_alignment = value
        return self

    def with_item_fit(self, value: FlowLayoutItemFit) -> Self:
        self.item_fit = value
        return self

    def with_min_item_width(self, value: str) -> Self:
        self.min_item_width = value
        return self

    def with_max_item_width(self, value: str) -> Self:
        self.max_item_width = value
        return self

    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 `<number>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_columns(self, value: Union[List[float], List[str]]) -> Self:
        self.columns = value
        return self

    def with_areas(self, value: List[GridArea]) -> Self:
        self.areas = 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 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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """
    select_action: Optional[SerializeAsAny[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] = False
    """ Controls if a border should be displayed around the container. """
    rounded_corners: Optional[bool] = False
    """ Controls if the container should have rounded corners. """
    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] = False
    """ 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 `<number>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 `<number>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 `<number>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
    """ An alternate element to render 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
    """ 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

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> 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_select_action(self, value: Action) -> Self:
        self.select_action = value
        return self

    def with_style(self, value: ContainerStyle) -> Self:
        self.style = value
        return self

    def with_show_border(self, value: bool) -> Self:
        self.show_border = value
        return self

    def with_rounded_corners(self, value: bool) -> Self:
        self.rounded_corners = value
        return self

    def with_layouts(self, value: List[ContainerLayout]) -> Self:
        self.layouts = 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_background_image(self, value: Union[str, BackgroundImage]) -> Self:
        self.background_image = value
        return self

    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
        return self

    def with_max_height(self, value: str) -> Self:
        self.max_height = value
        return self

    def with_width(self, value: Union[str, float]) -> Self:
        self.width = 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 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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """
    select_action: Optional[SerializeAsAny[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] = False
    """ Controls if a border should be displayed around the container. """
    rounded_corners: Optional[bool] = False
    """ Controls if the container should have rounded corners. """
    bleed: Optional[bool] = False
    """ 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 `<number>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 `<number>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
    """ An alternate element to render 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

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> 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_select_action(self, value: Action) -> Self:
        self.select_action = value
        return self

    def with_style(self, value: ContainerStyle) -> Self:
        self.style = value
        return self

    def with_show_border(self, value: bool) -> Self:
        self.show_border = value
        return self

    def with_rounded_corners(self, value: bool) -> Self:
        self.rounded_corners = 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_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

    def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self:
        self.fallback = value
        return self

    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. """

    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

    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. """

    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

    def with_url(self, value: str) -> Self:
        self.url = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_sources(self, value: List[MediaSource]) -> Self:
        self.sources = value
        return self

    def with_caption_sources(self, value: List[CaptionSource]) -> Self:
        self.caption_sources = value
        return self

    def with_poster(self, value: str) -> Self:
        self.poster = value
        return self

    def with_alt_text(self, value: str) -> Self:
        self.alt_text = 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


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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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
    """ An alternate element to render 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
    """ 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

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> 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_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

    def with_fallback(self, value: Union[CardElement, FallbackElement]) -> Self:
        self.fallback = value
        return self

    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 `<number>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
        return self

    def with_vertical_cell_content_alignment(self, value: VerticalAlignment) -> Self:
        self.vertical_cell_content_alignment = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """
    select_action: Optional[SerializeAsAny[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
    """ 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] = False
    """ 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 `<number>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 `<number>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
    """ An alternate element to render 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
    """ 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

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> 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_select_action(self, value: Action) -> Self:
        self.select_action = value
        return self

    def with_style(self, value: ContainerStyle) -> Self:
        self.style = value
        return self

    def with_layouts(self, value: List[ContainerLayout]) -> Self:
        self.layouts = 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_background_image(self, value: Union[str, BackgroundImage]) -> Self:
        self.background_image = value
        return self

    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
        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 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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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] = False
    """ Controls if a border should be displayed around the container. """
    rounded_corners: Optional[bool] = False
    """ 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
    """ An alternate element to render 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

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> 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_show_border(self, value: bool) -> Self:
        self.show_border = value
        return self

    def with_rounded_corners(self, value: bool) -> Self:
        self.rounded_corners = value
        return self

    def with_style(self, value: ContainerStyle) -> Self:
        self.style = value
        return self

    def with_horizontal_cell_content_alignment(self, value: HorizontalAlignment) -> Self:
        self.horizontal_cell_content_alignment = value
        return self

    def with_vertical_cell_content_alignment(self, value: VerticalAlignment) -> Self:
        self.vertical_cell_content_alignment = 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_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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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] = False
    """ Controls if a border should be displayed around the container. """
    rounded_corners: Optional[bool] = False
    """ 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 `<number>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
    """ An alternate element to render 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

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> 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_style(self, value: ContainerStyle) -> Self:
        self.style = value
        return self

    def with_show_border(self, value: bool) -> Self:
        self.show_border = value
        return self

    def with_rounded_corners(self, value: bool) -> Self:
        self.rounded_corners = value
        return self

    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

    def with_show_grid_lines(self, value: bool) -> Self:
        self.show_grid_lines = value
        return self

    def with_grid_style(self, value: ContainerStyle) -> Self:
        self.grid_style = value
        return self

    def with_horizontal_cell_content_alignment(self, value: HorizontalAlignment) -> Self:
        self.horizontal_cell_content_alignment = value
        return self

    def with_vertical_cell_content_alignment(self, value: VerticalAlignment) -> Self:
        self.vertical_cell_content_alignment = 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_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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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] = False
    """ 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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_size(self, value: TextSize) -> Self:
        self.size = value
        return self

    def with_weight(self, value: TextWeight) -> Self:
        self.weight = value
        return self

    def with_color(self, value: TextColor) -> Self:
        self.color = value
        return self

    def with_is_subtle(self, value: bool) -> Self:
        self.is_subtle = value
        return self

    def with_font_type(self, value: FontType) -> Self:
        self.font_type = value
        return self

    def with_wrap(self, value: bool) -> Self:
        self.wrap = value
        return self

    def with_max_lines(self, value: float) -> Self:
        self.max_lines = value
        return 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

    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. """

    def with_key(self, value: str) -> Self:
        self.key = value
        return self

    def with_title(self, value: str) -> Self:
        self.title = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_facts(self, value: List[Fact]) -> Self:
        self.facts = 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


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


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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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[SerializeAsAny[Action]] = None
    """ An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. """
    allow_expand: Optional[bool] = False
    """ Controls if the image can be expanded to full screen. """
    msteams: 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[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:
        self.key = value
        return self

    def with_id(self, value: str) -> Self:
        self.id = value
        return self

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> 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_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_url(self, value: str) -> Self:
        self.url = value
        return self

    def with_alt_text(self, value: str) -> Self:
        self.alt_text = value
        return self

    def with_background_color(self, value: str) -> Self:
        self.background_color = value
        return self

    def with_style(self, value: ImageStyle) -> Self:
        self.style = value
        return self

    def with_size(self, value: Size) -> Self:
        self.size = value
        return self

    def with_width(self, value: str) -> Self:
        self.width = value
        return self

    def with_select_action(self, value: Action) -> Self:
        self.select_action = value
        return self

    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_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

    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


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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_images(self, value: List[Image]) -> Self:
        self.images = value
        return self

    def with_image_size(self, value: ImageSize) -> Self:
        self.image_size = 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


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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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] = False
    """ 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[SerializeAsAny[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] = False
    """ 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[SerializeAsAny[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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_label(self, value: str) -> Self:
        self.label = value
        return self

    def with_is_required(self, value: bool) -> Self:
        self.is_required = value
        return self

    def with_error_message(self, value: str) -> Self:
        self.error_message = value
        return self

    def with_value_changed_action(self, value: Action) -> Self:
        self.value_changed_action = value
        return self

    def with_value(self, value: str) -> Self:
        self.value = value
        return self

    def with_max_length(self, value: float) -> Self:
        self.max_length = value
        return self

    def with_is_multiline(self, value: bool) -> Self:
        self.is_multiline = value
        return self

    def with_placeholder(self, value: str) -> Self:
        self.placeholder = value
        return self

    def with_style(self, value: InputTextStyle) -> Self:
        self.style = value
        return self

    def with_inline_action(self, value: Action) -> Self:
        self.inline_action = value
        return self

    def with_regex(self, value: str) -> Self:
        self.regex = 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


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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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] = False
    """ 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[SerializeAsAny[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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_label(self, value: str) -> Self:
        self.label = value
        return self

    def with_is_required(self, value: bool) -> Self:
        self.is_required = value
        return self

    def with_error_message(self, value: str) -> Self:
        self.error_message = value
        return self

    def with_value_changed_action(self, value: Action) -> Self:
        self.value_changed_action = value
        return self

    def with_value(self, value: str) -> Self:
        self.value = value
        return self

    def with_placeholder(self, value: str) -> Self:
        self.placeholder = value
        return self

    def with_min(self, value: str) -> Self:
        self.min = value
        return self

    def with_max(self, value: str) -> Self:
        self.max = 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


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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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] = False
    """ 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[SerializeAsAny[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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_label(self, value: str) -> Self:
        self.label = value
        return self

    def with_is_required(self, value: bool) -> Self:
        self.is_required = value
        return self

    def with_error_message(self, value: str) -> Self:
        self.error_message = value
        return self

    def with_value_changed_action(self, value: Action) -> Self:
        self.value_changed_action = value
        return self

    def with_value(self, value: str) -> Self:
        self.value = value
        return self

    def with_placeholder(self, value: str) -> Self:
        self.placeholder = value
        return self

    def with_min(self, value: str) -> Self:
        self.min = value
        return self

    def with_max(self, value: str) -> Self:
        self.max = 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


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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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] = False
    """ 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[SerializeAsAny[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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_label(self, value: str) -> Self:
        self.label = value
        return self

    def with_is_required(self, value: bool) -> Self:
        self.is_required = value
        return self

    def with_error_message(self, value: str) -> Self:
        self.error_message = value
        return self

    def with_value_changed_action(self, value: Action) -> Self:
        self.value_changed_action = value
        return self

    def with_value(self, value: float) -> Self:
        self.value = value
        return self

    def with_placeholder(self, value: str) -> Self:
        self.placeholder = value
        return self

    def with_min(self, value: float) -> Self:
        self.min = value
        return self

    def with_max(self, value: float) -> Self:
        self.max = 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


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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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] = False
    """ 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[SerializeAsAny[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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_label(self, value: str) -> Self:
        self.label = value
        return self

    def with_is_required(self, value: bool) -> Self:
        self.is_required = value
        return self

    def with_error_message(self, value: str) -> Self:
        self.error_message = value
        return self

    def with_value_changed_action(self, value: Action) -> Self:
        self.value_changed_action = value
        return self

    def with_value(self, value: str) -> Self:
        self.value = value
        return self

    def with_title(self, value: str) -> Self:
        self.title = value
        return self

    def with_value_on(self, value: str) -> Self:
        self.value_on = value
        return self

    def with_value_off(self, value: str) -> Self:
        self.value_off = value
        return self

    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

    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 """

    def with_key(self, value: str) -> Self:
        self.key = value
        return self

    def with_title(self, value: str) -> Self:
        self.title = value
        return self

    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"
    """ 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. """

    def with_key(self, value: str) -> Self:
        self.key = value
        return self

    def with_dataset(self, value: str) -> Self:
        self.dataset = value
        return self

    def with_associated_inputs(self, value: AssociatedInputs) -> Self:
        self.associated_inputs = value
        return self

    def with_count(self, value: float) -> Self:
        self.count = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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] = False
    """ 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[SerializeAsAny[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] = False
    """ 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] = False
    """ 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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_label(self, value: str) -> Self:
        self.label = value
        return self

    def with_is_required(self, value: bool) -> Self:
        self.is_required = value
        return self

    def with_error_message(self, value: str) -> Self:
        self.error_message = value
        return self

    def with_value_changed_action(self, value: Action) -> Self:
        self.value_changed_action = value
        return self

    def with_value(self, value: str) -> Self:
        self.value = value
        return self

    def with_choices(self, value: List[Choice]) -> Self:
        self.choices = value
        return self

    def with_choices_data(self, value: QueryData) -> Self:
        self.choices_data = value
        return self

    def with_style(self, value: ChoiceSetInputStyle) -> Self:
        self.style = value
        return self

    def with_is_multi_select(self, value: bool) -> Self:
        self.is_multi_select = value
        return self

    def with_placeholder(self, value: str) -> Self:
        self.placeholder = value
        return self

    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

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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] = False
    """ 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[SerializeAsAny[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] = False
    """ 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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_label(self, value: str) -> Self:
        self.label = value
        return self

    def with_is_required(self, value: bool) -> Self:
        self.is_required = value
        return self

    def with_error_message(self, value: str) -> Self:
        self.error_message = value
        return self

    def with_value_changed_action(self, value: Action) -> Self:
        self.value_changed_action = value
        return self

    def with_value(self, value: float) -> Self:
        self.value = value
        return self

    def with_max(self, value: float) -> Self:
        self.max = value
        return self

    def with_allow_half_steps(self, value: bool) -> Self:
        self.allow_half_steps = value
        return self

    def with_size(self, value: RatingSize) -> Self:
        self.size = value
        return self

    def with_color(self, value: RatingColor) -> Self:
        self.color = 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


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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_value(self, value: float) -> Self:
        self.value = value
        return self

    def with_count(self, value: float) -> Self:
        self.count = value
        return self

    def with_max(self, value: float) -> Self:
        self.max = value
        return self

    def with_size(self, value: RatingSize) -> Self:
        self.size = value
        return self

    def with_color(self, value: RatingColor) -> Self:
        self.color = value
        return self

    def with_style(self, value: RatingStyle) -> Self:
        self.style = 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


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. """

    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_size(self, value: IconSize) -> Self:
        self.size = value
        return self

    def with_style(self, value: IconStyle) -> Self:
        self.style = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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[SerializeAsAny[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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_icon(self, value: IconInfo) -> Self:
        self.icon = value
        return self

    def with_badge(self, value: str) -> Self:
        self.badge = value
        return self

    def with_title(self, value: str) -> Self:
        self.title = value
        return self

    def with_description(self, value: str) -> Self:
        self.description = value
        return self

    def with_select_action(self, value: Action) -> Self:
        self.select_action = 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


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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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[SerializeAsAny[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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_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_name(self, value: str) -> Self:
        self.name = value
        return self

    def with_size(self, value: IconSize) -> Self:
        self.size = value
        return self

    def with_style(self, value: IconStyle) -> Self:
        self.style = value
        return self

    def with_color(self, value: TextColor) -> Self:
        self.color = value
        return self

    def with_select_action(self, value: Action) -> Self:
        self.select_action = 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


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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """
    select_action: Optional[SerializeAsAny[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] = False
    """ Controls if a border should be displayed around the container. """
    rounded_corners: Optional[bool] = False
    """ Controls if the container should have rounded corners. """
    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 `<number>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 `<number>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
    """ An alternate element to render 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
    """ 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

    def with_requires(self, value: Union[HostCapabilities, Dict[str, Any]]) -> 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_height(self, value: ElementHeight) -> Self:
        self.height = 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_select_action(self, value: Action) -> Self:
        self.select_action = value
        return self

    def with_style(self, value: ContainerStyle) -> Self:
        self.style = value
        return self

    def with_show_border(self, value: bool) -> Self:
        self.show_border = value
        return self

    def with_rounded_corners(self, value: bool) -> Self:
        self.rounded_corners = value
        return self

    def with_layouts(self, value: List[ContainerLayout]) -> Self:
        self.layouts = value
        return self

    def with_min_height(self, value: str) -> Self:
        self.min_height = value
        return self

    def with_background_image(self, value: Union[str, BackgroundImage]) -> Self:
        self.background_image = value
        return self

    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
        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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. """
    bleed: Optional[bool] = False
    """ 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 `<number>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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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 `<icon-name>[,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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_tooltip(self, value: str) -> Self:
        self.tooltip = 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


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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_label(self, value: str) -> Self:
        self.label = value
        return self

    def with_label_position(self, value: ProgressRingLabelPosition) -> Self:
        self.label_position = value
        return self

    def with_size(self, value: ProgressRingSize) -> Self:
        self.size = 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


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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_value(self, value: float) -> Self:
        self.value = value
        return self

    def with_max(self, value: float) -> Self:
        self.max = value
        return self

    def with_color(self, value: ProgressBarColor) -> Self:
        self.color = 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


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] = 0
    """ 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). """

    def with_key(self, value: str) -> Self:
        self.key = value
        return self

    def with_legend(self, value: str) -> Self:
        self.legend = value
        return self

    def with_value(self, value: float) -> Self:
        self.value = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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] = False
    """ 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 `<number>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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_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

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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] = False
    """ 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 `<number>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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_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

    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] = 0
    """ 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

    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). """

    def with_key(self, value: str) -> Self:
        self.key = value
        return self

    def with_legend(self, value: str) -> Self:
        self.legend = value
        return self

    def with_values(self, value: List[BarChartDataValue]) -> Self:
        self.values = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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] = False
    """ 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 `<number>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] = False
    """ 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] = False
    """ 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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_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

    def with_y_axis_title(self, value: str) -> Self:
        self.y_axis_title = value
        return self

    def with_color(self, value: ChartColor) -> Self:
        self.color = value
        return self

    def with_stacked(self, value: bool) -> Self:
        self.stacked = value
        return self

    def with_data(self, value: List[GroupedVerticalBarChartData]) -> Self:
        self.data = value
        return self

    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

    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] = 0
    """ 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). """

    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

    def with_y(self, value: float) -> Self:
        self.y = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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] = False
    """ 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 `<number>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] = False
    """ 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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_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

    def with_y_axis_title(self, value: str) -> Self:
        self.y_axis_title = value
        return self

    def with_data(self, value: List[VerticalBarChartDataValue]) -> Self:
        self.data = value
        return self

    def with_color(self, value: ChartColor) -> Self:
        self.color = value
        return self

    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

    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] = 0
    """ 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). """

    def with_key(self, value: str) -> Self:
        self.key = value
        return self

    def with_x(self, value: str) -> Self:
        self.x = value
        return self

    def with_y(self, value: float) -> Self:
        self.y = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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] = False
    """ 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 `<number>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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_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

    def with_y_axis_title(self, value: str) -> Self:
        self.y_axis_title = value
        return self

    def with_color(self, value: ChartColor) -> Self:
        self.color = value
        return self

    def with_data(self, value: List[HorizontalBarChartDataValue]) -> Self:
        self.data = value
        return self

    def with_display_mode(self, value: HorizontalBarChartDisplayMode) -> Self:
        self.display_mode = 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


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] = 0
    """ 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). """

    def with_key(self, value: str) -> Self:
        self.key = value
        return self

    def with_legend(self, value: str) -> Self:
        self.legend = value
        return self

    def with_value(self, value: float) -> Self:
        self.value = value
        return self

    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. """

    def with_key(self, value: str) -> Self:
        self.key = value
        return self

    def with_title(self, value: str) -> Self:
        self.title = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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] = False
    """ 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 `<number>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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_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

    def with_y_axis_title(self, value: str) -> Self:
        self.y_axis_title = value
        return self

    def with_color(self, value: ChartColor) -> Self:
        self.color = value
        return self

    def with_data(self, value: List[StackedHorizontalBarChartData]) -> Self:
        self.data = 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


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] = 0
    """ 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

    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). """

    def with_key(self, value: str) -> Self:
        self.key = value
        return self

    def with_legend(self, value: str) -> Self:
        self.legend = value
        return self

    def with_values(self, value: List[LineChartValue]) -> Self:
        self.values = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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] = False
    """ 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 `<number>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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_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

    def with_y_axis_title(self, value: str) -> Self:
        self.y_axis_title = value
        return self

    def with_color(self, value: ChartColor) -> Self:
        self.color = value
        return self

    def with_data(self, value: List[LineChartData]) -> Self:
        self.data = 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

    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] = 0
    """ 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). """

    def with_key(self, value: str) -> Self:
        self.key = value
        return self

    def with_size(self, value: float) -> Self:
        self.size = value
        return self

    def with_legend(self, value: str) -> Self:
        self.legend = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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] = False
    """ 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 `<number>px` format. """
    show_legend: Optional[bool] = True
    """ Controls whether the chart's legend should be displayed. """
    min: Optional[float] = 0
    """ 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] = 0
    """ 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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_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

    def with_max(self, value: float) -> Self:
        self.max = value
        return self

    def with_sub_label(self, value: str) -> Self:
        self.sub_label = value
        return self

    def with_show_min_max(self, value: bool) -> Self:
        self.show_min_max = value
        return self

    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:
        self.segments = value
        return self

    def with_value(self, value: float) -> Self:
        self.value = value
        return self

    def with_value_format(self, value: GaugeChartValueFormat) -> Self:
        self.value_format = 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


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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_code_snippet(self, value: str) -> Self:
        self.code_snippet = value
        return self

    def with_language(self, value: CodeLanguage) -> Self:
        self.language = value
        return self

    def with_start_line_number(self, value: float) -> Self:
        self.start_line_number = 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


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

    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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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"
    """ 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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_properties(self, value: PersonaProperties) -> Self:
        self.properties = 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


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**. """
    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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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"
    """ 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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_properties(self, value: PersonaSetProperties) -> Self:
        self.properties = 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


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


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. """

    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_resource_reference(self, value: Dict[str, str]) -> Self:
        self.resource_reference = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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"
    """ 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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_properties(self, value: ResourceProperties) -> Self:
        self.properties = 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


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. """

    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_extension(self, value: str) -> Self:
        self.extension = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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"
    """ 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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_properties(self, value: FileProperties) -> Self:
        self.properties = 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


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. """

    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_email(self, value: str) -> Self:
        self.email = value
        return self

    def with_title(self, value: str) -> Self:
        self.title = value
        return self

    def with_type(self, value: str) -> Self:
        self.type = value
        return self

    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. """

    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_title(self, value: str) -> Self:
        self.title = value
        return self

    def with_start(self, value: str) -> Self:
        self.start = value
        return self

    def with_end(self, value: str) -> Self:
        self.end = value
        return self

    def with_status(self, value: str) -> Self:
        self.status = value
        return self

    def with_locations(self, value: List[str]) -> Self:
        self.locations = value
        return self

    def with_online_meeting_url(self, value: str) -> Self:
        self.online_meeting_url = value
        return self

    def with_is_all_day(self, value: bool) -> Self:
        self.is_all_day = value
        return self

    def with_extension(self, value: str) -> Self:
        self.extension = value
        return self

    def with_url(self, value: str) -> Self:
        self.url = value
        return self

    def with_attendees(self, value: List[CalendarEventAttendee]) -> Self:
        self.attendees = value
        return self

    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"
    """ 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[Union[HostCapabilities, Dict[str, Any]]] = 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] = False
    """ Controls whether a separator line should be displayed above the element to visually separate it 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] = False
    """ 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"
    """ 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
    """ An alternate element to render 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: Union[HostCapabilities, Dict[str, Any]]) -> 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_properties(self, value: CalendarEventProperties) -> Self:
        self.properties = 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


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**. """
    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] = False
    """ 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] = False
    """ Controls if the text should be italicized. """
    strikethrough: Optional[bool] = False
    """ Controls if the text should be struck through. """
    highlight: Optional[bool] = False
    """ Controls if the text should be highlighted. """
    underline: Optional[bool] = False
    """ Controls if the text should be underlined. """
    select_action: Optional[SerializeAsAny[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
    """ An alternate element to render 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_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_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_size(self, value: TextSize) -> Self:
        self.size = value
        return self

    def with_weight(self, value: TextWeight) -> Self:
        self.weight = value
        return self

    def with_color(self, value: TextColor) -> Self:
        self.color = value
        return self

    def with_is_subtle(self, value: bool) -> Self:
        self.is_subtle = value
        return self

    def with_font_type(self, value: FontType) -> Self:
        self.font_type = value
        return self

    def with_italic(self, value: bool) -> Self:
        self.italic = value
        return self

    def with_strikethrough(self, value: bool) -> Self:
        self.strikethrough = value
        return self

    def with_highlight(self, value: bool) -> Self:
        self.highlight = value
        return self

    def with_underline(self, value: bool) -> Self:
        self.underline = value
        return self

    def with_select_action(self, value: Action) -> Self:
        self.select_action = 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


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**. """
    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] = False
    """ 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[SerializeAsAny[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
    """ An alternate element to render 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_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_is_sort_key(self, value: bool) -> Self:
        self.is_sort_key = value
        return self

    def with_name(self, value: str) -> Self:
        self.name = value
        return self

    def with_size(self, value: SizeEnum) -> Self:
        self.size = value
        return self

    def with_style(self, value: IconStyle) -> Self:
        self.style = value
        return self

    def with_color(self, value: TextColor) -> Self:
        self.color = value
        return self

    def with_select_action(self, value: Action) -> Self:
        self.select_action = 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


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**. """
    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] = False
    """ 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[SerializeAsAny[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
    """ An alternate element to render 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_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_is_sort_key(self, value: bool) -> Self:
        self.is_sort_key = value
        return self

    def with_url(self, value: str) -> Self:
        self.url = value
        return self

    def with_size(self, value: SizeEnum) -> Self:
        self.size = value
        return self

    def with_style(self, value: ImageStyle) -> Self:
        self.style = value
        return self

    def with_select_action(self, value: Action) -> Self:
        self.select_action = value
        return self

    def with_themed_urls(self, value: List[ThemedUrl]) -> Self:
        self.themed_urls = 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


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
