src/models/Message.js
/**
* @deprecated
*
* Model representing message. In-app conversations consist of one or more messages.
*/
class MessageModel {
/**
* @deprecated
* @param {Object} response - JSON formatted response of a single message
* in a conversation
* @param {Number} response.id - The id of the message
* @param {String} response.title - The title of the message
* @param {Object} response.body - The body of the message
* @param {String} response.subject - The subject of the message
* @param {Array} response.recipients - The recipients of the message.
* @param {Object} response.attachment - Attachment included in the message.
* @param {String} response.attachment.file_data - File data for the attachment.
* @param {String} response.attachment.content_type - Content type of the attachment.
* @param {String} response.attachment.file_name - File name of hte attachment.
*/
constructor(response = {}) {
/** @type {Number} */
this.id = response.id;
/** @type {String} */
this.title = response.title;
/** @type {Object} */
this.body = response.body;
/** @type {String} */
this.created_at = response.created_at;
/** @type {String} */
this.updated_at = response.updated_at;
/** @type {String} */
this.subject = response.subject;
/** @type {Array} */
this.recipients = response.recipients;
/** @type {String} */
this.conversation_id = response.conversation_id;
/** @type {Object} */
this.attachment = response.attachment;
}
}
export default MessageModel;