File: /var/www/fintechfuel/node_modules/pipedrive/dist/model/MessageObject.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
var _MessageObjectAttachments = _interopRequireDefault(require("./MessageObjectAttachments"));
/**
* Pipedrive API v1
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
/**
* The MessageObject model module.
* @module model/MessageObject
* @version 1.0.0
*/
var MessageObject = /*#__PURE__*/function () {
/**
* Constructs a new <code>MessageObject</code>.
* @alias module:model/MessageObject
* @param id {String} The ID of the message
* @param channelId {String} The channel ID as in the provider
* @param senderId {String} The ID of the provider's user that sent the message
* @param conversationId {String} The ID of the conversation
* @param message {String} The body of the message
* @param status {module:model/MessageObject.StatusEnum} The status of the message
* @param createdAt {Date} The date and time when the message was created in the provider, in UTC. Format: YYYY-MM-DD HH:MM
*/
function MessageObject(id, channelId, senderId, conversationId, message, status, createdAt) {
(0, _classCallCheck2["default"])(this, MessageObject);
MessageObject.initialize(this, id, channelId, senderId, conversationId, message, status, createdAt);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
(0, _createClass2["default"])(MessageObject, null, [{
key: "initialize",
value: function initialize(obj, id, channelId, senderId, conversationId, message, status, createdAt) {
obj['id'] = id;
obj['channel_id'] = channelId;
obj['sender_id'] = senderId;
obj['conversation_id'] = conversationId;
obj['message'] = message;
obj['status'] = status;
obj['created_at'] = createdAt;
}
/**
* Constructs a <code>MessageObject</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/MessageObject} obj Optional instance to populate.
* @return {module:model/MessageObject} The populated <code>MessageObject</code> instance.
*/
}, {
key: "constructFromObject",
value: function constructFromObject(data, obj) {
if (data) {
obj = obj || new MessageObject();
if (data.hasOwnProperty('id')) {
obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
delete data['id'];
}
if (data.hasOwnProperty('channel_id')) {
obj['channel_id'] = _ApiClient["default"].convertToType(data['channel_id'], 'String');
delete data['channel_id'];
}
if (data.hasOwnProperty('sender_id')) {
obj['sender_id'] = _ApiClient["default"].convertToType(data['sender_id'], 'String');
delete data['sender_id'];
}
if (data.hasOwnProperty('conversation_id')) {
obj['conversation_id'] = _ApiClient["default"].convertToType(data['conversation_id'], 'String');
delete data['conversation_id'];
}
if (data.hasOwnProperty('message')) {
obj['message'] = _ApiClient["default"].convertToType(data['message'], 'String');
delete data['message'];
}
if (data.hasOwnProperty('status')) {
obj['status'] = _ApiClient["default"].convertToType(data['status'], 'String');
delete data['status'];
}
if (data.hasOwnProperty('created_at')) {
obj['created_at'] = _ApiClient["default"].convertToType(data['created_at'], 'Date');
delete data['created_at'];
}
if (data.hasOwnProperty('reply_by')) {
obj['reply_by'] = _ApiClient["default"].convertToType(data['reply_by'], 'Date');
delete data['reply_by'];
}
if (data.hasOwnProperty('conversation_link')) {
obj['conversation_link'] = _ApiClient["default"].convertToType(data['conversation_link'], 'String');
delete data['conversation_link'];
}
if (data.hasOwnProperty('attachments')) {
obj['attachments'] = _ApiClient["default"].convertToType(data['attachments'], [_MessageObjectAttachments["default"]]);
delete data['attachments'];
}
if (Object.keys(data).length > 0) {
Object.assign(obj, data);
}
}
return obj;
}
}]);
return MessageObject;
}();
/**
* The ID of the message
* @member {String} id
*/
MessageObject.prototype['id'] = undefined;
/**
* The channel ID as in the provider
* @member {String} channel_id
*/
MessageObject.prototype['channel_id'] = undefined;
/**
* The ID of the provider's user that sent the message
* @member {String} sender_id
*/
MessageObject.prototype['sender_id'] = undefined;
/**
* The ID of the conversation
* @member {String} conversation_id
*/
MessageObject.prototype['conversation_id'] = undefined;
/**
* The body of the message
* @member {String} message
*/
MessageObject.prototype['message'] = undefined;
/**
* The status of the message
* @member {module:model/MessageObject.StatusEnum} status
*/
MessageObject.prototype['status'] = undefined;
/**
* The date and time when the message was created in the provider, in UTC. Format: YYYY-MM-DD HH:MM
* @member {Date} created_at
*/
MessageObject.prototype['created_at'] = undefined;
/**
* The date and time when the message can no longer receive a reply, in UTC. Format: YYYY-MM-DD HH:MM
* @member {Date} reply_by
*/
MessageObject.prototype['reply_by'] = undefined;
/**
* A URL that can open the conversation in the provider's side
* @member {String} conversation_link
*/
MessageObject.prototype['conversation_link'] = undefined;
/**
* The list of attachments available in the message
* @member {Array.<module:model/MessageObjectAttachments>} attachments
*/
MessageObject.prototype['attachments'] = undefined;
/**
* Allowed values for the <code>status</code> property.
* @enum {String}
* @readonly
*/
MessageObject['StatusEnum'] = {
/**
* value: "sent"
* @const
*/
"sent": "sent",
/**
* value: "delivered"
* @const
*/
"delivered": "delivered",
/**
* value: "read"
* @const
*/
"read": "read",
/**
* value: "failed"
* @const
*/
"failed": "failed"
};
var _default = MessageObject;
exports["default"] = _default;