@tradecafe/offer-service-sdk 0.0.55 → 0.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/.openapi-generator/FILES +68 -67
  2. package/api/matchedOffersApi.ts +69 -0
  3. package/dist/api/apis.d.ts +20 -20
  4. package/dist/api/apis.js +56 -56
  5. package/dist/api/automatedOffersApi.d.ts +156 -156
  6. package/dist/api/automatedOffersApi.js +1218 -1218
  7. package/dist/api/futureBidsApi.d.ts +65 -65
  8. package/dist/api/futureBidsApi.js +456 -456
  9. package/dist/api/healthApi.d.ts +32 -32
  10. package/dist/api/healthApi.js +174 -174
  11. package/dist/api/matchedOffersApi.d.ts +258 -249
  12. package/dist/api/matchedOffersApi.js +2008 -1942
  13. package/dist/api/matchedOffersApi.js.map +1 -1
  14. package/dist/api/offersApi.d.ts +200 -200
  15. package/dist/api/offersApi.js +1605 -1605
  16. package/dist/api.d.ts +2 -2
  17. package/dist/api.js +18 -18
  18. package/dist/model/addFutureBidDto.d.ts +17 -17
  19. package/dist/model/addFutureBidDto.js +35 -35
  20. package/dist/model/addMatchedDeliveryDateDto.d.ts +14 -14
  21. package/dist/model/addMatchedDeliveryDateDto.js +20 -20
  22. package/dist/model/associatedCostDto.d.ts +16 -16
  23. package/dist/model/associatedCostDto.js +30 -30
  24. package/dist/model/bulkAddRelistingDto.d.ts +16 -16
  25. package/dist/model/bulkAddRelistingDto.js +25 -25
  26. package/dist/model/bulkAddTertiaryCostsDto.d.ts +16 -16
  27. package/dist/model/bulkAddTertiaryCostsDto.js +25 -25
  28. package/dist/model/bulkChangeFreightRatesDto.d.ts +19 -19
  29. package/dist/model/bulkChangeFreightRatesDto.js +40 -40
  30. package/dist/model/bulkChangeIncotermDto.d.ts +16 -0
  31. package/dist/model/bulkChangeIncotermDto.js +31 -0
  32. package/dist/model/bulkChangeIncotermDto.js.map +1 -0
  33. package/dist/model/bulkChangeSellPriceItemDto.d.ts +20 -20
  34. package/dist/model/bulkChangeSellPriceItemDto.js +45 -45
  35. package/dist/model/bulkChangeSellPricesDto.d.ts +23 -18
  36. package/dist/model/bulkChangeSellPricesDto.js +55 -35
  37. package/dist/model/bulkChangeSellPricesDto.js.map +1 -1
  38. package/dist/model/bulkChangeSellingTraderDto.d.ts +16 -16
  39. package/dist/model/bulkChangeSellingTraderDto.js +30 -30
  40. package/dist/model/bulkDeleteBuyerSpecialInstructionsDto.d.ts +15 -15
  41. package/dist/model/bulkDeleteBuyerSpecialInstructionsDto.js +25 -25
  42. package/dist/model/bulkUpdateBuyerSpecialInstructionsDto.d.ts +19 -19
  43. package/dist/model/bulkUpdateBuyerSpecialInstructionsDto.js +45 -45
  44. package/dist/model/bulkUpdateDeliveryDatesDto.d.ts +16 -16
  45. package/dist/model/bulkUpdateDeliveryDatesDto.js +30 -30
  46. package/dist/model/bulkUpdateDocsCountryDto.d.ts +16 -16
  47. package/dist/model/bulkUpdateDocsCountryDto.js +30 -30
  48. package/dist/model/bulkUpdateMatchedDeliveryDatesDto.d.ts +15 -15
  49. package/dist/model/bulkUpdateMatchedDeliveryDatesDto.js +25 -25
  50. package/dist/model/costAmountDto.d.ts +17 -17
  51. package/dist/model/costAmountDto.js +35 -35
  52. package/dist/model/costAttributesDto.d.ts +32 -32
  53. package/dist/model/costAttributesDto.js +100 -100
  54. package/dist/model/costAttributesDtoAssociated.d.ts +16 -16
  55. package/dist/model/costAttributesDtoAssociated.js +30 -30
  56. package/dist/model/costAttributesDtoDefaultCost.d.ts +18 -18
  57. package/dist/model/costAttributesDtoDefaultCost.js +40 -40
  58. package/dist/model/costDto.d.ts +35 -35
  59. package/dist/model/costDto.js +110 -110
  60. package/dist/model/costDtoAmount.d.ts +17 -17
  61. package/dist/model/costDtoAmount.js +35 -35
  62. package/dist/model/costDtoAttributes.d.ts +32 -32
  63. package/dist/model/costDtoAttributes.js +100 -100
  64. package/dist/model/costDtoSource.d.ts +15 -15
  65. package/dist/model/costDtoSource.js +25 -25
  66. package/dist/model/costSourceDto.d.ts +15 -15
  67. package/dist/model/costSourceDto.js +25 -25
  68. package/dist/model/createAutomatedOfferDto.d.ts +124 -124
  69. package/dist/model/createAutomatedOfferDto.js +419 -419
  70. package/dist/model/createMatchedOfferDto.d.ts +85 -85
  71. package/dist/model/createMatchedOfferDto.js +315 -315
  72. package/dist/model/createMatchedOfferDtoAttributes.d.ts +34 -34
  73. package/dist/model/createMatchedOfferDtoAttributes.js +94 -94
  74. package/dist/model/createOfferDto.d.ts +111 -111
  75. package/dist/model/createOfferDto.js +397 -397
  76. package/dist/model/createOfferDtoAttributes.d.ts +52 -52
  77. package/dist/model/createOfferDtoAttributes.js +174 -174
  78. package/dist/model/createOfferDtoFormula.d.ts +19 -19
  79. package/dist/model/createOfferDtoFormula.js +40 -40
  80. package/dist/model/createOfferDtoPacking.d.ts +17 -17
  81. package/dist/model/createOfferDtoPacking.js +35 -35
  82. package/dist/model/createOfferDtoWeight.d.ts +15 -15
  83. package/dist/model/createOfferDtoWeight.js +25 -25
  84. package/dist/model/defaultCostDto.d.ts +18 -18
  85. package/dist/model/defaultCostDto.js +40 -40
  86. package/dist/model/formulaDto.d.ts +19 -19
  87. package/dist/model/formulaDto.js +40 -40
  88. package/dist/model/formulaLineDto.d.ts +17 -17
  89. package/dist/model/formulaLineDto.js +35 -35
  90. package/dist/model/generalAddressDto.d.ts +43 -43
  91. package/dist/model/generalAddressDto.js +165 -165
  92. package/dist/model/healthControllerPing200Response.d.ts +24 -24
  93. package/dist/model/healthControllerPing200Response.js +35 -35
  94. package/dist/model/healthControllerPing200ResponseInfoValue.d.ts +10 -10
  95. package/dist/model/healthControllerPing200ResponseInfoValue.js +36 -36
  96. package/dist/model/healthControllerPing503Response.d.ts +24 -24
  97. package/dist/model/healthControllerPing503Response.js +35 -35
  98. package/dist/model/matchedOfferAttributesDto.d.ts +34 -34
  99. package/dist/model/matchedOfferAttributesDto.js +94 -94
  100. package/dist/model/models.d.ts +101 -100
  101. package/dist/model/models.js +399 -396
  102. package/dist/model/models.js.map +1 -1
  103. package/dist/model/offerAttributesDto.d.ts +52 -52
  104. package/dist/model/offerAttributesDto.js +174 -174
  105. package/dist/model/offerAttributesDtoEstablishment.d.ts +43 -43
  106. package/dist/model/offerAttributesDtoEstablishment.js +165 -165
  107. package/dist/model/overwriteItemDto.d.ts +22 -22
  108. package/dist/model/overwriteItemDto.js +55 -55
  109. package/dist/model/overwriteItemDtoWeight.d.ts +14 -14
  110. package/dist/model/overwriteItemDtoWeight.js +20 -20
  111. package/dist/model/packing.d.ts +17 -17
  112. package/dist/model/packing.js +35 -35
  113. package/dist/model/pinActionDto.d.ts +14 -14
  114. package/dist/model/pinActionDto.js +20 -20
  115. package/dist/model/relistingConfigDto.d.ts +17 -17
  116. package/dist/model/relistingConfigDto.js +35 -35
  117. package/dist/model/relistingDetailDto.d.ts +31 -31
  118. package/dist/model/relistingDetailDto.js +62 -62
  119. package/dist/model/relistingDetailDtoRandomConfig.d.ts +19 -19
  120. package/dist/model/relistingDetailDtoRandomConfig.js +45 -45
  121. package/dist/model/relistingRandomConfigDto.d.ts +19 -19
  122. package/dist/model/relistingRandomConfigDto.js +45 -45
  123. package/dist/model/updateFutureBidDto.d.ts +17 -17
  124. package/dist/model/updateFutureBidDto.js +35 -35
  125. package/dist/model/updateMatchedDeliveryDateDto.d.ts +15 -15
  126. package/dist/model/updateMatchedDeliveryDateDto.js +25 -25
  127. package/dist/model/userPin.d.ts +15 -15
  128. package/dist/model/userPin.js +25 -25
  129. package/dist/model/weight.d.ts +15 -15
  130. package/dist/model/weight.js +25 -25
  131. package/dist/model/weightDto.d.ts +14 -14
  132. package/dist/model/weightDto.js +20 -20
  133. package/model/bulkChangeIncotermDto.ts +43 -0
  134. package/model/bulkChangeSellPricesDto.ts +25 -0
  135. package/model/models.ts +3 -0
  136. package/package.json +1 -1
