CardAction Class

Represents a card action with button properties.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Constructor

CardAction(*, type: CardActionType, title: str, image: str | None = None, text: str | None = None, displayText: str | None = None, value: Any, channelData: Any | None = None, imageAltText: str | None = None, **extra_data: Any)

Keyword-Only Parameters

Name Description
type
Required
title
Required
image
Default value: None
text
Default value: None
displayText
Default value: None
value
Required
channelData
Default value: None
imageAltText
Default value: None

Attributes

channel_data

Channel-specific data associated with this action

channel_data: Any | None

display_text

(Optional) text to display in the chat feed if the button is clicked

display_text: str | None

image

Image URL which will appear on the button, next to text label

image: str | None

image_alt_text

Alternate image text to be used in place of the image field

image_alt_text: str | None

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_config: ClassVar[ConfigDict] = {'alias_generator': AliasGenerator(alias=None, validation_alias=<staticmethod(<function CustomBaseModel.validation_alias_generator>)>, serialization_alias=<staticmethod(<function CustomBaseModel.serialization_alias_generator>)>), 'arbitrary_types_allowed': True, 'extra': 'allow', 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

text

Text for this action

text: str | None

title

Text description which appears on the button

title: str

type

The type of action implemented by this button

type: CardActionType

value

Supplementary parameter for action. Content of this property depends on the ActionType

value: Any