typings/lib2/messagev2/messagePayload/rawMessage.js

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RawMessage = void 0;
/**
 * Represents a raw message.
 */
class RawMessage {
    /**
     * Creates an instance of the RawMessage class.
     * @param payload The message payload.
     */
    constructor(payload) {
        this.type = 'raw';
        this.payload = payload;
    }
    /**
     * Convert the message to JSON object
     * @returns The message in JSON format
     */
    toJson() {
        return JSON.parse(JSON.stringify(this));
    }
    /**
     * Gets the payload of the raw message.
     * @returns The message payload.
     */
    getPayload() {
        return this.payload;
    }
    /**
     * Sets the payload of the raw message.
     * @param payload The message payload to set.
     * @returns The updated instance of the RawMessage.
     */
    setPayload(payload) {
        this.payload = payload;
        return this;
    }
}
exports.RawMessage = RawMessage;