import { ButtonElement } from "../InteractiveElements/index";
/**
 * Represents the data for an interactive card.
 */
export class InteractiveCardData {
    imageUrl;
    text;
    cardActions;
    /**
     * Creates an instance of InteractiveCardData.
     * @param text The text to display on the card.
     * @param actions The actions to perform when the card is interacted with.
     */
    constructor(text, cardActions) {
        this.text = text;
        this.cardActions = cardActions;
    }
    /**
     * Gets the Url of the image for the card.
     * @returns The Url of the image.
     */
    getImageUrl() {
        return this.imageUrl || "";
    }
    /**
     * Sets the image Url for the interactive card data.
     * @param imageUrl - The Url of the image to be set.
     */
    setImageUrl(imageUrl) {
        this.imageUrl = imageUrl;
    }
    /**
     * Gets the text to display on the card.
     * @returns The text to display.
     */
    getText() {
        return this.text;
    }
    /**
     * Gets the actions to perform when the card is interacted with.
     * @returns The actions to perform.
     */
    getCardActions() {
        return this.cardActions;
    }
    /**
     * Creates an instance of InteractiveCardData from a JSON object.
     * @param json The JSON object to create the instance from.
     * @returns The created instance of InteractiveCardData.
     */
    static fromJSON(json) {
        const actions = json?.cardActions?.map((action) => {
            return ButtonElement.fromJSON(action);
        });
        const interactiveCardData = new InteractiveCardData(json.text, actions);
        if (json.imageUrl)
            interactiveCardData.setImageUrl(json.imageUrl);
        return interactiveCardData;
    }
}
//# sourceMappingURL=InteractiveCardData.js.map