File: /var/www/quadcode.com/node_modules/pipedrive/dist/model/ProductListItem.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 _ProductWithArrayPrices = _interopRequireDefault(require("./ProductWithArrayPrices"));
/**
* 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 ProductListItem model module.
* @module model/ProductListItem
* @version 1.0.0
*/
var ProductListItem = /*#__PURE__*/function () {
/**
* Constructs a new <code>ProductListItem</code>.
* @alias module:model/ProductListItem
*/
function ProductListItem() {
(0, _classCallCheck2["default"])(this, ProductListItem);
ProductListItem.initialize(this);
}
/**
* 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"])(ProductListItem, null, [{
key: "initialize",
value: function initialize(obj) {}
/**
* Constructs a <code>ProductListItem</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/ProductListItem} obj Optional instance to populate.
* @return {module:model/ProductListItem} The populated <code>ProductListItem</code> instance.
*/
}, {
key: "constructFromObject",
value: function constructFromObject(data, obj) {
if (data) {
obj = obj || new ProductListItem();
if (data.hasOwnProperty('id')) {
obj['id'] = _ApiClient["default"].convertToType(data['id'], 'Number');
delete data['id'];
}
if (data.hasOwnProperty('deal_id')) {
obj['deal_id'] = _ApiClient["default"].convertToType(data['deal_id'], 'Number');
delete data['deal_id'];
}
if (data.hasOwnProperty('order_nr')) {
obj['order_nr'] = _ApiClient["default"].convertToType(data['order_nr'], 'Number');
delete data['order_nr'];
}
if (data.hasOwnProperty('product_id')) {
obj['product_id'] = _ApiClient["default"].convertToType(data['product_id'], 'Number');
delete data['product_id'];
}
if (data.hasOwnProperty('product_variation_id')) {
obj['product_variation_id'] = _ApiClient["default"].convertToType(data['product_variation_id'], 'Number');
delete data['product_variation_id'];
}
if (data.hasOwnProperty('item_price')) {
obj['item_price'] = _ApiClient["default"].convertToType(data['item_price'], 'Number');
delete data['item_price'];
}
if (data.hasOwnProperty('discount')) {
obj['discount'] = _ApiClient["default"].convertToType(data['discount'], 'Number');
delete data['discount'];
}
if (data.hasOwnProperty('discount_type')) {
obj['discount_type'] = _ApiClient["default"].convertToType(data['discount_type'], 'String');
delete data['discount_type'];
}
if (data.hasOwnProperty('duration')) {
obj['duration'] = _ApiClient["default"].convertToType(data['duration'], 'Number');
delete data['duration'];
}
if (data.hasOwnProperty('duration_unit')) {
obj['duration_unit'] = _ApiClient["default"].convertToType(data['duration_unit'], 'String');
delete data['duration_unit'];
}
if (data.hasOwnProperty('sum')) {
obj['sum'] = _ApiClient["default"].convertToType(data['sum'], 'Number');
delete data['sum'];
}
if (data.hasOwnProperty('currency')) {
obj['currency'] = _ApiClient["default"].convertToType(data['currency'], 'String');
delete data['currency'];
}
if (data.hasOwnProperty('enabled_flag')) {
obj['enabled_flag'] = _ApiClient["default"].convertToType(data['enabled_flag'], 'Boolean');
delete data['enabled_flag'];
}
if (data.hasOwnProperty('add_time')) {
obj['add_time'] = _ApiClient["default"].convertToType(data['add_time'], 'String');
delete data['add_time'];
}
if (data.hasOwnProperty('last_edit')) {
obj['last_edit'] = _ApiClient["default"].convertToType(data['last_edit'], 'String');
delete data['last_edit'];
}
if (data.hasOwnProperty('comments')) {
obj['comments'] = _ApiClient["default"].convertToType(data['comments'], 'String');
delete data['comments'];
}
if (data.hasOwnProperty('active_flag')) {
obj['active_flag'] = _ApiClient["default"].convertToType(data['active_flag'], 'Boolean');
delete data['active_flag'];
}
if (data.hasOwnProperty('tax')) {
obj['tax'] = _ApiClient["default"].convertToType(data['tax'], 'Number');
delete data['tax'];
}
if (data.hasOwnProperty('tax_method')) {
obj['tax_method'] = _ApiClient["default"].convertToType(data['tax_method'], 'String');
delete data['tax_method'];
}
if (data.hasOwnProperty('name')) {
obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
delete data['name'];
}
if (data.hasOwnProperty('sum_formatted')) {
obj['sum_formatted'] = _ApiClient["default"].convertToType(data['sum_formatted'], 'String');
delete data['sum_formatted'];
}
if (data.hasOwnProperty('quantity_formatted')) {
obj['quantity_formatted'] = _ApiClient["default"].convertToType(data['quantity_formatted'], 'String');
delete data['quantity_formatted'];
}
if (data.hasOwnProperty('quantity')) {
obj['quantity'] = _ApiClient["default"].convertToType(data['quantity'], 'Number');
delete data['quantity'];
}
if (data.hasOwnProperty('product')) {
obj['product'] = _ProductWithArrayPrices["default"].constructFromObject(data['product']);
delete data['product'];
}
if (Object.keys(data).length > 0) {
Object.assign(obj, data);
}
}
return obj;
}
}]);
return ProductListItem;
}();
/**
* The ID of the deal-product (the ID of the product attached to the deal)
* @member {Number} id
*/
ProductListItem.prototype['id'] = undefined;
/**
* The ID of the deal
* @member {Number} deal_id
*/
ProductListItem.prototype['deal_id'] = undefined;
/**
* The order number of the product
* @member {Number} order_nr
*/
ProductListItem.prototype['order_nr'] = undefined;
/**
* The ID of the product
* @member {Number} product_id
*/
ProductListItem.prototype['product_id'] = undefined;
/**
* The ID of the product variation
* @member {Number} product_variation_id
*/
ProductListItem.prototype['product_variation_id'] = undefined;
/**
* The price value of the product
* @member {Number} item_price
*/
ProductListItem.prototype['item_price'] = undefined;
/**
* The value of the discount. The `discount_type` field can be used to specify whether the value is an amount or a percentage
* @member {Number} discount
* @default 0
*/
ProductListItem.prototype['discount'] = 0;
/**
* The type of the discount's value
* @member {module:model/ProductListItem.DiscountTypeEnum} discount_type
* @default 'percentage'
*/
ProductListItem.prototype['discount_type'] = 'percentage';
/**
* The duration of the product
* @member {Number} duration
*/
ProductListItem.prototype['duration'] = undefined;
/**
* The type of the duration. (For example hourly, daily, etc.)
* @member {String} duration_unit
*/
ProductListItem.prototype['duration_unit'] = undefined;
/**
* The sum of all the products attached to the deal
* @member {Number} sum
*/
ProductListItem.prototype['sum'] = undefined;
/**
* The currency associated with the deal product
* @member {String} currency
*/
ProductListItem.prototype['currency'] = undefined;
/**
* Whether the product is enabled or not
* @member {Boolean} enabled_flag
*/
ProductListItem.prototype['enabled_flag'] = undefined;
/**
* The date and time when the product was added to the deal
* @member {String} add_time
*/
ProductListItem.prototype['add_time'] = undefined;
/**
* The date and time when the deal product was last edited
* @member {String} last_edit
*/
ProductListItem.prototype['last_edit'] = undefined;
/**
* The comments of the product
* @member {String} comments
*/
ProductListItem.prototype['comments'] = undefined;
/**
* Whether the product is active or not
* @member {Boolean} active_flag
*/
ProductListItem.prototype['active_flag'] = undefined;
/**
* The product tax
* @member {Number} tax
*/
ProductListItem.prototype['tax'] = undefined;
/**
* The tax option to be applied to the products. When using `inclusive`, the tax percentage will already be included in the price. When using `exclusive`, the tax will not be included in the price. When using `none`, no tax will be added. Use the `tax` field for defining the tax percentage amount. By default, the user setting value for tax options will be used. Changing this in one product affects the rest of the products attached to the deal
* @member {module:model/ProductListItem.TaxMethodEnum} tax_method
*/
ProductListItem.prototype['tax_method'] = undefined;
/**
* The product name
* @member {String} name
*/
ProductListItem.prototype['name'] = undefined;
/**
* The formatted sum of the product
* @member {String} sum_formatted
*/
ProductListItem.prototype['sum_formatted'] = undefined;
/**
* The formatted quantity of the product
* @member {String} quantity_formatted
*/
ProductListItem.prototype['quantity_formatted'] = undefined;
/**
* The quantity of the product
* @member {Number} quantity
*/
ProductListItem.prototype['quantity'] = undefined;
/**
* @member {module:model/ProductWithArrayPrices} product
*/
ProductListItem.prototype['product'] = undefined;
/**
* Allowed values for the <code>discount_type</code> property.
* @enum {String}
* @readonly
*/
ProductListItem['DiscountTypeEnum'] = {
/**
* value: "percentage"
* @const
*/
"percentage": "percentage",
/**
* value: "amount"
* @const
*/
"amount": "amount"
};
/**
* Allowed values for the <code>tax_method</code> property.
* @enum {String}
* @readonly
*/
ProductListItem['TaxMethodEnum'] = {
/**
* value: "exclusive"
* @const
*/
"exclusive": "exclusive",
/**
* value: "inclusive"
* @const
*/
"inclusive": "inclusive",
/**
* value: "none"
* @const
*/
"none": "none"
};
var _default = ProductListItem;
exports["default"] = _default;