HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/fintechfuel/node_modules/pipedrive/dist/model/ProductAttachmentDetails.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 _BasicDealProduct = _interopRequireDefault(require("./BasicDealProduct"));
var _ProductAttachementFields = _interopRequireDefault(require("./ProductAttachementFields"));
/**
 * 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 ProductAttachmentDetails model module.
 * @module model/ProductAttachmentDetails
 * @version 1.0.0
 */
var ProductAttachmentDetails = /*#__PURE__*/function () {
  /**
   * Constructs a new <code>ProductAttachmentDetails</code>.
   * @alias module:model/ProductAttachmentDetails
   * @implements module:model/BasicDealProduct
   * @implements module:model/ProductAttachementFields
   * @param productId {Number} The ID of the product
   * @param itemPrice {Number} The price at which this product will be added to the deal
   * @param quantity {Number} Quantity – e.g. how many items of this product will be added to the deal
   */
  function ProductAttachmentDetails(productId, itemPrice, quantity) {
    (0, _classCallCheck2["default"])(this, ProductAttachmentDetails);
    _BasicDealProduct["default"].initialize(this, productId, itemPrice, quantity);
    _ProductAttachementFields["default"].initialize(this);
    ProductAttachmentDetails.initialize(this, productId, itemPrice, quantity);
  }

  /**
   * 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"])(ProductAttachmentDetails, null, [{
    key: "initialize",
    value: function initialize(obj, productId, itemPrice, quantity) {
      obj['product_id'] = productId;
      obj['item_price'] = itemPrice;
      obj['quantity'] = quantity;
    }

    /**
     * Constructs a <code>ProductAttachmentDetails</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/ProductAttachmentDetails} obj Optional instance to populate.
     * @return {module:model/ProductAttachmentDetails} The populated <code>ProductAttachmentDetails</code> instance.
     */
  }, {
    key: "constructFromObject",
    value: function constructFromObject(data, obj) {
      if (data) {
        obj = obj || new ProductAttachmentDetails();
        _BasicDealProduct["default"].constructFromObject(data, obj);
        _ProductAttachementFields["default"].constructFromObject(data, obj);
        if (data.hasOwnProperty('product_id')) {
          obj['product_id'] = _ApiClient["default"].convertToType(data['product_id'], 'Number');
          delete data['product_id'];
        }
        if (data.hasOwnProperty('item_price')) {
          obj['item_price'] = _ApiClient["default"].convertToType(data['item_price'], 'Number');
          delete data['item_price'];
        }
        if (data.hasOwnProperty('quantity')) {
          obj['quantity'] = _ApiClient["default"].convertToType(data['quantity'], 'Number');
          delete data['quantity'];
        }
        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('product_variation_id')) {
          obj['product_variation_id'] = _ApiClient["default"].convertToType(data['product_variation_id'], 'Number');
          delete data['product_variation_id'];
        }
        if (data.hasOwnProperty('comments')) {
          obj['comments'] = _ApiClient["default"].convertToType(data['comments'], 'String');
          delete data['comments'];
        }
        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('enabled_flag')) {
          obj['enabled_flag'] = _ApiClient["default"].convertToType(data['enabled_flag'], 'Boolean');
          delete data['enabled_flag'];
        }
        if (data.hasOwnProperty('id')) {
          obj['id'] = _ApiClient["default"].convertToType(data['id'], 'Number');
          delete data['id'];
        }
        if (data.hasOwnProperty('company_id')) {
          obj['company_id'] = _ApiClient["default"].convertToType(data['company_id'], 'Number');
          delete data['company_id'];
        }
        if (data.hasOwnProperty('deal_id')) {
          obj['deal_id'] = _ApiClient["default"].convertToType(data['deal_id'], 'Number');
          delete data['deal_id'];
        }
        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('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('active_flag')) {
          obj['active_flag'] = _ApiClient["default"].convertToType(data['active_flag'], 'Boolean');
          delete data['active_flag'];
        }
        if (data.hasOwnProperty('name')) {
          obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
          delete data['name'];
        }
        if (Object.keys(data).length > 0) {
          Object.assign(obj, data);
        }
      }
      return obj;
    }
  }]);
  return ProductAttachmentDetails;
}();
/**
 * The ID of the product
 * @member {Number} product_id
 */
