File: /var/www/quadcode.com/node_modules/pipedrive/dist/model/NewDeal.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 _BasicDeal = _interopRequireDefault(require("./BasicDeal"));
var _NewDealParameters = _interopRequireDefault(require("./NewDealParameters"));
var _RequredTitleParameter = _interopRequireDefault(require("./RequredTitleParameter"));
var _VisibleTo = _interopRequireDefault(require("./VisibleTo"));
/**
* 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 NewDeal model module.
* @module model/NewDeal
* @version 1.0.0
*/
var NewDeal = /*#__PURE__*/function () {
/**
* Constructs a new <code>NewDeal</code>.
* @alias module:model/NewDeal
* @implements module:model/RequredTitleParameter
* @implements module:model/NewDealParameters
* @implements module:model/BasicDeal
* @param title {String} The title of the deal
*/
function NewDeal(title) {
(0, _classCallCheck2["default"])(this, NewDeal);
_RequredTitleParameter["default"].initialize(this, title);
_NewDealParameters["default"].initialize(this);
_BasicDeal["default"].initialize(this);
NewDeal.initialize(this, title);
}
/**
* 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"])(NewDeal, null, [{
key: "initialize",
value: function initialize(obj, title) {
obj['title'] = title;
}
/**
* Constructs a <code>NewDeal</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/NewDeal} obj Optional instance to populate.
* @return {module:model/NewDeal} The populated <code>NewDeal</code> instance.
*/
}, {
key: "constructFromObject",
value: function constructFromObject(data, obj) {
if (data) {
obj = obj || new NewDeal();
_RequredTitleParameter["default"].constructFromObject(data, obj);
_NewDealParameters["default"].constructFromObject(data, obj);
_BasicDeal["default"].constructFromObject(data, obj);
if (data.hasOwnProperty('title')) {
obj['title'] = _ApiClient["default"].convertToType(data['title'], 'String');
delete data['title'];
}
if (data.hasOwnProperty('value')) {
obj['value'] = _ApiClient["default"].convertToType(data['value'], 'String');
delete data['value'];
}
if (data.hasOwnProperty('label')) {
obj['label'] = _ApiClient["default"].convertToType(data['label'], ['Number']);
delete data['label'];
}
if (data.hasOwnProperty('currency')) {
obj['currency'] = _ApiClient["default"].convertToType(data['currency'], 'String');
delete data['currency'];
}
if (data.hasOwnProperty('user_id')) {
obj['user_id'] = _ApiClient["default"].convertToType(data['user_id'], 'Number');
delete data['user_id'];
}
if (data.hasOwnProperty('person_id')) {
obj['person_id'] = _ApiClient["default"].convertToType(data['person_id'], 'Number');
delete data['person_id'];
}
if (data.hasOwnProperty('org_id')) {
obj['org_id'] = _ApiClient["default"].convertToType(data['org_id'], 'Number');
delete data['org_id'];
}
if (data.hasOwnProperty('pipeline_id')) {
obj['pipeline_id'] = _ApiClient["default"].convertToType(data['pipeline_id'], 'Number');
delete data['pipeline_id'];
}
if (data.hasOwnProperty('stage_id')) {
obj['stage_id'] = _ApiClient["default"].convertToType(data['stage_id'], 'Number');
delete data['stage_id'];
}
if (data.hasOwnProperty('status')) {
obj['status'] = _ApiClient["default"].convertToType(data['status'], 'String');
delete data['status'];
}
if (data.hasOwnProperty('origin_id')) {
obj['origin_id'] = _ApiClient["default"].convertToType(data['origin_id'], 'String');
delete data['origin_id'];
}
if (data.hasOwnProperty('channel')) {
obj['channel'] = _ApiClient["default"].convertToType(data['channel'], 'Number');
delete data['channel'];
}
if (data.hasOwnProperty('channel_id')) {
obj['channel_id'] = _ApiClient["default"].convertToType(data['channel_id'], 'String');
delete data['channel_id'];
}
if (data.hasOwnProperty('add_time')) {
obj['add_time'] = _ApiClient["default"].convertToType(data['add_time'], 'String');
delete data['add_time'];
}
if (data.hasOwnProperty('won_time')) {
obj['won_time'] = _ApiClient["default"].convertToType(data['won_time'], 'String');
delete data['won_time'];
}
if (data.hasOwnProperty('lost_time')) {
obj['lost_time'] = _ApiClient["default"].convertToType(data['lost_time'], 'String');
delete data['lost_time'];
}
if (data.hasOwnProperty('close_time')) {
obj['close_time'] = _ApiClient["default"].convertToType(data['close_time'], 'String');
delete data['close_time'];
}
if (data.hasOwnProperty('expected_close_date')) {
obj['expected_close_date'] = _ApiClient["default"].convertToType(data['expected_close_date'], 'Date');
delete data['expected_close_date'];
}
if (data.hasOwnProperty('probability')) {
obj['probability'] = _ApiClient["default"].convertToType(data['probability'], 'Number');
delete data['probability'];
}
if (data.hasOwnProperty('lost_reason')) {
obj['lost_reason'] = _ApiClient["default"].convertToType(data['lost_reason'], 'String');
delete data['lost_reason'];
}
if (data.hasOwnProperty('visible_to')) {
obj['visible_to'] = _ApiClient["default"].convertToType(data['visible_to'], _VisibleTo["default"]);
delete data['visible_to'];
}
if (Object.keys(data).length > 0) {
Object.assign(obj, data);
}
}
return obj;
}
}]);
return NewDeal;
}();
/**
* The title of the deal
* @member {String} title
*/
NewDeal.prototype['title'] = undefined;
/**
* The value of the deal. If omitted, value will be set to 0.
* @member {String} value
*/
NewDeal.prototype['value'] = undefined;
/**
* The array of the labels IDs.
* @member {Array.<Number>} label
*/
NewDeal.prototype['label'] = undefined;
/**
* The currency of the deal. Accepts a 3-character currency code. If omitted, currency will be set to the default currency of the authorized user.
* @member {String} currency
*/
NewDeal.prototype['currency'] = undefined;
/**
* The ID of the user which will be the owner of the created deal. If not provided, the user making the request will be used.
* @member {Number} user_id
*/
NewDeal.prototype['user_id'] = undefined;
/**
* The ID of a person which this deal will be linked to. If the person does not exist yet, it needs to be created first. This property is required unless `org_id` is specified.
* @member {Number} person_id
*/
NewDeal.prototype['person_id'] = undefined;
/**
* The ID of an organization which this deal will be linked to. If the organization does not exist yet, it needs to be created first. This property is required unless `person_id` is specified.
* @member {Number} org_id
*/
NewDeal.prototype['org_id'] = undefined;
/**
* The ID of the pipeline this deal will be added to. By default, the deal will be added to the first stage of the specified pipeline. Please note that `pipeline_id` and `stage_id` should not be used together as `pipeline_id` will be ignored.
* @member {Number} pipeline_id
*/
NewDeal.prototype['pipeline_id'] = undefined;
/**
* The ID of the stage this deal will be added to. Please note that a pipeline will be assigned automatically based on the `stage_id`. If omitted, the deal will be placed in the first stage of the default pipeline.
* @member {Number} stage_id
*/
NewDeal.prototype['stage_id'] = undefined;
/**
* open = Open, won = Won, lost = Lost, deleted = Deleted. If omitted, status will be set to open.
* @member {module:model/NewDeal.StatusEnum} status
*/
NewDeal.prototype['status'] = undefined;
/**
* The optional ID to further distinguish the origin of the deal - e.g. Which API integration created this deal. If omitted, `origin_id` will be set to null.
* @member {String} origin_id
*/
NewDeal.prototype['origin_id'] = undefined;
/**
* The ID of Marketing channel this deal was created from. Provided value must be one of the channels configured for your company. You can fetch allowed values with <a href=\"https://developers.pipedrive.com/docs/api/v1/DealFields#getDealField\" target=\"_blank\" rel=\"noopener noreferrer\">GET /v1/dealFields</a>. If omitted, channel will be set to null.
* @member {Number} channel
*/
NewDeal.prototype['channel'] = undefined;
/**
* The optional ID to further distinguish the Marketing channel. If omitted, `channel_id` will be set to null.
* @member {String} channel_id
*/
NewDeal.prototype['channel_id'] = undefined;
/**
* The optional creation date & time of the deal in UTC. Format: YYYY-MM-DD HH:MM:SS
* @member {String} add_time
*/
NewDeal.prototype['add_time'] = undefined;
/**
* The optional date and time of changing the deal status as won in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Won. Can not be used together with `lost_time`.
* @member {String} won_time
*/
NewDeal.prototype['won_time'] = undefined;
/**
* The optional date and time of changing the deal status as lost in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Lost. Can not be used together with `won_time`.
* @member {String} lost_time
*/
NewDeal.prototype['lost_time'] = undefined;
/**
* The optional date and time of closing the deal in UTC. Format: YYYY-MM-DD HH:MM:SS.
* @member {String} close_time
*/
NewDeal.prototype['close_time'] = undefined;
/**
* The expected close date of the deal. In ISO 8601 format: YYYY-MM-DD.
* @member {Date} expected_close_date
*/
NewDeal.prototype['expected_close_date'] = undefined;
/**
* The success probability percentage of the deal. Used/shown only when `deal_probability` for the pipeline of the deal is enabled.
* @member {Number} probability
*/
NewDeal.prototype['probability'] = undefined;
/**
* The optional message about why the deal was lost (to be used when status = lost)
* @member {String} lost_reason
*/
NewDeal.prototype['lost_reason'] = undefined;
/**
* The visibility of the deal. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner & followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table>
* @member {module:model/VisibleTo} visible_to
*/
NewDeal.prototype['visible_to'] = undefined;
// Implement RequredTitleParameter interface:
/**
* The title of the deal
* @member {String} title
*/
_RequredTitleParameter["default"].prototype['title'] = undefined;
// Implement NewDealParameters interface:
/**
* The value of the deal. If omitted, value will be set to 0.
* @member {String} value
*/
_NewDealParameters["default"].prototype['value'] = undefined;
/**
* The array of the labels IDs.
* @member {Array.<Number>} label
*/
_NewDealParameters["default"].prototype['label'] = undefined;
/**
* The currency of the deal. Accepts a 3-character currency code. If omitted, currency will be set to the default currency of the authorized user.
* @member {String} currency
*/
_NewDealParameters["default"].prototype['currency'] = undefined;
/**
* The ID of the user which will be the owner of the created deal. If not provided, the user making the request will be used.
* @member {Number} user_id
*/
_NewDealParameters["default"].prototype['user_id'] = undefined;
/**
* The ID of a person which this deal will be linked to. If the person does not exist yet, it needs to be created first. This property is required unless `org_id` is specified.
* @member {Number} person_id
*/
_NewDealParameters["default"].prototype['person_id'] = undefined;
/**
* The ID of an organization which this deal will be linked to. If the organization does not exist yet, it needs to be created first. This property is required unless `person_id` is specified.
* @member {Number} org_id
*/
_NewDealParameters["default"].prototype['org_id'] = undefined;
/**
* The ID of the pipeline this deal will be added to. By default, the deal will be added to the first stage of the specified pipeline. Please note that `pipeline_id` and `stage_id` should not be used together as `pipeline_id` will be ignored.
* @member {Number} pipeline_id
*/
_NewDealParameters["default"].prototype['pipeline_id'] = undefined;
/**
* The ID of the stage this deal will be added to. Please note that a pipeline will be assigned automatically based on the `stage_id`. If omitted, the deal will be placed in the first stage of the default pipeline.
* @member {Number} stage_id
*/
_NewDealParameters["default"].prototype['stage_id'] = undefined;
/**
* open = Open, won = Won, lost = Lost, deleted = Deleted. If omitted, status will be set to open.
* @member {module:model/NewDealParameters.StatusEnum} status
*/
_NewDealParameters["default"].prototype['status'] = undefined;
/**
* The optional ID to further distinguish the origin of the deal - e.g. Which API integration created this deal. If omitted, `origin_id` will be set to null.
* @member {String} origin_id
*/
_NewDealParameters["default"].prototype['origin_id'] = undefined;
/**
* The ID of Marketing channel this deal was created from. Provided value must be one of the channels configured for your company. You can fetch allowed values with <a href=\"https://developers.pipedrive.com/docs/api/v1/DealFields#getDealField\" target=\"_blank\" rel=\"noopener noreferrer\">GET /v1/dealFields</a>. If omitted, channel will be set to null.
* @member {Number} channel
*/
_NewDealParameters["default"].prototype['channel'] = undefined;
/**
* The optional ID to further distinguish the Marketing channel. If omitted, `channel_id` will be set to null.
* @member {String} channel_id
*/
_NewDealParameters["default"].prototype['channel_id'] = undefined;
/**
* The optional creation date & time of the deal in UTC. Format: YYYY-MM-DD HH:MM:SS
* @member {String} add_time
*/
_NewDealParameters["default"].prototype['add_time'] = undefined;
// Implement BasicDeal interface:
/**
* The optional date and time of changing the deal status as won in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Won. Can not be used together with `lost_time`.
* @member {String} won_time
*/
_BasicDeal["default"].prototype['won_time'] = undefined;
/**
* The optional date and time of changing the deal status as lost in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Lost. Can not be used together with `won_time`.
* @member {String} lost_time
*/
_BasicDeal["default"].prototype['lost_time'] = undefined;
/**
* The optional date and time of closing the deal in UTC. Format: YYYY-MM-DD HH:MM:SS.
* @member {String} close_time
*/
_BasicDeal["default"].prototype['close_time'] = undefined;
/**
* The expected close date of the deal. In ISO 8601 format: YYYY-MM-DD.
* @member {Date} expected_close_date
*/
_BasicDeal["default"].prototype['expected_close_date'] = undefined;
/**
* The success probability percentage of the deal. Used/shown only when `deal_probability` for the pipeline of the deal is enabled.
* @member {Number} probability
*/
_BasicDeal["default"].prototype['probability'] = undefined;
/**
* The optional message about why the deal was lost (to be used when status = lost)
* @member {String} lost_reason
*/
_BasicDeal["default"].prototype['lost_reason'] = undefined;
/**
* The visibility of the deal. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner & followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table>
* @member {module:model/VisibleTo} visible_to
*/
_BasicDeal["default"].prototype['visible_to'] = undefined;
/**
* Allowed values for the <code>status</code> property.
* @enum {String}
* @readonly
*/
NewDeal['StatusEnum'] = {
/**
* value: "open"
* @const
*/
"open": "open",
/**
* value: "won"
* @const
*/
"won": "won",
/**
* value: "lost"
* @const
*/
"lost": "lost",
/**
* value: "deleted"
* @const
*/
"deleted": "deleted"
};
var _default = NewDeal;
exports["default"] = _default;