typings/lib2/messagev2/messagePayload/formSubmissionMessage.js

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormSubmissionMessage = void 0;
const internal_1 = require("../internal");
/**
 * Represents a form submission message sent by the user.
 * @extends NonRawMessage
 */
class FormSubmissionMessage extends internal_1.NonRawMessage {
    /**
     * Creates a new instance of FormSubmissionMessage.
     */
    constructor() {
        super();
        /**
         * The type of the message.
         */
        this.type = 'formSubmission';
    }
    /**
     * Gets the submitted fields.
     * @returns The submitted fields.
     */
    getSubmittedFields() {
        return this.submittedFields;
    }
    /**
     * Get a submitted field value.
     * @param {string} id The id of the field.
     * @returns The submitted field value.
     */
    getSubmittedField(id) {
        return this.submittedFields ? this.submittedFields[id] : undefined;
    }
    /**
     * Gets the partial submit field.
     * @returns The partial submit field.
     */
    getPartialSubmitField() {
        return this.partialSubmitField;
    }
    /**
     * Gets the postback.
     * @returns The postback.
     */
    getPostback() {
        return this.postback;
    }
}
exports.FormSubmissionMessage = FormSubmissionMessage;