AnimationCard Class
An animation card (Ex: gif or short video clip).
Constructor
pydantic model AnimationCard
Parameters
| Name | Description |
|---|---|
|
title
Required
|
Title of this card |
|
subtitle
Required
|
Subtitle of this card |
|
text
Required
|
Text of this card |
|
image
Required
|
Thumbnail placeholder |
|
media
Required
|
Media URLs for this card. When this field contains more than one URL, each URL is an alternative format of the same content. |
|
buttons
Required
|
Actions on this card |
|
shareable
Required
|
This content may be shared with others (default:true) |
|
autoloop
Required
|
Should the client loop playback at end of content (default:true) |
|
autostart
Required
|
Should the client automatically start playback of media in this card (default:true) |
|
aspect
Required
|
Aspect ratio of thumbnail/media placeholder. Allowed values are "16:9" and "4:3" |
|
duration
Required
|
Describes the length of the media content without requiring a receiver to open the content. Formatted as an ISO 8601 Duration field. |
|
value
Required
|
Supplementary parameter for this card |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
title
|
Default value: None
|
|
subtitle
|
Default value: None
|
|
text
|
Default value: None
|
|
image
|
Default value: None
|
|
media
|
Default value: None
|
|
buttons
|
Default value: None
|
|
shareable
|
Default value: None
|
|
autoloop
|
Default value: None
|
|
autostart
|
Default value: None
|
|
aspect
|
Default value: None
|
|
duration
|
Default value: None
|
|
value
|
Default value: None
|
Methods
| add_button |
Adds a button and returns this card. |
| add_media |
Adds a media URL and returns this card. |
| to_attachment |
Creates a new Attachment that wraps this card. |
| to_message |
Creates a new message activity that includes this card as an attachment. |
add_button
Adds a button and returns this card.
add_button(button: CardAction) -> AnimationCard
Parameters
| Name | Description |
|---|---|
|
button
Required
|
The button to add. |
Returns
| Type | Description |
|---|---|
|
This card, to allow for method chaining. |
add_media
Adds a media URL and returns this card.
add_media(media: MediaUrl) -> AnimationCard
Parameters
| Name | Description |
|---|---|
|
media
|
The media URL to add. Default value: None
|
|
url
Required
|
The URL of the media, used when no media instance is provided. |
|
profile
Required
|
The profile of the media built from a URL. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
url
|
Default value: None
|
|
profile
|
Default value: None
|
Returns
| Type | Description |
|---|---|
|
This card, to allow for method chaining. |
to_attachment
Creates a new Attachment that wraps this card.
to_attachment() -> Attachment
Returns
| Type | Description |
|---|---|
|
The generated attachment. |
to_message
Creates a new message activity that includes this card as an attachment.
to_message() -> Activity
Returns
| Type | Description |
|---|---|
|
An Activity representing a message activity with the card attached. |
Attributes
aspect
field aspect: str = None
autoloop
field autoloop: bool = None
autostart
field autostart: bool = None
buttons
field buttons: list[CardAction] = None
duration
field duration: str = None
image
field image: ThumbnailUrl = None
media
field media: list[MediaUrl] = None
shareable
field shareable: bool = None
subtitle
field subtitle: str = None
text
field text: str = None
title
field title: str = None
value
field value: object = None