ProductAttachmentDetails.prototype['product_id'] = undefined;

/**
 * The price at which this product will be added to the deal
 * @member {Number} item_price
 */
ProductAttachmentDetails.prototype['item_price'] = undefined;

/**
 * Quantity – e.g. how many items of this product will be added to the deal
 * @member {Number} quantity
 */
ProductAttachmentDetails.prototype['quantity'] = 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
 */
ProductAttachmentDetails.prototype['discount'] = 0;

/**
 * The type of the discount's value.
 * @member {module:model/ProductAttachmentDetails.DiscountTypeEnum} discount_type
 * @default 'percentage'
 */
ProductAttachmentDetails.prototype['discount_type'] = 'percentage';

/**
 * The duration of the product. If omitted, will be set to 1.
 * @member {Number} duration
 * @default 1
 */
ProductAttachmentDetails.prototype['duration'] = 1;

/**
 * The type of the duration. (For example hourly, daily, etc.)
 * @member {String} duration_unit
 */
ProductAttachmentDetails.prototype['duration_unit'] = undefined;

/**
 * The ID of the product variation to use. When omitted, no variation will be used.
 * @member {Number} product_variation_id
 */
ProductAttachmentDetails.prototype['product_variation_id'] = undefined;

/**
 * A textual comment associated with this product-deal attachment
 * @member {String} comments
 */
ProductAttachmentDetails.prototype['comments'] = undefined;

/**
 * The product tax
 * @member {Number} tax
 */
ProductAttachmentDetails.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/ProductAttachmentDetails.TaxMethodEnum} tax_method
 */
ProductAttachmentDetails.prototype['tax_method'] = undefined;

/**
 * Whether the product is enabled for a deal or not. This makes it possible to add products to a deal with a specific price and discount criteria, but keep them disabled, which refrains them from being included in the deal value calculation. When omitted, the product will be marked as enabled by default.
 * @member {Boolean} enabled_flag
 * @default true
 */
ProductAttachmentDetails.prototype['enabled_flag'] = true;

/**
 * The ID of the deal-product (the ID of the product attached to the deal)
 * @member {Number} id
 */
ProductAttachmentDetails.prototype['id'] = undefined;

/**
 * The ID of the company
 * @member {Number} company_id
 */
ProductAttachmentDetails.prototype['company_id'] = undefined;

/**
 * The ID of the deal
 * @member {Number} deal_id
 */
ProductAttachmentDetails.prototype['deal_id'] = undefined;

/**
 * The sum of all the products attached to the deal
 * @member {Number} sum
 */
ProductAttachmentDetails.prototype['sum'] = undefined;

/**
 * The currency associated with the deal product
 * @member {String} currency
 */
ProductAttachmentDetails.prototype['currency'] = undefined;

/**
 * The date and time when the product was added to the deal
 * @member {String} add_time
 */
ProductAttachmentDetails.prototype['add_time'] = undefined;

/**
 * The date and time when the deal product was last edited
 * @member {String} last_edit
 */
ProductAttachmentDetails.prototype['last_edit'] = undefined;

/**
 * Whether the product is active or not
 * @member {Boolean} active_flag
 */
ProductAttachmentDetails.prototype['active_flag'] = undefined;

/**
 * The product name
 * @member {String} name
 */
ProductAttachmentDetails.prototype['name'] = undefined;

// Implement BasicDealProduct interface:
/**
 * The ID of the product to use
 * @member {Number} product_id
 */
_BasicDealProduct["default"].prototype['product_id'] = undefined;
/**
 * The price at which this product will be added to the deal
 * @member {Number} item_price
 */
_BasicDealProduct["default"].prototype['item_price'] = undefined;
/**
 * Quantity – e.g. how many items of this product will be added to the deal
 * @member {Number} quantity
 */
_BasicDealProduct["default"].prototype['quantity'] = 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
 */
_BasicDealProduct["default"].prototype['discount'] = 0;
/**
 * The type of the discount's value.
 * @member {module:model/BasicDealProduct.DiscountTypeEnum} discount_type
 * @default 'percentage'
 */
