@tradecafe/offer-service-sdk 0.0.5 → 0.0.6

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.
@@ -1,1130 +1,1130 @@
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.MatchedOffersApi = exports.MatchedOffersApiApiKeys = 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 MatchedOffersApiApiKeys;
48
- (function (MatchedOffersApiApiKeys) {
49
- })(MatchedOffersApiApiKeys = exports.MatchedOffersApiApiKeys || (exports.MatchedOffersApiApiKeys = {}));
50
- var MatchedOffersApi = (function () {
51
- function MatchedOffersApi(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(MatchedOffersApi.prototype, "useQuerystring", {
71
- set: function (value) {
72
- this._useQuerystring = value;
73
- },
74
- enumerable: false,
75
- configurable: true
76
- });
77
- Object.defineProperty(MatchedOffersApi.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(MatchedOffersApi.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
- MatchedOffersApi.prototype.setDefaultAuthentication = function (auth) {
98
- this.authentications.default = auth;
99
- };
100
- MatchedOffersApi.prototype.setApiKey = function (key, value) {
101
- this.authentications[MatchedOffersApiApiKeys[key]].apiKey = value;
102
- };
103
- MatchedOffersApi.prototype.addInterceptor = function (interceptor) {
104
- this.interceptors.push(interceptor);
105
- };
106
- MatchedOffersApi.prototype.matchedOffersControllerAddbid = function (id, userId, account, body, 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 + '/matched-offers/{account}/{id}/{userId}/bid'
113
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
114
- .replace('{' + 'userId' + '}', encodeURIComponent(String(userId)))
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 matchedOffersControllerAddbid.');
121
- }
122
- if (userId === null || userId === undefined) {
123
- throw new Error('Required parameter userId was null or undefined when calling matchedOffersControllerAddbid.');
124
- }
125
- if (account === null || account === undefined) {
126
- throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerAddbid.');
127
- }
128
- if (body === null || body === undefined) {
129
- throw new Error('Required parameter body was null or undefined when calling matchedOffersControllerAddbid.');
130
- }
131
- Object.assign(localVarHeaderParams, options.headers);
132
- localVarUseFormData = false;
133
- localVarRequestOptions = {
134
- method: 'POST',
135
- qs: localVarQueryParameters,
136
- headers: localVarHeaderParams,
137
- uri: localVarPath,
138
- useQuerystring: this._useQuerystring,
139
- json: true,
140
- body: models_1.ObjectSerializer.serialize(body, "object")
141
- };
142
- authenticationPromise = Promise.resolve();
143
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
144
- interceptorPromise = authenticationPromise;
145
- _loop_1 = function (interceptor) {
146
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
147
- };
148
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
149
- interceptor = _a[_i];
150
- _loop_1(interceptor);
151
- }
152
- return [2, interceptorPromise.then(function () {
153
- if (Object.keys(localVarFormParams).length) {
154
- if (localVarUseFormData) {
155
- localVarRequestOptions.formData = localVarFormParams;
156
- }
157
- else {
158
- localVarRequestOptions.form = localVarFormParams;
159
- }
160
- }
161
- return new Promise(function (resolve, reject) {
162
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
163
- if (error) {
164
- reject(error);
165
- }
166
- else {
167
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
168
- resolve({ response: response, body: body });
169
- }
170
- else {
171
- reject(new apis_1.HttpError(response, body, response.statusCode));
172
- }
173
- }
174
- });
175
- });
176
- })];
177
- });
178
- });
179
- };
180
- MatchedOffersApi.prototype.matchedOffersControllerCreate = function (account, body, options) {
181
- if (options === void 0) { options = { headers: {} }; }
182
- return __awaiter(this, void 0, void 0, function () {
183
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_2, _i, _a, interceptor;
184
- var _this = this;
185
- return __generator(this, function (_b) {
186
- localVarPath = this.basePath + '/matched-offers/{account}'
187
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
188
- localVarQueryParameters = {};
189
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
190
- localVarFormParams = {};
191
- if (account === null || account === undefined) {
192
- throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerCreate.');
193
- }
194
- if (body === null || body === undefined) {
195
- throw new Error('Required parameter body was null or undefined when calling matchedOffersControllerCreate.');
196
- }
197
- Object.assign(localVarHeaderParams, options.headers);
198
- localVarUseFormData = false;
199
- localVarRequestOptions = {
200
- method: 'POST',
201
- qs: localVarQueryParameters,
202
- headers: localVarHeaderParams,
203
- uri: localVarPath,
204
- useQuerystring: this._useQuerystring,
205
- json: true,
206
- body: models_1.ObjectSerializer.serialize(body, "object")
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
- MatchedOffersApi.prototype.matchedOffersControllerDeletebid = function (id, userId, account, 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 + '/matched-offers/{account}/{id}/{userId}/bid'
253
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
254
- .replace('{' + 'userId' + '}', encodeURIComponent(String(userId)))
255
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
256
- localVarQueryParameters = {};
257
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
258
- localVarFormParams = {};
259
- if (id === null || id === undefined) {
260
- throw new Error('Required parameter id was null or undefined when calling matchedOffersControllerDeletebid.');
261
- }
262
- if (userId === null || userId === undefined) {
263
- throw new Error('Required parameter userId was null or undefined when calling matchedOffersControllerDeletebid.');
264
- }
265
- if (account === null || account === undefined) {
266
- throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerDeletebid.');
267
- }
268
- Object.assign(localVarHeaderParams, options.headers);
269
- localVarUseFormData = false;
270
- localVarRequestOptions = {
271
- method: 'DELETE',
272
- qs: localVarQueryParameters,
273
- headers: localVarHeaderParams,
274
- uri: localVarPath,
275
- useQuerystring: this._useQuerystring,
276
- json: true,
277
- };
278
- authenticationPromise = Promise.resolve();
279
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
280
- interceptorPromise = authenticationPromise;
281
- _loop_3 = function (interceptor) {
282
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
283
- };
284
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
285
- interceptor = _a[_i];
286
- _loop_3(interceptor);
287
- }
288
- return [2, interceptorPromise.then(function () {
289
- if (Object.keys(localVarFormParams).length) {
290
- if (localVarUseFormData) {
291
- localVarRequestOptions.formData = localVarFormParams;
292
- }
293
- else {
294
- localVarRequestOptions.form = localVarFormParams;
295
- }
296
- }
297
- return new Promise(function (resolve, reject) {
298
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
299
- if (error) {
300
- reject(error);
301
- }
302
- else {
303
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
304
- resolve({ response: response, body: body });
305
- }
306
- else {
307
- reject(new apis_1.HttpError(response, body, response.statusCode));
308
- }
309
- }
310
- });
311
- });
312
- })];
313
- });
314
- });
315
- };
316
- MatchedOffersApi.prototype.matchedOffersControllerFilter = function (account, skip, limit, sort, body, options) {
317
- if (options === void 0) { options = { headers: {} }; }
318
- return __awaiter(this, void 0, void 0, function () {
319
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_4, _i, _a, interceptor;
320
- var _this = this;
321
- return __generator(this, function (_b) {
322
- localVarPath = this.basePath + '/matched-offers/{account}/search'
323
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
324
- localVarQueryParameters = {};
325
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
326
- localVarFormParams = {};
327
- if (account === null || account === undefined) {
328
- throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerFilter.');
329
- }
330
- if (skip !== undefined) {
331
- localVarQueryParameters['skip'] = models_1.ObjectSerializer.serialize(skip, "number");
332
- }
333
- if (limit !== undefined) {
334
- localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number");
335
- }
336
- if (sort !== undefined) {
337
- localVarQueryParameters['sort'] = models_1.ObjectSerializer.serialize(sort, "string");
338
- }
339
- Object.assign(localVarHeaderParams, options.headers);
340
- localVarUseFormData = false;
341
- localVarRequestOptions = {
342
- method: 'POST',
343
- qs: localVarQueryParameters,
344
- headers: localVarHeaderParams,
345
- uri: localVarPath,
346
- useQuerystring: this._useQuerystring,
347
- json: true,
348
- body: models_1.ObjectSerializer.serialize(body, "object")
349
- };
350
- authenticationPromise = Promise.resolve();
351
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
352
- interceptorPromise = authenticationPromise;
353
- _loop_4 = function (interceptor) {
354
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
355
- };
356
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
357
- interceptor = _a[_i];
358
- _loop_4(interceptor);
359
- }
360
- return [2, interceptorPromise.then(function () {
361
- if (Object.keys(localVarFormParams).length) {
362
- if (localVarUseFormData) {
363
- localVarRequestOptions.formData = localVarFormParams;
364
- }
365
- else {
366
- localVarRequestOptions.form = localVarFormParams;
367
- }
368
- }
369
- return new Promise(function (resolve, reject) {
370
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
371
- if (error) {
372
- reject(error);
373
- }
374
- else {
375
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
376
- resolve({ response: response, body: body });
377
- }
378
- else {
379
- reject(new apis_1.HttpError(response, body, response.statusCode));
380
- }
381
- }
382
- });
383
- });
384
- })];
385
- });
386
- });
387
- };
388
- MatchedOffersApi.prototype.matchedOffersControllerFindall = function (account, body, skip, limit, sort, options) {
389
- if (options === void 0) { options = { headers: {} }; }
390
- return __awaiter(this, void 0, void 0, function () {
391
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_5, _i, _a, interceptor;
392
- var _this = this;
393
- return __generator(this, function (_b) {
394
- localVarPath = this.basePath + '/matched-offers/{account}'
395
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
396
- localVarQueryParameters = {};
397
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
398
- localVarFormParams = {};
399
- if (account === null || account === undefined) {
400
- throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerFindall.');
401
- }
402
- if (body === null || body === undefined) {
403
- throw new Error('Required parameter body was null or undefined when calling matchedOffersControllerFindall.');
404
- }
405
- if (skip !== undefined) {
406
- localVarQueryParameters['skip'] = models_1.ObjectSerializer.serialize(skip, "number");
407
- }
408
- if (limit !== undefined) {
409
- localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number");
410
- }
411
- if (sort !== undefined) {
412
- localVarQueryParameters['sort'] = models_1.ObjectSerializer.serialize(sort, "string");
413
- }
414
- Object.assign(localVarHeaderParams, options.headers);
415
- localVarUseFormData = false;
416
- localVarRequestOptions = {
417
- method: 'GET',
418
- qs: localVarQueryParameters,
419
- headers: localVarHeaderParams,
420
- uri: localVarPath,
421
- useQuerystring: this._useQuerystring,
422
- json: true,
423
- body: models_1.ObjectSerializer.serialize(body, "object")
424
- };
425
- authenticationPromise = Promise.resolve();
426
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
427
- interceptorPromise = authenticationPromise;
428
- _loop_5 = function (interceptor) {
429
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
430
- };
431
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
432
- interceptor = _a[_i];
433
- _loop_5(interceptor);
434
- }
435
- return [2, interceptorPromise.then(function () {
436
- if (Object.keys(localVarFormParams).length) {
437
- if (localVarUseFormData) {
438
- localVarRequestOptions.formData = localVarFormParams;
439
- }
440
- else {
441
- localVarRequestOptions.form = localVarFormParams;
442
- }
443
- }
444
- return new Promise(function (resolve, reject) {
445
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
446
- if (error) {
447
- reject(error);
448
- }
449
- else {
450
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
451
- resolve({ response: response, body: body });
452
- }
453
- else {
454
- reject(new apis_1.HttpError(response, body, response.statusCode));
455
- }
456
- }
457
- });
458
- });
459
- })];
460
- });
461
- });
462
- };
463
- MatchedOffersApi.prototype.matchedOffersControllerFindcountries = function (account, options) {
464
- if (options === void 0) { options = { headers: {} }; }
465
- return __awaiter(this, void 0, void 0, function () {
466
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_6, _i, _a, interceptor;
467
- var _this = this;
468
- return __generator(this, function (_b) {
469
- localVarPath = this.basePath + '/matched-offers/{account}/countries'
470
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
471
- localVarQueryParameters = {};
472
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
473
- localVarFormParams = {};
474
- if (account === null || account === undefined) {
475
- throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerFindcountries.');
476
- }
477
- Object.assign(localVarHeaderParams, options.headers);
478
- localVarUseFormData = false;
479
- localVarRequestOptions = {
480
- method: 'GET',
481
- qs: localVarQueryParameters,
482
- headers: localVarHeaderParams,
483
- uri: localVarPath,
484
- useQuerystring: this._useQuerystring,
485
- json: true,
486
- };
487
- authenticationPromise = Promise.resolve();
488
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
489
- interceptorPromise = authenticationPromise;
490
- _loop_6 = function (interceptor) {
491
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
492
- };
493
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
494
- interceptor = _a[_i];
495
- _loop_6(interceptor);
496
- }
497
- return [2, interceptorPromise.then(function () {
498
- if (Object.keys(localVarFormParams).length) {
499
- if (localVarUseFormData) {
500
- localVarRequestOptions.formData = localVarFormParams;
501
- }
502
- else {
503
- localVarRequestOptions.form = localVarFormParams;
504
- }
505
- }
506
- return new Promise(function (resolve, reject) {
507
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
508
- if (error) {
509
- reject(error);
510
- }
511
- else {
512
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
513
- resolve({ response: response, body: body });
514
- }
515
- else {
516
- reject(new apis_1.HttpError(response, body, response.statusCode));
517
- }
518
- }
519
- });
520
- });
521
- })];
522
- });
523
- });
524
- };
525
- MatchedOffersApi.prototype.matchedOffersControllerFindone = function (id, account, options) {
526
- if (options === void 0) { options = { headers: {} }; }
527
- return __awaiter(this, void 0, void 0, function () {
528
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_7, _i, _a, interceptor;
529
- var _this = this;
530
- return __generator(this, function (_b) {
531
- localVarPath = this.basePath + '/matched-offers/{account}/{id}'
532
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
533
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
534
- localVarQueryParameters = {};
535
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
536
- localVarFormParams = {};
537
- if (id === null || id === undefined) {
538
- throw new Error('Required parameter id was null or undefined when calling matchedOffersControllerFindone.');
539
- }
540
- if (account === null || account === undefined) {
541
- throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerFindone.');
542
- }
543
- Object.assign(localVarHeaderParams, options.headers);
544
- localVarUseFormData = false;
545
- localVarRequestOptions = {
546
- method: 'GET',
547
- qs: localVarQueryParameters,
548
- headers: localVarHeaderParams,
549
- uri: localVarPath,
550
- useQuerystring: this._useQuerystring,
551
- json: true,
552
- };
553
- authenticationPromise = Promise.resolve();
554
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
555
- interceptorPromise = authenticationPromise;
556
- _loop_7 = function (interceptor) {
557
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
558
- };
559
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
560
- interceptor = _a[_i];
561
- _loop_7(interceptor);
562
- }
563
- return [2, interceptorPromise.then(function () {
564
- if (Object.keys(localVarFormParams).length) {
565
- if (localVarUseFormData) {
566
- localVarRequestOptions.formData = localVarFormParams;
567
- }
568
- else {
569
- localVarRequestOptions.form = localVarFormParams;
570
- }
571
- }
572
- return new Promise(function (resolve, reject) {
573
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
574
- if (error) {
575
- reject(error);
576
- }
577
- else {
578
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
579
- resolve({ response: response, body: body });
580
- }
581
- else {
582
- reject(new apis_1.HttpError(response, body, response.statusCode));
583
- }
584
- }
585
- });
586
- });
587
- })];
588
- });
589
- });
590
- };
591
- MatchedOffersApi.prototype.matchedOffersControllerGenerateoffernumber = function (id, account, options) {
592
- if (options === void 0) { options = { headers: {} }; }
593
- return __awaiter(this, void 0, void 0, function () {
594
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_8, _i, _a, interceptor;
595
- var _this = this;
596
- return __generator(this, function (_b) {
597
- localVarPath = this.basePath + '/matched-offers/{account}/{id}/generate/number'
598
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
599
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
600
- localVarQueryParameters = {};
601
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
602
- localVarFormParams = {};
603
- if (id === null || id === undefined) {
604
- throw new Error('Required parameter id was null or undefined when calling matchedOffersControllerGenerateoffernumber.');
605
- }
606
- if (account === null || account === undefined) {
607
- throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerGenerateoffernumber.');
608
- }
609
- Object.assign(localVarHeaderParams, options.headers);
610
- localVarUseFormData = false;
611
- localVarRequestOptions = {
612
- method: 'PUT',
613
- qs: localVarQueryParameters,
614
- headers: localVarHeaderParams,
615
- uri: localVarPath,
616
- useQuerystring: this._useQuerystring,
617
- json: true,
618
- };
619
- authenticationPromise = Promise.resolve();
620
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
621
- interceptorPromise = authenticationPromise;
622
- _loop_8 = function (interceptor) {
623
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
624
- };
625
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
626
- interceptor = _a[_i];
627
- _loop_8(interceptor);
628
- }
629
- return [2, interceptorPromise.then(function () {
630
- if (Object.keys(localVarFormParams).length) {
631
- if (localVarUseFormData) {
632
- localVarRequestOptions.formData = localVarFormParams;
633
- }
634
- else {
635
- localVarRequestOptions.form = localVarFormParams;
636
- }
637
- }
638
- return new Promise(function (resolve, reject) {
639
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
640
- if (error) {
641
- reject(error);
642
- }
643
- else {
644
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
645
- resolve({ response: response, body: body });
646
- }
647
- else {
648
- reject(new apis_1.HttpError(response, body, response.statusCode));
649
- }
650
- }
651
- });
652
- });
653
- })];
654
- });
655
- });
656
- };
657
- MatchedOffersApi.prototype.matchedOffersControllerRemove = function (id, account, options) {
658
- if (options === void 0) { options = { headers: {} }; }
659
- return __awaiter(this, void 0, void 0, function () {
660
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_9, _i, _a, interceptor;
661
- var _this = this;
662
- return __generator(this, function (_b) {
663
- localVarPath = this.basePath + '/matched-offers/{account}/{id}'
664
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
665
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
666
- localVarQueryParameters = {};
667
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
668
- localVarFormParams = {};
669
- if (id === null || id === undefined) {
670
- throw new Error('Required parameter id was null or undefined when calling matchedOffersControllerRemove.');
671
- }
672
- if (account === null || account === undefined) {
673
- throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerRemove.');
674
- }
675
- Object.assign(localVarHeaderParams, options.headers);
676
- localVarUseFormData = false;
677
- localVarRequestOptions = {
678
- method: 'DELETE',
679
- qs: localVarQueryParameters,
680
- headers: localVarHeaderParams,
681
- uri: localVarPath,
682
- useQuerystring: this._useQuerystring,
683
- json: true,
684
- };
685
- authenticationPromise = Promise.resolve();
686
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
687
- interceptorPromise = authenticationPromise;
688
- _loop_9 = function (interceptor) {
689
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
690
- };
691
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
692
- interceptor = _a[_i];
693
- _loop_9(interceptor);
694
- }
695
- return [2, interceptorPromise.then(function () {
696
- if (Object.keys(localVarFormParams).length) {
697
- if (localVarUseFormData) {
698
- localVarRequestOptions.formData = localVarFormParams;
699
- }
700
- else {
701
- localVarRequestOptions.form = localVarFormParams;
702
- }
703
- }
704
- return new Promise(function (resolve, reject) {
705
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
706
- if (error) {
707
- reject(error);
708
- }
709
- else {
710
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
711
- resolve({ response: response, body: body });
712
- }
713
- else {
714
- reject(new apis_1.HttpError(response, body, response.statusCode));
715
- }
716
- }
717
- });
718
- });
719
- })];
720
- });
721
- });
722
- };
723
- MatchedOffersApi.prototype.matchedOffersControllerReopen = function (id, account, options) {
724
- if (options === void 0) { options = { headers: {} }; }
725
- return __awaiter(this, void 0, void 0, function () {
726
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_10, _i, _a, interceptor;
727
- var _this = this;
728
- return __generator(this, function (_b) {
729
- localVarPath = this.basePath + '/matched-offers/{account}/{id}/reopen'
730
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
731
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
732
- localVarQueryParameters = {};
733
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
734
- localVarFormParams = {};
735
- if (id === null || id === undefined) {
736
- throw new Error('Required parameter id was null or undefined when calling matchedOffersControllerReopen.');
737
- }
738
- if (account === null || account === undefined) {
739
- throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerReopen.');
740
- }
741
- Object.assign(localVarHeaderParams, options.headers);
742
- localVarUseFormData = false;
743
- localVarRequestOptions = {
744
- method: 'POST',
745
- qs: localVarQueryParameters,
746
- headers: localVarHeaderParams,
747
- uri: localVarPath,
748
- useQuerystring: this._useQuerystring,
749
- json: true,
750
- };
751
- authenticationPromise = Promise.resolve();
752
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
753
- interceptorPromise = authenticationPromise;
754
- _loop_10 = function (interceptor) {
755
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
756
- };
757
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
758
- interceptor = _a[_i];
759
- _loop_10(interceptor);
760
- }
761
- return [2, interceptorPromise.then(function () {
762
- if (Object.keys(localVarFormParams).length) {
763
- if (localVarUseFormData) {
764
- localVarRequestOptions.formData = localVarFormParams;
765
- }
766
- else {
767
- localVarRequestOptions.form = localVarFormParams;
768
- }
769
- }
770
- return new Promise(function (resolve, reject) {
771
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
772
- if (error) {
773
- reject(error);
774
- }
775
- else {
776
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
777
- resolve({ response: response, body: body });
778
- }
779
- else {
780
- reject(new apis_1.HttpError(response, body, response.statusCode));
781
- }
782
- }
783
- });
784
- });
785
- })];
786
- });
787
- });
788
- };
789
- MatchedOffersApi.prototype.matchedOffersControllerSetconfirmindex = function (id, account, body, options) {
790
- if (options === void 0) { options = { headers: {} }; }
791
- return __awaiter(this, void 0, void 0, function () {
792
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_11, _i, _a, interceptor;
793
- var _this = this;
794
- return __generator(this, function (_b) {
795
- localVarPath = this.basePath + '/matched-offers/{account}/{id}/confirm/index'
796
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
797
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
798
- localVarQueryParameters = {};
799
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
800
- localVarFormParams = {};
801
- if (id === null || id === undefined) {
802
- throw new Error('Required parameter id was null or undefined when calling matchedOffersControllerSetconfirmindex.');
803
- }
804
- if (account === null || account === undefined) {
805
- throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerSetconfirmindex.');
806
- }
807
- if (body === null || body === undefined) {
808
- throw new Error('Required parameter body was null or undefined when calling matchedOffersControllerSetconfirmindex.');
809
- }
810
- Object.assign(localVarHeaderParams, options.headers);
811
- localVarUseFormData = false;
812
- localVarRequestOptions = {
813
- method: 'PUT',
814
- qs: localVarQueryParameters,
815
- headers: localVarHeaderParams,
816
- uri: localVarPath,
817
- useQuerystring: this._useQuerystring,
818
- json: true,
819
- body: models_1.ObjectSerializer.serialize(body, "object")
820
- };
821
- authenticationPromise = Promise.resolve();
822
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
823
- interceptorPromise = authenticationPromise;
824
- _loop_11 = function (interceptor) {
825
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
826
- };
827
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
828
- interceptor = _a[_i];
829
- _loop_11(interceptor);
830
- }
831
- return [2, interceptorPromise.then(function () {
832
- if (Object.keys(localVarFormParams).length) {
833
- if (localVarUseFormData) {
834
- localVarRequestOptions.formData = localVarFormParams;
835
- }
836
- else {
837
- localVarRequestOptions.form = localVarFormParams;
838
- }
839
- }
840
- return new Promise(function (resolve, reject) {
841
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
842
- if (error) {
843
- reject(error);
844
- }
845
- else {
846
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
847
- resolve({ response: response, body: body });
848
- }
849
- else {
850
- reject(new apis_1.HttpError(response, body, response.statusCode));
851
- }
852
- }
853
- });
854
- });
855
- })];
856
- });
857
- });
858
- };
859
- MatchedOffersApi.prototype.matchedOffersControllerTotal = function (account, body, options) {
860
- if (options === void 0) { options = { headers: {} }; }
861
- return __awaiter(this, void 0, void 0, function () {
862
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_12, _i, _a, interceptor;
863
- var _this = this;
864
- return __generator(this, function (_b) {
865
- localVarPath = this.basePath + '/matched-offers/{account}/total'
866
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
867
- localVarQueryParameters = {};
868
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
869
- localVarFormParams = {};
870
- if (account === null || account === undefined) {
871
- throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerTotal.');
872
- }
873
- if (body === null || body === undefined) {
874
- throw new Error('Required parameter body was null or undefined when calling matchedOffersControllerTotal.');
875
- }
876
- Object.assign(localVarHeaderParams, options.headers);
877
- localVarUseFormData = false;
878
- localVarRequestOptions = {
879
- method: 'GET',
880
- qs: localVarQueryParameters,
881
- headers: localVarHeaderParams,
882
- uri: localVarPath,
883
- useQuerystring: this._useQuerystring,
884
- json: true,
885
- body: models_1.ObjectSerializer.serialize(body, "object")
886
- };
887
- authenticationPromise = Promise.resolve();
888
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
889
- interceptorPromise = authenticationPromise;
890
- _loop_12 = function (interceptor) {
891
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
892
- };
893
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
894
- interceptor = _a[_i];
895
- _loop_12(interceptor);
896
- }
897
- return [2, interceptorPromise.then(function () {
898
- if (Object.keys(localVarFormParams).length) {
899
- if (localVarUseFormData) {
900
- localVarRequestOptions.formData = localVarFormParams;
901
- }
902
- else {
903
- localVarRequestOptions.form = localVarFormParams;
904
- }
905
- }
906
- return new Promise(function (resolve, reject) {
907
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
908
- if (error) {
909
- reject(error);
910
- }
911
- else {
912
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
913
- resolve({ response: response, body: body });
914
- }
915
- else {
916
- reject(new apis_1.HttpError(response, body, response.statusCode));
917
- }
918
- }
919
- });
920
- });
921
- })];
922
- });
923
- });
924
- };
925
- MatchedOffersApi.prototype.matchedOffersControllerUpdate = function (id, account, body, options) {
926
- if (options === void 0) { options = { headers: {} }; }
927
- return __awaiter(this, void 0, void 0, function () {
928
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_13, _i, _a, interceptor;
929
- var _this = this;
930
- return __generator(this, function (_b) {
931
- localVarPath = this.basePath + '/matched-offers/{account}/{id}'
932
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
933
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
934
- localVarQueryParameters = {};
935
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
936
- localVarFormParams = {};
937
- if (id === null || id === undefined) {
938
- throw new Error('Required parameter id was null or undefined when calling matchedOffersControllerUpdate.');
939
- }
940
- if (account === null || account === undefined) {
941
- throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerUpdate.');
942
- }
943
- if (body === null || body === undefined) {
944
- throw new Error('Required parameter body was null or undefined when calling matchedOffersControllerUpdate.');
945
- }
946
- Object.assign(localVarHeaderParams, options.headers);
947
- localVarUseFormData = false;
948
- localVarRequestOptions = {
949
- method: 'PUT',
950
- qs: localVarQueryParameters,
951
- headers: localVarHeaderParams,
952
- uri: localVarPath,
953
- useQuerystring: this._useQuerystring,
954
- json: true,
955
- body: models_1.ObjectSerializer.serialize(body, "object")
956
- };
957
- authenticationPromise = Promise.resolve();
958
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
959
- interceptorPromise = authenticationPromise;
960
- _loop_13 = function (interceptor) {
961
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
962
- };
963
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
964
- interceptor = _a[_i];
965
- _loop_13(interceptor);
966
- }
967
- return [2, interceptorPromise.then(function () {
968
- if (Object.keys(localVarFormParams).length) {
969
- if (localVarUseFormData) {
970
- localVarRequestOptions.formData = localVarFormParams;
971
- }
972
- else {
973
- localVarRequestOptions.form = localVarFormParams;
974
- }
975
- }
976
- return new Promise(function (resolve, reject) {
977
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
978
- if (error) {
979
- reject(error);
980
- }
981
- else {
982
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
983
- resolve({ response: response, body: body });
984
- }
985
- else {
986
- reject(new apis_1.HttpError(response, body, response.statusCode));
987
- }
988
- }
989
- });
990
- });
991
- })];
992
- });
993
- });
994
- };
995
- MatchedOffersApi.prototype.matchedOffersControllerUpdatestatus = function (account, body, options) {
996
- if (options === void 0) { options = { headers: {} }; }
997
- return __awaiter(this, void 0, void 0, function () {
998
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_14, _i, _a, interceptor;
999
- var _this = this;
1000
- return __generator(this, function (_b) {
1001
- localVarPath = this.basePath + '/matched-offers/{account}/status'
1002
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1003
- localVarQueryParameters = {};
1004
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1005
- localVarFormParams = {};
1006
- if (account === null || account === undefined) {
1007
- throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerUpdatestatus.');
1008
- }
1009
- if (body === null || body === undefined) {
1010
- throw new Error('Required parameter body was null or undefined when calling matchedOffersControllerUpdatestatus.');
1011
- }
1012
- Object.assign(localVarHeaderParams, options.headers);
1013
- localVarUseFormData = false;
1014
- localVarRequestOptions = {
1015
- method: 'PUT',
1016
- qs: localVarQueryParameters,
1017
- headers: localVarHeaderParams,
1018
- uri: localVarPath,
1019
- useQuerystring: this._useQuerystring,
1020
- json: true,
1021
- body: models_1.ObjectSerializer.serialize(body, "object")
1022
- };
1023
- authenticationPromise = Promise.resolve();
1024
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1025
- interceptorPromise = authenticationPromise;
1026
- _loop_14 = function (interceptor) {
1027
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1028
- };
1029
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1030
- interceptor = _a[_i];
1031
- _loop_14(interceptor);
1032
- }
1033
- return [2, interceptorPromise.then(function () {
1034
- if (Object.keys(localVarFormParams).length) {
1035
- if (localVarUseFormData) {
1036
- localVarRequestOptions.formData = localVarFormParams;
1037
- }
1038
- else {
1039
- localVarRequestOptions.form = localVarFormParams;
1040
- }
1041
- }
1042
- return new Promise(function (resolve, reject) {
1043
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1044
- if (error) {
1045
- reject(error);
1046
- }
1047
- else {
1048
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1049
- resolve({ response: response, body: body });
1050
- }
1051
- else {
1052
- reject(new apis_1.HttpError(response, body, response.statusCode));
1053
- }
1054
- }
1055
- });
1056
- });
1057
- })];
1058
- });
1059
- });
1060
- };
1061
- MatchedOffersApi.prototype.matchedOffersControllerValidatestatus = function (account, body, options) {
1062
- if (options === void 0) { options = { headers: {} }; }
1063
- return __awaiter(this, void 0, void 0, function () {
1064
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_15, _i, _a, interceptor;
1065
- var _this = this;
1066
- return __generator(this, function (_b) {
1067
- localVarPath = this.basePath + '/matched-offers/{account}/status/validate'
1068
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1069
- localVarQueryParameters = {};
1070
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1071
- localVarFormParams = {};
1072
- if (account === null || account === undefined) {
1073
- throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerValidatestatus.');
1074
- }
1075
- if (body === null || body === undefined) {
1076
- throw new Error('Required parameter body was null or undefined when calling matchedOffersControllerValidatestatus.');
1077
- }
1078
- Object.assign(localVarHeaderParams, options.headers);
1079
- localVarUseFormData = false;
1080
- localVarRequestOptions = {
1081
- method: 'POST',
1082
- qs: localVarQueryParameters,
1083
- headers: localVarHeaderParams,
1084
- uri: localVarPath,
1085
- useQuerystring: this._useQuerystring,
1086
- json: true,
1087
- body: models_1.ObjectSerializer.serialize(body, "object")
1088
- };
1089
- authenticationPromise = Promise.resolve();
1090
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1091
- interceptorPromise = authenticationPromise;
1092
- _loop_15 = function (interceptor) {
1093
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1094
- };
1095
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1096
- interceptor = _a[_i];
1097
- _loop_15(interceptor);
1098
- }
1099
- return [2, interceptorPromise.then(function () {
1100
- if (Object.keys(localVarFormParams).length) {
1101
- if (localVarUseFormData) {
1102
- localVarRequestOptions.formData = localVarFormParams;
1103
- }
1104
- else {
1105
- localVarRequestOptions.form = localVarFormParams;
1106
- }
1107
- }
1108
- return new Promise(function (resolve, reject) {
1109
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1110
- if (error) {
1111
- reject(error);
1112
- }
1113
- else {
1114
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1115
- resolve({ response: response, body: body });
1116
- }
1117
- else {
1118
- reject(new apis_1.HttpError(response, body, response.statusCode));
1119
- }
1120
- }
1121
- });
1122
- });
1123
- })];
1124
- });
1125
- });
1126
- };
1127
- return MatchedOffersApi;
1128
- }());
1129
- exports.MatchedOffersApi = MatchedOffersApi;
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.MatchedOffersApi = exports.MatchedOffersApiApiKeys = 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 MatchedOffersApiApiKeys;
48
+ (function (MatchedOffersApiApiKeys) {
49
+ })(MatchedOffersApiApiKeys = exports.MatchedOffersApiApiKeys || (exports.MatchedOffersApiApiKeys = {}));
50
+ var MatchedOffersApi = (function () {
51
+ function MatchedOffersApi(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(MatchedOffersApi.prototype, "useQuerystring", {
71
+ set: function (value) {
72
+ this._useQuerystring = value;
73
+ },
74
+ enumerable: false,
75
+ configurable: true
76
+ });
77
+ Object.defineProperty(MatchedOffersApi.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(MatchedOffersApi.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
+ MatchedOffersApi.prototype.setDefaultAuthentication = function (auth) {
98
+ this.authentications.default = auth;
99
+ };
100
+ MatchedOffersApi.prototype.setApiKey = function (key, value) {
101
+ this.authentications[MatchedOffersApiApiKeys[key]].apiKey = value;
102
+ };
103
+ MatchedOffersApi.prototype.addInterceptor = function (interceptor) {
104
+ this.interceptors.push(interceptor);
105
+ };
106
+ MatchedOffersApi.prototype.matchedOffersControllerAddbid = function (id, userId, account, body, 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 + '/matched-offers/{account}/{id}/{userId}/bid'
113
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
114
+ .replace('{' + 'userId' + '}', encodeURIComponent(String(userId)))
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 matchedOffersControllerAddbid.');
121
+ }
122
+ if (userId === null || userId === undefined) {
123
+ throw new Error('Required parameter userId was null or undefined when calling matchedOffersControllerAddbid.');
124
+ }
125
+ if (account === null || account === undefined) {
126
+ throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerAddbid.');
127
+ }
128
+ if (body === null || body === undefined) {
129
+ throw new Error('Required parameter body was null or undefined when calling matchedOffersControllerAddbid.');
130
+ }
131
+ Object.assign(localVarHeaderParams, options.headers);
132
+ localVarUseFormData = false;
133
+ localVarRequestOptions = {
134
+ method: 'POST',
135
+ qs: localVarQueryParameters,
136
+ headers: localVarHeaderParams,
137
+ uri: localVarPath,
138
+ useQuerystring: this._useQuerystring,
139
+ json: true,
140
+ body: models_1.ObjectSerializer.serialize(body, "object")
141
+ };
142
+ authenticationPromise = Promise.resolve();
143
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
144
+ interceptorPromise = authenticationPromise;
145
+ _loop_1 = function (interceptor) {
146
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
147
+ };
148
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
149
+ interceptor = _a[_i];
150
+ _loop_1(interceptor);
151
+ }
152
+ return [2, interceptorPromise.then(function () {
153
+ if (Object.keys(localVarFormParams).length) {
154
+ if (localVarUseFormData) {
155
+ localVarRequestOptions.formData = localVarFormParams;
156
+ }
157
+ else {
158
+ localVarRequestOptions.form = localVarFormParams;
159
+ }
160
+ }
161
+ return new Promise(function (resolve, reject) {
162
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
163
+ if (error) {
164
+ reject(error);
165
+ }
166
+ else {
167
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
168
+ resolve({ response: response, body: body });
169
+ }
170
+ else {
171
+ reject(new apis_1.HttpError(response, body, response.statusCode));
172
+ }
173
+ }
174
+ });
175
+ });
176
+ })];
177
+ });
178
+ });
179
+ };
180
+ MatchedOffersApi.prototype.matchedOffersControllerCreate = function (account, body, options) {
181
+ if (options === void 0) { options = { headers: {} }; }
182
+ return __awaiter(this, void 0, void 0, function () {
183
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_2, _i, _a, interceptor;
184
+ var _this = this;
185
+ return __generator(this, function (_b) {
186
+ localVarPath = this.basePath + '/matched-offers/{account}'
187
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
188
+ localVarQueryParameters = {};
189
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
190
+ localVarFormParams = {};
191
+ if (account === null || account === undefined) {
192
+ throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerCreate.');
193
+ }
194
+ if (body === null || body === undefined) {
195
+ throw new Error('Required parameter body was null or undefined when calling matchedOffersControllerCreate.');
196
+ }
197
+ Object.assign(localVarHeaderParams, options.headers);
198
+ localVarUseFormData = false;
199
+ localVarRequestOptions = {
200
+ method: 'POST',
201
+ qs: localVarQueryParameters,
202
+ headers: localVarHeaderParams,
203
+ uri: localVarPath,
204
+ useQuerystring: this._useQuerystring,
205
+ json: true,
206
+ body: models_1.ObjectSerializer.serialize(body, "object")
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
+ MatchedOffersApi.prototype.matchedOffersControllerDeletebid = function (id, userId, account, 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 + '/matched-offers/{account}/{id}/{userId}/bid'
253
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
254
+ .replace('{' + 'userId' + '}', encodeURIComponent(String(userId)))
255
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
256
+ localVarQueryParameters = {};
257
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
258
+ localVarFormParams = {};
259
+ if (id === null || id === undefined) {
260
+ throw new Error('Required parameter id was null or undefined when calling matchedOffersControllerDeletebid.');
261
+ }
262
+ if (userId === null || userId === undefined) {
263
+ throw new Error('Required parameter userId was null or undefined when calling matchedOffersControllerDeletebid.');
264
+ }
265
+ if (account === null || account === undefined) {
266
+ throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerDeletebid.');
267
+ }
268
+ Object.assign(localVarHeaderParams, options.headers);
269
+ localVarUseFormData = false;
270
+ localVarRequestOptions = {
271
+ method: 'DELETE',
272
+ qs: localVarQueryParameters,
273
+ headers: localVarHeaderParams,
274
+ uri: localVarPath,
275
+ useQuerystring: this._useQuerystring,
276
+ json: true,
277
+ };
278
+ authenticationPromise = Promise.resolve();
279
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
280
+ interceptorPromise = authenticationPromise;
281
+ _loop_3 = function (interceptor) {
282
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
283
+ };
284
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
285
+ interceptor = _a[_i];
286
+ _loop_3(interceptor);
287
+ }
288
+ return [2, interceptorPromise.then(function () {
289
+ if (Object.keys(localVarFormParams).length) {
290
+ if (localVarUseFormData) {
291
+ localVarRequestOptions.formData = localVarFormParams;
292
+ }
293
+ else {
294
+ localVarRequestOptions.form = localVarFormParams;
295
+ }
296
+ }
297
+ return new Promise(function (resolve, reject) {
298
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
299
+ if (error) {
300
+ reject(error);
301
+ }
302
+ else {
303
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
304
+ resolve({ response: response, body: body });
305
+ }
306
+ else {
307
+ reject(new apis_1.HttpError(response, body, response.statusCode));
308
+ }
309
+ }
310
+ });
311
+ });
312
+ })];
313
+ });
314
+ });
315
+ };
316
+ MatchedOffersApi.prototype.matchedOffersControllerFilter = function (account, skip, limit, sort, body, options) {
317
+ if (options === void 0) { options = { headers: {} }; }
318
+ return __awaiter(this, void 0, void 0, function () {
319
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_4, _i, _a, interceptor;
320
+ var _this = this;
321
+ return __generator(this, function (_b) {
322
+ localVarPath = this.basePath + '/matched-offers/{account}/search'
323
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
324
+ localVarQueryParameters = {};
325
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
326
+ localVarFormParams = {};
327
+ if (account === null || account === undefined) {
328
+ throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerFilter.');
329
+ }
330
+ if (skip !== undefined) {
331
+ localVarQueryParameters['skip'] = models_1.ObjectSerializer.serialize(skip, "number");
332
+ }
333
+ if (limit !== undefined) {
334
+ localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number");
335
+ }
336
+ if (sort !== undefined) {
337
+ localVarQueryParameters['sort'] = models_1.ObjectSerializer.serialize(sort, "string");
338
+ }
339
+ Object.assign(localVarHeaderParams, options.headers);
340
+ localVarUseFormData = false;
341
+ localVarRequestOptions = {
342
+ method: 'POST',
343
+ qs: localVarQueryParameters,
344
+ headers: localVarHeaderParams,
345
+ uri: localVarPath,
346
+ useQuerystring: this._useQuerystring,
347
+ json: true,
348
+ body: models_1.ObjectSerializer.serialize(body, "object")
349
+ };
350
+ authenticationPromise = Promise.resolve();
351
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
352
+ interceptorPromise = authenticationPromise;
353
+ _loop_4 = function (interceptor) {
354
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
355
+ };
356
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
357
+ interceptor = _a[_i];
358
+ _loop_4(interceptor);
359
+ }
360
+ return [2, interceptorPromise.then(function () {
361
+ if (Object.keys(localVarFormParams).length) {
362
+ if (localVarUseFormData) {
363
+ localVarRequestOptions.formData = localVarFormParams;
364
+ }
365
+ else {
366
+ localVarRequestOptions.form = localVarFormParams;
367
+ }
368
+ }
369
+ return new Promise(function (resolve, reject) {
370
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
371
+ if (error) {
372
+ reject(error);
373
+ }
374
+ else {
375
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
376
+ resolve({ response: response, body: body });
377
+ }
378
+ else {
379
+ reject(new apis_1.HttpError(response, body, response.statusCode));
380
+ }
381
+ }
382
+ });
383
+ });
384
+ })];
385
+ });
386
+ });
387
+ };
388
+ MatchedOffersApi.prototype.matchedOffersControllerFindall = function (account, body, skip, limit, sort, options) {
389
+ if (options === void 0) { options = { headers: {} }; }
390
+ return __awaiter(this, void 0, void 0, function () {
391
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_5, _i, _a, interceptor;
392
+ var _this = this;
393
+ return __generator(this, function (_b) {
394
+ localVarPath = this.basePath + '/matched-offers/{account}'
395
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
396
+ localVarQueryParameters = {};
397
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
398
+ localVarFormParams = {};
399
+ if (account === null || account === undefined) {
400
+ throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerFindall.');
401
+ }
402
+ if (body === null || body === undefined) {
403
+ throw new Error('Required parameter body was null or undefined when calling matchedOffersControllerFindall.');
404
+ }
405
+ if (skip !== undefined) {
406
+ localVarQueryParameters['skip'] = models_1.ObjectSerializer.serialize(skip, "number");
407
+ }
408
+ if (limit !== undefined) {
409
+ localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number");
410
+ }
411
+ if (sort !== undefined) {
412
+ localVarQueryParameters['sort'] = models_1.ObjectSerializer.serialize(sort, "string");
413
+ }
414
+ Object.assign(localVarHeaderParams, options.headers);
415
+ localVarUseFormData = false;
416
+ localVarRequestOptions = {
417
+ method: 'GET',
418
+ qs: localVarQueryParameters,
419
+ headers: localVarHeaderParams,
420
+ uri: localVarPath,
421
+ useQuerystring: this._useQuerystring,
422
+ json: true,
423
+ body: models_1.ObjectSerializer.serialize(body, "object")
424
+ };
425
+ authenticationPromise = Promise.resolve();
426
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
427
+ interceptorPromise = authenticationPromise;
428
+ _loop_5 = function (interceptor) {
429
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
430
+ };
431
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
432
+ interceptor = _a[_i];
433
+ _loop_5(interceptor);
434
+ }
435
+ return [2, interceptorPromise.then(function () {
436
+ if (Object.keys(localVarFormParams).length) {
437
+ if (localVarUseFormData) {
438
+ localVarRequestOptions.formData = localVarFormParams;
439
+ }
440
+ else {
441
+ localVarRequestOptions.form = localVarFormParams;
442
+ }
443
+ }
444
+ return new Promise(function (resolve, reject) {
445
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
446
+ if (error) {
447
+ reject(error);
448
+ }
449
+ else {
450
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
451
+ resolve({ response: response, body: body });
452
+ }
453
+ else {
454
+ reject(new apis_1.HttpError(response, body, response.statusCode));
455
+ }
456
+ }
457
+ });
458
+ });
459
+ })];
460
+ });
461
+ });
462
+ };
463
+ MatchedOffersApi.prototype.matchedOffersControllerFindcountries = function (account, options) {
464
+ if (options === void 0) { options = { headers: {} }; }
465
+ return __awaiter(this, void 0, void 0, function () {
466
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_6, _i, _a, interceptor;
467
+ var _this = this;
468
+ return __generator(this, function (_b) {
469
+ localVarPath = this.basePath + '/matched-offers/{account}/countries'
470
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
471
+ localVarQueryParameters = {};
472
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
473
+ localVarFormParams = {};
474
+ if (account === null || account === undefined) {
475
+ throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerFindcountries.');
476
+ }
477
+ Object.assign(localVarHeaderParams, options.headers);
478
+ localVarUseFormData = false;
479
+ localVarRequestOptions = {
480
+ method: 'GET',
481
+ qs: localVarQueryParameters,
482
+ headers: localVarHeaderParams,
483
+ uri: localVarPath,
484
+ useQuerystring: this._useQuerystring,
485
+ json: true,
486
+ };
487
+ authenticationPromise = Promise.resolve();
488
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
489
+ interceptorPromise = authenticationPromise;
490
+ _loop_6 = function (interceptor) {
491
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
492
+ };
493
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
494
+ interceptor = _a[_i];
495
+ _loop_6(interceptor);
496
+ }
497
+ return [2, interceptorPromise.then(function () {
498
+ if (Object.keys(localVarFormParams).length) {
499
+ if (localVarUseFormData) {
500
+ localVarRequestOptions.formData = localVarFormParams;
501
+ }
502
+ else {
503
+ localVarRequestOptions.form = localVarFormParams;
504
+ }
505
+ }
506
+ return new Promise(function (resolve, reject) {
507
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
508
+ if (error) {
509
+ reject(error);
510
+ }
511
+ else {
512
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
513
+ resolve({ response: response, body: body });
514
+ }
515
+ else {
516
+ reject(new apis_1.HttpError(response, body, response.statusCode));
517
+ }
518
+ }
519
+ });
520
+ });
521
+ })];
522
+ });
523
+ });
524
+ };
525
+ MatchedOffersApi.prototype.matchedOffersControllerFindone = function (id, account, options) {
526
+ if (options === void 0) { options = { headers: {} }; }
527
+ return __awaiter(this, void 0, void 0, function () {
528
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_7, _i, _a, interceptor;
529
+ var _this = this;
530
+ return __generator(this, function (_b) {
531
+ localVarPath = this.basePath + '/matched-offers/{account}/{id}'
532
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
533
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
534
+ localVarQueryParameters = {};
535
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
536
+ localVarFormParams = {};
537
+ if (id === null || id === undefined) {
538
+ throw new Error('Required parameter id was null or undefined when calling matchedOffersControllerFindone.');
539
+ }
540
+ if (account === null || account === undefined) {
541
+ throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerFindone.');
542
+ }
543
+ Object.assign(localVarHeaderParams, options.headers);
544
+ localVarUseFormData = false;
545
+ localVarRequestOptions = {
546
+ method: 'GET',
547
+ qs: localVarQueryParameters,
548
+ headers: localVarHeaderParams,
549
+ uri: localVarPath,
550
+ useQuerystring: this._useQuerystring,
551
+ json: true,
552
+ };
553
+ authenticationPromise = Promise.resolve();
554
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
555
+ interceptorPromise = authenticationPromise;
556
+ _loop_7 = function (interceptor) {
557
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
558
+ };
559
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
560
+ interceptor = _a[_i];
561
+ _loop_7(interceptor);
562
+ }
563
+ return [2, interceptorPromise.then(function () {
564
+ if (Object.keys(localVarFormParams).length) {
565
+ if (localVarUseFormData) {
566
+ localVarRequestOptions.formData = localVarFormParams;
567
+ }
568
+ else {
569
+ localVarRequestOptions.form = localVarFormParams;
570
+ }
571
+ }
572
+ return new Promise(function (resolve, reject) {
573
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
574
+ if (error) {
575
+ reject(error);
576
+ }
577
+ else {
578
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
579
+ resolve({ response: response, body: body });
580
+ }
581
+ else {
582
+ reject(new apis_1.HttpError(response, body, response.statusCode));
583
+ }
584
+ }
585
+ });
586
+ });
587
+ })];
588
+ });
589
+ });
590
+ };
591
+ MatchedOffersApi.prototype.matchedOffersControllerGenerateoffernumber = function (id, account, options) {
592
+ if (options === void 0) { options = { headers: {} }; }
593
+ return __awaiter(this, void 0, void 0, function () {
594
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_8, _i, _a, interceptor;
595
+ var _this = this;
596
+ return __generator(this, function (_b) {
597
+ localVarPath = this.basePath + '/matched-offers/{account}/{id}/generate/number'
598
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
599
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
600
+ localVarQueryParameters = {};
601
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
602
+ localVarFormParams = {};
603
+ if (id === null || id === undefined) {
604
+ throw new Error('Required parameter id was null or undefined when calling matchedOffersControllerGenerateoffernumber.');
605
+ }
606
+ if (account === null || account === undefined) {
607
+ throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerGenerateoffernumber.');
608
+ }
609
+ Object.assign(localVarHeaderParams, options.headers);
610
+ localVarUseFormData = false;
611
+ localVarRequestOptions = {
612
+ method: 'PUT',
613
+ qs: localVarQueryParameters,
614
+ headers: localVarHeaderParams,
615
+ uri: localVarPath,
616
+ useQuerystring: this._useQuerystring,
617
+ json: true,
618
+ };
619
+ authenticationPromise = Promise.resolve();
620
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
621
+ interceptorPromise = authenticationPromise;
622
+ _loop_8 = function (interceptor) {
623
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
624
+ };
625
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
626
+ interceptor = _a[_i];
627
+ _loop_8(interceptor);
628
+ }
629
+ return [2, interceptorPromise.then(function () {
630
+ if (Object.keys(localVarFormParams).length) {
631
+ if (localVarUseFormData) {
632
+ localVarRequestOptions.formData = localVarFormParams;
633
+ }
634
+ else {
635
+ localVarRequestOptions.form = localVarFormParams;
636
+ }
637
+ }
638
+ return new Promise(function (resolve, reject) {
639
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
640
+ if (error) {
641
+ reject(error);
642
+ }
643
+ else {
644
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
645
+ resolve({ response: response, body: body });
646
+ }
647
+ else {
648
+ reject(new apis_1.HttpError(response, body, response.statusCode));
649
+ }
650
+ }
651
+ });
652
+ });
653
+ })];
654
+ });
655
+ });
656
+ };
657
+ MatchedOffersApi.prototype.matchedOffersControllerRemove = function (id, account, options) {
658
+ if (options === void 0) { options = { headers: {} }; }
659
+ return __awaiter(this, void 0, void 0, function () {
660
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_9, _i, _a, interceptor;
661
+ var _this = this;
662
+ return __generator(this, function (_b) {
663
+ localVarPath = this.basePath + '/matched-offers/{account}/{id}'
664
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
665
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
666
+ localVarQueryParameters = {};
667
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
668
+ localVarFormParams = {};
669
+ if (id === null || id === undefined) {
670
+ throw new Error('Required parameter id was null or undefined when calling matchedOffersControllerRemove.');
671
+ }
672
+ if (account === null || account === undefined) {
673
+ throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerRemove.');
674
+ }
675
+ Object.assign(localVarHeaderParams, options.headers);
676
+ localVarUseFormData = false;
677
+ localVarRequestOptions = {
678
+ method: 'DELETE',
679
+ qs: localVarQueryParameters,
680
+ headers: localVarHeaderParams,
681
+ uri: localVarPath,
682
+ useQuerystring: this._useQuerystring,
683
+ json: true,
684
+ };
685
+ authenticationPromise = Promise.resolve();
686
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
687
+ interceptorPromise = authenticationPromise;
688
+ _loop_9 = function (interceptor) {
689
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
690
+ };
691
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
692
+ interceptor = _a[_i];
693
+ _loop_9(interceptor);
694
+ }
695
+ return [2, interceptorPromise.then(function () {
696
+ if (Object.keys(localVarFormParams).length) {
697
+ if (localVarUseFormData) {
698
+ localVarRequestOptions.formData = localVarFormParams;
699
+ }
700
+ else {
701
+ localVarRequestOptions.form = localVarFormParams;
702
+ }
703
+ }
704
+ return new Promise(function (resolve, reject) {
705
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
706
+ if (error) {
707
+ reject(error);
708
+ }
709
+ else {
710
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
711
+ resolve({ response: response, body: body });
712
+ }
713
+ else {
714
+ reject(new apis_1.HttpError(response, body, response.statusCode));
715
+ }
716
+ }
717
+ });
718
+ });
719
+ })];
720
+ });
721
+ });
722
+ };
723
+ MatchedOffersApi.prototype.matchedOffersControllerReopen = function (id, account, options) {
724
+ if (options === void 0) { options = { headers: {} }; }
725
+ return __awaiter(this, void 0, void 0, function () {
726
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_10, _i, _a, interceptor;
727
+ var _this = this;
728
+ return __generator(this, function (_b) {
729
+ localVarPath = this.basePath + '/matched-offers/{account}/{id}/reopen'
730
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
731
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
732
+ localVarQueryParameters = {};
733
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
734
+ localVarFormParams = {};
735
+ if (id === null || id === undefined) {
736
+ throw new Error('Required parameter id was null or undefined when calling matchedOffersControllerReopen.');
737
+ }
738
+ if (account === null || account === undefined) {
739
+ throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerReopen.');
740
+ }
741
+ Object.assign(localVarHeaderParams, options.headers);
742
+ localVarUseFormData = false;
743
+ localVarRequestOptions = {
744
+ method: 'POST',
745
+ qs: localVarQueryParameters,
746
+ headers: localVarHeaderParams,
747
+ uri: localVarPath,
748
+ useQuerystring: this._useQuerystring,
749
+ json: true,
750
+ };
751
+ authenticationPromise = Promise.resolve();
752
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
753
+ interceptorPromise = authenticationPromise;
754
+ _loop_10 = function (interceptor) {
755
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
756
+ };
757
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
758
+ interceptor = _a[_i];
759
+ _loop_10(interceptor);
760
+ }
761
+ return [2, interceptorPromise.then(function () {
762
+ if (Object.keys(localVarFormParams).length) {
763
+ if (localVarUseFormData) {
764
+ localVarRequestOptions.formData = localVarFormParams;
765
+ }
766
+ else {
767
+ localVarRequestOptions.form = localVarFormParams;
768
+ }
769
+ }
770
+ return new Promise(function (resolve, reject) {
771
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
772
+ if (error) {
773
+ reject(error);
774
+ }
775
+ else {
776
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
777
+ resolve({ response: response, body: body });
778
+ }
779
+ else {
780
+ reject(new apis_1.HttpError(response, body, response.statusCode));
781
+ }
782
+ }
783
+ });
784
+ });
785
+ })];
786
+ });
787
+ });
788
+ };
789
+ MatchedOffersApi.prototype.matchedOffersControllerSetconfirmindex = function (id, account, body, options) {
790
+ if (options === void 0) { options = { headers: {} }; }
791
+ return __awaiter(this, void 0, void 0, function () {
792
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_11, _i, _a, interceptor;
793
+ var _this = this;
794
+ return __generator(this, function (_b) {
795
+ localVarPath = this.basePath + '/matched-offers/{account}/{id}/confirm/index'
796
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
797
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
798
+ localVarQueryParameters = {};
799
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
800
+ localVarFormParams = {};
801
+ if (id === null || id === undefined) {
802
+ throw new Error('Required parameter id was null or undefined when calling matchedOffersControllerSetconfirmindex.');
803
+ }
804
+ if (account === null || account === undefined) {
805
+ throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerSetconfirmindex.');
806
+ }
807
+ if (body === null || body === undefined) {
808
+ throw new Error('Required parameter body was null or undefined when calling matchedOffersControllerSetconfirmindex.');
809
+ }
810
+ Object.assign(localVarHeaderParams, options.headers);
811
+ localVarUseFormData = false;
812
+ localVarRequestOptions = {
813
+ method: 'PUT',
814
+ qs: localVarQueryParameters,
815
+ headers: localVarHeaderParams,
816
+ uri: localVarPath,
817
+ useQuerystring: this._useQuerystring,
818
+ json: true,
819
+ body: models_1.ObjectSerializer.serialize(body, "object")
820
+ };
821
+ authenticationPromise = Promise.resolve();
822
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
823
+ interceptorPromise = authenticationPromise;
824
+ _loop_11 = function (interceptor) {
825
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
826
+ };
827
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
828
+ interceptor = _a[_i];
829
+ _loop_11(interceptor);
830
+ }
831
+ return [2, interceptorPromise.then(function () {
832
+ if (Object.keys(localVarFormParams).length) {
833
+ if (localVarUseFormData) {
834
+ localVarRequestOptions.formData = localVarFormParams;
835
+ }
836
+ else {
837
+ localVarRequestOptions.form = localVarFormParams;
838
+ }
839
+ }
840
+ return new Promise(function (resolve, reject) {
841
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
842
+ if (error) {
843
+ reject(error);
844
+ }
845
+ else {
846
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
847
+ resolve({ response: response, body: body });
848
+ }
849
+ else {
850
+ reject(new apis_1.HttpError(response, body, response.statusCode));
851
+ }
852
+ }
853
+ });
854
+ });
855
+ })];
856
+ });
857
+ });
858
+ };
859
+ MatchedOffersApi.prototype.matchedOffersControllerTotal = function (account, body, options) {
860
+ if (options === void 0) { options = { headers: {} }; }
861
+ return __awaiter(this, void 0, void 0, function () {
862
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_12, _i, _a, interceptor;
863
+ var _this = this;
864
+ return __generator(this, function (_b) {
865
+ localVarPath = this.basePath + '/matched-offers/{account}/total'
866
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
867
+ localVarQueryParameters = {};
868
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
869
+ localVarFormParams = {};
870
+ if (account === null || account === undefined) {
871
+ throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerTotal.');
872
+ }
873
+ if (body === null || body === undefined) {
874
+ throw new Error('Required parameter body was null or undefined when calling matchedOffersControllerTotal.');
875
+ }
876
+ Object.assign(localVarHeaderParams, options.headers);
877
+ localVarUseFormData = false;
878
+ localVarRequestOptions = {
879
+ method: 'GET',
880
+ qs: localVarQueryParameters,
881
+ headers: localVarHeaderParams,
882
+ uri: localVarPath,
883
+ useQuerystring: this._useQuerystring,
884
+ json: true,
885
+ body: models_1.ObjectSerializer.serialize(body, "object")
886
+ };
887
+ authenticationPromise = Promise.resolve();
888
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
889
+ interceptorPromise = authenticationPromise;
890
+ _loop_12 = function (interceptor) {
891
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
892
+ };
893
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
894
+ interceptor = _a[_i];
895
+ _loop_12(interceptor);
896
+ }
897
+ return [2, interceptorPromise.then(function () {
898
+ if (Object.keys(localVarFormParams).length) {
899
+ if (localVarUseFormData) {
900
+ localVarRequestOptions.formData = localVarFormParams;
901
+ }
902
+ else {
903
+ localVarRequestOptions.form = localVarFormParams;
904
+ }
905
+ }
906
+ return new Promise(function (resolve, reject) {
907
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
908
+ if (error) {
909
+ reject(error);
910
+ }
911
+ else {
912
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
913
+ resolve({ response: response, body: body });
914
+ }
915
+ else {
916
+ reject(new apis_1.HttpError(response, body, response.statusCode));
917
+ }
918
+ }
919
+ });
920
+ });
921
+ })];
922
+ });
923
+ });
924
+ };
925
+ MatchedOffersApi.prototype.matchedOffersControllerUpdate = function (id, account, body, options) {
926
+ if (options === void 0) { options = { headers: {} }; }
927
+ return __awaiter(this, void 0, void 0, function () {
928
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_13, _i, _a, interceptor;
929
+ var _this = this;
930
+ return __generator(this, function (_b) {
931
+ localVarPath = this.basePath + '/matched-offers/{account}/{id}'
932
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
933
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
934
+ localVarQueryParameters = {};
935
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
936
+ localVarFormParams = {};
937
+ if (id === null || id === undefined) {
938
+ throw new Error('Required parameter id was null or undefined when calling matchedOffersControllerUpdate.');
939
+ }
940
+ if (account === null || account === undefined) {
941
+ throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerUpdate.');
942
+ }
943
+ if (body === null || body === undefined) {
944
+ throw new Error('Required parameter body was null or undefined when calling matchedOffersControllerUpdate.');
945
+ }
946
+ Object.assign(localVarHeaderParams, options.headers);
947
+ localVarUseFormData = false;
948
+ localVarRequestOptions = {
949
+ method: 'PUT',
950
+ qs: localVarQueryParameters,
951
+ headers: localVarHeaderParams,
952
+ uri: localVarPath,
953
+ useQuerystring: this._useQuerystring,
954
+ json: true,
955
+ body: models_1.ObjectSerializer.serialize(body, "object")
956
+ };
957
+ authenticationPromise = Promise.resolve();
958
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
959
+ interceptorPromise = authenticationPromise;
960
+ _loop_13 = function (interceptor) {
961
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
962
+ };
963
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
964
+ interceptor = _a[_i];
965
+ _loop_13(interceptor);
966
+ }
967
+ return [2, interceptorPromise.then(function () {
968
+ if (Object.keys(localVarFormParams).length) {
969
+ if (localVarUseFormData) {
970
+ localVarRequestOptions.formData = localVarFormParams;
971
+ }
972
+ else {
973
+ localVarRequestOptions.form = localVarFormParams;
974
+ }
975
+ }
976
+ return new Promise(function (resolve, reject) {
977
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
978
+ if (error) {
979
+ reject(error);
980
+ }
981
+ else {
982
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
983
+ resolve({ response: response, body: body });
984
+ }
985
+ else {
986
+ reject(new apis_1.HttpError(response, body, response.statusCode));
987
+ }
988
+ }
989
+ });
990
+ });
991
+ })];
992
+ });
993
+ });
994
+ };
995
+ MatchedOffersApi.prototype.matchedOffersControllerUpdatestatus = function (account, body, options) {
996
+ if (options === void 0) { options = { headers: {} }; }
997
+ return __awaiter(this, void 0, void 0, function () {
998
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_14, _i, _a, interceptor;
999
+ var _this = this;
1000
+ return __generator(this, function (_b) {
1001
+ localVarPath = this.basePath + '/matched-offers/{account}/status'
1002
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1003
+ localVarQueryParameters = {};
1004
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1005
+ localVarFormParams = {};
1006
+ if (account === null || account === undefined) {
1007
+ throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerUpdatestatus.');
1008
+ }
1009
+ if (body === null || body === undefined) {
1010
+ throw new Error('Required parameter body was null or undefined when calling matchedOffersControllerUpdatestatus.');
1011
+ }
1012
+ Object.assign(localVarHeaderParams, options.headers);
1013
+ localVarUseFormData = false;
1014
+ localVarRequestOptions = {
1015
+ method: 'PUT',
1016
+ qs: localVarQueryParameters,
1017
+ headers: localVarHeaderParams,
1018
+ uri: localVarPath,
1019
+ useQuerystring: this._useQuerystring,
1020
+ json: true,
1021
+ body: models_1.ObjectSerializer.serialize(body, "object")
1022
+ };
1023
+ authenticationPromise = Promise.resolve();
1024
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1025
+ interceptorPromise = authenticationPromise;
1026
+ _loop_14 = function (interceptor) {
1027
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1028
+ };
1029
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1030
+ interceptor = _a[_i];
1031
+ _loop_14(interceptor);
1032
+ }
1033
+ return [2, interceptorPromise.then(function () {
1034
+ if (Object.keys(localVarFormParams).length) {
1035
+ if (localVarUseFormData) {
1036
+ localVarRequestOptions.formData = localVarFormParams;
1037
+ }
1038
+ else {
1039
+ localVarRequestOptions.form = localVarFormParams;
1040
+ }
1041
+ }
1042
+ return new Promise(function (resolve, reject) {
1043
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1044
+ if (error) {
1045
+ reject(error);
1046
+ }
1047
+ else {
1048
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1049
+ resolve({ response: response, body: body });
1050
+ }
1051
+ else {
1052
+ reject(new apis_1.HttpError(response, body, response.statusCode));
1053
+ }
1054
+ }
1055
+ });
1056
+ });
1057
+ })];
1058
+ });
1059
+ });
1060
+ };
1061
+ MatchedOffersApi.prototype.matchedOffersControllerValidatestatus = function (account, body, options) {
1062
+ if (options === void 0) { options = { headers: {} }; }
1063
+ return __awaiter(this, void 0, void 0, function () {
1064
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_15, _i, _a, interceptor;
1065
+ var _this = this;
1066
+ return __generator(this, function (_b) {
1067
+ localVarPath = this.basePath + '/matched-offers/{account}/status/validate'
1068
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1069
+ localVarQueryParameters = {};
1070
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1071
+ localVarFormParams = {};
1072
+ if (account === null || account === undefined) {
1073
+ throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerValidatestatus.');
1074
+ }
1075
+ if (body === null || body === undefined) {
1076
+ throw new Error('Required parameter body was null or undefined when calling matchedOffersControllerValidatestatus.');
1077
+ }
1078
+ Object.assign(localVarHeaderParams, options.headers);
1079
+ localVarUseFormData = false;
1080
+ localVarRequestOptions = {
1081
+ method: 'POST',
1082
+ qs: localVarQueryParameters,
1083
+ headers: localVarHeaderParams,
1084
+ uri: localVarPath,
1085
+ useQuerystring: this._useQuerystring,
1086
+ json: true,
1087
+ body: models_1.ObjectSerializer.serialize(body, "object")
1088
+ };
1089
+ authenticationPromise = Promise.resolve();
1090
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1091
+ interceptorPromise = authenticationPromise;
1092
+ _loop_15 = function (interceptor) {
1093
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1094
+ };
1095
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1096
+ interceptor = _a[_i];
1097
+ _loop_15(interceptor);
1098
+ }
1099
+ return [2, interceptorPromise.then(function () {
1100
+ if (Object.keys(localVarFormParams).length) {
1101
+ if (localVarUseFormData) {
1102
+ localVarRequestOptions.formData = localVarFormParams;
1103
+ }
1104
+ else {
1105
+ localVarRequestOptions.form = localVarFormParams;
1106
+ }
1107
+ }
1108
+ return new Promise(function (resolve, reject) {
1109
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1110
+ if (error) {
1111
+ reject(error);
1112
+ }
1113
+ else {
1114
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1115
+ resolve({ response: response, body: body });
1116
+ }
1117
+ else {
1118
+ reject(new apis_1.HttpError(response, body, response.statusCode));
1119
+ }
1120
+ }
1121
+ });
1122
+ });
1123
+ })];
1124
+ });
1125
+ });
1126
+ };
1127
+ return MatchedOffersApi;
1128
+ }());
1129
+ exports.MatchedOffersApi = MatchedOffersApi;
1130
1130
  //# sourceMappingURL=matchedOffersApi.js.map