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/quadcode.com/node_modules/pipedrive/dist/model/AddProductRequestBody.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 _AddProductRequestBodyAllOf = _interopRequireDefault(require("./AddProductRequestBodyAllOf"));
var _BillingFrequency = _interopRequireDefault(require("./BillingFrequency1"));
var _NameObject = _interopRequireDefault(require("./NameObject"));
var _NewDealProductAllOf = _interopRequireDefault(require("./NewDealProductAllOf1"));
var _ProductRequest = _interopRequireDefault(require("./ProductRequest"));
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 AddProductRequestBody model module.
 * @module model/AddProductRequestBody
 * @version 1.0.0
 */
var AddProductRequestBody = /*#__PURE__*/function () {
  /**
   * Constructs a new <code>AddProductRequestBody</code>.
   * @alias module:model/AddProductRequestBody
   * @implements module:model/NameObject
   * @implements module:model/ProductRequest
   * @implements module:model/AddProductRequestBodyAllOf
   * @implements module:model/NewDealProductAllOf1
   */
  function AddProductRequestBody() {
    (0, _classCallCheck2["default"])(this, AddProductRequestBody);
    _NameObject["default"].initialize(this);
    _ProductRequest["default"].initialize(this);
    _AddProductRequestBodyAllOf["default"].initialize(this);
    _NewDealProductAllOf["default"].initialize(this);
    AddProductRequestBody.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"])(AddProductRequestBody, null, [{
    key: "initialize",
    value: function initialize(obj) {}

    /**
     * Constructs a <code>AddProductRequestBody</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/AddProductRequestBody} obj Optional instance to populate.
     * @return {module:model/AddProductRequestBody} The populated <code>AddProductRequestBody</code> instance.
     */
  }, {
    key: "constructFromObject",
    value: function constructFromObject(data, obj) {
      if (data) {
        obj = obj || new AddProductRequestBody();
        _NameObject["default"].constructFromObject(data, obj);
        _ProductRequest["default"].constructFromObject(data, obj);
        _AddProductRequestBodyAllOf["default"].constructFromObject(data, obj);
        _NewDealProductAllOf["default"].constructFromObject(data, obj);
        if (data.hasOwnProperty('name')) {
          obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
          delete data['name'];
        }
        if (data.hasOwnProperty('code')) {
          obj['code'] = _ApiClient["default"].convertToType(data['code'], 'String');
          delete data['code'];
        }
        if (data.hasOwnProperty('unit')) {
          obj['unit'] = _ApiClient["default"].convertToType(data['unit'], 'String');
          delete data['unit'];
        }
        if (data.hasOwnProperty('tax')) {
          obj['tax'] = _ApiClient["default"].convertToType(data['tax'], 'Number');
          delete data['tax'];
        }
        if (data.hasOwnProperty('active_flag')) {
          obj['active_flag'] = _ApiClient["default"].convertToType(data['active_flag'], 'Boolean');
          delete data['active_flag'];
        }
        if (data.hasOwnProperty('selectable')) {
          obj['selectable'] = _ApiClient["default"].convertToType(data['selectable'], 'Boolean');
          delete data['selectable'];
        }
        if (data.hasOwnProperty('visible_to')) {
          obj['visible_to'] = _ApiClient["default"].convertToType(data['visible_to'], _VisibleTo["default"]);
          delete data['visible_to'];
        }
        if (data.hasOwnProperty('owner_id')) {
          obj['owner_id'] = _ApiClient["default"].convertToType(data['owner_id'], 'Number');
          delete data['owner_id'];
        }
        if (data.hasOwnProperty('prices')) {
          obj['prices'] = _ApiClient["default"].convertToType(data['prices'], [Object]);
          delete data['prices'];
        }
        if (data.hasOwnProperty('billing_frequency')) {
          obj['billing_frequency'] = _BillingFrequency["default"].constructFromObject(data['billing_frequency']);
          delete data['billing_frequency'];
        }
        if (data.hasOwnProperty('billing_frequency_cycles')) {
          obj['billing_frequency_cycles'] = _ApiClient["default"].convertToType(data['billing_frequency_cycles'], 'Number');
          delete data['billing_frequency_cycles'];
        }
        if (Object.keys(data).length > 0) {
          Object.assign(obj, data);
        }
      }
      return obj;
    }
  }]);
  return AddProductRequestBody;
}();
/**
 * The name of the product
 * @member {String} name
 */
