Skip to content

Code Reference

AdaptiveCard

Bases: CamelModel

An Adaptive Card, containing a free-form body of card elements, and an optional set of actions.

Other Parameters:

Name Type Description
schema_ str

The Adaptive Card schema. Aliased with $schema.

type str

Type of card must be AdaptiveCard

version str

Schema version that this card requires. If a client is lower than this version, the fallbackText will be rendered. NOTE: Version is not required for cards within an Action.ShowCard. However, it is required for the top-level card.

refresh str

Defines how the card can be refreshed by making a request to the target Bot.

authentication str

Defines authentication information to enable on-behalf-of single sign on or just-in-time OAuth.

body List[ElementModel]

The card elements to show in the primary card region.

actions List[ActionModel]

The Actions to show in the card's action bar.

select_action SelectAction

An Action that will be invoked when the card is tapped or selected. Action.ShowCard is not supported.

fallback_text str

Text shown when the client doesn't support the version specified (may contain markdown).

background_image Union[BackgroundImage, str]

Specifies the background image of the card.

min_height str

Specifies the minimum height of the card.

rtl bool

When true content in this Adaptive Card should be presented right to left. When 'false' content in this Adaptive Card should be presented left to right. If unset, the default platform behavior will apply.

speak str

Specifies what should be spoken for this entire card. This is simple text or SSML fragment.

lang str

The 2-letter ISO-639-1 language used in the card. Used to localize any date/time functions.

vertical_content_alignment str

Defines how the content should be aligned vertically within the container. Only relevant for fixed-height cards, or cards with a minHeight specified.

Source code in msadaptivecards/cards.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
class AdaptiveCard(CamelModel):
    """
    An Adaptive Card, containing a free-form body of card elements, and an optional set of actions.

    Keyword Args:
        schema_ (str): The Adaptive Card schema. Aliased with `$schema`.
        type (str): Type of card must be `AdaptiveCard`
        version (str): Schema version that this card requires. If a client is lower than this version, the
            fallbackText will be rendered. NOTE: Version is not required for cards within an Action.ShowCard.
            However, it is required for the top-level card.
        refresh (str): Defines how the card can be refreshed by making a request to the target Bot.
        authentication (str): Defines authentication information to enable on-behalf-of single sign on or
            just-in-time OAuth.
        body (List[ElementModel]): The card elements to show in the primary card region.
        actions (List[ActionModel]): The Actions to show in the card's action bar.
        select_action (SelectAction): An Action that will be invoked when the card is tapped or selected.
            Action.ShowCard is not supported.
        fallback_text (str): Text shown when the client doesn't support the version specified (may contain markdown).
        background_image (Union[BackgroundImage, str]): Specifies the background image of the card.
        min_height (str): Specifies the minimum height of the card.
        rtl (bool): When true content in this Adaptive Card should be presented right to left. When 'false' content
            in this Adaptive Card should be presented left to right. If unset, the default platform behavior will apply.
        speak (str): Specifies what should be spoken for this entire card. This is simple text or SSML fragment.
        lang (str): The 2-letter ISO-639-1 language used in the card. Used to localize any date/time functions.
        vertical_content_alignment (str): Defines how the content should be aligned vertically within the container.
            Only relevant for fixed-height cards, or cards with a minHeight specified.
    """

    schema_: str = Field(
        "http://adaptivecards.io/schemas/adaptive-card.json", description="The Adaptive Card schema.", alias="$schema"
    )
    type: Literal["AdaptiveCard"] = Field("AdaptiveCard", description="Must be 'AdaptiveCard'.")
    version: str = Field(
        "1.4",
        description="Schema version that this card requires. If a client is lower than this version, the fallbackText "
        "will be rendered. NOTE: Version is not required for cards within an Action.ShowCard. However, it is required "
        "for the top-level card.",
    )
    refresh: str = Field(
        None, description="Defines how the card can be refreshed by making a request to the target Bot."
    )
    authentication: str = Field(
        None,
        description="Defines authentication information to enable on-behalf-of single sign on or just-in-time OAuth.",
    )
    body: List[ElementModel] = Field(
        default_factory=list, description="The card elements to show in the primary card region."
    )
    actions: List[ActionModel] = Field(
        default_factory=list, description="The Actions to show in the card's action bar."
    )
    select_action: SelectAction = Field(
        None,
        description="An Action that will be invoked when the card is tapped or selected. Action.ShowCard is not "
        "supported.",
    )
    fallback_text: str = Field(
        None, description="Text shown when the client doesn't support the version specified (may contain markdown)."
    )
    background_image: Union[BackgroundImage, str] = Field(
        None, description="Specifies the background image of the card."
    )
    min_height: str = Field(None, description="Specifies the minimum height of the card.")
    rtl: bool = Field(
        False,
        description="When true content in this Adaptive Card should be presented right to left. When 'false' content "
        "in this Adaptive Card should be presented left to right. If unset, the default platform behavior will apply.",
    )
    speak: str = Field(
        None, description="Specifies what should be spoken for this entire card. This is simple text or SSML fragment."
    )
    lang: str = Field(
        None, description="The 2-letter ISO-639-1 language used in the card. Used to localize any date/time functions."
    )
    vertical_content_alignment: str = Field(
        None,
        description="Defines how the content should be aligned vertically within the container. Only relevant for "
        "fixed-height cards, or cards with a minHeight specified.",
    )

Last update: 2022-08-16