@@ -1,1219 +1,1219 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.AutomatedOffersApi = exports.AutomatedOffersApiApiKeys = void 0;
43
- var request_1 = __importDefault(require("request"));
44
- var models_1 = require("../model/models");
45
- var apis_1 = require("./apis");
46
- var defaultBasePath = 'http://localhost';
47
- var AutomatedOffersApiApiKeys;
48
- (function (AutomatedOffersApiApiKeys) {
49
- })(AutomatedOffersApiApiKeys = exports.AutomatedOffersApiApiKeys || (exports.AutomatedOffersApiApiKeys = {}));
50
- var AutomatedOffersApi = (function () {
51
- function AutomatedOffersApi(basePathOrUsername, password, basePath) {
52
- this._basePath = defaultBasePath;
53
- this._defaultHeaders = {};
54
- this._useQuerystring = false;
55
- this.authentications = {
56
- 'default': new models_1.VoidAuth(),
57
- };
58
- this.interceptors = [];
59
- if (password) {
60
- if (basePath) {
61
- this.basePath = basePath;
62
- }
63
- }
64
- else {
65
- if (basePathOrUsername) {
66
- this.basePath = basePathOrUsername;
67
- }
68
- }
69
- }
70
- Object.defineProperty(AutomatedOffersApi.prototype, "useQuerystring", {
71
- set: function (value) {
72
- this._useQuerystring = value;
73
- },
74
- enumerable: false,
75
- configurable: true
76
- });
77
- Object.defineProperty(AutomatedOffersApi.prototype, "basePath", {
78
- get: function () {
79
- return this._basePath;
80
- },
81
- set: function (basePath) {
82
- this._basePath = basePath;
83
- },
84
- enumerable: false,
85
- configurable: true
86
- });
87
- Object.defineProperty(AutomatedOffersApi.prototype, "defaultHeaders", {
88
- get: function () {
89
- return this._defaultHeaders;
90
- },
91
- set: function (defaultHeaders) {
92
- this._defaultHeaders = defaultHeaders;
93
- },
94
- enumerable: false,
95
- configurable: true
96
- });
97
- AutomatedOffersApi.prototype.setDefaultAuthentication = function (auth) {
98
- this.authentications.default = auth;
99
- };
100
- AutomatedOffersApi.prototype.setApiKey = function (key, value) {
101
- this.authentications[AutomatedOffersApiApiKeys[key]].apiKey = value;
102
- };
103
- AutomatedOffersApi.prototype.addInterceptor = function (interceptor) {
104
- this.interceptors.push(interceptor);
105
- };
106
- AutomatedOffersApi.prototype.automatedOffersControllerAddmatchedbuyertooffer = function (id, buyer, account, options) {
107
- if (options === void 0) { options = { headers: {} }; }
108
- return __awaiter(this, void 0, void 0, function () {
109
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_1, _i, _a, interceptor;
110
- var _this = this;
111
- return __generator(this, function (_b) {
112
- localVarPath = this.basePath + '/automated-offers/{account}/{id}/matched-buyer/{buyer}/add'
113
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
114
- .replace('{' + 'buyer' + '}', encodeURIComponent(String(buyer)))
115
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
116
- localVarQueryParameters = {};
117
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
118
- localVarFormParams = {};
119
- if (id === null || id === undefined) {
120
- throw new Error('Required parameter id was null or undefined when calling automatedOffersControllerAddmatchedbuyertooffer.');
121
- }
122
- if (buyer === null || buyer === undefined) {
123
- throw new Error('Required parameter buyer was null or undefined when calling automatedOffersControllerAddmatchedbuyertooffer.');
124
- }
125
- if (account === null || account === undefined) {
126
- throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerAddmatchedbuyertooffer.');
127
- }
128
- Object.assign(localVarHeaderParams, options.headers);
129
- localVarUseFormData = false;
130
- localVarRequestOptions = {
131
- method: 'PUT',
132
- qs: localVarQueryParameters,
133
- headers: localVarHeaderParams,
134
- uri: localVarPath,
135
- useQuerystring: this._useQuerystring,
136
- json: true,
137
- };
138
- authenticationPromise = Promise.resolve();
139
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
140
- interceptorPromise = authenticationPromise;
141
- _loop_1 = function (interceptor) {
142
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
143
- };
144
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
145
- interceptor = _a[_i];
146
- _loop_1(interceptor);
147
- }
148
- return [2, interceptorPromise.then(function () {
149
- if (Object.keys(localVarFormParams).length) {
150
- if (localVarUseFormData) {
151
- localVarRequestOptions.formData = localVarFormParams;
152
- }
153
- else {
154
- localVarRequestOptions.form = localVarFormParams;
155
- }
156
- }
157
- return new Promise(function (resolve, reject) {
158
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
159
- if (error) {
160
- reject(error);
161
- }
162
- else {
163
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
164
- resolve({ response: response, body: body });
165
- }
166
- else {
167
- reject(new apis_1.HttpError(response, body, response.statusCode));
168
- }
169
- }
170
- });
171
- });
172
- })];
173
- });
174
- });
175
- };
176
- AutomatedOffersApi.prototype.automatedOffersControllerAddmatcheddeliverydatetooffer = function (id, account, addMatchedDeliveryDateDto, options) {
177
- if (options === void 0) { options = { headers: {} }; }
178
- return __awaiter(this, void 0, void 0, function () {
179
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_2, _i, _a, interceptor;
180
- var _this = this;
181
- return __generator(this, function (_b) {
182
- localVarPath = this.basePath + '/automated-offers/{account}/{id}/matched-delivery-date/add'
183
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
184
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
185
- localVarQueryParameters = {};
186
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
187
- localVarFormParams = {};
188
- if (id === null || id === undefined) {
189
- throw new Error('Required parameter id was null or undefined when calling automatedOffersControllerAddmatcheddeliverydatetooffer.');
190
- }
191
- if (account === null || account === undefined) {
192
- throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerAddmatcheddeliverydatetooffer.');
193
- }
194
- if (addMatchedDeliveryDateDto === null || addMatchedDeliveryDateDto === undefined) {
195
- throw new Error('Required parameter addMatchedDeliveryDateDto was null or undefined when calling automatedOffersControllerAddmatcheddeliverydatetooffer.');
196
- }
197
- Object.assign(localVarHeaderParams, options.headers);
198
- localVarUseFormData = false;
199
- localVarRequestOptions = {
200
- method: 'PUT',
201
- qs: localVarQueryParameters,
202
- headers: localVarHeaderParams,
203
- uri: localVarPath,
204
- useQuerystring: this._useQuerystring,
205
- json: true,
206
- body: models_1.ObjectSerializer.serialize(addMatchedDeliveryDateDto, "AddMatchedDeliveryDateDto")
207
- };
208
- authenticationPromise = Promise.resolve();
209
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
210
- interceptorPromise = authenticationPromise;
211
- _loop_2 = function (interceptor) {
212
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
213
- };
214
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
215
- interceptor = _a[_i];
216
- _loop_2(interceptor);
217
- }
218
- return [2, interceptorPromise.then(function () {
219
- if (Object.keys(localVarFormParams).length) {
220
- if (localVarUseFormData) {
221
- localVarRequestOptions.formData = localVarFormParams;
222
- }
223
- else {
224
- localVarRequestOptions.form = localVarFormParams;
225
- }
226
- }
227
- return new Promise(function (resolve, reject) {
228
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
229
- if (error) {
230
- reject(error);
231
- }
232
- else {
233
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
234
- resolve({ response: response, body: body });
235
- }
236
- else {
237
- reject(new apis_1.HttpError(response, body, response.statusCode));
238
- }
239
- }
240
- });
241
- });
242
- })];
243
- });
244
- });
245
- };
246
- AutomatedOffersApi.prototype.automatedOffersControllerAddrelistingbulk = function (account, bulkAddRelistingDto, options) {
247
- if (options === void 0) { options = { headers: {} }; }
248
- return __awaiter(this, void 0, void 0, function () {
249
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_3, _i, _a, interceptor;
250
- var _this = this;
251
- return __generator(this, function (_b) {
252
- localVarPath = this.basePath + '/automated-offers/{account}/bulk/relisting'
253
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
254
- localVarQueryParameters = {};
255
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
256
- localVarFormParams = {};
257
- if (account === null || account === undefined) {
258
- throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerAddrelistingbulk.');
259
- }
260
- if (bulkAddRelistingDto === null || bulkAddRelistingDto === undefined) {
261
- throw new Error('Required parameter bulkAddRelistingDto was null or undefined when calling automatedOffersControllerAddrelistingbulk.');
262
- }
263
- Object.assign(localVarHeaderParams, options.headers);
264
- localVarUseFormData = false;
265
- localVarRequestOptions = {
266
- method: 'POST',
267
- qs: localVarQueryParameters,
268
- headers: localVarHeaderParams,
269
- uri: localVarPath,
270
- useQuerystring: this._useQuerystring,
271
- json: true,
272
- body: models_1.ObjectSerializer.serialize(bulkAddRelistingDto, "BulkAddRelistingDto")
273
- };
274
- authenticationPromise = Promise.resolve();
275
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
276
- interceptorPromise = authenticationPromise;
277
- _loop_3 = function (interceptor) {
278
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
279
- };
280
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
281
- interceptor = _a[_i];
282
- _loop_3(interceptor);
283
- }
284
- return [2, interceptorPromise.then(function () {
285
- if (Object.keys(localVarFormParams).length) {
286
- if (localVarUseFormData) {
287
- localVarRequestOptions.formData = localVarFormParams;
288
- }
289
- else {
290
- localVarRequestOptions.form = localVarFormParams;
291
- }
292
- }
293
- return new Promise(function (resolve, reject) {
294
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
295
- if (error) {
296
- reject(error);
297
- }
298
- else {
299
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
300
- resolve({ response: response, body: body });
301
- }
302
- else {
303
- reject(new apis_1.HttpError(response, body, response.statusCode));
304
- }
305
- }
306
- });
307
- });
308
- })];
309
- });
310
- });
311
- };
312
- AutomatedOffersApi.prototype.automatedOffersControllerBulkupdatematcheddeliverydatesonoffer = function (id, account, bulkUpdateMatchedDeliveryDatesDto, options) {
313
- if (options === void 0) { options = { headers: {} }; }
314
- return __awaiter(this, void 0, void 0, function () {
315
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_4, _i, _a, interceptor;
316
- var _this = this;
317
- return __generator(this, function (_b) {
318
- localVarPath = this.basePath + '/automated-offers/{account}/{id}/matched-delivery-dates/bulk-update'
319
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
320
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
321
- localVarQueryParameters = {};
322
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
323
- localVarFormParams = {};
324
- if (id === null || id === undefined) {
325
- throw new Error('Required parameter id was null or undefined when calling automatedOffersControllerBulkupdatematcheddeliverydatesonoffer.');
326
- }
327
- if (account === null || account === undefined) {
328
- throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerBulkupdatematcheddeliverydatesonoffer.');
329
- }
330
- if (bulkUpdateMatchedDeliveryDatesDto === null || bulkUpdateMatchedDeliveryDatesDto === undefined) {
331
- throw new Error('Required parameter bulkUpdateMatchedDeliveryDatesDto was null or undefined when calling automatedOffersControllerBulkupdatematcheddeliverydatesonoffer.');
332
- }
333
- Object.assign(localVarHeaderParams, options.headers);
334
- localVarUseFormData = false;
335
- localVarRequestOptions = {
336
- method: 'PATCH',
337
- qs: localVarQueryParameters,
338
- headers: localVarHeaderParams,
339
- uri: localVarPath,
340
- useQuerystring: this._useQuerystring,
341
- json: true,
342
- body: models_1.ObjectSerializer.serialize(bulkUpdateMatchedDeliveryDatesDto, "BulkUpdateMatchedDeliveryDatesDto")
343
- };
344
- authenticationPromise = Promise.resolve();
345
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
346
- interceptorPromise = authenticationPromise;
347
- _loop_4 = function (interceptor) {
348
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
349
- };
350
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
351
- interceptor = _a[_i];
352
- _loop_4(interceptor);
353
- }
354
- return [2, interceptorPromise.then(function () {
355
- if (Object.keys(localVarFormParams).length) {
356
- if (localVarUseFormData) {
357
- localVarRequestOptions.formData = localVarFormParams;
358
- }
359
- else {
360
- localVarRequestOptions.form = localVarFormParams;
361
- }
362
- }
363
- return new Promise(function (resolve, reject) {
364
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
365
- if (error) {
366
- reject(error);
367
- }
368
- else {
369
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
370
- resolve({ response: response, body: body });
371
- }
372
- else {
373
- reject(new apis_1.HttpError(response, body, response.statusCode));
374
- }
375
- }
376
- });
377
- });
378
- })];
379
- });
380
- });
381
- };
382
- AutomatedOffersApi.prototype.automatedOffersControllerCreate = function (account, createAutomatedOfferDto, options) {
383
- if (options === void 0) { options = { headers: {} }; }
384
- return __awaiter(this, void 0, void 0, function () {
385
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_5, _i, _a, interceptor;
386
- var _this = this;
387
- return __generator(this, function (_b) {
388
- localVarPath = this.basePath + '/automated-offers/{account}'
389
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
390
- localVarQueryParameters = {};
391
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
392
- localVarFormParams = {};
393
- if (account === null || account === undefined) {
394
- throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerCreate.');
395
- }
396
- if (createAutomatedOfferDto === null || createAutomatedOfferDto === undefined) {
397
- throw new Error('Required parameter createAutomatedOfferDto was null or undefined when calling automatedOffersControllerCreate.');
398
- }
399
- Object.assign(localVarHeaderParams, options.headers);
400
- localVarUseFormData = false;
401
- localVarRequestOptions = {
402
- method: 'POST',
403
- qs: localVarQueryParameters,
404
- headers: localVarHeaderParams,
405
- uri: localVarPath,
406
- useQuerystring: this._useQuerystring,
407
- json: true,
408
- body: models_1.ObjectSerializer.serialize(createAutomatedOfferDto, "CreateAutomatedOfferDto")
409
- };
410
- authenticationPromise = Promise.resolve();
411
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
412
- interceptorPromise = authenticationPromise;
413
- _loop_5 = function (interceptor) {
414
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
415
- };
416
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
417
- interceptor = _a[_i];
418
- _loop_5(interceptor);
419
- }
420
- return [2, interceptorPromise.then(function () {
421
- if (Object.keys(localVarFormParams).length) {
422
- if (localVarUseFormData) {
423
- localVarRequestOptions.formData = localVarFormParams;
424
- }
425
- else {
426
- localVarRequestOptions.form = localVarFormParams;
427
- }
428
- }
429
- return new Promise(function (resolve, reject) {
430
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
431
- if (error) {
432
- reject(error);
433
- }
434
- else {
435
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
436
- resolve({ response: response, body: body });
437
- }
438
- else {
439
- reject(new apis_1.HttpError(response, body, response.statusCode));
440
- }
441
- }
442
- });
443
- });
444
- })];
445
- });
446
- });
447
- };
448
- AutomatedOffersApi.prototype.automatedOffersControllerCreatebulk = function (account, createAutomatedOfferDto, options) {
449
- if (options === void 0) { options = { headers: {} }; }
450
- return __awaiter(this, void 0, void 0, function () {
451
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_6, _i, _a, interceptor;
452
- var _this = this;
453
- return __generator(this, function (_b) {
454
- localVarPath = this.basePath + '/automated-offers/{account}/bulk'
455
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
456
- localVarQueryParameters = {};
457
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
458
- localVarFormParams = {};
459
- if (account === null || account === undefined) {
460
- throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerCreatebulk.');
461
- }
462
- if (createAutomatedOfferDto === null || createAutomatedOfferDto === undefined) {
463
- throw new Error('Required parameter createAutomatedOfferDto was null or undefined when calling automatedOffersControllerCreatebulk.');
464
- }
465
- Object.assign(localVarHeaderParams, options.headers);
466
- localVarUseFormData = false;
467
- localVarRequestOptions = {
468
- method: 'POST',
469
- qs: localVarQueryParameters,
470
- headers: localVarHeaderParams,
471
- uri: localVarPath,
472
- useQuerystring: this._useQuerystring,
473
- json: true,
474
- body: models_1.ObjectSerializer.serialize(createAutomatedOfferDto, "Array<CreateAutomatedOfferDto>")
475
- };
476
- authenticationPromise = Promise.resolve();
477
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
478
- interceptorPromise = authenticationPromise;
479
- _loop_6 = function (interceptor) {
480
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
481
- };
482
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
483
- interceptor = _a[_i];
484
- _loop_6(interceptor);
485
- }
486
- return [2, interceptorPromise.then(function () {
487
- if (Object.keys(localVarFormParams).length) {
488
- if (localVarUseFormData) {
489
- localVarRequestOptions.formData = localVarFormParams;
490
- }
491
- else {
492
- localVarRequestOptions.form = localVarFormParams;
493
- }
494
- }
495
- return new Promise(function (resolve, reject) {
496
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
497
- if (error) {
498
- reject(error);
499
- }
500
- else {
501
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
502
- resolve({ response: response, body: body });
503
- }
504
- else {
505
- reject(new apis_1.HttpError(response, body, response.statusCode));
506
- }
507
- }
508
- });
509
- });
510
- })];
511
- });
512
- });
513
- };
514
- AutomatedOffersApi.prototype.automatedOffersControllerFilter = function (account, skip, limit, sort, fields, body, options) {
515
- if (options === void 0) { options = { headers: {} }; }
516
- return __awaiter(this, void 0, void 0, function () {
517
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_7, _i, _a, interceptor;
518
- var _this = this;
519
- return __generator(this, function (_b) {
520
- localVarPath = this.basePath + '/automated-offers/{account}/search'
521
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
522
- localVarQueryParameters = {};
523
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
524
- localVarFormParams = {};
525
- if (account === null || account === undefined) {
526
- throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerFilter.');
527
- }
528
- if (skip !== undefined) {
529
- localVarQueryParameters['skip'] = models_1.ObjectSerializer.serialize(skip, "number");
530
- }
531
- if (limit !== undefined) {
532
- localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number");
533
- }
534
- if (sort !== undefined) {
535
- localVarQueryParameters['sort'] = models_1.ObjectSerializer.serialize(sort, "string");
536
- }
537
- if (fields !== undefined) {
538
- localVarQueryParameters['fields'] = models_1.ObjectSerializer.serialize(fields, "Array<string>");
539
- }
540
- Object.assign(localVarHeaderParams, options.headers);
541
- localVarUseFormData = false;
542
- localVarRequestOptions = {
543
- method: 'POST',
544
- qs: localVarQueryParameters,
545
- headers: localVarHeaderParams,
546
- uri: localVarPath,
547
- useQuerystring: this._useQuerystring,
548
- json: true,
549
- body: models_1.ObjectSerializer.serialize(body, "object")
550
- };
551
- authenticationPromise = Promise.resolve();
552
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
553
- interceptorPromise = authenticationPromise;
554
- _loop_7 = function (interceptor) {
555
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
556
- };
557
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
558
- interceptor = _a[_i];
559
- _loop_7(interceptor);
560
- }
561
- return [2, interceptorPromise.then(function () {
562
- if (Object.keys(localVarFormParams).length) {
563
- if (localVarUseFormData) {
564
- localVarRequestOptions.formData = localVarFormParams;
565
- }
566
- else {
567
- localVarRequestOptions.form = localVarFormParams;
568
- }
569
- }
570
- return new Promise(function (resolve, reject) {
571
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
572
- if (error) {
573
- reject(error);
574
- }
575
- else {
576
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
577
- resolve({ response: response, body: body });
578
- }
579
- else {
580
- reject(new apis_1.HttpError(response, body, response.statusCode));
581
- }
582
- }
583
- });
584
- });
585
- })];
586
- });
587
- });
588
- };
589
- AutomatedOffersApi.prototype.automatedOffersControllerFindall = function (account, skip, limit, sort, fields, options) {
590
- if (options === void 0) { options = { headers: {} }; }
591
- return __awaiter(this, void 0, void 0, function () {
592
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_8, _i, _a, interceptor;
593
- var _this = this;
594
- return __generator(this, function (_b) {
595
- localVarPath = this.basePath + '/automated-offers/{account}'
596
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
597
- localVarQueryParameters = {};
598
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
599
- localVarFormParams = {};
600
- if (account === null || account === undefined) {
601
- throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerFindall.');
602
- }
603
- if (skip !== undefined) {
604
- localVarQueryParameters['skip'] = models_1.ObjectSerializer.serialize(skip, "number");
605
- }
606
- if (limit !== undefined) {
607
- localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number");
608
- }
609
- if (sort !== undefined) {
610
- localVarQueryParameters['sort'] = models_1.ObjectSerializer.serialize(sort, "string");
611
- }
612
- if (fields !== undefined) {
613
- localVarQueryParameters['fields'] = models_1.ObjectSerializer.serialize(fields, "Array<string>");
614
- }
615
- Object.assign(localVarHeaderParams, options.headers);
616
- localVarUseFormData = false;
617
- localVarRequestOptions = {
618
- method: 'GET',
619
- qs: localVarQueryParameters,
620
- headers: localVarHeaderParams,
621
- uri: localVarPath,
622
- useQuerystring: this._useQuerystring,
623
- json: true,
624
- };
625
- authenticationPromise = Promise.resolve();
626
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
627
- interceptorPromise = authenticationPromise;
628
- _loop_8 = function (interceptor) {
629
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
630
- };
631
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
632
- interceptor = _a[_i];
633
- _loop_8(interceptor);
634
- }
635
- return [2, interceptorPromise.then(function () {
636
- if (Object.keys(localVarFormParams).length) {
637
- if (localVarUseFormData) {
638
- localVarRequestOptions.formData = localVarFormParams;
639
- }
640
- else {
641
- localVarRequestOptions.form = localVarFormParams;
642
- }
643
- }
644
- return new Promise(function (resolve, reject) {
645
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
646
- if (error) {
647
- reject(error);
648
- }
649
- else {
650
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
651
- resolve({ response: response, body: body });
652
- }
653
- else {
654
- reject(new apis_1.HttpError(response, body, response.statusCode));
655
- }
656
- }
657
- });
658
- });
659
- })];
660
- });
661
- });
662
- };
663
- AutomatedOffersApi.prototype.automatedOffersControllerFindone = function (id, account, fields, options) {
664
- if (options === void 0) { options = { headers: {} }; }
665
- return __awaiter(this, void 0, void 0, function () {
666
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_9, _i, _a, interceptor;
667
- var _this = this;
668
- return __generator(this, function (_b) {
669
- localVarPath = this.basePath + '/automated-offers/{account}/{id}'
670
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
671
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
672
- localVarQueryParameters = {};
673
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
674
- localVarFormParams = {};
675
- if (id === null || id === undefined) {
676
- throw new Error('Required parameter id was null or undefined when calling automatedOffersControllerFindone.');
677
- }
678
- if (account === null || account === undefined) {
679
- throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerFindone.');
680
- }
681
- if (fields !== undefined) {
682
- localVarQueryParameters['fields'] = models_1.ObjectSerializer.serialize(fields, "string");
683
- }
684
- Object.assign(localVarHeaderParams, options.headers);
685
- localVarUseFormData = false;
686
- localVarRequestOptions = {
687
- method: 'GET',
688
- qs: localVarQueryParameters,
689
- headers: localVarHeaderParams,
690
- uri: localVarPath,
691
- useQuerystring: this._useQuerystring,
692
- json: true,
693
- };
694
- authenticationPromise = Promise.resolve();
695
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
696
- interceptorPromise = authenticationPromise;
697
- _loop_9 = function (interceptor) {
698
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
699
- };
700
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
701
- interceptor = _a[_i];
702
- _loop_9(interceptor);
703
- }
704
- return [2, interceptorPromise.then(function () {
705
- if (Object.keys(localVarFormParams).length) {
706
- if (localVarUseFormData) {
707
- localVarRequestOptions.formData = localVarFormParams;
708
- }
709
- else {
710
- localVarRequestOptions.form = localVarFormParams;
711
- }
712
- }
713
- return new Promise(function (resolve, reject) {
714
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
715
- if (error) {
716
- reject(error);
717
- }
718
- else {
719
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
720
- resolve({ response: response, body: body });
721
- }
722
- else {
723
- reject(new apis_1.HttpError(response, body, response.statusCode));
724
- }
725
- }
726
- });
727
- });
728
- })];
729
- });
730
- });
731
- };
732
- AutomatedOffersApi.prototype.automatedOffersControllerGetbids = function (account, skip, limit, sort, fields, body, options) {
733
- if (options === void 0) { options = { headers: {} }; }
734
- return __awaiter(this, void 0, void 0, function () {
735
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_10, _i, _a, interceptor;
736
- var _this = this;
737
- return __generator(this, function (_b) {
738
- localVarPath = this.basePath + '/automated-offers/{account}/bids'
739
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
740
- localVarQueryParameters = {};
741
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
742
- localVarFormParams = {};
743
- if (account === null || account === undefined) {
744
- throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerGetbids.');
745
- }
746
- if (skip !== undefined) {
747
- localVarQueryParameters['skip'] = models_1.ObjectSerializer.serialize(skip, "number");
748
- }
749
- if (limit !== undefined) {
750
- localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number");
751
- }
752
- if (sort !== undefined) {
753
- localVarQueryParameters['sort'] = models_1.ObjectSerializer.serialize(sort, "string");
754
- }
755
- if (fields !== undefined) {
756
- localVarQueryParameters['fields'] = models_1.ObjectSerializer.serialize(fields, "Array<string>");
757
- }
758
- Object.assign(localVarHeaderParams, options.headers);
759
- localVarUseFormData = false;
760
- localVarRequestOptions = {
761
- method: 'POST',
762
- qs: localVarQueryParameters,
763
- headers: localVarHeaderParams,
764
- uri: localVarPath,
765
- useQuerystring: this._useQuerystring,
766
- json: true,
767
- body: models_1.ObjectSerializer.serialize(body, "object")
768
- };
769
- authenticationPromise = Promise.resolve();
770
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
771
- interceptorPromise = authenticationPromise;
772
- _loop_10 = function (interceptor) {
773
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
774
- };
775
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
776
- interceptor = _a[_i];
777
- _loop_10(interceptor);
778
- }
779
- return [2, interceptorPromise.then(function () {
780
- if (Object.keys(localVarFormParams).length) {
781
- if (localVarUseFormData) {
782
- localVarRequestOptions.formData = localVarFormParams;
783
- }
784
- else {
785
- localVarRequestOptions.form = localVarFormParams;
786
- }
787
- }
788
- return new Promise(function (resolve, reject) {
789
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
790
- if (error) {
791
- reject(error);
792
- }
793
- else {
794
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
795
- resolve({ response: response, body: body });
796
- }
797
- else {
798
- reject(new apis_1.HttpError(response, body, response.statusCode));
799
- }
800
- }
801
- });
802
- });
803
- })];
804
- });
805
- });
806
- };
807
- AutomatedOffersApi.prototype.automatedOffersControllerRemove = function (id, account, options) {
808
- if (options === void 0) { options = { headers: {} }; }
809
- return __awaiter(this, void 0, void 0, function () {
810
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_11, _i, _a, interceptor;
811
- var _this = this;
812
- return __generator(this, function (_b) {
813
- localVarPath = this.basePath + '/automated-offers/{account}/{id}'
814
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
815
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
816
- localVarQueryParameters = {};
817
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
818
- localVarFormParams = {};
819
- if (id === null || id === undefined) {
820
- throw new Error('Required parameter id was null or undefined when calling automatedOffersControllerRemove.');
821
- }
822
- if (account === null || account === undefined) {
823
- throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerRemove.');
824
- }
825
- Object.assign(localVarHeaderParams, options.headers);
826
- localVarUseFormData = false;
827
- localVarRequestOptions = {
828
- method: 'DELETE',
829
- qs: localVarQueryParameters,
830
- headers: localVarHeaderParams,
831
- uri: localVarPath,
832
- useQuerystring: this._useQuerystring,
833
- json: true,
834
- };
835
- authenticationPromise = Promise.resolve();
836
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
837
- interceptorPromise = authenticationPromise;
838
- _loop_11 = function (interceptor) {
839
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
840
- };
841
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
842
- interceptor = _a[_i];
843
- _loop_11(interceptor);
844
- }
845
- return [2, interceptorPromise.then(function () {
846
- if (Object.keys(localVarFormParams).length) {
847
- if (localVarUseFormData) {
848
- localVarRequestOptions.formData = localVarFormParams;
849
- }
850
- else {
851
- localVarRequestOptions.form = localVarFormParams;
852
- }
853
- }
854
- return new Promise(function (resolve, reject) {
855
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
856
- if (error) {
857
- reject(error);
858
- }
859
- else {
860
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
861
- resolve({ response: response, body: body });
862
- }
863
- else {
864
- reject(new apis_1.HttpError(response, body, response.statusCode));
865
- }
866
- }
867
- });
868
- });
869
- })];
870
- });
871
- });
872
- };
873
- AutomatedOffersApi.prototype.automatedOffersControllerUpdate = function (id, account, body, options) {
874
- if (options === void 0) { options = { headers: {} }; }
875
- return __awaiter(this, void 0, void 0, function () {
876
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_12, _i, _a, interceptor;
877
- var _this = this;
878
- return __generator(this, function (_b) {
879
- localVarPath = this.basePath + '/automated-offers/{account}/{id}'
880
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
881
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
882
- localVarQueryParameters = {};
883
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
884
- localVarFormParams = {};
885
- if (id === null || id === undefined) {
886
- throw new Error('Required parameter id was null or undefined when calling automatedOffersControllerUpdate.');
887
- }
888
- if (account === null || account === undefined) {
889
- throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerUpdate.');
890
- }
891
- if (body === null || body === undefined) {
892
- throw new Error('Required parameter body was null or undefined when calling automatedOffersControllerUpdate.');
893
- }
894
- Object.assign(localVarHeaderParams, options.headers);
895
- localVarUseFormData = false;
896
- localVarRequestOptions = {
897
- method: 'PUT',
898
- qs: localVarQueryParameters,
899
- headers: localVarHeaderParams,
900
- uri: localVarPath,
901
- useQuerystring: this._useQuerystring,
902
- json: true,
903
- body: models_1.ObjectSerializer.serialize(body, "object")
904
- };
905
- authenticationPromise = Promise.resolve();
906
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
907
- interceptorPromise = authenticationPromise;
908
- _loop_12 = function (interceptor) {
909
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
910
- };
911
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
912
- interceptor = _a[_i];
913
- _loop_12(interceptor);
914
- }
915
- return [2, interceptorPromise.then(function () {
916
- if (Object.keys(localVarFormParams).length) {
917
- if (localVarUseFormData) {
918
- localVarRequestOptions.formData = localVarFormParams;
919
- }
920
- else {
921
- localVarRequestOptions.form = localVarFormParams;
922
- }
923
- }
924
- return new Promise(function (resolve, reject) {
925
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
926
- if (error) {
927
- reject(error);
928
- }
929
- else {
930
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
931
- resolve({ response: response, body: body });
932
- }
933
- else {
934
- reject(new apis_1.HttpError(response, body, response.statusCode));
935
- }
936
- }
937
- });
938
- });
939
- })];
940
- });
941
- });
942
- };
943
- AutomatedOffersApi.prototype.automatedOffersControllerUpdatematcheddeliverydateonoffer = function (id, account, updateMatchedDeliveryDateDto, options) {
944
- if (options === void 0) { options = { headers: {} }; }
945
- return __awaiter(this, void 0, void 0, function () {
946
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_13, _i, _a, interceptor;
947
- var _this = this;
948
- return __generator(this, function (_b) {
949
- localVarPath = this.basePath + '/automated-offers/{account}/{id}/matched-delivery-date/update'
950
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
951
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
952
- localVarQueryParameters = {};
953
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
954
- localVarFormParams = {};
955
- if (id === null || id === undefined) {
956
- throw new Error('Required parameter id was null or undefined when calling automatedOffersControllerUpdatematcheddeliverydateonoffer.');
957
- }
958
- if (account === null || account === undefined) {
959
- throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerUpdatematcheddeliverydateonoffer.');
960
- }
961
- if (updateMatchedDeliveryDateDto === null || updateMatchedDeliveryDateDto === undefined) {
962
- throw new Error('Required parameter updateMatchedDeliveryDateDto was null or undefined when calling automatedOffersControllerUpdatematcheddeliverydateonoffer.');
963
- }
964
- Object.assign(localVarHeaderParams, options.headers);
965
- localVarUseFormData = false;
966
- localVarRequestOptions = {
967
- method: 'PATCH',
968
- qs: localVarQueryParameters,
969
- headers: localVarHeaderParams,
970
- uri: localVarPath,
971
- useQuerystring: this._useQuerystring,
972
- json: true,
973
- body: models_1.ObjectSerializer.serialize(updateMatchedDeliveryDateDto, "UpdateMatchedDeliveryDateDto")
974
- };
975
- authenticationPromise = Promise.resolve();
976
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
977
- interceptorPromise = authenticationPromise;
978
- _loop_13 = function (interceptor) {
979
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
980
- };
981
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
982
- interceptor = _a[_i];
983
- _loop_13(interceptor);
984
- }
985
- return [2, interceptorPromise.then(function () {
986
- if (Object.keys(localVarFormParams).length) {
987
- if (localVarUseFormData) {
988
- localVarRequestOptions.formData = localVarFormParams;
989
- }
990
- else {
991
- localVarRequestOptions.form = localVarFormParams;
992
- }
993
- }
994
- return new Promise(function (resolve, reject) {
995
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
996
- if (error) {
997
- reject(error);
998
- }
999
- else {
1000
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1001
- resolve({ response: response, body: body });
1002
- }
1003
- else {
1004
- reject(new apis_1.HttpError(response, body, response.statusCode));
1005
- }
1006
- }
1007
- });
1008
- });
1009
- })];
1010
- });
1011
- });
1012
- };
1013
- AutomatedOffersApi.prototype.automatedOffersControllerUpdaterelistingstatus = function (automatedOfferId, id, account, body, options) {
1014
- if (options === void 0) { options = { headers: {} }; }
1015
- return __awaiter(this, void 0, void 0, function () {
1016
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_14, _i, _a, interceptor;
1017
- var _this = this;
1018
- return __generator(this, function (_b) {
1019
- localVarPath = this.basePath + '/automated-offers/{account}/{automatedOfferId}/relistings/{id}/status'
1020
- .replace('{' + 'automatedOfferId' + '}', encodeURIComponent(String(automatedOfferId)))
1021
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
1022
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1023
- localVarQueryParameters = {};
1024
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1025
- localVarFormParams = {};
1026
- if (automatedOfferId === null || automatedOfferId === undefined) {
1027
- throw new Error('Required parameter automatedOfferId was null or undefined when calling automatedOffersControllerUpdaterelistingstatus.');
1028
- }
1029
- if (id === null || id === undefined) {
1030
- throw new Error('Required parameter id was null or undefined when calling automatedOffersControllerUpdaterelistingstatus.');
1031
- }
1032
- if (account === null || account === undefined) {
1033
- throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerUpdaterelistingstatus.');
1034
- }
1035
- if (body === null || body === undefined) {
1036
- throw new Error('Required parameter body was null or undefined when calling automatedOffersControllerUpdaterelistingstatus.');
1037
- }
1038
- Object.assign(localVarHeaderParams, options.headers);
1039
- localVarUseFormData = false;
1040
- localVarRequestOptions = {
1041
- method: 'PUT',
1042
- qs: localVarQueryParameters,
1043
- headers: localVarHeaderParams,
1044
- uri: localVarPath,
1045
- useQuerystring: this._useQuerystring,
1046
- json: true,
1047
- body: models_1.ObjectSerializer.serialize(body, "object")
1048
- };
1049
- authenticationPromise = Promise.resolve();
1050
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1051
- interceptorPromise = authenticationPromise;
1052
- _loop_14 = function (interceptor) {
1053
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1054
- };
1055
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1056
- interceptor = _a[_i];
1057
- _loop_14(interceptor);
1058
- }
1059
- return [2, interceptorPromise.then(function () {
1060
- if (Object.keys(localVarFormParams).length) {
1061
- if (localVarUseFormData) {
1062
- localVarRequestOptions.formData = localVarFormParams;
1063
- }
1064
- else {
1065
- localVarRequestOptions.form = localVarFormParams;
1066
- }
1067
- }
1068
- return new Promise(function (resolve, reject) {
1069
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1070
- if (error) {
1071
- reject(error);
1072
- }
1073
- else {
1074
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1075
- resolve({ response: response, body: body });
1076
- }
1077
- else {
1078
- reject(new apis_1.HttpError(response, body, response.statusCode));
1079
- }
1080
- }
1081
- });
1082
- });
1083
- })];
1084
- });
1085
- });
1086
- };
1087
- AutomatedOffersApi.prototype.automatedOffersControllerUpdatestatus = function (account, body, options) {
1088
- if (options === void 0) { options = { headers: {} }; }
1089
- return __awaiter(this, void 0, void 0, function () {
1090
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_15, _i, _a, interceptor;
1091
- var _this = this;
1092
- return __generator(this, function (_b) {
1093
- localVarPath = this.basePath + '/automated-offers/{account}/status'
1094
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1095
- localVarQueryParameters = {};
1096
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1097
- localVarFormParams = {};
1098
- if (account === null || account === undefined) {
1099
- throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerUpdatestatus.');
1100
- }
1101
- if (body === null || body === undefined) {
1102
- throw new Error('Required parameter body was null or undefined when calling automatedOffersControllerUpdatestatus.');
1103
- }
1104
- Object.assign(localVarHeaderParams, options.headers);
1105
- localVarUseFormData = false;
1106
- localVarRequestOptions = {
1107
- method: 'PUT',
1108
- qs: localVarQueryParameters,
1109
- headers: localVarHeaderParams,
1110
- uri: localVarPath,
1111
- useQuerystring: this._useQuerystring,
1112
- json: true,
1113
- body: models_1.ObjectSerializer.serialize(body, "object")
1114
- };
1115
- authenticationPromise = Promise.resolve();
1116
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1117
- interceptorPromise = authenticationPromise;
1118
- _loop_15 = function (interceptor) {
1119
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1120
- };
1121
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1122
- interceptor = _a[_i];
1123
- _loop_15(interceptor);
1124
- }
1125
- return [2, interceptorPromise.then(function () {
1126
- if (Object.keys(localVarFormParams).length) {
1127
- if (localVarUseFormData) {
1128
- localVarRequestOptions.formData = localVarFormParams;
1129
- }
1130
- else {
1131
- localVarRequestOptions.form = localVarFormParams;
1132
- }
1133
- }
1134
- return new Promise(function (resolve, reject) {
1135
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1136
- if (error) {
1137
- reject(error);
1138
- }
1139
- else {
1140
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1141
- resolve({ response: response, body: body });
1142
- }
1143
- else {
1144
- reject(new apis_1.HttpError(response, body, response.statusCode));
1145
- }
1146
- }
1147
- });
1148
- });
1149
- })];
1150
- });
1151
- });
1152
- };
1153
- AutomatedOffersApi.prototype.automatedOffersControllerViews = function (account, body, options) {
1154
- if (options === void 0) { options = { headers: {} }; }
1155
- return __awaiter(this, void 0, void 0, function () {
1156
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_16, _i, _a, interceptor;
1157
- var _this = this;
1158
- return __generator(this, function (_b) {
1159
- localVarPath = this.basePath + '/automated-offers/{account}/views'
1160
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1161
- localVarQueryParameters = {};
1162
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1163
- localVarFormParams = {};
1164
- if (account === null || account === undefined) {
1165
- throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerViews.');
1166
- }
1167
- Object.assign(localVarHeaderParams, options.headers);
1168
- localVarUseFormData = false;
1169
- localVarRequestOptions = {
1170
- method: 'POST',
1171
- qs: localVarQueryParameters,
1172
- headers: localVarHeaderParams,
1173
- uri: localVarPath,
1174
- useQuerystring: this._useQuerystring,
1175
- json: true,
1176
- body: models_1.ObjectSerializer.serialize(body, "object")
1177
- };
1178
- authenticationPromise = Promise.resolve();
1179
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1180
- interceptorPromise = authenticationPromise;
1181
- _loop_16 = function (interceptor) {
1182
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1183
- };
1184
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1185
- interceptor = _a[_i];
1186
- _loop_16(interceptor);
1187
- }
1188
- return [2, interceptorPromise.then(function () {
1189
- if (Object.keys(localVarFormParams).length) {
1190
- if (localVarUseFormData) {
1191
- localVarRequestOptions.formData = localVarFormParams;
1192
- }
1193
- else {
1194
- localVarRequestOptions.form = localVarFormParams;
1195
- }
1196
- }
1197
- return new Promise(function (resolve, reject) {
1198
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1199
- if (error) {
1200
- reject(error);
1201
- }
1202
- else {
1203
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1204
- resolve({ response: response, body: body });
1205
- }
1206
- else {
1207
- reject(new apis_1.HttpError(response, body, response.statusCode));
1208
- }
1209
- }
1210
- });
1211
- });
1212
- })];
1213
- });
1214
- });
1215
- };
1216
- return AutomatedOffersApi;
1217
- }());
1218
- exports.AutomatedOffersApi = AutomatedOffersApi;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.AutomatedOffersApi = exports.AutomatedOffersApiApiKeys = void 0;
43
+ var request_1 = __importDefault(require("request"));
44
+ var models_1 = require("../model/models");
45
+ var apis_1 = require("./apis");
46
+ var defaultBasePath = 'http://localhost';
47
+ var AutomatedOffersApiApiKeys;
48
+ (function (AutomatedOffersApiApiKeys) {
49
+ })(AutomatedOffersApiApiKeys = exports.AutomatedOffersApiApiKeys || (exports.AutomatedOffersApiApiKeys = {}));
50
+ var AutomatedOffersApi = (function () {
51
+ function AutomatedOffersApi(basePathOrUsername, password, basePath) {
52
+ this._basePath = defaultBasePath;
53
+ this._defaultHeaders = {};
54
+ this._useQuerystring = false;
55
+ this.authentications = {
56
+ 'default': new models_1.VoidAuth(),
57
+ };
58
+ this.interceptors = [];
59
+ if (password) {
60
+ if (basePath) {
61
+ this.basePath = basePath;
62
+ }
63
+ }
64
+ else {
65
+ if (basePathOrUsername) {
66
+ this.basePath = basePathOrUsername;
67
+ }
68
+ }
69
+ }
70
+ Object.defineProperty(AutomatedOffersApi.prototype, "useQuerystring", {
71
+ set: function (value) {
72
+ this._useQuerystring = value;
73
+ },
74
+ enumerable: false,
75
+ configurable: true
76
+ });
77
+ Object.defineProperty(AutomatedOffersApi.prototype, "basePath", {
78
+ get: function () {
79
+ return this._basePath;
80
+ },
81
+ set: function (basePath) {
82
+ this._basePath = basePath;
83
+ },
84
+ enumerable: false,
85
+ configurable: true
86
+ });
87
+ Object.defineProperty(AutomatedOffersApi.prototype, "defaultHeaders", {
88
+ get: function () {
89
+ return this._defaultHeaders;
90
+ },
91
+ set: function (defaultHeaders) {
92
+ this._defaultHeaders = defaultHeaders;
93
+ },
94
+ enumerable: false,
95
+ configurable: true
96
+ });
97
+ AutomatedOffersApi.prototype.setDefaultAuthentication = function (auth) {
98
+ this.authentications.default = auth;
99
+ };
100
+ AutomatedOffersApi.prototype.setApiKey = function (key, value) {
101
+ this.authentications[AutomatedOffersApiApiKeys[key]].apiKey = value;
102
+ };
103
+ AutomatedOffersApi.prototype.addInterceptor = function (interceptor) {
104
+ this.interceptors.push(interceptor);
105
+ };
106
+ AutomatedOffersApi.prototype.automatedOffersControllerAddmatchedbuyertooffer = function (id, buyer, account, options) {
107
+ if (options === void 0) { options = { headers: {} }; }
108
+ return __awaiter(this, void 0, void 0, function () {
109
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_1, _i, _a, interceptor;
110
+ var _this = this;
111
+ return __generator(this, function (_b) {
112
+ localVarPath = this.basePath + '/automated-offers/{account}/{id}/matched-buyer/{buyer}/add'
113
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
114
+ .replace('{' + 'buyer' + '}', encodeURIComponent(String(buyer)))
115
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
116
+ localVarQueryParameters = {};
117
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
118
+ localVarFormParams = {};
119
+ if (id === null || id === undefined) {
120
+ throw new Error('Required parameter id was null or undefined when calling automatedOffersControllerAddmatchedbuyertooffer.');
121
+ }
122
+ if (buyer === null || buyer === undefined) {
123
+ throw new Error('Required parameter buyer was null or undefined when calling automatedOffersControllerAddmatchedbuyertooffer.');
124
+ }
125
+ if (account === null || account === undefined) {
126
+ throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerAddmatchedbuyertooffer.');
127
+ }
128
+ Object.assign(localVarHeaderParams, options.headers);
129
+ localVarUseFormData = false;
130
+ localVarRequestOptions = {
131
+ method: 'PUT',
132
+ qs: localVarQueryParameters,
133
+ headers: localVarHeaderParams,
134
+ uri: localVarPath,
135
+ useQuerystring: this._useQuerystring,
136
+ json: true,
137
+ };
138
+ authenticationPromise = Promise.resolve();
139
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
140
+ interceptorPromise = authenticationPromise;
141
+ _loop_1 = function (interceptor) {
142
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
143
+ };
144
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
145
+ interceptor = _a[_i];
146
+ _loop_1(interceptor);
147
+ }
148
+ return [2, interceptorPromise.then(function () {
149
+ if (Object.keys(localVarFormParams).length) {
150
+ if (localVarUseFormData) {
151
+ localVarRequestOptions.formData = localVarFormParams;
152
+ }
153
+ else {
154
+ localVarRequestOptions.form = localVarFormParams;
155
+ }
156
+ }
157
+ return new Promise(function (resolve, reject) {
158
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
159
+ if (error) {
160
+ reject(error);
161
+ }
162
+ else {
163
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
164
+ resolve({ response: response, body: body });
165
+ }
166
+ else {
167
+ reject(new apis_1.HttpError(response, body, response.statusCode));
168
+ }
169
+ }
170
+ });
171
+ });
172
+ })];
173
+ });
174
+ });
175
+ };
176
+ AutomatedOffersApi.prototype.automatedOffersControllerAddmatcheddeliverydatetooffer = function (id, account, addMatchedDeliveryDateDto, options) {
177
+ if (options === void 0) { options = { headers: {} }; }
178
+ return __awaiter(this, void 0, void 0, function () {
179
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_2, _i, _a, interceptor;
180
+ var _this = this;
181
+ return __generator(this, function (_b) {
182
+ localVarPath = this.basePath + '/automated-offers/{account}/{id}/matched-delivery-date/add'
183
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
184
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
185
+ localVarQueryParameters = {};
186
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
187
+ localVarFormParams = {};
188
+ if (id === null || id === undefined) {
189
+ throw new Error('Required parameter id was null or undefined when calling automatedOffersControllerAddmatcheddeliverydatetooffer.');
190
+ }
191
+ if (account === null || account === undefined) {
192
+ throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerAddmatcheddeliverydatetooffer.');
193
+ }
194
+ if (addMatchedDeliveryDateDto === null || addMatchedDeliveryDateDto === undefined) {
195
+ throw new Error('Required parameter addMatchedDeliveryDateDto was null or undefined when calling automatedOffersControllerAddmatcheddeliverydatetooffer.');
196
+ }
197
+ Object.assign(localVarHeaderParams, options.headers);
198
+ localVarUseFormData = false;
199
+ localVarRequestOptions = {
200
+ method: 'PUT',
201
+ qs: localVarQueryParameters,
202
+ headers: localVarHeaderParams,
203
+ uri: localVarPath,
204
+ useQuerystring: this._useQuerystring,
205
+ json: true,
206
+ body: models_1.ObjectSerializer.serialize(addMatchedDeliveryDateDto, "AddMatchedDeliveryDateDto")
207
+ };
208
+ authenticationPromise = Promise.resolve();
209
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
210
+ interceptorPromise = authenticationPromise;
211
+ _loop_2 = function (interceptor) {
212
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
213
+ };
214
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
215
+ interceptor = _a[_i];
216
+ _loop_2(interceptor);
217
+ }
218
+ return [2, interceptorPromise.then(function () {
219
+ if (Object.keys(localVarFormParams).length) {
220
+ if (localVarUseFormData) {
221
+ localVarRequestOptions.formData = localVarFormParams;
222
+ }
223
+ else {
224
+ localVarRequestOptions.form = localVarFormParams;
225
+ }
226
+ }
227
+ return new Promise(function (resolve, reject) {
228
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
229
+ if (error) {
230
+ reject(error);
231
+ }
232
+ else {
233
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
234
+ resolve({ response: response, body: body });
235
+ }
236
+ else {
237
+ reject(new apis_1.HttpError(response, body, response.statusCode));
238
+ }
239
+ }
240
+ });
241
+ });
242
+ })];
243
+ });
244
+ });
245
+ };
246
+ AutomatedOffersApi.prototype.automatedOffersControllerAddrelistingbulk = function (account, bulkAddRelistingDto, options) {
247
+ if (options === void 0) { options = { headers: {} }; }
248
+ return __awaiter(this, void 0, void 0, function () {
249
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_3, _i, _a, interceptor;
250
+ var _this = this;
251
+ return __generator(this, function (_b) {
252
+ localVarPath = this.basePath + '/automated-offers/{account}/bulk/relisting'
253
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
254
+ localVarQueryParameters = {};
255
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
256
+ localVarFormParams = {};
257
+ if (account === null || account === undefined) {
258
+ throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerAddrelistingbulk.');
259
+ }
260
+ if (bulkAddRelistingDto === null || bulkAddRelistingDto === undefined) {
261
+ throw new Error('Required parameter bulkAddRelistingDto was null or undefined when calling automatedOffersControllerAddrelistingbulk.');
262
+ }
263
+ Object.assign(localVarHeaderParams, options.headers);
264
+ localVarUseFormData = false;
265
+ localVarRequestOptions = {
266
+ method: 'POST',
267
+ qs: localVarQueryParameters,
268
+ headers: localVarHeaderParams,
269
+ uri: localVarPath,
270
+ useQuerystring: this._useQuerystring,
271
+ json: true,
272
+ body: models_1.ObjectSerializer.serialize(bulkAddRelistingDto, "BulkAddRelistingDto")
273
+ };
274
+ authenticationPromise = Promise.resolve();
275
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
276
+ interceptorPromise = authenticationPromise;
277
+ _loop_3 = function (interceptor) {
278
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
279
+ };
280
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
281
+ interceptor = _a[_i];
282
+ _loop_3(interceptor);
283
+ }
284
+ return [2, interceptorPromise.then(function () {
285
+ if (Object.keys(localVarFormParams).length) {
286
+ if (localVarUseFormData) {
287
+ localVarRequestOptions.formData = localVarFormParams;
288
+ }
289
+ else {
290
+ localVarRequestOptions.form = localVarFormParams;
291
+ }
292
+ }
293
+ return new Promise(function (resolve, reject) {
294
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
295
+ if (error) {
296
+ reject(error);
297
+ }
298
+ else {
299
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
300
+ resolve({ response: response, body: body });
301
+ }
302
+ else {
303
+ reject(new apis_1.HttpError(response, body, response.statusCode));
304
+ }
305
+ }
306
+ });
307
+ });
308
+ })];
309
+ });
310
+ });
311
+ };
312
+ AutomatedOffersApi.prototype.automatedOffersControllerBulkupdatematcheddeliverydatesonoffer = function (id, account, bulkUpdateMatchedDeliveryDatesDto, options) {
313
+ if (options === void 0) { options = { headers: {} }; }
314
+ return __awaiter(this, void 0, void 0, function () {
315
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_4, _i, _a, interceptor;
316
+ var _this = this;
317
+ return __generator(this, function (_b) {
318
+ localVarPath = this.basePath + '/automated-offers/{account}/{id}/matched-delivery-dates/bulk-update'
319
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
320
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
321
+ localVarQueryParameters = {};
322
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
323
+ localVarFormParams = {};
324
+ if (id === null || id === undefined) {
325
+ throw new Error('Required parameter id was null or undefined when calling automatedOffersControllerBulkupdatematcheddeliverydatesonoffer.');
326
+ }
327
+ if (account === null || account === undefined) {
328
+ throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerBulkupdatematcheddeliverydatesonoffer.');
329
+ }
330
+ if (bulkUpdateMatchedDeliveryDatesDto === null || bulkUpdateMatchedDeliveryDatesDto === undefined) {
331
+ throw new Error('Required parameter bulkUpdateMatchedDeliveryDatesDto was null or undefined when calling automatedOffersControllerBulkupdatematcheddeliverydatesonoffer.');
332
+ }
333
+ Object.assign(localVarHeaderParams, options.headers);
334
+ localVarUseFormData = false;
335
+ localVarRequestOptions = {
336
+ method: 'PATCH',
337
+ qs: localVarQueryParameters,
338
+ headers: localVarHeaderParams,
339
+ uri: localVarPath,
340
+ useQuerystring: this._useQuerystring,
341
+ json: true,
342
+ body: models_1.ObjectSerializer.serialize(bulkUpdateMatchedDeliveryDatesDto, "BulkUpdateMatchedDeliveryDatesDto")
343
+ };
344
+ authenticationPromise = Promise.resolve();
345
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
346
+ interceptorPromise = authenticationPromise;
347
+ _loop_4 = function (interceptor) {
348
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
349
+ };
350
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
351
+ interceptor = _a[_i];
352
+ _loop_4(interceptor);
353
+ }
354
+ return [2, interceptorPromise.then(function () {
355
+ if (Object.keys(localVarFormParams).length) {
356
+ if (localVarUseFormData) {
357
+ localVarRequestOptions.formData = localVarFormParams;
358
+ }
359
+ else {
360
+ localVarRequestOptions.form = localVarFormParams;
361
+ }
362
+ }
363
+ return new Promise(function (resolve, reject) {
364
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
365
+ if (error) {
366
+ reject(error);
367
+ }
368
+ else {
369
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
370
+ resolve({ response: response, body: body });
371
+ }
372
+ else {
373
+ reject(new apis_1.HttpError(response, body, response.statusCode));
374
+ }
375
+ }
376
+ });
377
+ });
378
+ })];
379
+ });
380
+ });
381
+ };
382
+ AutomatedOffersApi.prototype.automatedOffersControllerCreate = function (account, createAutomatedOfferDto, options) {
383
+ if (options === void 0) { options = { headers: {} }; }
384
+ return __awaiter(this, void 0, void 0, function () {
385
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_5, _i, _a, interceptor;
386
+ var _this = this;
387
+ return __generator(this, function (_b) {
388
+ localVarPath = this.basePath + '/automated-offers/{account}'
389
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
390
+ localVarQueryParameters = {};
391
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
392
+ localVarFormParams = {};
393
+ if (account === null || account === undefined) {
394
+ throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerCreate.');
395
+ }
396
+ if (createAutomatedOfferDto === null || createAutomatedOfferDto === undefined) {
397
+ throw new Error('Required parameter createAutomatedOfferDto was null or undefined when calling automatedOffersControllerCreate.');
398
+ }
399
+ Object.assign(localVarHeaderParams, options.headers);
400
+ localVarUseFormData = false;
401
+ localVarRequestOptions = {
402
+ method: 'POST',
403
+ qs: localVarQueryParameters,
404
+ headers: localVarHeaderParams,
405
+ uri: localVarPath,
406
+ useQuerystring: this._useQuerystring,
407
+ json: true,
408
+ body: models_1.ObjectSerializer.serialize(createAutomatedOfferDto, "CreateAutomatedOfferDto")
409
+ };
410
+ authenticationPromise = Promise.resolve();
411
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
412
+ interceptorPromise = authenticationPromise;
413
+ _loop_5 = function (interceptor) {
414
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
415
+ };
416
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
417
+ interceptor = _a[_i];
418
+ _loop_5(interceptor);
419
+ }
420
+ return [2, interceptorPromise.then(function () {
421
+ if (Object.keys(localVarFormParams).length) {
422
+ if (localVarUseFormData) {
423
+ localVarRequestOptions.formData = localVarFormParams;
424
+ }
425
+ else {
426
+ localVarRequestOptions.form = localVarFormParams;
427
+ }
428
+ }
429
+ return new Promise(function (resolve, reject) {
430
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
431
+ if (error) {
432
+ reject(error);
433
+ }
434
+ else {
435
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
436
+ resolve({ response: response, body: body });
437
+ }
438
+ else {
439
+ reject(new apis_1.HttpError(response, body, response.statusCode));
440
+ }
441
+ }
442
+ });
443
+ });
444
+ })];
445
+ });
446
+ });
447
+ };
448
+ AutomatedOffersApi.prototype.automatedOffersControllerCreatebulk = function (account, createAutomatedOfferDto, options) {
449
+ if (options === void 0) { options = { headers: {} }; }
450
+ return __awaiter(this, void 0, void 0, function () {
451
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_6, _i, _a, interceptor;
452
+ var _this = this;
453
+ return __generator(this, function (_b) {
454
+ localVarPath = this.basePath + '/automated-offers/{account}/bulk'
455
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
456
+ localVarQueryParameters = {};
457
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
458
+ localVarFormParams = {};
459
+ if (account === null || account === undefined) {
460
+ throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerCreatebulk.');
461
+ }
462
+ if (createAutomatedOfferDto === null || createAutomatedOfferDto === undefined) {
463
+ throw new Error('Required parameter createAutomatedOfferDto was null or undefined when calling automatedOffersControllerCreatebulk.');
464
+ }
465
+ Object.assign(localVarHeaderParams, options.headers);
466
+ localVarUseFormData = false;
467
+ localVarRequestOptions = {
468
+ method: 'POST',
469
+ qs: localVarQueryParameters,
470
+ headers: localVarHeaderParams,
471
+ uri: localVarPath,
472
+ useQuerystring: this._useQuerystring,
473
+ json: true,
474
+ body: models_1.ObjectSerializer.serialize(createAutomatedOfferDto, "Array<CreateAutomatedOfferDto>")
475
+ };
476
+ authenticationPromise = Promise.resolve();
477
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
478
+ interceptorPromise = authenticationPromise;
479
+ _loop_6 = function (interceptor) {
480
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
481
+ };
482
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
483
+ interceptor = _a[_i];
484
+ _loop_6(interceptor);
485
+ }
486
+ return [2, interceptorPromise.then(function () {
487
+ if (Object.keys(localVarFormParams).length) {
488
+ if (localVarUseFormData) {
489
+ localVarRequestOptions.formData = localVarFormParams;
490
+ }
491
+ else {
492
+ localVarRequestOptions.form = localVarFormParams;
493
+ }
494
+ }
495
+ return new Promise(function (resolve, reject) {
496
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
497
+ if (error) {
498
+ reject(error);
499
+ }
500
+ else {
501
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
502
+ resolve({ response: response, body: body });
503
+ }
504
+ else {
505
+ reject(new apis_1.HttpError(response, body, response.statusCode));
506
+ }
507
+ }
508
+ });
509
+ });
510
+ })];
511
+ });
512
+ });
513
+ };
514
+ AutomatedOffersApi.prototype.automatedOffersControllerFilter = function (account, skip, limit, sort, fields, body, options) {
515
+ if (options === void 0) { options = { headers: {} }; }
516
+ return __awaiter(this, void 0, void 0, function () {
517
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_7, _i, _a, interceptor;
518
+ var _this = this;
519
+ return __generator(this, function (_b) {
520
+ localVarPath = this.basePath + '/automated-offers/{account}/search'
521
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
522
+ localVarQueryParameters = {};
523
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
524
+ localVarFormParams = {};
525
+ if (account === null || account === undefined) {
526
+ throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerFilter.');
527
+ }
528
+ if (skip !== undefined) {
529
+ localVarQueryParameters['skip'] = models_1.ObjectSerializer.serialize(skip, "number");
530
+ }
531
+ if (limit !== undefined) {
532
+ localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number");
533
+ }
534
+ if (sort !== undefined) {
535
+ localVarQueryParameters['sort'] = models_1.ObjectSerializer.serialize(sort, "string");
536
+ }
537
+ if (fields !== undefined) {
538
+ localVarQueryParameters['fields'] = models_1.ObjectSerializer.serialize(fields, "Array<string>");
539
+ }
540
+ Object.assign(localVarHeaderParams, options.headers);
541
+ localVarUseFormData = false;
542
+ localVarRequestOptions = {
543
+ method: 'POST',
544
+ qs: localVarQueryParameters,
545
+ headers: localVarHeaderParams,
546
+ uri: localVarPath,
547
+ useQuerystring: this._useQuerystring,
548
+ json: true,
549
+ body: models_1.ObjectSerializer.serialize(body, "object")
550
+ };
551
+ authenticationPromise = Promise.resolve();
552
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
553
+ interceptorPromise = authenticationPromise;
554
+ _loop_7 = function (interceptor) {
555
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
556
+ };
557
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
558
+ interceptor = _a[_i];
559
+ _loop_7(interceptor);
560
+ }
561
+ return [2, interceptorPromise.then(function () {
562
+ if (Object.keys(localVarFormParams).length) {
563
+ if (localVarUseFormData) {
564
+ localVarRequestOptions.formData = localVarFormParams;
565
+ }
566
+ else {
567
+ localVarRequestOptions.form = localVarFormParams;
568
+ }
569
+ }
570
+ return new Promise(function (resolve, reject) {
571
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
572
+ if (error) {
573
+ reject(error);
574
+ }
575
+ else {
576
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
577
+ resolve({ response: response, body: body });
578
+ }
579
+ else {
580
+ reject(new apis_1.HttpError(response, body, response.statusCode));
581
+ }
582
+ }
583
+ });
584
+ });
585
+ })];
586
+ });
587
+ });
588
+ };
589
+ AutomatedOffersApi.prototype.automatedOffersControllerFindall = function (account, skip, limit, sort, fields, options) {
590
+ if (options === void 0) { options = { headers: {} }; }
591
+ return __awaiter(this, void 0, void 0, function () {
592
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_8, _i, _a, interceptor;
593
+ var _this = this;
594
+ return __generator(this, function (_b) {
595
+ localVarPath = this.basePath + '/automated-offers/{account}'
596
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
597
+ localVarQueryParameters = {};
598
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
599
+ localVarFormParams = {};
600
+ if (account === null || account === undefined) {
601
+ throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerFindall.');
602
+ }
603
+ if (skip !== undefined) {
604
+ localVarQueryParameters['skip'] = models_1.ObjectSerializer.serialize(skip, "number");
605
+ }
606
+ if (limit !== undefined) {
607
+ localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number");
608
+ }
609
+ if (sort !== undefined) {
610
+ localVarQueryParameters['sort'] = models_1.ObjectSerializer.serialize(sort, "string");
611
+ }
612
+ if (fields !== undefined) {
613
+ localVarQueryParameters['fields'] = models_1.ObjectSerializer.serialize(fields, "Array<string>");
614
+ }
615
+ Object.assign(localVarHeaderParams, options.headers);
616
+ localVarUseFormData = false;
617
+ localVarRequestOptions = {
618
+ method: 'GET',
619
+ qs: localVarQueryParameters,
620
+ headers: localVarHeaderParams,
621
+ uri: localVarPath,
622
+ useQuerystring: this._useQuerystring,
623
+ json: true,
624
+ };
625
+ authenticationPromise = Promise.resolve();
626
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
627
+ interceptorPromise = authenticationPromise;
628
+ _loop_8 = function (interceptor) {
629
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
630
+ };
631
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
632
+ interceptor = _a[_i];
633
+ _loop_8(interceptor);
634
+ }
635
+ return [2, interceptorPromise.then(function () {
636
+ if (Object.keys(localVarFormParams).length) {
637
+ if (localVarUseFormData) {
638
+ localVarRequestOptions.formData = localVarFormParams;
639
+ }
640
+ else {
641
+ localVarRequestOptions.form = localVarFormParams;
642
+ }
643
+ }
644
+ return new Promise(function (resolve, reject) {
645
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
646
+ if (error) {
647
+ reject(error);
648
+ }
649
+ else {
650
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
651
+ resolve({ response: response, body: body });
652
+ }
653
+ else {
654
+ reject(new apis_1.HttpError(response, body, response.statusCode));
655
+ }
656
+ }
657
+ });
658
+ });
659
+ })];
660
+ });
661
+ });
662
+ };
663
+ AutomatedOffersApi.prototype.automatedOffersControllerFindone = function (id, account, fields, options) {
664
+ if (options === void 0) { options = { headers: {} }; }
665
+ return __awaiter(this, void 0, void 0, function () {
666
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_9, _i, _a, interceptor;
667
+ var _this = this;
668
+ return __generator(this, function (_b) {
669
+ localVarPath = this.basePath + '/automated-offers/{account}/{id}'
670
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
671
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
672
+ localVarQueryParameters = {};
673
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
674
+ localVarFormParams = {};
675
+ if (id === null || id === undefined) {
676
+ throw new Error('Required parameter id was null or undefined when calling automatedOffersControllerFindone.');
677
+ }
678
+ if (account === null || account === undefined) {
679
+ throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerFindone.');
680
+ }
681
+ if (fields !== undefined) {
682
+ localVarQueryParameters['fields'] = models_1.ObjectSerializer.serialize(fields, "string");
683
+ }
684
+ Object.assign(localVarHeaderParams, options.headers);
685
+ localVarUseFormData = false;
686
+ localVarRequestOptions = {
687
+ method: 'GET',
688
+ qs: localVarQueryParameters,
689
+ headers: localVarHeaderParams,
690
+ uri: localVarPath,
691
+ useQuerystring: this._useQuerystring,
692
+ json: true,
693
+ };
694
+ authenticationPromise = Promise.resolve();
695
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
696
+ interceptorPromise = authenticationPromise;
697
+ _loop_9 = function (interceptor) {
698
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
699
+ };
700
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
701
+ interceptor = _a[_i];
702
+ _loop_9(interceptor);
703
+ }
704
+ return [2, interceptorPromise.then(function () {
705
+ if (Object.keys(localVarFormParams).length) {
706
+ if (localVarUseFormData) {
707
+ localVarRequestOptions.formData = localVarFormParams;
708
+ }
709
+ else {
710
+ localVarRequestOptions.form = localVarFormParams;
711
+ }
712
+ }
713
+ return new Promise(function (resolve, reject) {
714
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
715
+ if (error) {
716
+ reject(error);
717
+ }
718
+ else {
719
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
720
+ resolve({ response: response, body: body });
721
+ }
722
+ else {
723
+ reject(new apis_1.HttpError(response, body, response.statusCode));
724
+ }
725
+ }
726
+ });
727
+ });
728
+ })];
729
+ });
730
+ });
731
+ };
732
+ AutomatedOffersApi.prototype.automatedOffersControllerGetbids = function (account, skip, limit, sort, fields, body, options) {
733
+ if (options === void 0) { options = { headers: {} }; }
734
+ return __awaiter(this, void 0, void 0, function () {
735
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_10, _i, _a, interceptor;
736
+ var _this = this;
737
+ return __generator(this, function (_b) {
738
+ localVarPath = this.basePath + '/automated-offers/{account}/bids'
739
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
740
+ localVarQueryParameters = {};
741
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
742
+ localVarFormParams = {};
743
+ if (account === null || account === undefined) {
744
+ throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerGetbids.');
745
+ }
746
+ if (skip !== undefined) {
747
+ localVarQueryParameters['skip'] = models_1.ObjectSerializer.serialize(skip, "number");
748
+ }
749
+ if (limit !== undefined) {
750
+ localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number");
751
+ }
752
+ if (sort !== undefined) {
753
+ localVarQueryParameters['sort'] = models_1.ObjectSerializer.serialize(sort, "string");
754
+ }
755
+ if (fields !== undefined) {
756
+ localVarQueryParameters['fields'] = models_1.ObjectSerializer.serialize(fields, "Array<string>");
757
+ }
758
+ Object.assign(localVarHeaderParams, options.headers);
759
+ localVarUseFormData = false;
760
+ localVarRequestOptions = {
761
+ method: 'POST',
762
+ qs: localVarQueryParameters,
763
+ headers: localVarHeaderParams,
764
+ uri: localVarPath,
765
+ useQuerystring: this._useQuerystring,
766
+ json: true,
767
+ body: models_1.ObjectSerializer.serialize(body, "object")
768
+ };
769
+ authenticationPromise = Promise.resolve();
770
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
771
+ interceptorPromise = authenticationPromise;
772
+ _loop_10 = function (interceptor) {
773
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
774
+ };
775
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
776
+ interceptor = _a[_i];
777
+ _loop_10(interceptor);
778
+ }
779
+ return [2, interceptorPromise.then(function () {
780
+ if (Object.keys(localVarFormParams).length) {
781
+ if (localVarUseFormData) {
782
+ localVarRequestOptions.formData = localVarFormParams;
783
+ }
784
+ else {
785
+ localVarRequestOptions.form = localVarFormParams;
786
+ }
787
+ }
788
+ return new Promise(function (resolve, reject) {
789
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
790
+ if (error) {
791
+ reject(error);
792
+ }
793
+ else {
794
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
795
+ resolve({ response: response, body: body });
796
+ }
797
+ else {
798
+ reject(new apis_1.HttpError(response, body, response.statusCode));
799
+ }
800
+ }
801
+ });
802
+ });
803
+ })];
804
+ });
805
+ });
806
+ };
807
+ AutomatedOffersApi.prototype.automatedOffersControllerRemove = function (id, account, options) {
808
+ if (options === void 0) { options = { headers: {} }; }
809
+ return __awaiter(this, void 0, void 0, function () {
810
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_11, _i, _a, interceptor;
811
+ var _this = this;
812
+ return __generator(this, function (_b) {
813
+ localVarPath = this.basePath + '/automated-offers/{account}/{id}'
814
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
815
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
816
+ localVarQueryParameters = {};
817
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
818
+ localVarFormParams = {};
819
+ if (id === null || id === undefined) {
820
+ throw new Error('Required parameter id was null or undefined when calling automatedOffersControllerRemove.');
821
+ }
822
+ if (account === null || account === undefined) {
823
+ throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerRemove.');
824
+ }
825
+ Object.assign(localVarHeaderParams, options.headers);
826
+ localVarUseFormData = false;
827
+ localVarRequestOptions = {
828
+ method: 'DELETE',
829
+ qs: localVarQueryParameters,
830
+ headers: localVarHeaderParams,
831
+ uri: localVarPath,
832
+ useQuerystring: this._useQuerystring,
833
+ json: true,
834
+ };
835
+ authenticationPromise = Promise.resolve();
836
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
837
+ interceptorPromise = authenticationPromise;
838
+ _loop_11 = function (interceptor) {
839
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
840
+ };
841
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
842
+ interceptor = _a[_i];
843
+ _loop_11(interceptor);
844
+ }
845
+ return [2, interceptorPromise.then(function () {
846
+ if (Object.keys(localVarFormParams).length) {
847
+ if (localVarUseFormData) {
848
+ localVarRequestOptions.formData = localVarFormParams;
849
+ }
850
+ else {
851
+ localVarRequestOptions.form = localVarFormParams;
852
+ }
853
+ }
854
+ return new Promise(function (resolve, reject) {
855
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
856
+ if (error) {
857
+ reject(error);
858
+ }
859
+ else {
860
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
861
+ resolve({ response: response, body: body });
862
+ }
863
+ else {
864
+ reject(new apis_1.HttpError(response, body, response.statusCode));
865
+ }
866
+ }
867
+ });
868
+ });
869
+ })];
870
+ });
871
+ });
872
+ };
873
+ AutomatedOffersApi.prototype.automatedOffersControllerUpdate = function (id, account, body, options) {
874
+ if (options === void 0) { options = { headers: {} }; }
875
+ return __awaiter(this, void 0, void 0, function () {
876
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_12, _i, _a, interceptor;
877
+ var _this = this;
878
+ return __generator(this, function (_b) {
879
+ localVarPath = this.basePath + '/automated-offers/{account}/{id}'
880
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
881
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
882
+ localVarQueryParameters = {};
883
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
884
+ localVarFormParams = {};
885
+ if (id === null || id === undefined) {
886
+ throw new Error('Required parameter id was null or undefined when calling automatedOffersControllerUpdate.');
887
+ }
888
+ if (account === null || account === undefined) {
889
+ throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerUpdate.');
890
+ }
891
+ if (body === null || body === undefined) {
892
+ throw new Error('Required parameter body was null or undefined when calling automatedOffersControllerUpdate.');
893
+ }
894
+ Object.assign(localVarHeaderParams, options.headers);
895
+ localVarUseFormData = false;
896
+ localVarRequestOptions = {
897
+ method: 'PUT',
898
+ qs: localVarQueryParameters,
899
+ headers: localVarHeaderParams,
900
+ uri: localVarPath,
901
+ useQuerystring: this._useQuerystring,
902
+ json: true,
903
+ body: models_1.ObjectSerializer.serialize(body, "object")
904
+ };
905
+ authenticationPromise = Promise.resolve();
906
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
907
+ interceptorPromise = authenticationPromise;
908
+ _loop_12 = function (interceptor) {
909
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
910
+ };
911
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
912
+ interceptor = _a[_i];
913
+ _loop_12(interceptor);
914
+ }
915
+ return [2, interceptorPromise.then(function () {
916
+ if (Object.keys(localVarFormParams).length) {
917
+ if (localVarUseFormData) {
918
+ localVarRequestOptions.formData = localVarFormParams;
919
+ }
920
+ else {
921
+ localVarRequestOptions.form = localVarFormParams;
922
+ }
923
+ }
924
+ return new Promise(function (resolve, reject) {
925
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
926
+ if (error) {
927
+ reject(error);
928
+ }
929
+ else {
930
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
931
+ resolve({ response: response, body: body });
932
+ }
933
+ else {
934
+ reject(new apis_1.HttpError(response, body, response.statusCode));
935
+ }
936
+ }
937
+ });
938
+ });
939
+ })];
940
+ });
941
+ });
942
+ };
943
+ AutomatedOffersApi.prototype.automatedOffersControllerUpdatematcheddeliverydateonoffer = function (id, account, updateMatchedDeliveryDateDto, options) {
944
+ if (options === void 0) { options = { headers: {} }; }
945
+ return __awaiter(this, void 0, void 0, function () {
946
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_13, _i, _a, interceptor;
947
+ var _this = this;
948
+ return __generator(this, function (_b) {
949
+ localVarPath = this.basePath + '/automated-offers/{account}/{id}/matched-delivery-date/update'
950
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
951
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
952
+ localVarQueryParameters = {};
953
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
954
+ localVarFormParams = {};
955
+ if (id === null || id === undefined) {
956
+ throw new Error('Required parameter id was null or undefined when calling automatedOffersControllerUpdatematcheddeliverydateonoffer.');
957
+ }
958
+ if (account === null || account === undefined) {
959
+ throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerUpdatematcheddeliverydateonoffer.');
960
+ }
961
+ if (updateMatchedDeliveryDateDto === null || updateMatchedDeliveryDateDto === undefined) {
962
+ throw new Error('Required parameter updateMatchedDeliveryDateDto was null or undefined when calling automatedOffersControllerUpdatematcheddeliverydateonoffer.');
963
+ }
964
+ Object.assign(localVarHeaderParams, options.headers);
965
+ localVarUseFormData = false;
966
+ localVarRequestOptions = {
967
+ method: 'PATCH',
968
+ qs: localVarQueryParameters,
969
+ headers: localVarHeaderParams,
970
+ uri: localVarPath,
971
+ useQuerystring: this._useQuerystring,
972
+ json: true,
973
+ body: models_1.ObjectSerializer.serialize(updateMatchedDeliveryDateDto, "UpdateMatchedDeliveryDateDto")
974
+ };
975
+ authenticationPromise = Promise.resolve();
976
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
977
+ interceptorPromise = authenticationPromise;
978
+ _loop_13 = function (interceptor) {
979
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
980
+ };
981
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
982
+ interceptor = _a[_i];
983
+ _loop_13(interceptor);
984
+ }
985
+ return [2, interceptorPromise.then(function () {
986
+ if (Object.keys(localVarFormParams).length) {
987
+ if (localVarUseFormData) {
988
+ localVarRequestOptions.formData = localVarFormParams;
989
+ }
990
+ else {
991
+ localVarRequestOptions.form = localVarFormParams;
992
+ }
993
+ }
994
+ return new Promise(function (resolve, reject) {
995
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
996
+ if (error) {
997
+ reject(error);
998
+ }
999
+ else {
1000
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1001
+ resolve({ response: response, body: body });
1002
+ }
1003
+ else {
1004
+ reject(new apis_1.HttpError(response, body, response.statusCode));
1005
+ }
1006
+ }
1007
+ });
1008
+ });
1009
+ })];
1010
+ });
1011
+ });
1012
+ };
1013
+ AutomatedOffersApi.prototype.automatedOffersControllerUpdaterelistingstatus = function (automatedOfferId, id, account, body, options) {
1014
+ if (options === void 0) { options = { headers: {} }; }
1015
+ return __awaiter(this, void 0, void 0, function () {
1016
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_14, _i, _a, interceptor;
1017
+ var _this = this;
1018
+ return __generator(this, function (_b) {
1019
+ localVarPath = this.basePath + '/automated-offers/{account}/{automatedOfferId}/relistings/{id}/status'
1020
+ .replace('{' + 'automatedOfferId' + '}', encodeURIComponent(String(automatedOfferId)))
1021
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
1022
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1023
+ localVarQueryParameters = {};
1024
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1025
+ localVarFormParams = {};
1026
+ if (automatedOfferId === null || automatedOfferId === undefined) {
1027
+ throw new Error('Required parameter automatedOfferId was null or undefined when calling automatedOffersControllerUpdaterelistingstatus.');
1028
+ }
1029
+ if (id === null || id === undefined) {
1030
+ throw new Error('Required parameter id was null or undefined when calling automatedOffersControllerUpdaterelistingstatus.');
1031
+ }
1032
+ if (account === null || account === undefined) {
1033
+ throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerUpdaterelistingstatus.');
1034
+ }
1035
+ if (body === null || body === undefined) {
1036
+ throw new Error('Required parameter body was null or undefined when calling automatedOffersControllerUpdaterelistingstatus.');
1037
+ }
1038
+ Object.assign(localVarHeaderParams, options.headers);
1039
+ localVarUseFormData = false;
1040
+ localVarRequestOptions = {
1041
+ method: 'PUT',
1042
+ qs: localVarQueryParameters,
1043
+ headers: localVarHeaderParams,
1044
+ uri: localVarPath,
1045
+ useQuerystring: this._useQuerystring,
1046
+ json: true,
1047
+ body: models_1.ObjectSerializer.serialize(body, "object")
1048
+ };
1049
+ authenticationPromise = Promise.resolve();
1050
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1051
+ interceptorPromise = authenticationPromise;
1052
+ _loop_14 = function (interceptor) {
1053
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1054
+ };
1055
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1056
+ interceptor = _a[_i];
1057
+ _loop_14(interceptor);
1058
+ }
1059
+ return [2, interceptorPromise.then(function () {
1060
+ if (Object.keys(localVarFormParams).length) {
1061
+ if (localVarUseFormData) {
1062
+ localVarRequestOptions.formData = localVarFormParams;
1063
+ }
1064
+ else {
1065
+ localVarRequestOptions.form = localVarFormParams;
1066
+ }
1067
+ }
1068
+ return new Promise(function (resolve, reject) {
1069
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1070
+ if (error) {
1071
+ reject(error);
1072
+ }
1073
+ else {
1074
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1075
+ resolve({ response: response, body: body });
1076
+ }
1077
+ else {
1078
+ reject(new apis_1.HttpError(response, body, response.statusCode));
1079
+ }
1080
+ }
1081
+ });
1082
+ });
1083
+ })];
1084
+ });
1085
+ });
1086
+ };
1087
+ AutomatedOffersApi.prototype.automatedOffersControllerUpdatestatus = function (account, body, options) {
1088
+ if (options === void 0) { options = { headers: {} }; }
1089
+ return __awaiter(this, void 0, void 0, function () {
1090
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_15, _i, _a, interceptor;
1091
+ var _this = this;
1092
+ return __generator(this, function (_b) {
1093
+ localVarPath = this.basePath + '/automated-offers/{account}/status'
1094
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1095
+ localVarQueryParameters = {};
1096
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1097
+ localVarFormParams = {};
1098
+ if (account === null || account === undefined) {
1099
+ throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerUpdatestatus.');
1100
+ }
1101
+ if (body === null || body === undefined) {
1102
+ throw new Error('Required parameter body was null or undefined when calling automatedOffersControllerUpdatestatus.');
1103
+ }
1104
+ Object.assign(localVarHeaderParams, options.headers);
1105
+ localVarUseFormData = false;
1106
+ localVarRequestOptions = {
1107
+ method: 'PUT',
1108
+ qs: localVarQueryParameters,
1109
+ headers: localVarHeaderParams,
1110
+ uri: localVarPath,
1111
+ useQuerystring: this._useQuerystring,
1112
+ json: true,
1113
+ body: models_1.ObjectSerializer.serialize(body, "object")
1114
+ };
1115
+ authenticationPromise = Promise.resolve();
1116
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1117
+ interceptorPromise = authenticationPromise;
1118
+ _loop_15 = function (interceptor) {
1119
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1120
+ };
1121
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1122
+ interceptor = _a[_i];
1123
+ _loop_15(interceptor);
1124
+ }
1125
+ return [2, interceptorPromise.then(function () {
1126
+ if (Object.keys(localVarFormParams).length) {
1127
+ if (localVarUseFormData) {
1128
+ localVarRequestOptions.formData = localVarFormParams;
1129
+ }
1130
+ else {
1131
+ localVarRequestOptions.form = localVarFormParams;
1132
+ }
1133
+ }
1134
+ return new Promise(function (resolve, reject) {
1135
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1136
+ if (error) {
1137
+ reject(error);
1138
+ }
1139
+ else {
1140
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1141
+ resolve({ response: response, body: body });
1142
+ }
1143
+ else {
1144
+ reject(new apis_1.HttpError(response, body, response.statusCode));
1145
+ }
1146
+ }
1147
+ });
1148
+ });
1149
+ })];
1150
+ });
1151
+ });
1152
+ };
1153
+ AutomatedOffersApi.prototype.automatedOffersControllerViews = function (account, body, options) {
1154
+ if (options === void 0) { options = { headers: {} }; }
1155
+ return __awaiter(this, void 0, void 0, function () {
1156
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_16, _i, _a, interceptor;
1157
+ var _this = this;
1158
+ return __generator(this, function (_b) {
1159
+ localVarPath = this.basePath + '/automated-offers/{account}/views'
1160
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1161
+ localVarQueryParameters = {};
1162
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1163
+ localVarFormParams = {};
1164
+ if (account === null || account === undefined) {
1165
+ throw new Error('Required parameter account was null or undefined when calling automatedOffersControllerViews.');
1166
+ }
1167
+ Object.assign(localVarHeaderParams, options.headers);
1168
+ localVarUseFormData = false;
1169
+ localVarRequestOptions = {
1170
+ method: 'POST',
1171
+ qs: localVarQueryParameters,
1172
+ headers: localVarHeaderParams,
1173
+ uri: localVarPath,
1174
+ useQuerystring: this._useQuerystring,
1175
+ json: true,
1176
+ body: models_1.ObjectSerializer.serialize(body, "object")
1177
+ };
1178
+ authenticationPromise = Promise.resolve();
1179
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1180
+ interceptorPromise = authenticationPromise;
1181
+ _loop_16 = function (interceptor) {
1182
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1183
+ };
1184
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1185
+ interceptor = _a[_i];
1186
+ _loop_16(interceptor);
1187
+ }
1188
+ return [2, interceptorPromise.then(function () {
1189
+ if (Object.keys(localVarFormParams).length) {
1190
+ if (localVarUseFormData) {
1191
+ localVarRequestOptions.formData = localVarFormParams;
1192
+ }
1193
+ else {
1194
+ localVarRequestOptions.form = localVarFormParams;
1195
+ }
1196
+ }
1197
+ return new Promise(function (resolve, reject) {
1198
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1199
+ if (error) {
1200
+ reject(error);
1201
+ }
1202
+ else {
1203
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1204
+ resolve({ response: response, body: body });
1205
+ }
1206
+ else {
1207
+ reject(new apis_1.HttpError(response, body, response.statusCode));
1208
+ }
1209
+ }
1210
+ });
1211
+ });
1212
+ })];
1213
+ });
1214
+ });
1215
+ };
1216
+ return AutomatedOffersApi;
1217
+ }());
1218
+ exports.AutomatedOffersApi = AutomatedOffersApi;
1219
1219
  //# sourceMappingURL=automatedOffersApi.js.map