_BasicDealProduct["default"].prototype['discount_type'] = 'percentage';
/**
 * The duration of the product. If omitted, will be set to 1.
 * @member {Number} duration
 * @default 1
 */
_BasicDealProduct["default"].prototype['duration'] = 1;
/**
 * The unit duration of the product
 * @member {module:model/DealProductUnitDuration} duration_unit
 */
_BasicDealProduct["default"].prototype['duration_unit'] = undefined;
/**
 * The ID of the product variation to use. When omitted, no variation will be used.
 * @member {Number} product_variation_id
 */
_BasicDealProduct["default"].prototype['product_variation_id'] = undefined;
/**
 * A textual comment associated with this product-deal attachment
 * @member {String} comments
 */
_BasicDealProduct["default"].prototype['comments'] = undefined;
/**
 * The tax percentage
 * @member {Number} tax
 * @default 0
 */
_BasicDealProduct["default"].prototype['tax'] = 0;
/**
 * 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/BasicDealProduct.TaxMethodEnum} tax_method
 */
_BasicDealProduct["default"].prototype['tax_method'] = undefined;
/**
 * Whether the product is enabled for a deal or not. This makes it possible to add products to a deal with a specific price and discount criteria, but keep them disabled, which refrains them from being included in the deal value calculation. When omitted, the product will be marked as enabled by default.
 * @member {Boolean} enabled_flag
 * @default true
 */
_BasicDealProduct["default"].prototype['enabled_flag'] = true;
// Implement ProductAttachementFields interface:
/**
 * The ID of the deal-product (the ID of the product attached to the deal)
 * @member {Number} id
 */
_ProductAttachementFields["default"].prototype['id'] = undefined;
/**
 * The ID of the company
 * @member {Number} company_id
 */
_ProductAttachementFields["default"].prototype['company_id'] = undefined;
/**
 * The ID of the deal
 * @member {Number} deal_id
 */
_ProductAttachementFields["default"].prototype['deal_id'] = undefined;
/**
 * The ID of the product
 * @member {Number} product_id
 */
_ProductAttachementFields["default"].prototype['product_id'] = undefined;
/**
 * The type of the duration. (For example hourly, daily, etc.)
 * @member {String} duration_unit
 */
_ProductAttachementFields["default"].prototype['duration_unit'] = undefined;
/**
 * The sum of all the products attached to the deal
 * @member {Number} sum
 */
_ProductAttachementFields["default"].prototype['sum'] = undefined;
/**
 * The currency associated with the deal product
 * @member {String} currency
 */
_ProductAttachementFields["default"].prototype['currency'] = undefined;
/**
 * The date and time when the product was added to the deal
 * @member {String} add_time
 */
_ProductAttachementFields["default"].prototype['add_time'] = undefined;
/**
 * The date and time when the deal product was last edited
 * @member {String} last_edit
 */
_ProductAttachementFields["default"].prototype['last_edit'] = undefined;
/**
 * Whether the product is active or not
 * @member {Boolean} active_flag
 */
_ProductAttachementFields["default"].prototype['active_flag'] = undefined;
/**
 * The product tax
 * @member {Number} tax
 */
_ProductAttachementFields["default"].prototype['tax'] = undefined;
/**
 * The product name
 * @member {String} name
 */
_ProductAttachementFields["default"].prototype['name'] = undefined;

/**
 * Allowed values for the <code>discount_type</code> property.
 * @enum {String}
 * @readonly
 */
ProductAttachmentDetails['DiscountTypeEnum'] = {
  /**
   * value: "percentage"
   * @const
   */
  "percentage": "percentage",
  /**
   * value: "amount"
   * @const
   */
  "amount": "amount"
};

/**
 * Allowed values for the <code>tax_method</code> property.
 * @enum {String}
 * @readonly
 */
ProductAttachmentDetails['TaxMethodEnum'] = {
  /**
   * value: "exclusive"
   * @const
   */
  "exclusive": "exclusive",
  /**
   * value: "inclusive"
   * @const
   */
  "inclusive": "inclusive",
  /**
   * value: "none"
   * @const
   */
  "none": "none"
};
var _default = ProductAttachmentDetails;
exports["default"] = _default;