pipedrive 22.6.1 → 22.7.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +9 -4
- package/dist/index.js +63 -28
- package/dist/model/AddProductAttachmentDetails.js +60 -23
- package/dist/model/AddProductRequestBody.js +50 -14
- package/dist/model/AddProductRequestBodyAllOf.js +78 -0
- package/dist/model/BaseProduct.js +60 -1
- package/dist/model/BasicDealProduct.js +139 -16
- package/dist/model/BasicDealProductAllOf.js +235 -0
- package/dist/model/BillingFrequency.js +86 -0
- package/dist/model/BillingFrequency1.js +86 -0
- package/dist/model/DealProductRequestBody.js +235 -0
- package/dist/model/NameObject.js +78 -0
- package/dist/model/NewDealProduct.js +95 -43
- package/dist/model/NewDealProductAllOf.js +9 -12
- package/dist/model/NewDealProductAllOf1.js +78 -0
- package/dist/model/NewDealProductAllOf2.js +78 -0
- package/dist/model/PersonListProduct.js +1 -1
- package/dist/model/ProductAttachmentDetails.js +60 -23
- package/dist/model/ProductListItem.js +6 -6
- package/dist/model/ProductRequest.js +1 -1
- package/dist/model/ProductWithArrayPrices.js +72 -2
- package/dist/model/UpdateDealProduct.js +135 -5
- package/dist/model/UpdateProductRequestBody.js +50 -14
- package/dist/model/UpdateProductResponse.js +3 -3
- package/package.json +1 -1
@@ -0,0 +1,78 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports["default"] = void 0;
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
10
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
11
|
+
var _BillingFrequency = _interopRequireDefault(require("./BillingFrequency1"));
|
12
|
+
/**
|
13
|
+
* Pipedrive API v1
|
14
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
15
|
+
*
|
16
|
+
* The version of the OpenAPI document: 1.0.0
|
17
|
+
*
|
18
|
+
*
|
19
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
20
|
+
* https://openapi-generator.tech
|
21
|
+
* Do not edit the class manually.
|
22
|
+
*
|
23
|
+
*/
|
24
|
+
/**
|
25
|
+
* The AddProductRequestBodyAllOf model module.
|
26
|
+
* @module model/AddProductRequestBodyAllOf
|
27
|
+
* @version 1.0.0
|
28
|
+
*/
|
29
|
+
var AddProductRequestBodyAllOf = /*#__PURE__*/function () {
|
30
|
+
/**
|
31
|
+
* Constructs a new <code>AddProductRequestBodyAllOf</code>.
|
32
|
+
* @alias module:model/AddProductRequestBodyAllOf
|
33
|
+
*/
|
34
|
+
function AddProductRequestBodyAllOf() {
|
35
|
+
(0, _classCallCheck2["default"])(this, AddProductRequestBodyAllOf);
|
36
|
+
AddProductRequestBodyAllOf.initialize(this);
|
37
|
+
}
|
38
|
+
|
39
|
+
/**
|
40
|
+
* Initializes the fields of this object.
|
41
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
42
|
+
* Only for internal use.
|
43
|
+
*/
|
44
|
+
(0, _createClass2["default"])(AddProductRequestBodyAllOf, null, [{
|
45
|
+
key: "initialize",
|
46
|
+
value: function initialize(obj) {}
|
47
|
+
|
48
|
+
/**
|
49
|
+
* Constructs a <code>AddProductRequestBodyAllOf</code> from a plain JavaScript object, optionally creating a new instance.
|
50
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
51
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
52
|
+
* @param {module:model/AddProductRequestBodyAllOf} obj Optional instance to populate.
|
53
|
+
* @return {module:model/AddProductRequestBodyAllOf} The populated <code>AddProductRequestBodyAllOf</code> instance.
|
54
|
+
*/
|
55
|
+
}, {
|
56
|
+
key: "constructFromObject",
|
57
|
+
value: function constructFromObject(data, obj) {
|
58
|
+
if (data) {
|
59
|
+
obj = obj || new AddProductRequestBodyAllOf();
|
60
|
+
if (data.hasOwnProperty('billing_frequency')) {
|
61
|
+
obj['billing_frequency'] = _BillingFrequency["default"].constructFromObject(data['billing_frequency']);
|
62
|
+
delete data['billing_frequency'];
|
63
|
+
}
|
64
|
+
if (Object.keys(data).length > 0) {
|
65
|
+
Object.assign(obj, data);
|
66
|
+
}
|
67
|
+
}
|
68
|
+
return obj;
|
69
|
+
}
|
70
|
+
}]);
|
71
|
+
return AddProductRequestBodyAllOf;
|
72
|
+
}();
|
73
|
+
/**
|
74
|
+
* @member {module:model/BillingFrequency1} billing_frequency
|
75
|
+
*/
|
76
|
+
AddProductRequestBodyAllOf.prototype['billing_frequency'] = undefined;
|
77
|
+
var _default = AddProductRequestBodyAllOf;
|
78
|
+
exports["default"] = _default;
|
@@ -93,6 +93,14 @@ var BaseProduct = /*#__PURE__*/function () {
|
|
93
93
|
obj['owner_id'] = _ApiClient["default"].convertToType(data['owner_id'], Object);
|
94
94
|
delete data['owner_id'];
|
95
95
|
}
|
96
|
+
if (data.hasOwnProperty('billing_frequency')) {
|
97
|
+
obj['billing_frequency'] = _ApiClient["default"].convertToType(data['billing_frequency'], 'String');
|
98
|
+
delete data['billing_frequency'];
|
99
|
+
}
|
100
|
+
if (data.hasOwnProperty('billing_frequency_cycles')) {
|
101
|
+
obj['billing_frequency_cycles'] = _ApiClient["default"].convertToType(data['billing_frequency_cycles'], 'Number');
|
102
|
+
delete data['billing_frequency_cycles'];
|
103
|
+
}
|
96
104
|
if (Object.keys(data).length > 0) {
|
97
105
|
Object.assign(obj, data);
|
98
106
|
}
|
@@ -127,7 +135,7 @@ BaseProduct.prototype['code'] = undefined;
|
|
127
135
|
BaseProduct.prototype['unit'] = undefined;
|
128
136
|
|
129
137
|
/**
|
130
|
-
* The
|
138
|
+
* The tax percentage
|
131
139
|
* @member {Number} tax
|
132
140
|
* @default 0
|
133
141
|
*/
|
@@ -158,5 +166,56 @@ BaseProduct.prototype['visible_to'] = undefined;
|
|
158
166
|
* @member {Object} owner_id
|
159
167
|
*/
|
160
168
|
BaseProduct.prototype['owner_id'] = undefined;
|
169
|
+
|
170
|
+
/**
|
171
|
+
* Only available in Advanced and above plans How often a customer is billed for access to a service or product
|
172
|
+
* @member {module:model/BaseProduct.BillingFrequencyEnum} billing_frequency
|
173
|
+
* @default 'one-time'
|
174
|
+
*/
|
175
|
+
BaseProduct.prototype['billing_frequency'] = 'one-time';
|
176
|
+
|
177
|
+
/**
|
178
|
+
* 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 is always `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
|
179
|
+
* @member {Number} billing_frequency_cycles
|
180
|
+
*/
|
181
|
+
BaseProduct.prototype['billing_frequency_cycles'] = undefined;
|
182
|
+
|
183
|
+
/**
|
184
|
+
* Allowed values for the <code>billing_frequency</code> property.
|
185
|
+
* @enum {String}
|
186
|
+
* @readonly
|
187
|
+
*/
|
188
|
+
BaseProduct['BillingFrequencyEnum'] = {
|
189
|
+
/**
|
190
|
+
* value: "one-time"
|
191
|
+
* @const
|
192
|
+
*/
|
193
|
+
"one-time": "one-time",
|
194
|
+
/**
|
195
|
+
* value: "annually"
|
196
|
+
* @const
|
197
|
+
*/
|
198
|
+
"annually": "annually",
|
199
|
+
/**
|
200
|
+
* value: "semi-annually"
|
201
|
+
* @const
|
202
|
+
*/
|
203
|
+
"semi-annually": "semi-annually",
|
204
|
+
/**
|
205
|
+
* value: "quarterly"
|
206
|
+
* @const
|
207
|
+
*/
|
208
|
+
"quarterly": "quarterly",
|
209
|
+
/**
|
210
|
+
* value: "monthly"
|
211
|
+
* @const
|
212
|
+
*/
|
213
|
+
"monthly": "monthly",
|
214
|
+
/**
|
215
|
+
* value: "weekly"
|
216
|
+
* @const
|
217
|
+
*/
|
218
|
+
"weekly": "weekly"
|
219
|
+
};
|
161
220
|
var _default = BaseProduct;
|
162
221
|
exports["default"] = _default;
|
@@ -8,7 +8,12 @@ exports["default"] = void 0;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
10
10
|
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
11
|
+
var _BasicDealProductAllOf = _interopRequireDefault(require("./BasicDealProductAllOf"));
|
12
|
+
var _BillingFrequency = _interopRequireDefault(require("./BillingFrequency"));
|
11
13
|
var _DealProductUnitDuration = _interopRequireDefault(require("./DealProductUnitDuration"));
|
14
|
+
var _NewDealProductAllOf = _interopRequireDefault(require("./NewDealProductAllOf"));
|
15
|
+
var _NewDealProductAllOf2 = _interopRequireDefault(require("./NewDealProductAllOf1"));
|
16
|
+
var _NewDealProductAllOf3 = _interopRequireDefault(require("./NewDealProductAllOf2"));
|
12
17
|
/**
|
13
18
|
* Pipedrive API v1
|
14
19
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
@@ -30,13 +35,18 @@ var BasicDealProduct = /*#__PURE__*/function () {
|
|
30
35
|
/**
|
31
36
|
* Constructs a new <code>BasicDealProduct</code>.
|
32
37
|
* @alias module:model/BasicDealProduct
|
33
|
-
* @
|
34
|
-
* @
|
35
|
-
* @
|
38
|
+
* @implements module:model/BasicDealProductAllOf
|
39
|
+
* @implements module:model/NewDealProductAllOf
|
40
|
+
* @implements module:model/NewDealProductAllOf1
|
41
|
+
* @implements module:model/NewDealProductAllOf2
|
36
42
|
*/
|
37
|
-
function BasicDealProduct(
|
43
|
+
function BasicDealProduct() {
|
38
44
|
(0, _classCallCheck2["default"])(this, BasicDealProduct);
|
39
|
-
|
45
|
+
_BasicDealProductAllOf["default"].initialize(this);
|
46
|
+
_NewDealProductAllOf["default"].initialize(this);
|
47
|
+
_NewDealProductAllOf2["default"].initialize(this);
|
48
|
+
_NewDealProductAllOf3["default"].initialize(this);
|
49
|
+
BasicDealProduct.initialize(this);
|
40
50
|
}
|
41
51
|
|
42
52
|
/**
|
@@ -46,11 +56,7 @@ var BasicDealProduct = /*#__PURE__*/function () {
|
|
46
56
|
*/
|
47
57
|
(0, _createClass2["default"])(BasicDealProduct, null, [{
|
48
58
|
key: "initialize",
|
49
|
-
value: function initialize(obj
|
50
|
-
obj['product_id'] = productId;
|
51
|
-
obj['item_price'] = itemPrice;
|
52
|
-
obj['quantity'] = quantity;
|
53
|
-
}
|
59
|
+
value: function initialize(obj) {}
|
54
60
|
|
55
61
|
/**
|
56
62
|
* Constructs a <code>BasicDealProduct</code> from a plain JavaScript object, optionally creating a new instance.
|
@@ -64,6 +70,10 @@ var BasicDealProduct = /*#__PURE__*/function () {
|
|
64
70
|
value: function constructFromObject(data, obj) {
|
65
71
|
if (data) {
|
66
72
|
obj = obj || new BasicDealProduct();
|
73
|
+
_BasicDealProductAllOf["default"].constructFromObject(data, obj);
|
74
|
+
_NewDealProductAllOf["default"].constructFromObject(data, obj);
|
75
|
+
_NewDealProductAllOf2["default"].constructFromObject(data, obj);
|
76
|
+
_NewDealProductAllOf3["default"].constructFromObject(data, obj);
|
67
77
|
if (data.hasOwnProperty('product_id')) {
|
68
78
|
obj['product_id'] = _ApiClient["default"].convertToType(data['product_id'], 'Number');
|
69
79
|
delete data['product_id'];
|
@@ -112,6 +122,18 @@ var BasicDealProduct = /*#__PURE__*/function () {
|
|
112
122
|
obj['enabled_flag'] = _ApiClient["default"].convertToType(data['enabled_flag'], 'Boolean');
|
113
123
|
delete data['enabled_flag'];
|
114
124
|
}
|
125
|
+
if (data.hasOwnProperty('billing_frequency')) {
|
126
|
+
obj['billing_frequency'] = _BillingFrequency["default"].constructFromObject(data['billing_frequency']);
|
127
|
+
delete data['billing_frequency'];
|
128
|
+
}
|
129
|
+
if (data.hasOwnProperty('billing_frequency_cycles')) {
|
130
|
+
obj['billing_frequency_cycles'] = _ApiClient["default"].convertToType(data['billing_frequency_cycles'], 'Number');
|
131
|
+
delete data['billing_frequency_cycles'];
|
132
|
+
}
|
133
|
+
if (data.hasOwnProperty('billing_start_date')) {
|
134
|
+
obj['billing_start_date'] = _ApiClient["default"].convertToType(data['billing_start_date'], 'String');
|
135
|
+
delete data['billing_start_date'];
|
136
|
+
}
|
115
137
|
if (Object.keys(data).length > 0) {
|
116
138
|
Object.assign(obj, data);
|
117
139
|
}
|
@@ -140,21 +162,21 @@ BasicDealProduct.prototype['item_price'] = undefined;
|
|
140
162
|
BasicDealProduct.prototype['quantity'] = undefined;
|
141
163
|
|
142
164
|
/**
|
143
|
-
* The value of the discount. The `discount_type` field can be used to specify whether the value is an amount or a percentage
|
165
|
+
* The value of the discount. The `discount_type` field can be used to specify whether the value is an amount or a percentage
|
144
166
|
* @member {Number} discount
|
145
167
|
* @default 0
|
146
168
|
*/
|
147
169
|
BasicDealProduct.prototype['discount'] = 0;
|
148
170
|
|
149
171
|
/**
|
150
|
-
* The type of the discount's value
|
172
|
+
* The type of the discount's value
|
151
173
|
* @member {module:model/BasicDealProduct.DiscountTypeEnum} discount_type
|
152
174
|
* @default 'percentage'
|
153
175
|
*/
|
154
176
|
BasicDealProduct.prototype['discount_type'] = 'percentage';
|
155
177
|
|
156
178
|
/**
|
157
|
-
* The duration of the product. If omitted, will be set to 1
|
179
|
+
* The duration of the product. If omitted, will be set to 1
|
158
180
|
* @member {Number} duration
|
159
181
|
* @default 1
|
160
182
|
*/
|
@@ -167,7 +189,7 @@ BasicDealProduct.prototype['duration'] = 1;
|
|
167
189
|
BasicDealProduct.prototype['duration_unit'] = undefined;
|
168
190
|
|
169
191
|
/**
|
170
|
-
* The ID of the product variation to use. When omitted, no variation will be used
|
192
|
+
* The ID of the product variation to use. When omitted, no variation will be used
|
171
193
|
* @member {Number} product_variation_id
|
172
194
|
*/
|
173
195
|
BasicDealProduct.prototype['product_variation_id'] = undefined;
|
@@ -186,18 +208,119 @@ BasicDealProduct.prototype['comments'] = undefined;
|
|
186
208
|
BasicDealProduct.prototype['tax'] = 0;
|
187
209
|
|
188
210
|
/**
|
189
|
-
* 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
|
211
|
+
* 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
|
190
212
|
* @member {module:model/BasicDealProduct.TaxMethodEnum} tax_method
|
191
213
|
*/
|
192
214
|
BasicDealProduct.prototype['tax_method'] = undefined;
|
193
215
|
|
194
216
|
/**
|
195
|
-
* 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
|
217
|
+
* 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
|
196
218
|
* @member {Boolean} enabled_flag
|
197
219
|
* @default true
|
198
220
|
*/
|
199
221
|
BasicDealProduct.prototype['enabled_flag'] = true;
|
200
222
|
|
223
|
+
/**
|
224
|
+
* @member {module:model/BillingFrequency} billing_frequency
|
225
|
+
*/
|
226
|
+
BasicDealProduct.prototype['billing_frequency'] = undefined;
|
227
|
+
|
228
|
+
/**
|
229
|
+
* 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
|
230
|
+
* @member {Number} billing_frequency_cycles
|
231
|
+
*/
|
232
|
+
BasicDealProduct.prototype['billing_frequency_cycles'] = undefined;
|
233
|
+
|
234
|
+
/**
|
235
|
+
* Only available in Advanced and above plans The billing start date. Must be between 15 years in the past and 15 years in the future
|
236
|
+
* @member {String} billing_start_date
|
237
|
+
*/
|
238
|
+
BasicDealProduct.prototype['billing_start_date'] = undefined;
|
239
|
+
|
240
|
+
// Implement BasicDealProductAllOf interface:
|
241
|
+
/**
|
242
|
+
* The ID of the product to use
|
243
|
+
* @member {Number} product_id
|
244
|
+
*/
|
245
|
+
_BasicDealProductAllOf["default"].prototype['product_id'] = undefined;
|
246
|
+
/**
|
247
|
+
* The price at which this product will be added to the deal
|
248
|
+
* @member {Number} item_price
|
249
|
+
*/
|
250
|
+
_BasicDealProductAllOf["default"].prototype['item_price'] = undefined;
|
251
|
+
/**
|
252
|
+
* Quantity – e.g. how many items of this product will be added to the deal
|
253
|
+
* @member {Number} quantity
|
254
|
+
*/
|
255
|
+
_BasicDealProductAllOf["default"].prototype['quantity'] = undefined;
|
256
|
+
/**
|
257
|
+
* The value of the discount. The `discount_type` field can be used to specify whether the value is an amount or a percentage
|
258
|
+
* @member {Number} discount
|
259
|
+
* @default 0
|
260
|
+
*/
|
261
|
+
_BasicDealProductAllOf["default"].prototype['discount'] = 0;
|
262
|
+
/**
|
263
|
+
* The type of the discount's value
|
264
|
+
* @member {module:model/BasicDealProductAllOf.DiscountTypeEnum} discount_type
|
265
|
+
* @default 'percentage'
|
266
|
+
*/
|
267
|
+
_BasicDealProductAllOf["default"].prototype['discount_type'] = 'percentage';
|
268
|
+
/**
|
269
|
+
* The duration of the product. If omitted, will be set to 1
|
270
|
+
* @member {Number} duration
|
271
|
+
* @default 1
|
272
|
+
*/
|
273
|
+
_BasicDealProductAllOf["default"].prototype['duration'] = 1;
|
274
|
+
/**
|
275
|
+
* The unit duration of the product
|
276
|
+
* @member {module:model/DealProductUnitDuration} duration_unit
|
277
|
+
*/
|
278
|
+
_BasicDealProductAllOf["default"].prototype['duration_unit'] = undefined;
|
279
|
+
/**
|
280
|
+
* The ID of the product variation to use. When omitted, no variation will be used
|
281
|
+
* @member {Number} product_variation_id
|
282
|
+
*/
|
283
|
+
_BasicDealProductAllOf["default"].prototype['product_variation_id'] = undefined;
|
284
|
+
/**
|
285
|
+
* A textual comment associated with this product-deal attachment
|
286
|
+
* @member {String} comments
|
287
|
+
*/
|
288
|
+
_BasicDealProductAllOf["default"].prototype['comments'] = undefined;
|
289
|
+
/**
|
290
|
+
* The tax percentage
|
291
|
+
* @member {Number} tax
|
292
|
+
* @default 0
|
293
|
+
*/
|
294
|
+
_BasicDealProductAllOf["default"].prototype['tax'] = 0;
|
295
|
+
/**
|
296
|
+
* 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
|
297
|
+
* @member {module:model/BasicDealProductAllOf.TaxMethodEnum} tax_method
|
298
|
+
*/
|
299
|
+
_BasicDealProductAllOf["default"].prototype['tax_method'] = undefined;
|
300
|
+
/**
|
301
|
+
* 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
|
302
|
+
* @member {Boolean} enabled_flag
|
303
|
+
* @default true
|
304
|
+
*/
|
305
|
+
_BasicDealProductAllOf["default"].prototype['enabled_flag'] = true;
|
306
|
+
// Implement NewDealProductAllOf interface:
|
307
|
+
/**
|
308
|
+
* @member {module:model/BillingFrequency} billing_frequency
|
309
|
+
*/
|
310
|
+
_NewDealProductAllOf["default"].prototype['billing_frequency'] = undefined;
|
311
|
+
// Implement NewDealProductAllOf1 interface:
|
312
|
+
/**
|
313
|
+
* 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
|
314
|
+
* @member {Number} billing_frequency_cycles
|
315
|
+
*/
|
316
|
+
_NewDealProductAllOf2["default"].prototype['billing_frequency_cycles'] = undefined;
|
317
|
+
// Implement NewDealProductAllOf2 interface:
|
318
|
+
/**
|
319
|
+
* Only available in Advanced and above plans The billing start date. Must be between 15 years in the past and 15 years in the future
|
320
|
+
* @member {String} billing_start_date
|
321
|
+
*/
|
322
|
+
_NewDealProductAllOf3["default"].prototype['billing_start_date'] = undefined;
|
323
|
+
|
201
324
|
/**
|
202
325
|
* Allowed values for the <code>discount_type</code> property.
|
203
326
|
* @enum {String}
|
@@ -0,0 +1,235 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports["default"] = void 0;
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
10
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
11
|
+
var _DealProductUnitDuration = _interopRequireDefault(require("./DealProductUnitDuration"));
|
12
|
+
/**
|
13
|
+
* Pipedrive API v1
|
14
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
15
|
+
*
|
16
|
+
* The version of the OpenAPI document: 1.0.0
|
17
|
+
*
|
18
|
+
*
|
19
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
20
|
+
* https://openapi-generator.tech
|
21
|
+
* Do not edit the class manually.
|
22
|
+
*
|
23
|
+
*/
|
24
|
+
/**
|
25
|
+
* The BasicDealProductAllOf model module.
|
26
|
+
* @module model/BasicDealProductAllOf
|
27
|
+
* @version 1.0.0
|
28
|
+
*/
|
29
|
+
var BasicDealProductAllOf = /*#__PURE__*/function () {
|
30
|
+
/**
|
31
|
+
* Constructs a new <code>BasicDealProductAllOf</code>.
|
32
|
+
* @alias module:model/BasicDealProductAllOf
|
33
|
+
*/
|
34
|
+
function BasicDealProductAllOf() {
|
35
|
+
(0, _classCallCheck2["default"])(this, BasicDealProductAllOf);
|
36
|
+
BasicDealProductAllOf.initialize(this);
|
37
|
+
}
|
38
|
+
|
39
|
+
/**
|
40
|
+
* Initializes the fields of this object.
|
41
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
42
|
+
* Only for internal use.
|
43
|
+
*/
|
44
|
+
(0, _createClass2["default"])(BasicDealProductAllOf, null, [{
|
45
|
+
key: "initialize",
|
46
|
+
value: function initialize(obj) {}
|
47
|
+
|
48
|
+
/**
|
49
|
+
* Constructs a <code>BasicDealProductAllOf</code> from a plain JavaScript object, optionally creating a new instance.
|
50
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
51
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
52
|
+
* @param {module:model/BasicDealProductAllOf} obj Optional instance to populate.
|
53
|
+
* @return {module:model/BasicDealProductAllOf} The populated <code>BasicDealProductAllOf</code> instance.
|
54
|
+
*/
|
55
|
+
}, {
|
56
|
+
key: "constructFromObject",
|
57
|
+
value: function constructFromObject(data, obj) {
|
58
|
+
if (data) {
|
59
|
+
obj = obj || new BasicDealProductAllOf();
|
60
|
+
if (data.hasOwnProperty('product_id')) {
|
61
|
+
obj['product_id'] = _ApiClient["default"].convertToType(data['product_id'], 'Number');
|
62
|
+
delete data['product_id'];
|
63
|
+
}
|
64
|
+
if (data.hasOwnProperty('item_price')) {
|
65
|
+
obj['item_price'] = _ApiClient["default"].convertToType(data['item_price'], 'Number');
|
66
|
+
delete data['item_price'];
|
67
|
+
}
|
68
|
+
if (data.hasOwnProperty('quantity')) {
|
69
|
+
obj['quantity'] = _ApiClient["default"].convertToType(data['quantity'], 'Number');
|
70
|
+
delete data['quantity'];
|
71
|
+
}
|
72
|
+
if (data.hasOwnProperty('discount')) {
|
73
|
+
obj['discount'] = _ApiClient["default"].convertToType(data['discount'], 'Number');
|
74
|
+
delete data['discount'];
|
75
|
+
}
|
76
|
+
if (data.hasOwnProperty('discount_type')) {
|
77
|
+
obj['discount_type'] = _ApiClient["default"].convertToType(data['discount_type'], 'String');
|
78
|
+
delete data['discount_type'];
|
79
|
+
}
|
80
|
+
if (data.hasOwnProperty('duration')) {
|
81
|
+
obj['duration'] = _ApiClient["default"].convertToType(data['duration'], 'Number');
|
82
|
+
delete data['duration'];
|
83
|
+
}
|
84
|
+
if (data.hasOwnProperty('duration_unit')) {
|
85
|
+
obj['duration_unit'] = _ApiClient["default"].convertToType(data['duration_unit'], _DealProductUnitDuration["default"]);
|
86
|
+
delete data['duration_unit'];
|
87
|
+
}
|
88
|
+
if (data.hasOwnProperty('product_variation_id')) {
|
89
|
+
obj['product_variation_id'] = _ApiClient["default"].convertToType(data['product_variation_id'], 'Number');
|
90
|
+
delete data['product_variation_id'];
|
91
|
+
}
|
92
|
+
if (data.hasOwnProperty('comments')) {
|
93
|
+
obj['comments'] = _ApiClient["default"].convertToType(data['comments'], 'String');
|
94
|
+
delete data['comments'];
|
95
|
+
}
|
96
|
+
if (data.hasOwnProperty('tax')) {
|
97
|
+
obj['tax'] = _ApiClient["default"].convertToType(data['tax'], 'Number');
|
98
|
+
delete data['tax'];
|
99
|
+
}
|
100
|
+
if (data.hasOwnProperty('tax_method')) {
|
101
|
+
obj['tax_method'] = _ApiClient["default"].convertToType(data['tax_method'], 'String');
|
102
|
+
delete data['tax_method'];
|
103
|
+
}
|
104
|
+
if (data.hasOwnProperty('enabled_flag')) {
|
105
|
+
obj['enabled_flag'] = _ApiClient["default"].convertToType(data['enabled_flag'], 'Boolean');
|
106
|
+
delete data['enabled_flag'];
|
107
|
+
}
|
108
|
+
if (Object.keys(data).length > 0) {
|
109
|
+
Object.assign(obj, data);
|
110
|
+
}
|
111
|
+
}
|
112
|
+
return obj;
|
113
|
+
}
|
114
|
+
}]);
|
115
|
+
return BasicDealProductAllOf;
|
116
|
+
}();
|
117
|
+
/**
|
118
|
+
* The ID of the product to use
|
119
|
+
* @member {Number} product_id
|
120
|
+
*/
|
121
|
+
BasicDealProductAllOf.prototype['product_id'] = undefined;
|
122
|
+
|
123
|
+
/**
|
124
|
+
* The price at which this product will be added to the deal
|
125
|
+
* @member {Number} item_price
|
126
|
+
*/
|
127
|
+
BasicDealProductAllOf.prototype['item_price'] = undefined;
|
128
|
+
|
129
|
+
/**
|
130
|
+
* Quantity – e.g. how many items of this product will be added to the deal
|
131
|
+
* @member {Number} quantity
|
132
|
+
*/
|
133
|
+
BasicDealProductAllOf.prototype['quantity'] = undefined;
|
134
|
+
|
135
|
+
/**
|
136
|
+
* The value of the discount. The `discount_type` field can be used to specify whether the value is an amount or a percentage
|
137
|
+
* @member {Number} discount
|
138
|
+
* @default 0
|
139
|
+
*/
|
140
|
+
BasicDealProductAllOf.prototype['discount'] = 0;
|
141
|
+
|
142
|
+
/**
|
143
|
+
* The type of the discount's value
|
144
|
+
* @member {module:model/BasicDealProductAllOf.DiscountTypeEnum} discount_type
|
145
|
+
* @default 'percentage'
|
146
|
+
*/
|
147
|
+
BasicDealProductAllOf.prototype['discount_type'] = 'percentage';
|
148
|
+
|
149
|
+
/**
|
150
|
+
* The duration of the product. If omitted, will be set to 1
|
151
|
+
* @member {Number} duration
|
152
|
+
* @default 1
|
153
|
+
*/
|
154
|
+
BasicDealProductAllOf.prototype['duration'] = 1;
|
155
|
+
|
156
|
+
/**
|
157
|
+
* The unit duration of the product
|
158
|
+
* @member {module:model/DealProductUnitDuration} duration_unit
|
159
|
+
*/
|
160
|
+
BasicDealProductAllOf.prototype['duration_unit'] = undefined;
|
161
|
+
|
162
|
+
/**
|
163
|
+
* The ID of the product variation to use. When omitted, no variation will be used
|
164
|
+
* @member {Number} product_variation_id
|
165
|
+
*/
|
166
|
+
BasicDealProductAllOf.prototype['product_variation_id'] = undefined;
|
167
|
+
|
168
|
+
/**
|
169
|
+
* A textual comment associated with this product-deal attachment
|
170
|
+
* @member {String} comments
|
171
|
+
*/
|
172
|
+
BasicDealProductAllOf.prototype['comments'] = undefined;
|
173
|
+
|
174
|
+
/**
|
175
|
+
* The tax percentage
|
176
|
+
* @member {Number} tax
|
177
|
+
* @default 0
|
178
|
+
*/
|
179
|
+
BasicDealProductAllOf.prototype['tax'] = 0;
|
180
|
+
|
181
|
+
/**
|
182
|
+
* 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
|
183
|
+
* @member {module:model/BasicDealProductAllOf.TaxMethodEnum} tax_method
|
184
|
+
*/
|
185
|
+
BasicDealProductAllOf.prototype['tax_method'] = undefined;
|
186
|
+
|
187
|
+
/**
|
188
|
+
* 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
|
189
|
+
* @member {Boolean} enabled_flag
|
190
|
+
* @default true
|
191
|
+
*/
|
192
|
+
BasicDealProductAllOf.prototype['enabled_flag'] = true;
|
193
|
+
|
194
|
+
/**
|
195
|
+
* Allowed values for the <code>discount_type</code> property.
|
196
|
+
* @enum {String}
|
197
|
+
* @readonly
|
198
|
+
*/
|
199
|
+
BasicDealProductAllOf['DiscountTypeEnum'] = {
|
200
|
+
/**
|
201
|
+
* value: "percentage"
|
202
|
+
* @const
|
203
|
+
*/
|
204
|
+
"percentage": "percentage",
|
205
|
+
/**
|
206
|
+
* value: "amount"
|
207
|
+
* @const
|
208
|
+
*/
|
209
|
+
"amount": "amount"
|
210
|
+
};
|
211
|
+
|
212
|
+
/**
|
213
|
+
* Allowed values for the <code>tax_method</code> property.
|
214
|
+
* @enum {String}
|
215
|
+
* @readonly
|
216
|
+
*/
|
217
|
+
BasicDealProductAllOf['TaxMethodEnum'] = {
|
218
|
+
/**
|
219
|
+
* value: "exclusive"
|
220
|
+
* @const
|
221
|
+
*/
|
222
|
+
"exclusive": "exclusive",
|
223
|
+
/**
|
224
|
+
* value: "inclusive"
|
225
|
+
* @const
|
226
|
+
*/
|
227
|
+
"inclusive": "inclusive",
|
228
|
+
/**
|
229
|
+
* value: "none"
|
230
|
+
* @const
|
231
|
+
*/
|
232
|
+
"none": "none"
|
233
|
+
};
|
234
|
+
var _default = BasicDealProductAllOf;
|
235
|
+
exports["default"] = _default;
|