AddProductRequestBody.prototype['name'] = undefined;

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

/**
 * The unit in which this product is sold
 * @member {String} unit
 */
AddProductRequestBody.prototype['unit'] = undefined;

/**
 * The tax percentage
 * @member {Number} tax
 * @default 0
 */
AddProductRequestBody.prototype['tax'] = 0;

/**
 * Whether this product will be made active or not
 * @member {Boolean} active_flag
 * @default true
 */
AddProductRequestBody.prototype['active_flag'] = true;

/**
 * Whether this product can be selected in deals or not
 * @member {Boolean} selectable
 * @default true
 */
AddProductRequestBody.prototype['selectable'] = true;

/**
 * The visibility of the product. 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 &amp; 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
 */
AddProductRequestBody.prototype['visible_to'] = undefined;

/**
 * The ID of the user who will be marked as the owner of this product. When omitted, the authorized user ID will be used
 * @member {Number} owner_id
 */
AddProductRequestBody.prototype['owner_id'] = undefined;

/**
 * An array of objects, each containing: `currency` (string), `price` (number), `cost` (number, optional), `overhead_cost` (number, optional). Note that there can only be one price per product per currency. When `prices` is omitted altogether, a default price of 0 and a default currency based on the company's currency will be assigned.
 * @member {Array.<Object>} prices
 */
AddProductRequestBody.prototype['prices'] = undefined;

/**
 * @member {module:model/BillingFrequency1} billing_frequency
 */
AddProductRequestBody.prototype['billing_frequency'] = undefined;

/**
 * Only available in Advanced and above plans  The number of times the billing frequency repeats for a product in a deal  When `billing_frequency` is set to `one-time`, this field must be `null`  For all the other values of `billing_frequency`, `null` represents a product billed indefinitely  Must be a positive integer less or equal to 312 
 * @member {Number} billing_frequency_cycles
 */
AddProductRequestBody.prototype['billing_frequency_cycles'] = undefined;

// Implement NameObject interface:
/**
 * The name of the product
 * @member {String} name
 */
_NameObject["default"].prototype['name'] = undefined;
// Implement ProductRequest interface:
/**
 * The product code
 * @member {String} code
 */
_ProductRequest["default"].prototype['code'] = undefined;
/**
 * The unit in which this product is sold
 * @member {String} unit
 */
_ProductRequest["default"].prototype['unit'] = undefined;
/**
 * The tax percentage
 * @member {Number} tax
 * @default 0
 */
_ProductRequest["default"].prototype['tax'] = 0;
/**
 * Whether this product will be made active or not
 * @member {Boolean} active_flag
 * @default true
 */
_ProductRequest["default"].prototype['active_flag'] = true;
/**
 * Whether this product can be selected in deals or not
 * @member {Boolean} selectable
 * @default true
 */
_ProductRequest["default"].prototype['selectable'] = true;
/**
 * The visibility of the product. 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 &amp; 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
 */
_ProductRequest["default"].prototype['visible_to'] = undefined;
/**
 * The ID of the user who will be marked as the owner of this product. When omitted, the authorized user ID will be used
 * @member {Number} owner_id
 */
_ProductRequest["default"].prototype['owner_id'] = undefined;
/**
 * An array of objects, each containing: `currency` (string), `price` (number), `cost` (number, optional), `overhead_cost` (number, optional). Note that there can only be one price per product per currency. When `prices` is omitted altogether, a default price of 0 and a default currency based on the company's currency will be assigned.
 * @member {Array.<Object>} prices
 */
_ProductRequest["default"].prototype['prices'] = undefined;
// Implement AddProductRequestBodyAllOf interface:
/**
 * @member {module:model/BillingFrequency1} billing_frequency
 */
_AddProductRequestBodyAllOf["default"].prototype['billing_frequency'] = undefined;
// Implement NewDealProductAllOf1 interface:
/**
 * Only available in Advanced and above plans  The number of times the billing frequency repeats for a product in a deal  When `billing_frequency` is set to `one-time`, this field must be `null`  For all the other values of `billing_frequency`, `null` represents a product billed indefinitely  Must be a positive integer less or equal to 312 
 * @member {Number} billing_frequency_cycles
 */
_NewDealProductAllOf["default"].prototype['billing_frequency_cycles'] = undefined;
var _default = AddProductRequestBody;
exports["default"] = _default;