@tradecafe/offer-service-sdk 0.0.58 → 0.0.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/.openapi-generator/FILES +77 -69
  2. package/api/apis.ts +3 -1
  3. package/api/matchedOffersApi.ts +260 -0
  4. package/api/promoTextsApi.ts +426 -0
  5. package/dist/api/apis.d.ts +22 -20
  6. package/dist/api/apis.js +58 -56
  7. package/dist/api/apis.js.map +1 -1
  8. package/dist/api/automatedOffersApi.d.ts +156 -156
  9. package/dist/api/automatedOffersApi.js +1218 -1218
  10. package/dist/api/futureBidsApi.d.ts +65 -65
  11. package/dist/api/futureBidsApi.js +456 -456
  12. package/dist/api/healthApi.d.ts +32 -32
  13. package/dist/api/healthApi.js +174 -174
  14. package/dist/api/matchedOffersApi.d.ts +301 -267
  15. package/dist/api/matchedOffersApi.js +2330 -2074
  16. package/dist/api/matchedOffersApi.js.map +1 -1
  17. package/dist/api/offersApi.d.ts +200 -200
  18. package/dist/api/offersApi.js +1605 -1605
  19. package/dist/api/promoTextsApi.d.ts +67 -0
  20. package/dist/api/promoTextsApi.js +436 -0
  21. package/dist/api/promoTextsApi.js.map +1 -0
  22. package/dist/api.d.ts +2 -2
  23. package/dist/api.js +18 -18
  24. package/dist/model/addFutureBidDto.d.ts +17 -17
  25. package/dist/model/addFutureBidDto.js +35 -35
  26. package/dist/model/addMatchedDeliveryDateDto.d.ts +14 -14
  27. package/dist/model/addMatchedDeliveryDateDto.js +20 -20
  28. package/dist/model/archivePromoTextDto.d.ts +14 -0
  29. package/dist/model/archivePromoTextDto.js +21 -0
  30. package/dist/model/archivePromoTextDto.js.map +1 -0
  31. package/dist/model/associatedCostDto.d.ts +16 -16
  32. package/dist/model/associatedCostDto.js +30 -30
  33. package/dist/model/bulkAddRelistingDto.d.ts +16 -16
  34. package/dist/model/bulkAddRelistingDto.js +25 -25
  35. package/dist/model/bulkAddTertiaryCostsDto.d.ts +16 -16
  36. package/dist/model/bulkAddTertiaryCostsDto.js +25 -25
  37. package/dist/model/bulkCancelPromotionDto.d.ts +16 -0
  38. package/dist/model/bulkCancelPromotionDto.js +31 -0
  39. package/dist/model/bulkCancelPromotionDto.js.map +1 -0
  40. package/dist/model/bulkChangeDestinationLocationDto.d.ts +16 -16
  41. package/dist/model/bulkChangeDestinationLocationDto.js +30 -30
  42. package/dist/model/bulkChangeFreightRatesDto.d.ts +19 -19
  43. package/dist/model/bulkChangeFreightRatesDto.js +40 -40
  44. package/dist/model/bulkChangeIncotermDto.d.ts +16 -16
  45. package/dist/model/bulkChangeIncotermDto.js +30 -30
  46. package/dist/model/bulkChangeSellPriceItemDto.d.ts +20 -20
  47. package/dist/model/bulkChangeSellPriceItemDto.js +45 -45
  48. package/dist/model/bulkChangeSellPricesDto.d.ts +23 -23
  49. package/dist/model/bulkChangeSellPricesDto.js +55 -55
  50. package/dist/model/bulkChangeSellingTraderDto.d.ts +16 -16
  51. package/dist/model/bulkChangeSellingTraderDto.js +30 -30
  52. package/dist/model/bulkDeleteBuyerSpecialInstructionsDto.d.ts +15 -15
  53. package/dist/model/bulkDeleteBuyerSpecialInstructionsDto.js +25 -25
  54. package/dist/model/bulkPromoteDto.d.ts +17 -0
  55. package/dist/model/bulkPromoteDto.js +36 -0
  56. package/dist/model/bulkPromoteDto.js.map +1 -0
  57. package/dist/model/bulkUpdateBuyerSpecialInstructionsDto.d.ts +19 -19
  58. package/dist/model/bulkUpdateBuyerSpecialInstructionsDto.js +45 -45
  59. package/dist/model/bulkUpdateDeliveryDatesDto.d.ts +16 -16
  60. package/dist/model/bulkUpdateDeliveryDatesDto.js +30 -30
  61. package/dist/model/bulkUpdateDocsCountryDto.d.ts +16 -16
  62. package/dist/model/bulkUpdateDocsCountryDto.js +30 -30
  63. package/dist/model/bulkUpdateMatchedDeliveryDatesDto.d.ts +15 -15
  64. package/dist/model/bulkUpdateMatchedDeliveryDatesDto.js +25 -25
  65. package/dist/model/costAmountDto.d.ts +17 -17
  66. package/dist/model/costAmountDto.js +35 -35
  67. package/dist/model/costAttributesDto.d.ts +32 -32
  68. package/dist/model/costAttributesDto.js +100 -100
  69. package/dist/model/costAttributesDtoAssociated.d.ts +16 -16
  70. package/dist/model/costAttributesDtoAssociated.js +30 -30
  71. package/dist/model/costAttributesDtoDefaultCost.d.ts +18 -18
  72. package/dist/model/costAttributesDtoDefaultCost.js +40 -40
  73. package/dist/model/costDto.d.ts +35 -35
  74. package/dist/model/costDto.js +110 -110
  75. package/dist/model/costDtoAmount.d.ts +17 -17
  76. package/dist/model/costDtoAmount.js +35 -35
  77. package/dist/model/costDtoAttributes.d.ts +32 -32
  78. package/dist/model/costDtoAttributes.js +100 -100
  79. package/dist/model/costDtoSource.d.ts +15 -15
  80. package/dist/model/costDtoSource.js +25 -25
  81. package/dist/model/costSourceDto.d.ts +15 -15
  82. package/dist/model/costSourceDto.js +25 -25
  83. package/dist/model/createAutomatedOfferDto.d.ts +125 -124
  84. package/dist/model/createAutomatedOfferDto.js +424 -419
  85. package/dist/model/createAutomatedOfferDto.js.map +1 -1
  86. package/dist/model/createMatchedOfferDto.d.ts +85 -85
  87. package/dist/model/createMatchedOfferDto.js +315 -315
  88. package/dist/model/createMatchedOfferDtoAttributes.d.ts +36 -34
  89. package/dist/model/createMatchedOfferDtoAttributes.js +104 -94
  90. package/dist/model/createMatchedOfferDtoAttributes.js.map +1 -1
  91. package/dist/model/createOfferDto.d.ts +112 -111
  92. package/dist/model/createOfferDto.js +402 -397
  93. package/dist/model/createOfferDto.js.map +1 -1
  94. package/dist/model/createOfferDtoAttributes.d.ts +52 -52
  95. package/dist/model/createOfferDtoAttributes.js +174 -174
  96. package/dist/model/createOfferDtoFormula.d.ts +19 -19
  97. package/dist/model/createOfferDtoFormula.js +40 -40
  98. package/dist/model/createOfferDtoPacking.d.ts +17 -17
  99. package/dist/model/createOfferDtoPacking.js +35 -35
  100. package/dist/model/createOfferDtoWeight.d.ts +15 -15
  101. package/dist/model/createOfferDtoWeight.js +25 -25
  102. package/dist/model/createPromoTextDto.d.ts +17 -0
  103. package/dist/model/createPromoTextDto.js +31 -0
  104. package/dist/model/createPromoTextDto.js.map +1 -0
  105. package/dist/model/defaultCostDto.d.ts +18 -18
  106. package/dist/model/defaultCostDto.js +40 -40
  107. package/dist/model/formulaDto.d.ts +19 -19
  108. package/dist/model/formulaDto.js +40 -40
  109. package/dist/model/formulaLineDto.d.ts +17 -17
  110. package/dist/model/formulaLineDto.js +35 -35
  111. package/dist/model/generalAddressDto.d.ts +43 -43
  112. package/dist/model/generalAddressDto.js +165 -165
  113. package/dist/model/healthControllerPing200Response.d.ts +24 -24
  114. package/dist/model/healthControllerPing200Response.js +35 -35
  115. package/dist/model/healthControllerPing200ResponseInfoValue.d.ts +10 -10
  116. package/dist/model/healthControllerPing200ResponseInfoValue.js +36 -36
  117. package/dist/model/healthControllerPing503Response.d.ts +24 -24
  118. package/dist/model/healthControllerPing503Response.js +35 -35
  119. package/dist/model/matchedOfferAttributesDto.d.ts +36 -34
  120. package/dist/model/matchedOfferAttributesDto.js +104 -94
  121. package/dist/model/matchedOfferAttributesDto.js.map +1 -1
  122. package/dist/model/models.d.ts +109 -102
  123. package/dist/model/models.js +424 -402
  124. package/dist/model/models.js.map +1 -1
  125. package/dist/model/offerAttributesDto.d.ts +52 -52
  126. package/dist/model/offerAttributesDto.js +174 -174
  127. package/dist/model/offerAttributesDtoEstablishment.d.ts +43 -43
  128. package/dist/model/offerAttributesDtoEstablishment.js +165 -165
  129. package/dist/model/overwriteItemDto.d.ts +22 -22
  130. package/dist/model/overwriteItemDto.js +55 -55
  131. package/dist/model/overwriteItemDtoWeight.d.ts +14 -14
  132. package/dist/model/overwriteItemDtoWeight.js +20 -20
  133. package/dist/model/packing.d.ts +17 -17
  134. package/dist/model/packing.js +35 -35
  135. package/dist/model/pinActionDto.d.ts +14 -14
  136. package/dist/model/pinActionDto.js +20 -20
  137. package/dist/model/promoTextPairDto.d.ts +24 -0
  138. package/dist/model/promoTextPairDto.js +41 -0
  139. package/dist/model/promoTextPairDto.js.map +1 -0
  140. package/dist/model/relistingConfigDto.d.ts +17 -17
  141. package/dist/model/relistingConfigDto.js +35 -35
  142. package/dist/model/relistingDetailDto.d.ts +31 -31
  143. package/dist/model/relistingDetailDto.js +62 -62
  144. package/dist/model/relistingDetailDtoRandomConfig.d.ts +19 -19
  145. package/dist/model/relistingDetailDtoRandomConfig.js +45 -45
  146. package/dist/model/relistingRandomConfigDto.d.ts +19 -19
  147. package/dist/model/relistingRandomConfigDto.js +45 -45
  148. package/dist/model/searchPromoTextDto.d.ts +15 -0
  149. package/dist/model/searchPromoTextDto.js +26 -0
  150. package/dist/model/searchPromoTextDto.js.map +1 -0
  151. package/dist/model/updateFutureBidDto.d.ts +17 -17
  152. package/dist/model/updateFutureBidDto.js +35 -35
  153. package/dist/model/updateMatchedDeliveryDateDto.d.ts +15 -15
  154. package/dist/model/updateMatchedDeliveryDateDto.js +25 -25
  155. package/dist/model/updatePromoTextDto.d.ts +17 -0
  156. package/dist/model/updatePromoTextDto.js +31 -0
  157. package/dist/model/updatePromoTextDto.js.map +1 -0
  158. package/dist/model/userPin.d.ts +15 -15
  159. package/dist/model/userPin.js +25 -25
  160. package/dist/model/weight.d.ts +15 -15
  161. package/dist/model/weight.js +25 -25
  162. package/dist/model/weightDto.d.ts +14 -14
  163. package/dist/model/weightDto.js +20 -20
  164. package/model/archivePromoTextDto.ts +34 -0
  165. package/model/bulkCancelPromotionDto.ts +49 -0
  166. package/model/bulkPromoteDto.ts +55 -0
  167. package/model/createAutomatedOfferDto.ts +9 -0
  168. package/model/createMatchedOfferDtoAttributes.ts +18 -0
  169. package/model/createOfferDto.ts +9 -0
  170. package/model/createPromoTextDto.ts +53 -0
  171. package/model/matchedOfferAttributesDto.ts +18 -0
  172. package/model/models.ts +22 -0
  173. package/model/promoTextPairDto.ts +60 -0
  174. package/model/searchPromoTextDto.ts +43 -0
  175. package/model/updatePromoTextDto.ts +47 -0
  176. package/package.json +1 -1
@@ -1,1606 +1,1606 @@
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.OffersApi = exports.OffersApiApiKeys = 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 OffersApiApiKeys;
48
- (function (OffersApiApiKeys) {
49
- })(OffersApiApiKeys = exports.OffersApiApiKeys || (exports.OffersApiApiKeys = {}));
50
- var OffersApi = (function () {
51
- function OffersApi(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(OffersApi.prototype, "useQuerystring", {
71
- set: function (value) {
72
- this._useQuerystring = value;
73
- },
74
- enumerable: false,
75
- configurable: true
76
- });
77
- Object.defineProperty(OffersApi.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(OffersApi.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
- OffersApi.prototype.setDefaultAuthentication = function (auth) {
98
- this.authentications.default = auth;
99
- };
100
- OffersApi.prototype.setApiKey = function (key, value) {
101
- this.authentications[OffersApiApiKeys[key]].apiKey = value;
102
- };
103
- OffersApi.prototype.addInterceptor = function (interceptor) {
104
- this.interceptors.push(interceptor);
105
- };
106
- OffersApi.prototype.offersControllerAddmatchedbuyertooffer = function (id, buyer, account, options) {
107
- if (options === void 0) { options = { headers: {} }; }
108
- return __awaiter(this, void 0, void 0, function () {
109
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_1, _i, _a, interceptor;
110
- var _this = this;
111
- return __generator(this, function (_b) {
112
- localVarPath = this.basePath + '/offers/{account}/{id}/matched-buyer/{buyer}/add'
113
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
114
- .replace('{' + 'buyer' + '}', encodeURIComponent(String(buyer)))
115
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
116
- localVarQueryParameters = {};
117
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
118
- localVarFormParams = {};
119
- if (id === null || id === undefined) {
120
- throw new Error('Required parameter id was null or undefined when calling offersControllerAddmatchedbuyertooffer.');
121
- }
122
- if (buyer === null || buyer === undefined) {
123
- throw new Error('Required parameter buyer was null or undefined when calling offersControllerAddmatchedbuyertooffer.');
124
- }
125
- if (account === null || account === undefined) {
126
- throw new Error('Required parameter account was null or undefined when calling offersControllerAddmatchedbuyertooffer.');
127
- }
128
- Object.assign(localVarHeaderParams, options.headers);
129
- localVarUseFormData = false;
130
- localVarRequestOptions = {
131
- method: 'PUT',
132
- qs: localVarQueryParameters,
133
- headers: localVarHeaderParams,
134
- uri: localVarPath,
135
- useQuerystring: this._useQuerystring,
136
- json: true,
137
- };
138
- authenticationPromise = Promise.resolve();
139
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
140
- interceptorPromise = authenticationPromise;
141
- _loop_1 = function (interceptor) {
142
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
143
- };
144
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
145
- interceptor = _a[_i];
146
- _loop_1(interceptor);
147
- }
148
- return [2, interceptorPromise.then(function () {
149
- if (Object.keys(localVarFormParams).length) {
150
- if (localVarUseFormData) {
151
- localVarRequestOptions.formData = localVarFormParams;
152
- }
153
- else {
154
- localVarRequestOptions.form = localVarFormParams;
155
- }
156
- }
157
- return new Promise(function (resolve, reject) {
158
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
159
- if (error) {
160
- reject(error);
161
- }
162
- else {
163
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
164
- resolve({ response: response, body: body });
165
- }
166
- else {
167
- reject(new apis_1.HttpError(response, body, response.statusCode));
168
- }
169
- }
170
- });
171
- });
172
- })];
173
- });
174
- });
175
- };
176
- OffersApi.prototype.offersControllerAddnote = function (id, account, body, options) {
177
- if (options === void 0) { options = { headers: {} }; }
178
- return __awaiter(this, void 0, void 0, function () {
179
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_2, _i, _a, interceptor;
180
- var _this = this;
181
- return __generator(this, function (_b) {
182
- localVarPath = this.basePath + '/offers/{account}/{id}/notes'
183
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
184
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
185
- localVarQueryParameters = {};
186
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
187
- localVarFormParams = {};
188
- if (id === null || id === undefined) {
189
- throw new Error('Required parameter id was null or undefined when calling offersControllerAddnote.');
190
- }
191
- if (account === null || account === undefined) {
192
- throw new Error('Required parameter account was null or undefined when calling offersControllerAddnote.');
193
- }
194
- if (body === null || body === undefined) {
195
- throw new Error('Required parameter body was null or undefined when calling offersControllerAddnote.');
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
- OffersApi.prototype.offersControllerAttachclones = function (id, account, body, 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 + '/offers/{account}/{id}/clones/add'
253
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
254
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
255
- localVarQueryParameters = {};
256
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
257
- localVarFormParams = {};
258
- if (id === null || id === undefined) {
259
- throw new Error('Required parameter id was null or undefined when calling offersControllerAttachclones.');
260
- }
261
- if (account === null || account === undefined) {
262
- throw new Error('Required parameter account was null or undefined when calling offersControllerAttachclones.');
263
- }
264
- if (body === null || body === undefined) {
265
- throw new Error('Required parameter body was null or undefined when calling offersControllerAttachclones.');
266
- }
267
- Object.assign(localVarHeaderParams, options.headers);
268
- localVarUseFormData = false;
269
- localVarRequestOptions = {
270
- method: 'PUT',
271
- qs: localVarQueryParameters,
272
- headers: localVarHeaderParams,
273
- uri: localVarPath,
274
- useQuerystring: this._useQuerystring,
275
- json: true,
276
- body: models_1.ObjectSerializer.serialize(body, "object")
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
- OffersApi.prototype.offersControllerAttachmatchedoffers = function (id, account, 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 + '/offers/{account}/{id}/matched-offers/add'
323
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
324
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
325
- localVarQueryParameters = {};
326
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
327
- localVarFormParams = {};
328
- if (id === null || id === undefined) {
329
- throw new Error('Required parameter id was null or undefined when calling offersControllerAttachmatchedoffers.');
330
- }
331
- if (account === null || account === undefined) {
332
- throw new Error('Required parameter account was null or undefined when calling offersControllerAttachmatchedoffers.');
333
- }
334
- if (body === null || body === undefined) {
335
- throw new Error('Required parameter body was null or undefined when calling offersControllerAttachmatchedoffers.');
336
- }
337
- Object.assign(localVarHeaderParams, options.headers);
338
- localVarUseFormData = false;
339
- localVarRequestOptions = {
340
- method: 'PUT',
341
- qs: localVarQueryParameters,
342
- headers: localVarHeaderParams,
343
- uri: localVarPath,
344
- useQuerystring: this._useQuerystring,
345
- json: true,
346
- body: models_1.ObjectSerializer.serialize(body, "object")
347
- };
348
- authenticationPromise = Promise.resolve();
349
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
350
- interceptorPromise = authenticationPromise;
351
- _loop_4 = function (interceptor) {
352
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
353
- };
354
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
355
- interceptor = _a[_i];
356
- _loop_4(interceptor);
357
- }
358
- return [2, interceptorPromise.then(function () {
359
- if (Object.keys(localVarFormParams).length) {
360
- if (localVarUseFormData) {
361
- localVarRequestOptions.formData = localVarFormParams;
362
- }
363
- else {
364
- localVarRequestOptions.form = localVarFormParams;
365
- }
366
- }
367
- return new Promise(function (resolve, reject) {
368
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
369
- if (error) {
370
- reject(error);
371
- }
372
- else {
373
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
374
- resolve({ response: response, body: body });
375
- }
376
- else {
377
- reject(new apis_1.HttpError(response, body, response.statusCode));
378
- }
379
- }
380
- });
381
- });
382
- })];
383
- });
384
- });
385
- };
386
- OffersApi.prototype.offersControllerCancel = function (account, body, options) {
387
- if (options === void 0) { options = { headers: {} }; }
388
- return __awaiter(this, void 0, void 0, function () {
389
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_5, _i, _a, interceptor;
390
- var _this = this;
391
- return __generator(this, function (_b) {
392
- localVarPath = this.basePath + '/offers/{account}/cancel'
393
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
394
- localVarQueryParameters = {};
395
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
396
- localVarFormParams = {};
397
- if (account === null || account === undefined) {
398
- throw new Error('Required parameter account was null or undefined when calling offersControllerCancel.');
399
- }
400
- if (body === null || body === undefined) {
401
- throw new Error('Required parameter body was null or undefined when calling offersControllerCancel.');
402
- }
403
- Object.assign(localVarHeaderParams, options.headers);
404
- localVarUseFormData = false;
405
- localVarRequestOptions = {
406
- method: 'PUT',
407
- qs: localVarQueryParameters,
408
- headers: localVarHeaderParams,
409
- uri: localVarPath,
410
- useQuerystring: this._useQuerystring,
411
- json: true,
412
- body: models_1.ObjectSerializer.serialize(body, "object")
413
- };
414
- authenticationPromise = Promise.resolve();
415
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
416
- interceptorPromise = authenticationPromise;
417
- _loop_5 = function (interceptor) {
418
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
419
- };
420
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
421
- interceptor = _a[_i];
422
- _loop_5(interceptor);
423
- }
424
- return [2, interceptorPromise.then(function () {
425
- if (Object.keys(localVarFormParams).length) {
426
- if (localVarUseFormData) {
427
- localVarRequestOptions.formData = localVarFormParams;
428
- }
429
- else {
430
- localVarRequestOptions.form = localVarFormParams;
431
- }
432
- }
433
- return new Promise(function (resolve, reject) {
434
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
435
- if (error) {
436
- reject(error);
437
- }
438
- else {
439
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
440
- resolve({ response: response, body: body });
441
- }
442
- else {
443
- reject(new apis_1.HttpError(response, body, response.statusCode));
444
- }
445
- }
446
- });
447
- });
448
- })];
449
- });
450
- });
451
- };
452
- OffersApi.prototype.offersControllerCountsbystatus = function (account, options) {
453
- if (options === void 0) { options = { headers: {} }; }
454
- return __awaiter(this, void 0, void 0, function () {
455
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_6, _i, _a, interceptor;
456
- var _this = this;
457
- return __generator(this, function (_b) {
458
- localVarPath = this.basePath + '/offers/{account}/counts-by-status'
459
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
460
- localVarQueryParameters = {};
461
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
462
- localVarFormParams = {};
463
- if (account === null || account === undefined) {
464
- throw new Error('Required parameter account was null or undefined when calling offersControllerCountsbystatus.');
465
- }
466
- Object.assign(localVarHeaderParams, options.headers);
467
- localVarUseFormData = false;
468
- localVarRequestOptions = {
469
- method: 'GET',
470
- qs: localVarQueryParameters,
471
- headers: localVarHeaderParams,
472
- uri: localVarPath,
473
- useQuerystring: this._useQuerystring,
474
- json: true,
475
- };
476
- authenticationPromise = Promise.resolve();
477
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
478
- interceptorPromise = authenticationPromise;
479
- _loop_6 = function (interceptor) {
480
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
481
- };
482
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
483
- interceptor = _a[_i];
484
- _loop_6(interceptor);
485
- }
486
- return [2, interceptorPromise.then(function () {
487
- if (Object.keys(localVarFormParams).length) {
488
- if (localVarUseFormData) {
489
- localVarRequestOptions.formData = localVarFormParams;
490
- }
491
- else {
492
- localVarRequestOptions.form = localVarFormParams;
493
- }
494
- }
495
- return new Promise(function (resolve, reject) {
496
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
497
- if (error) {
498
- reject(error);
499
- }
500
- else {
501
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
502
- resolve({ response: response, body: body });
503
- }
504
- else {
505
- reject(new apis_1.HttpError(response, body, response.statusCode));
506
- }
507
- }
508
- });
509
- });
510
- })];
511
- });
512
- });
513
- };
514
- OffersApi.prototype.offersControllerCreate = function (account, createOfferDto, options) {
515
- if (options === void 0) { options = { headers: {} }; }
516
- return __awaiter(this, void 0, void 0, function () {
517
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_7, _i, _a, interceptor;
518
- var _this = this;
519
- return __generator(this, function (_b) {
520
- localVarPath = this.basePath + '/offers/{account}'
521
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
522
- localVarQueryParameters = {};
523
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
524
- localVarFormParams = {};
525
- if (account === null || account === undefined) {
526
- throw new Error('Required parameter account was null or undefined when calling offersControllerCreate.');
527
- }
528
- if (createOfferDto === null || createOfferDto === undefined) {
529
- throw new Error('Required parameter createOfferDto was null or undefined when calling offersControllerCreate.');
530
- }
531
- Object.assign(localVarHeaderParams, options.headers);
532
- localVarUseFormData = false;
533
- localVarRequestOptions = {
534
- method: 'POST',
535
- qs: localVarQueryParameters,
536
- headers: localVarHeaderParams,
537
- uri: localVarPath,
538
- useQuerystring: this._useQuerystring,
539
- json: true,
540
- body: models_1.ObjectSerializer.serialize(createOfferDto, "CreateOfferDto")
541
- };
542
- authenticationPromise = Promise.resolve();
543
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
544
- interceptorPromise = authenticationPromise;
545
- _loop_7 = function (interceptor) {
546
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
547
- };
548
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
549
- interceptor = _a[_i];
550
- _loop_7(interceptor);
551
- }
552
- return [2, interceptorPromise.then(function () {
553
- if (Object.keys(localVarFormParams).length) {
554
- if (localVarUseFormData) {
555
- localVarRequestOptions.formData = localVarFormParams;
556
- }
557
- else {
558
- localVarRequestOptions.form = localVarFormParams;
559
- }
560
- }
561
- return new Promise(function (resolve, reject) {
562
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
563
- if (error) {
564
- reject(error);
565
- }
566
- else {
567
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
568
- resolve({ response: response, body: body });
569
- }
570
- else {
571
- reject(new apis_1.HttpError(response, body, response.statusCode));
572
- }
573
- }
574
- });
575
- });
576
- })];
577
- });
578
- });
579
- };
580
- OffersApi.prototype.offersControllerCreatebulk = function (account, createOfferDto, options) {
581
- if (options === void 0) { options = { headers: {} }; }
582
- return __awaiter(this, void 0, void 0, function () {
583
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_8, _i, _a, interceptor;
584
- var _this = this;
585
- return __generator(this, function (_b) {
586
- localVarPath = this.basePath + '/offers/{account}/bulk'
587
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
588
- localVarQueryParameters = {};
589
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
590
- localVarFormParams = {};
591
- if (account === null || account === undefined) {
592
- throw new Error('Required parameter account was null or undefined when calling offersControllerCreatebulk.');
593
- }
594
- if (createOfferDto === null || createOfferDto === undefined) {
595
- throw new Error('Required parameter createOfferDto was null or undefined when calling offersControllerCreatebulk.');
596
- }
597
- Object.assign(localVarHeaderParams, options.headers);
598
- localVarUseFormData = false;
599
- localVarRequestOptions = {
600
- method: 'POST',
601
- qs: localVarQueryParameters,
602
- headers: localVarHeaderParams,
603
- uri: localVarPath,
604
- useQuerystring: this._useQuerystring,
605
- json: true,
606
- body: models_1.ObjectSerializer.serialize(createOfferDto, "Array<CreateOfferDto>")
607
- };
608
- authenticationPromise = Promise.resolve();
609
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
610
- interceptorPromise = authenticationPromise;
611
- _loop_8 = function (interceptor) {
612
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
613
- };
614
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
615
- interceptor = _a[_i];
616
- _loop_8(interceptor);
617
- }
618
- return [2, interceptorPromise.then(function () {
619
- if (Object.keys(localVarFormParams).length) {
620
- if (localVarUseFormData) {
621
- localVarRequestOptions.formData = localVarFormParams;
622
- }
623
- else {
624
- localVarRequestOptions.form = localVarFormParams;
625
- }
626
- }
627
- return new Promise(function (resolve, reject) {
628
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
629
- if (error) {
630
- reject(error);
631
- }
632
- else {
633
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
634
- resolve({ response: response, body: body });
635
- }
636
- else {
637
- reject(new apis_1.HttpError(response, body, response.statusCode));
638
- }
639
- }
640
- });
641
- });
642
- })];
643
- });
644
- });
645
- };
646
- OffersApi.prototype.offersControllerDeletebatch = function (account, body, options) {
647
- if (options === void 0) { options = { headers: {} }; }
648
- return __awaiter(this, void 0, void 0, function () {
649
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_9, _i, _a, interceptor;
650
- var _this = this;
651
- return __generator(this, function (_b) {
652
- localVarPath = this.basePath + '/offers/{account}'
653
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
654
- localVarQueryParameters = {};
655
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
656
- localVarFormParams = {};
657
- if (account === null || account === undefined) {
658
- throw new Error('Required parameter account was null or undefined when calling offersControllerDeletebatch.');
659
- }
660
- if (body === null || body === undefined) {
661
- throw new Error('Required parameter body was null or undefined when calling offersControllerDeletebatch.');
662
- }
663
- Object.assign(localVarHeaderParams, options.headers);
664
- localVarUseFormData = false;
665
- localVarRequestOptions = {
666
- method: 'DELETE',
667
- qs: localVarQueryParameters,
668
- headers: localVarHeaderParams,
669
- uri: localVarPath,
670
- useQuerystring: this._useQuerystring,
671
- json: true,
672
- body: models_1.ObjectSerializer.serialize(body, "object")
673
- };
674
- authenticationPromise = Promise.resolve();
675
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
676
- interceptorPromise = authenticationPromise;
677
- _loop_9 = function (interceptor) {
678
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
679
- };
680
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
681
- interceptor = _a[_i];
682
- _loop_9(interceptor);
683
- }
684
- return [2, interceptorPromise.then(function () {
685
- if (Object.keys(localVarFormParams).length) {
686
- if (localVarUseFormData) {
687
- localVarRequestOptions.formData = localVarFormParams;
688
- }
689
- else {
690
- localVarRequestOptions.form = localVarFormParams;
691
- }
692
- }
693
- return new Promise(function (resolve, reject) {
694
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
695
- if (error) {
696
- reject(error);
697
- }
698
- else {
699
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
700
- resolve({ response: response, body: body });
701
- }
702
- else {
703
- reject(new apis_1.HttpError(response, body, response.statusCode));
704
- }
705
- }
706
- });
707
- });
708
- })];
709
- });
710
- });
711
- };
712
- OffersApi.prototype.offersControllerFilter = function (account, skip, limit, sort, fields, body, options) {
713
- if (options === void 0) { options = { headers: {} }; }
714
- return __awaiter(this, void 0, void 0, function () {
715
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_10, _i, _a, interceptor;
716
- var _this = this;
717
- return __generator(this, function (_b) {
718
- localVarPath = this.basePath + '/offers/{account}/search'
719
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
720
- localVarQueryParameters = {};
721
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
722
- localVarFormParams = {};
723
- if (account === null || account === undefined) {
724
- throw new Error('Required parameter account was null or undefined when calling offersControllerFilter.');
725
- }
726
- if (skip !== undefined) {
727
- localVarQueryParameters['skip'] = models_1.ObjectSerializer.serialize(skip, "number");
728
- }
729
- if (limit !== undefined) {
730
- localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number");
731
- }
732
- if (sort !== undefined) {
733
- localVarQueryParameters['sort'] = models_1.ObjectSerializer.serialize(sort, "string");
734
- }
735
- if (fields !== undefined) {
736
- localVarQueryParameters['fields'] = models_1.ObjectSerializer.serialize(fields, "Array<string>");
737
- }
738
- Object.assign(localVarHeaderParams, options.headers);
739
- localVarUseFormData = false;
740
- localVarRequestOptions = {
741
- method: 'POST',
742
- qs: localVarQueryParameters,
743
- headers: localVarHeaderParams,
744
- uri: localVarPath,
745
- useQuerystring: this._useQuerystring,
746
- json: true,
747
- body: models_1.ObjectSerializer.serialize(body, "object")
748
- };
749
- authenticationPromise = Promise.resolve();
750
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
751
- interceptorPromise = authenticationPromise;
752
- _loop_10 = function (interceptor) {
753
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
754
- };
755
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
756
- interceptor = _a[_i];
757
- _loop_10(interceptor);
758
- }
759
- return [2, interceptorPromise.then(function () {
760
- if (Object.keys(localVarFormParams).length) {
761
- if (localVarUseFormData) {
762
- localVarRequestOptions.formData = localVarFormParams;
763
- }
764
- else {
765
- localVarRequestOptions.form = localVarFormParams;
766
- }
767
- }
768
- return new Promise(function (resolve, reject) {
769
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
770
- if (error) {
771
- reject(error);
772
- }
773
- else {
774
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
775
- resolve({ response: response, body: body });
776
- }
777
- else {
778
- reject(new apis_1.HttpError(response, body, response.statusCode));
779
- }
780
- }
781
- });
782
- });
783
- })];
784
- });
785
- });
786
- };
787
- OffersApi.prototype.offersControllerFindall = function (account, createOfferDto, skip, limit, sort, fields, options) {
788
- if (options === void 0) { options = { headers: {} }; }
789
- return __awaiter(this, void 0, void 0, function () {
790
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_11, _i, _a, interceptor;
791
- var _this = this;
792
- return __generator(this, function (_b) {
793
- localVarPath = this.basePath + '/offers/{account}'
794
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
795
- localVarQueryParameters = {};
796
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
797
- localVarFormParams = {};
798
- if (account === null || account === undefined) {
799
- throw new Error('Required parameter account was null or undefined when calling offersControllerFindall.');
800
- }
801
- if (createOfferDto === null || createOfferDto === undefined) {
802
- throw new Error('Required parameter createOfferDto was null or undefined when calling offersControllerFindall.');
803
- }
804
- if (skip !== undefined) {
805
- localVarQueryParameters['skip'] = models_1.ObjectSerializer.serialize(skip, "number");
806
- }
807
- if (limit !== undefined) {
808
- localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number");
809
- }
810
- if (sort !== undefined) {
811
- localVarQueryParameters['sort'] = models_1.ObjectSerializer.serialize(sort, "string");
812
- }
813
- if (fields !== undefined) {
814
- localVarQueryParameters['fields'] = models_1.ObjectSerializer.serialize(fields, "Array<string>");
815
- }
816
- Object.assign(localVarHeaderParams, options.headers);
817
- localVarUseFormData = false;
818
- localVarRequestOptions = {
819
- method: 'GET',
820
- qs: localVarQueryParameters,
821
- headers: localVarHeaderParams,
822
- uri: localVarPath,
823
- useQuerystring: this._useQuerystring,
824
- json: true,
825
- body: models_1.ObjectSerializer.serialize(createOfferDto, "CreateOfferDto")
826
- };
827
- authenticationPromise = Promise.resolve();
828
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
829
- interceptorPromise = authenticationPromise;
830
- _loop_11 = function (interceptor) {
831
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
832
- };
833
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
834
- interceptor = _a[_i];
835
- _loop_11(interceptor);
836
- }
837
- return [2, interceptorPromise.then(function () {
838
- if (Object.keys(localVarFormParams).length) {
839
- if (localVarUseFormData) {
840
- localVarRequestOptions.formData = localVarFormParams;
841
- }
842
- else {
843
- localVarRequestOptions.form = localVarFormParams;
844
- }
845
- }
846
- return new Promise(function (resolve, reject) {
847
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
848
- if (error) {
849
- reject(error);
850
- }
851
- else {
852
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
853
- resolve({ response: response, body: body });
854
- }
855
- else {
856
- reject(new apis_1.HttpError(response, body, response.statusCode));
857
- }
858
- }
859
- });
860
- });
861
- })];
862
- });
863
- });
864
- };
865
- OffersApi.prototype.offersControllerFindcountries = function (account, options) {
866
- if (options === void 0) { options = { headers: {} }; }
867
- return __awaiter(this, void 0, void 0, function () {
868
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_12, _i, _a, interceptor;
869
- var _this = this;
870
- return __generator(this, function (_b) {
871
- localVarPath = this.basePath + '/offers/{account}/countries'
872
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
873
- localVarQueryParameters = {};
874
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
875
- localVarFormParams = {};
876
- if (account === null || account === undefined) {
877
- throw new Error('Required parameter account was null or undefined when calling offersControllerFindcountries.');
878
- }
879
- Object.assign(localVarHeaderParams, options.headers);
880
- localVarUseFormData = false;
881
- localVarRequestOptions = {
882
- method: 'GET',
883
- qs: localVarQueryParameters,
884
- headers: localVarHeaderParams,
885
- uri: localVarPath,
886
- useQuerystring: this._useQuerystring,
887
- json: true,
888
- };
889
- authenticationPromise = Promise.resolve();
890
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
891
- interceptorPromise = authenticationPromise;
892
- _loop_12 = function (interceptor) {
893
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
894
- };
895
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
896
- interceptor = _a[_i];
897
- _loop_12(interceptor);
898
- }
899
- return [2, interceptorPromise.then(function () {
900
- if (Object.keys(localVarFormParams).length) {
901
- if (localVarUseFormData) {
902
- localVarRequestOptions.formData = localVarFormParams;
903
- }
904
- else {
905
- localVarRequestOptions.form = localVarFormParams;
906
- }
907
- }
908
- return new Promise(function (resolve, reject) {
909
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
910
- if (error) {
911
- reject(error);
912
- }
913
- else {
914
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
915
- resolve({ response: response, body: body });
916
- }
917
- else {
918
- reject(new apis_1.HttpError(response, body, response.statusCode));
919
- }
920
- }
921
- });
922
- });
923
- })];
924
- });
925
- });
926
- };
927
- OffersApi.prototype.offersControllerFindone = function (id, account, fields, options) {
928
- if (options === void 0) { options = { headers: {} }; }
929
- return __awaiter(this, void 0, void 0, function () {
930
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_13, _i, _a, interceptor;
931
- var _this = this;
932
- return __generator(this, function (_b) {
933
- localVarPath = this.basePath + '/offers/{account}/{id}'
934
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
935
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
936
- localVarQueryParameters = {};
937
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
938
- localVarFormParams = {};
939
- if (id === null || id === undefined) {
940
- throw new Error('Required parameter id was null or undefined when calling offersControllerFindone.');
941
- }
942
- if (account === null || account === undefined) {
943
- throw new Error('Required parameter account was null or undefined when calling offersControllerFindone.');
944
- }
945
- if (fields !== undefined) {
946
- localVarQueryParameters['fields'] = models_1.ObjectSerializer.serialize(fields, "string");
947
- }
948
- Object.assign(localVarHeaderParams, options.headers);
949
- localVarUseFormData = false;
950
- localVarRequestOptions = {
951
- method: 'GET',
952
- qs: localVarQueryParameters,
953
- headers: localVarHeaderParams,
954
- uri: localVarPath,
955
- useQuerystring: this._useQuerystring,
956
- json: true,
957
- };
958
- authenticationPromise = Promise.resolve();
959
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
960
- interceptorPromise = authenticationPromise;
961
- _loop_13 = function (interceptor) {
962
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
963
- };
964
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
965
- interceptor = _a[_i];
966
- _loop_13(interceptor);
967
- }
968
- return [2, interceptorPromise.then(function () {
969
- if (Object.keys(localVarFormParams).length) {
970
- if (localVarUseFormData) {
971
- localVarRequestOptions.formData = localVarFormParams;
972
- }
973
- else {
974
- localVarRequestOptions.form = localVarFormParams;
975
- }
976
- }
977
- return new Promise(function (resolve, reject) {
978
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
979
- if (error) {
980
- reject(error);
981
- }
982
- else {
983
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
984
- resolve({ response: response, body: body });
985
- }
986
- else {
987
- reject(new apis_1.HttpError(response, body, response.statusCode));
988
- }
989
- }
990
- });
991
- });
992
- })];
993
- });
994
- });
995
- };
996
- OffersApi.prototype.offersControllerLock = function (id, account, body, options) {
997
- if (options === void 0) { options = { headers: {} }; }
998
- return __awaiter(this, void 0, void 0, function () {
999
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_14, _i, _a, interceptor;
1000
- var _this = this;
1001
- return __generator(this, function (_b) {
1002
- localVarPath = this.basePath + '/offers/{account}/{id}/lock'
1003
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
1004
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1005
- localVarQueryParameters = {};
1006
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1007
- localVarFormParams = {};
1008
- if (id === null || id === undefined) {
1009
- throw new Error('Required parameter id was null or undefined when calling offersControllerLock.');
1010
- }
1011
- if (account === null || account === undefined) {
1012
- throw new Error('Required parameter account was null or undefined when calling offersControllerLock.');
1013
- }
1014
- Object.assign(localVarHeaderParams, options.headers);
1015
- localVarUseFormData = false;
1016
- localVarRequestOptions = {
1017
- method: 'PUT',
1018
- qs: localVarQueryParameters,
1019
- headers: localVarHeaderParams,
1020
- uri: localVarPath,
1021
- useQuerystring: this._useQuerystring,
1022
- json: true,
1023
- body: models_1.ObjectSerializer.serialize(body, "object")
1024
- };
1025
- authenticationPromise = Promise.resolve();
1026
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1027
- interceptorPromise = authenticationPromise;
1028
- _loop_14 = function (interceptor) {
1029
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1030
- };
1031
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1032
- interceptor = _a[_i];
1033
- _loop_14(interceptor);
1034
- }
1035
- return [2, interceptorPromise.then(function () {
1036
- if (Object.keys(localVarFormParams).length) {
1037
- if (localVarUseFormData) {
1038
- localVarRequestOptions.formData = localVarFormParams;
1039
- }
1040
- else {
1041
- localVarRequestOptions.form = localVarFormParams;
1042
- }
1043
- }
1044
- return new Promise(function (resolve, reject) {
1045
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1046
- if (error) {
1047
- reject(error);
1048
- }
1049
- else {
1050
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1051
- resolve({ response: response, body: body });
1052
- }
1053
- else {
1054
- reject(new apis_1.HttpError(response, body, response.statusCode));
1055
- }
1056
- }
1057
- });
1058
- });
1059
- })];
1060
- });
1061
- });
1062
- };
1063
- OffersApi.prototype.offersControllerReload = function (id, account, options) {
1064
- if (options === void 0) { options = { headers: {} }; }
1065
- return __awaiter(this, void 0, void 0, function () {
1066
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_15, _i, _a, interceptor;
1067
- var _this = this;
1068
- return __generator(this, function (_b) {
1069
- localVarPath = this.basePath + '/offers/{account}/{id}/reload'
1070
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
1071
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1072
- localVarQueryParameters = {};
1073
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1074
- localVarFormParams = {};
1075
- if (id === null || id === undefined) {
1076
- throw new Error('Required parameter id was null or undefined when calling offersControllerReload.');
1077
- }
1078
- if (account === null || account === undefined) {
1079
- throw new Error('Required parameter account was null or undefined when calling offersControllerReload.');
1080
- }
1081
- Object.assign(localVarHeaderParams, options.headers);
1082
- localVarUseFormData = false;
1083
- localVarRequestOptions = {
1084
- method: 'POST',
1085
- qs: localVarQueryParameters,
1086
- headers: localVarHeaderParams,
1087
- uri: localVarPath,
1088
- useQuerystring: this._useQuerystring,
1089
- json: true,
1090
- };
1091
- authenticationPromise = Promise.resolve();
1092
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1093
- interceptorPromise = authenticationPromise;
1094
- _loop_15 = function (interceptor) {
1095
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1096
- };
1097
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1098
- interceptor = _a[_i];
1099
- _loop_15(interceptor);
1100
- }
1101
- return [2, interceptorPromise.then(function () {
1102
- if (Object.keys(localVarFormParams).length) {
1103
- if (localVarUseFormData) {
1104
- localVarRequestOptions.formData = localVarFormParams;
1105
- }
1106
- else {
1107
- localVarRequestOptions.form = localVarFormParams;
1108
- }
1109
- }
1110
- return new Promise(function (resolve, reject) {
1111
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1112
- if (error) {
1113
- reject(error);
1114
- }
1115
- else {
1116
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1117
- resolve({ response: response, body: body });
1118
- }
1119
- else {
1120
- reject(new apis_1.HttpError(response, body, response.statusCode));
1121
- }
1122
- }
1123
- });
1124
- });
1125
- })];
1126
- });
1127
- });
1128
- };
1129
- OffersApi.prototype.offersControllerRemove = function (id, account, options) {
1130
- if (options === void 0) { options = { headers: {} }; }
1131
- return __awaiter(this, void 0, void 0, function () {
1132
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_16, _i, _a, interceptor;
1133
- var _this = this;
1134
- return __generator(this, function (_b) {
1135
- localVarPath = this.basePath + '/offers/{account}/{id}'
1136
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
1137
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1138
- localVarQueryParameters = {};
1139
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1140
- localVarFormParams = {};
1141
- if (id === null || id === undefined) {
1142
- throw new Error('Required parameter id was null or undefined when calling offersControllerRemove.');
1143
- }
1144
- if (account === null || account === undefined) {
1145
- throw new Error('Required parameter account was null or undefined when calling offersControllerRemove.');
1146
- }
1147
- Object.assign(localVarHeaderParams, options.headers);
1148
- localVarUseFormData = false;
1149
- localVarRequestOptions = {
1150
- method: 'DELETE',
1151
- qs: localVarQueryParameters,
1152
- headers: localVarHeaderParams,
1153
- uri: localVarPath,
1154
- useQuerystring: this._useQuerystring,
1155
- json: true,
1156
- };
1157
- authenticationPromise = Promise.resolve();
1158
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1159
- interceptorPromise = authenticationPromise;
1160
- _loop_16 = function (interceptor) {
1161
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1162
- };
1163
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1164
- interceptor = _a[_i];
1165
- _loop_16(interceptor);
1166
- }
1167
- return [2, interceptorPromise.then(function () {
1168
- if (Object.keys(localVarFormParams).length) {
1169
- if (localVarUseFormData) {
1170
- localVarRequestOptions.formData = localVarFormParams;
1171
- }
1172
- else {
1173
- localVarRequestOptions.form = localVarFormParams;
1174
- }
1175
- }
1176
- return new Promise(function (resolve, reject) {
1177
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1178
- if (error) {
1179
- reject(error);
1180
- }
1181
- else {
1182
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1183
- resolve({ response: response, body: body });
1184
- }
1185
- else {
1186
- reject(new apis_1.HttpError(response, body, response.statusCode));
1187
- }
1188
- }
1189
- });
1190
- });
1191
- })];
1192
- });
1193
- });
1194
- };
1195
- OffersApi.prototype.offersControllerSetdealid = function (id, account, body, options) {
1196
- if (options === void 0) { options = { headers: {} }; }
1197
- return __awaiter(this, void 0, void 0, function () {
1198
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_17, _i, _a, interceptor;
1199
- var _this = this;
1200
- return __generator(this, function (_b) {
1201
- localVarPath = this.basePath + '/offers/{account}/{id}/deal-id'
1202
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
1203
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1204
- localVarQueryParameters = {};
1205
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1206
- localVarFormParams = {};
1207
- if (id === null || id === undefined) {
1208
- throw new Error('Required parameter id was null or undefined when calling offersControllerSetdealid.');
1209
- }
1210
- if (account === null || account === undefined) {
1211
- throw new Error('Required parameter account was null or undefined when calling offersControllerSetdealid.');
1212
- }
1213
- if (body === null || body === undefined) {
1214
- throw new Error('Required parameter body was null or undefined when calling offersControllerSetdealid.');
1215
- }
1216
- Object.assign(localVarHeaderParams, options.headers);
1217
- localVarUseFormData = false;
1218
- localVarRequestOptions = {
1219
- method: 'PUT',
1220
- qs: localVarQueryParameters,
1221
- headers: localVarHeaderParams,
1222
- uri: localVarPath,
1223
- useQuerystring: this._useQuerystring,
1224
- json: true,
1225
- body: models_1.ObjectSerializer.serialize(body, "object")
1226
- };
1227
- authenticationPromise = Promise.resolve();
1228
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1229
- interceptorPromise = authenticationPromise;
1230
- _loop_17 = function (interceptor) {
1231
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1232
- };
1233
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1234
- interceptor = _a[_i];
1235
- _loop_17(interceptor);
1236
- }
1237
- return [2, interceptorPromise.then(function () {
1238
- if (Object.keys(localVarFormParams).length) {
1239
- if (localVarUseFormData) {
1240
- localVarRequestOptions.formData = localVarFormParams;
1241
- }
1242
- else {
1243
- localVarRequestOptions.form = localVarFormParams;
1244
- }
1245
- }
1246
- return new Promise(function (resolve, reject) {
1247
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1248
- if (error) {
1249
- reject(error);
1250
- }
1251
- else {
1252
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1253
- resolve({ response: response, body: body });
1254
- }
1255
- else {
1256
- reject(new apis_1.HttpError(response, body, response.statusCode));
1257
- }
1258
- }
1259
- });
1260
- });
1261
- })];
1262
- });
1263
- });
1264
- };
1265
- OffersApi.prototype.offersControllerSethscode = function (id, account, body, options) {
1266
- if (options === void 0) { options = { headers: {} }; }
1267
- return __awaiter(this, void 0, void 0, function () {
1268
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_18, _i, _a, interceptor;
1269
- var _this = this;
1270
- return __generator(this, function (_b) {
1271
- localVarPath = this.basePath + '/offers/{account}/{id}/hs-code'
1272
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
1273
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1274
- localVarQueryParameters = {};
1275
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1276
- localVarFormParams = {};
1277
- if (id === null || id === undefined) {
1278
- throw new Error('Required parameter id was null or undefined when calling offersControllerSethscode.');
1279
- }
1280
- if (account === null || account === undefined) {
1281
- throw new Error('Required parameter account was null or undefined when calling offersControllerSethscode.');
1282
- }
1283
- if (body === null || body === undefined) {
1284
- throw new Error('Required parameter body was null or undefined when calling offersControllerSethscode.');
1285
- }
1286
- Object.assign(localVarHeaderParams, options.headers);
1287
- localVarUseFormData = false;
1288
- localVarRequestOptions = {
1289
- method: 'PUT',
1290
- qs: localVarQueryParameters,
1291
- headers: localVarHeaderParams,
1292
- uri: localVarPath,
1293
- useQuerystring: this._useQuerystring,
1294
- json: true,
1295
- body: models_1.ObjectSerializer.serialize(body, "object")
1296
- };
1297
- authenticationPromise = Promise.resolve();
1298
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1299
- interceptorPromise = authenticationPromise;
1300
- _loop_18 = function (interceptor) {
1301
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1302
- };
1303
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1304
- interceptor = _a[_i];
1305
- _loop_18(interceptor);
1306
- }
1307
- return [2, interceptorPromise.then(function () {
1308
- if (Object.keys(localVarFormParams).length) {
1309
- if (localVarUseFormData) {
1310
- localVarRequestOptions.formData = localVarFormParams;
1311
- }
1312
- else {
1313
- localVarRequestOptions.form = localVarFormParams;
1314
- }
1315
- }
1316
- return new Promise(function (resolve, reject) {
1317
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1318
- if (error) {
1319
- reject(error);
1320
- }
1321
- else {
1322
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1323
- resolve({ response: response, body: body });
1324
- }
1325
- else {
1326
- reject(new apis_1.HttpError(response, body, response.statusCode));
1327
- }
1328
- }
1329
- });
1330
- });
1331
- })];
1332
- });
1333
- });
1334
- };
1335
- OffersApi.prototype.offersControllerUnlock = function (id, account, options) {
1336
- if (options === void 0) { options = { headers: {} }; }
1337
- return __awaiter(this, void 0, void 0, function () {
1338
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_19, _i, _a, interceptor;
1339
- var _this = this;
1340
- return __generator(this, function (_b) {
1341
- localVarPath = this.basePath + '/offers/{account}/{id}/unlock'
1342
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
1343
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1344
- localVarQueryParameters = {};
1345
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1346
- localVarFormParams = {};
1347
- if (id === null || id === undefined) {
1348
- throw new Error('Required parameter id was null or undefined when calling offersControllerUnlock.');
1349
- }
1350
- if (account === null || account === undefined) {
1351
- throw new Error('Required parameter account was null or undefined when calling offersControllerUnlock.');
1352
- }
1353
- Object.assign(localVarHeaderParams, options.headers);
1354
- localVarUseFormData = false;
1355
- localVarRequestOptions = {
1356
- method: 'PUT',
1357
- qs: localVarQueryParameters,
1358
- headers: localVarHeaderParams,
1359
- uri: localVarPath,
1360
- useQuerystring: this._useQuerystring,
1361
- json: true,
1362
- };
1363
- authenticationPromise = Promise.resolve();
1364
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1365
- interceptorPromise = authenticationPromise;
1366
- _loop_19 = function (interceptor) {
1367
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1368
- };
1369
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1370
- interceptor = _a[_i];
1371
- _loop_19(interceptor);
1372
- }
1373
- return [2, interceptorPromise.then(function () {
1374
- if (Object.keys(localVarFormParams).length) {
1375
- if (localVarUseFormData) {
1376
- localVarRequestOptions.formData = localVarFormParams;
1377
- }
1378
- else {
1379
- localVarRequestOptions.form = localVarFormParams;
1380
- }
1381
- }
1382
- return new Promise(function (resolve, reject) {
1383
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1384
- if (error) {
1385
- reject(error);
1386
- }
1387
- else {
1388
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1389
- resolve({ response: response, body: body });
1390
- }
1391
- else {
1392
- reject(new apis_1.HttpError(response, body, response.statusCode));
1393
- }
1394
- }
1395
- });
1396
- });
1397
- })];
1398
- });
1399
- });
1400
- };
1401
- OffersApi.prototype.offersControllerUpdate = function (id, account, body, options) {
1402
- if (options === void 0) { options = { headers: {} }; }
1403
- return __awaiter(this, void 0, void 0, function () {
1404
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_20, _i, _a, interceptor;
1405
- var _this = this;
1406
- return __generator(this, function (_b) {
1407
- localVarPath = this.basePath + '/offers/{account}/{id}'
1408
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
1409
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1410
- localVarQueryParameters = {};
1411
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1412
- localVarFormParams = {};
1413
- if (id === null || id === undefined) {
1414
- throw new Error('Required parameter id was null or undefined when calling offersControllerUpdate.');
1415
- }
1416
- if (account === null || account === undefined) {
1417
- throw new Error('Required parameter account was null or undefined when calling offersControllerUpdate.');
1418
- }
1419
- if (body === null || body === undefined) {
1420
- throw new Error('Required parameter body was null or undefined when calling offersControllerUpdate.');
1421
- }
1422
- Object.assign(localVarHeaderParams, options.headers);
1423
- localVarUseFormData = false;
1424
- localVarRequestOptions = {
1425
- method: 'PUT',
1426
- qs: localVarQueryParameters,
1427
- headers: localVarHeaderParams,
1428
- uri: localVarPath,
1429
- useQuerystring: this._useQuerystring,
1430
- json: true,
1431
- body: models_1.ObjectSerializer.serialize(body, "object")
1432
- };
1433
- authenticationPromise = Promise.resolve();
1434
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1435
- interceptorPromise = authenticationPromise;
1436
- _loop_20 = function (interceptor) {
1437
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1438
- };
1439
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1440
- interceptor = _a[_i];
1441
- _loop_20(interceptor);
1442
- }
1443
- return [2, interceptorPromise.then(function () {
1444
- if (Object.keys(localVarFormParams).length) {
1445
- if (localVarUseFormData) {
1446
- localVarRequestOptions.formData = localVarFormParams;
1447
- }
1448
- else {
1449
- localVarRequestOptions.form = localVarFormParams;
1450
- }
1451
- }
1452
- return new Promise(function (resolve, reject) {
1453
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1454
- if (error) {
1455
- reject(error);
1456
- }
1457
- else {
1458
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1459
- resolve({ response: response, body: body });
1460
- }
1461
- else {
1462
- reject(new apis_1.HttpError(response, body, response.statusCode));
1463
- }
1464
- }
1465
- });
1466
- });
1467
- })];
1468
- });
1469
- });
1470
- };
1471
- OffersApi.prototype.offersControllerUpdatestatus = function (account, body, options) {
1472
- if (options === void 0) { options = { headers: {} }; }
1473
- return __awaiter(this, void 0, void 0, function () {
1474
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_21, _i, _a, interceptor;
1475
- var _this = this;
1476
- return __generator(this, function (_b) {
1477
- localVarPath = this.basePath + '/offers/{account}/status'
1478
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1479
- localVarQueryParameters = {};
1480
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1481
- localVarFormParams = {};
1482
- if (account === null || account === undefined) {
1483
- throw new Error('Required parameter account was null or undefined when calling offersControllerUpdatestatus.');
1484
- }
1485
- if (body === null || body === undefined) {
1486
- throw new Error('Required parameter body was null or undefined when calling offersControllerUpdatestatus.');
1487
- }
1488
- Object.assign(localVarHeaderParams, options.headers);
1489
- localVarUseFormData = false;
1490
- localVarRequestOptions = {
1491
- method: 'PUT',
1492
- qs: localVarQueryParameters,
1493
- headers: localVarHeaderParams,
1494
- uri: localVarPath,
1495
- useQuerystring: this._useQuerystring,
1496
- json: true,
1497
- body: models_1.ObjectSerializer.serialize(body, "object")
1498
- };
1499
- authenticationPromise = Promise.resolve();
1500
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1501
- interceptorPromise = authenticationPromise;
1502
- _loop_21 = function (interceptor) {
1503
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1504
- };
1505
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1506
- interceptor = _a[_i];
1507
- _loop_21(interceptor);
1508
- }
1509
- return [2, interceptorPromise.then(function () {
1510
- if (Object.keys(localVarFormParams).length) {
1511
- if (localVarUseFormData) {
1512
- localVarRequestOptions.formData = localVarFormParams;
1513
- }
1514
- else {
1515
- localVarRequestOptions.form = localVarFormParams;
1516
- }
1517
- }
1518
- return new Promise(function (resolve, reject) {
1519
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1520
- if (error) {
1521
- reject(error);
1522
- }
1523
- else {
1524
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1525
- resolve({ response: response, body: body });
1526
- }
1527
- else {
1528
- reject(new apis_1.HttpError(response, body, response.statusCode));
1529
- }
1530
- }
1531
- });
1532
- });
1533
- })];
1534
- });
1535
- });
1536
- };
1537
- OffersApi.prototype.offersControllerValidatestatus = function (account, body, options) {
1538
- if (options === void 0) { options = { headers: {} }; }
1539
- return __awaiter(this, void 0, void 0, function () {
1540
- var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_22, _i, _a, interceptor;
1541
- var _this = this;
1542
- return __generator(this, function (_b) {
1543
- localVarPath = this.basePath + '/offers/{account}/status/validate'
1544
- .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1545
- localVarQueryParameters = {};
1546
- localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1547
- localVarFormParams = {};
1548
- if (account === null || account === undefined) {
1549
- throw new Error('Required parameter account was null or undefined when calling offersControllerValidatestatus.');
1550
- }
1551
- if (body === null || body === undefined) {
1552
- throw new Error('Required parameter body was null or undefined when calling offersControllerValidatestatus.');
1553
- }
1554
- Object.assign(localVarHeaderParams, options.headers);
1555
- localVarUseFormData = false;
1556
- localVarRequestOptions = {
1557
- method: 'POST',
1558
- qs: localVarQueryParameters,
1559
- headers: localVarHeaderParams,
1560
- uri: localVarPath,
1561
- useQuerystring: this._useQuerystring,
1562
- json: true,
1563
- body: models_1.ObjectSerializer.serialize(body, "object")
1564
- };
1565
- authenticationPromise = Promise.resolve();
1566
- authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1567
- interceptorPromise = authenticationPromise;
1568
- _loop_22 = function (interceptor) {
1569
- interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1570
- };
1571
- for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1572
- interceptor = _a[_i];
1573
- _loop_22(interceptor);
1574
- }
1575
- return [2, interceptorPromise.then(function () {
1576
- if (Object.keys(localVarFormParams).length) {
1577
- if (localVarUseFormData) {
1578
- localVarRequestOptions.formData = localVarFormParams;
1579
- }
1580
- else {
1581
- localVarRequestOptions.form = localVarFormParams;
1582
- }
1583
- }
1584
- return new Promise(function (resolve, reject) {
1585
- (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1586
- if (error) {
1587
- reject(error);
1588
- }
1589
- else {
1590
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1591
- resolve({ response: response, body: body });
1592
- }
1593
- else {
1594
- reject(new apis_1.HttpError(response, body, response.statusCode));
1595
- }
1596
- }
1597
- });
1598
- });
1599
- })];
1600
- });
1601
- });
1602
- };
1603
- return OffersApi;
1604
- }());
1605
- exports.OffersApi = OffersApi;
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.OffersApi = exports.OffersApiApiKeys = 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 OffersApiApiKeys;
48
+ (function (OffersApiApiKeys) {
49
+ })(OffersApiApiKeys = exports.OffersApiApiKeys || (exports.OffersApiApiKeys = {}));
50
+ var OffersApi = (function () {
51
+ function OffersApi(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(OffersApi.prototype, "useQuerystring", {
71
+ set: function (value) {
72
+ this._useQuerystring = value;
73
+ },
74
+ enumerable: false,
75
+ configurable: true
76
+ });
77
+ Object.defineProperty(OffersApi.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(OffersApi.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
+ OffersApi.prototype.setDefaultAuthentication = function (auth) {
98
+ this.authentications.default = auth;
99
+ };
100
+ OffersApi.prototype.setApiKey = function (key, value) {
101
+ this.authentications[OffersApiApiKeys[key]].apiKey = value;
102
+ };
103
+ OffersApi.prototype.addInterceptor = function (interceptor) {
104
+ this.interceptors.push(interceptor);
105
+ };
106
+ OffersApi.prototype.offersControllerAddmatchedbuyertooffer = function (id, buyer, account, options) {
107
+ if (options === void 0) { options = { headers: {} }; }
108
+ return __awaiter(this, void 0, void 0, function () {
109
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_1, _i, _a, interceptor;
110
+ var _this = this;
111
+ return __generator(this, function (_b) {
112
+ localVarPath = this.basePath + '/offers/{account}/{id}/matched-buyer/{buyer}/add'
113
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
114
+ .replace('{' + 'buyer' + '}', encodeURIComponent(String(buyer)))
115
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
116
+ localVarQueryParameters = {};
117
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
118
+ localVarFormParams = {};
119
+ if (id === null || id === undefined) {
120
+ throw new Error('Required parameter id was null or undefined when calling offersControllerAddmatchedbuyertooffer.');
121
+ }
122
+ if (buyer === null || buyer === undefined) {
123
+ throw new Error('Required parameter buyer was null or undefined when calling offersControllerAddmatchedbuyertooffer.');
124
+ }
125
+ if (account === null || account === undefined) {
126
+ throw new Error('Required parameter account was null or undefined when calling offersControllerAddmatchedbuyertooffer.');
127
+ }
128
+ Object.assign(localVarHeaderParams, options.headers);
129
+ localVarUseFormData = false;
130
+ localVarRequestOptions = {
131
+ method: 'PUT',
132
+ qs: localVarQueryParameters,
133
+ headers: localVarHeaderParams,
134
+ uri: localVarPath,
135
+ useQuerystring: this._useQuerystring,
136
+ json: true,
137
+ };
138
+ authenticationPromise = Promise.resolve();
139
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
140
+ interceptorPromise = authenticationPromise;
141
+ _loop_1 = function (interceptor) {
142
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
143
+ };
144
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
145
+ interceptor = _a[_i];
146
+ _loop_1(interceptor);
147
+ }
148
+ return [2, interceptorPromise.then(function () {
149
+ if (Object.keys(localVarFormParams).length) {
150
+ if (localVarUseFormData) {
151
+ localVarRequestOptions.formData = localVarFormParams;
152
+ }
153
+ else {
154
+ localVarRequestOptions.form = localVarFormParams;
155
+ }
156
+ }
157
+ return new Promise(function (resolve, reject) {
158
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
159
+ if (error) {
160
+ reject(error);
161
+ }
162
+ else {
163
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
164
+ resolve({ response: response, body: body });
165
+ }
166
+ else {
167
+ reject(new apis_1.HttpError(response, body, response.statusCode));
168
+ }
169
+ }
170
+ });
171
+ });
172
+ })];
173
+ });
174
+ });
175
+ };
176
+ OffersApi.prototype.offersControllerAddnote = function (id, account, body, options) {
177
+ if (options === void 0) { options = { headers: {} }; }
178
+ return __awaiter(this, void 0, void 0, function () {
179
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_2, _i, _a, interceptor;
180
+ var _this = this;
181
+ return __generator(this, function (_b) {
182
+ localVarPath = this.basePath + '/offers/{account}/{id}/notes'
183
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
184
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
185
+ localVarQueryParameters = {};
186
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
187
+ localVarFormParams = {};
188
+ if (id === null || id === undefined) {
189
+ throw new Error('Required parameter id was null or undefined when calling offersControllerAddnote.');
190
+ }
191
+ if (account === null || account === undefined) {
192
+ throw new Error('Required parameter account was null or undefined when calling offersControllerAddnote.');
193
+ }
194
+ if (body === null || body === undefined) {
195
+ throw new Error('Required parameter body was null or undefined when calling offersControllerAddnote.');
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
+ OffersApi.prototype.offersControllerAttachclones = function (id, account, body, 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 + '/offers/{account}/{id}/clones/add'
253
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
254
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
255
+ localVarQueryParameters = {};
256
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
257
+ localVarFormParams = {};
258
+ if (id === null || id === undefined) {
259
+ throw new Error('Required parameter id was null or undefined when calling offersControllerAttachclones.');
260
+ }
261
+ if (account === null || account === undefined) {
262
+ throw new Error('Required parameter account was null or undefined when calling offersControllerAttachclones.');
263
+ }
264
+ if (body === null || body === undefined) {
265
+ throw new Error('Required parameter body was null or undefined when calling offersControllerAttachclones.');
266
+ }
267
+ Object.assign(localVarHeaderParams, options.headers);
268
+ localVarUseFormData = false;
269
+ localVarRequestOptions = {
270
+ method: 'PUT',
271
+ qs: localVarQueryParameters,
272
+ headers: localVarHeaderParams,
273
+ uri: localVarPath,
274
+ useQuerystring: this._useQuerystring,
275
+ json: true,
276
+ body: models_1.ObjectSerializer.serialize(body, "object")
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
+ OffersApi.prototype.offersControllerAttachmatchedoffers = function (id, account, 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 + '/offers/{account}/{id}/matched-offers/add'
323
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
324
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
325
+ localVarQueryParameters = {};
326
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
327
+ localVarFormParams = {};
328
+ if (id === null || id === undefined) {
329
+ throw new Error('Required parameter id was null or undefined when calling offersControllerAttachmatchedoffers.');
330
+ }
331
+ if (account === null || account === undefined) {
332
+ throw new Error('Required parameter account was null or undefined when calling offersControllerAttachmatchedoffers.');
333
+ }
334
+ if (body === null || body === undefined) {
335
+ throw new Error('Required parameter body was null or undefined when calling offersControllerAttachmatchedoffers.');
336
+ }
337
+ Object.assign(localVarHeaderParams, options.headers);
338
+ localVarUseFormData = false;
339
+ localVarRequestOptions = {
340
+ method: 'PUT',
341
+ qs: localVarQueryParameters,
342
+ headers: localVarHeaderParams,
343
+ uri: localVarPath,
344
+ useQuerystring: this._useQuerystring,
345
+ json: true,
346
+ body: models_1.ObjectSerializer.serialize(body, "object")
347
+ };
348
+ authenticationPromise = Promise.resolve();
349
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
350
+ interceptorPromise = authenticationPromise;
351
+ _loop_4 = function (interceptor) {
352
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
353
+ };
354
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
355
+ interceptor = _a[_i];
356
+ _loop_4(interceptor);
357
+ }
358
+ return [2, interceptorPromise.then(function () {
359
+ if (Object.keys(localVarFormParams).length) {
360
+ if (localVarUseFormData) {
361
+ localVarRequestOptions.formData = localVarFormParams;
362
+ }
363
+ else {
364
+ localVarRequestOptions.form = localVarFormParams;
365
+ }
366
+ }
367
+ return new Promise(function (resolve, reject) {
368
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
369
+ if (error) {
370
+ reject(error);
371
+ }
372
+ else {
373
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
374
+ resolve({ response: response, body: body });
375
+ }
376
+ else {
377
+ reject(new apis_1.HttpError(response, body, response.statusCode));
378
+ }
379
+ }
380
+ });
381
+ });
382
+ })];
383
+ });
384
+ });
385
+ };
386
+ OffersApi.prototype.offersControllerCancel = function (account, body, options) {
387
+ if (options === void 0) { options = { headers: {} }; }
388
+ return __awaiter(this, void 0, void 0, function () {
389
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_5, _i, _a, interceptor;
390
+ var _this = this;
391
+ return __generator(this, function (_b) {
392
+ localVarPath = this.basePath + '/offers/{account}/cancel'
393
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
394
+ localVarQueryParameters = {};
395
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
396
+ localVarFormParams = {};
397
+ if (account === null || account === undefined) {
398
+ throw new Error('Required parameter account was null or undefined when calling offersControllerCancel.');
399
+ }
400
+ if (body === null || body === undefined) {
401
+ throw new Error('Required parameter body was null or undefined when calling offersControllerCancel.');
402
+ }
403
+ Object.assign(localVarHeaderParams, options.headers);
404
+ localVarUseFormData = false;
405
+ localVarRequestOptions = {
406
+ method: 'PUT',
407
+ qs: localVarQueryParameters,
408
+ headers: localVarHeaderParams,
409
+ uri: localVarPath,
410
+ useQuerystring: this._useQuerystring,
411
+ json: true,
412
+ body: models_1.ObjectSerializer.serialize(body, "object")
413
+ };
414
+ authenticationPromise = Promise.resolve();
415
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
416
+ interceptorPromise = authenticationPromise;
417
+ _loop_5 = function (interceptor) {
418
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
419
+ };
420
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
421
+ interceptor = _a[_i];
422
+ _loop_5(interceptor);
423
+ }
424
+ return [2, interceptorPromise.then(function () {
425
+ if (Object.keys(localVarFormParams).length) {
426
+ if (localVarUseFormData) {
427
+ localVarRequestOptions.formData = localVarFormParams;
428
+ }
429
+ else {
430
+ localVarRequestOptions.form = localVarFormParams;
431
+ }
432
+ }
433
+ return new Promise(function (resolve, reject) {
434
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
435
+ if (error) {
436
+ reject(error);
437
+ }
438
+ else {
439
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
440
+ resolve({ response: response, body: body });
441
+ }
442
+ else {
443
+ reject(new apis_1.HttpError(response, body, response.statusCode));
444
+ }
445
+ }
446
+ });
447
+ });
448
+ })];
449
+ });
450
+ });
451
+ };
452
+ OffersApi.prototype.offersControllerCountsbystatus = function (account, options) {
453
+ if (options === void 0) { options = { headers: {} }; }
454
+ return __awaiter(this, void 0, void 0, function () {
455
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_6, _i, _a, interceptor;
456
+ var _this = this;
457
+ return __generator(this, function (_b) {
458
+ localVarPath = this.basePath + '/offers/{account}/counts-by-status'
459
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
460
+ localVarQueryParameters = {};
461
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
462
+ localVarFormParams = {};
463
+ if (account === null || account === undefined) {
464
+ throw new Error('Required parameter account was null or undefined when calling offersControllerCountsbystatus.');
465
+ }
466
+ Object.assign(localVarHeaderParams, options.headers);
467
+ localVarUseFormData = false;
468
+ localVarRequestOptions = {
469
+ method: 'GET',
470
+ qs: localVarQueryParameters,
471
+ headers: localVarHeaderParams,
472
+ uri: localVarPath,
473
+ useQuerystring: this._useQuerystring,
474
+ json: true,
475
+ };
476
+ authenticationPromise = Promise.resolve();
477
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
478
+ interceptorPromise = authenticationPromise;
479
+ _loop_6 = function (interceptor) {
480
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
481
+ };
482
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
483
+ interceptor = _a[_i];
484
+ _loop_6(interceptor);
485
+ }
486
+ return [2, interceptorPromise.then(function () {
487
+ if (Object.keys(localVarFormParams).length) {
488
+ if (localVarUseFormData) {
489
+ localVarRequestOptions.formData = localVarFormParams;
490
+ }
491
+ else {
492
+ localVarRequestOptions.form = localVarFormParams;
493
+ }
494
+ }
495
+ return new Promise(function (resolve, reject) {
496
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
497
+ if (error) {
498
+ reject(error);
499
+ }
500
+ else {
501
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
502
+ resolve({ response: response, body: body });
503
+ }
504
+ else {
505
+ reject(new apis_1.HttpError(response, body, response.statusCode));
506
+ }
507
+ }
508
+ });
509
+ });
510
+ })];
511
+ });
512
+ });
513
+ };
514
+ OffersApi.prototype.offersControllerCreate = function (account, createOfferDto, options) {
515
+ if (options === void 0) { options = { headers: {} }; }
516
+ return __awaiter(this, void 0, void 0, function () {
517
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_7, _i, _a, interceptor;
518
+ var _this = this;
519
+ return __generator(this, function (_b) {
520
+ localVarPath = this.basePath + '/offers/{account}'
521
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
522
+ localVarQueryParameters = {};
523
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
524
+ localVarFormParams = {};
525
+ if (account === null || account === undefined) {
526
+ throw new Error('Required parameter account was null or undefined when calling offersControllerCreate.');
527
+ }
528
+ if (createOfferDto === null || createOfferDto === undefined) {
529
+ throw new Error('Required parameter createOfferDto was null or undefined when calling offersControllerCreate.');
530
+ }
531
+ Object.assign(localVarHeaderParams, options.headers);
532
+ localVarUseFormData = false;
533
+ localVarRequestOptions = {
534
+ method: 'POST',
535
+ qs: localVarQueryParameters,
536
+ headers: localVarHeaderParams,
537
+ uri: localVarPath,
538
+ useQuerystring: this._useQuerystring,
539
+ json: true,
540
+ body: models_1.ObjectSerializer.serialize(createOfferDto, "CreateOfferDto")
541
+ };
542
+ authenticationPromise = Promise.resolve();
543
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
544
+ interceptorPromise = authenticationPromise;
545
+ _loop_7 = function (interceptor) {
546
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
547
+ };
548
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
549
+ interceptor = _a[_i];
550
+ _loop_7(interceptor);
551
+ }
552
+ return [2, interceptorPromise.then(function () {
553
+ if (Object.keys(localVarFormParams).length) {
554
+ if (localVarUseFormData) {
555
+ localVarRequestOptions.formData = localVarFormParams;
556
+ }
557
+ else {
558
+ localVarRequestOptions.form = localVarFormParams;
559
+ }
560
+ }
561
+ return new Promise(function (resolve, reject) {
562
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
563
+ if (error) {
564
+ reject(error);
565
+ }
566
+ else {
567
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
568
+ resolve({ response: response, body: body });
569
+ }
570
+ else {
571
+ reject(new apis_1.HttpError(response, body, response.statusCode));
572
+ }
573
+ }
574
+ });
575
+ });
576
+ })];
577
+ });
578
+ });
579
+ };
580
+ OffersApi.prototype.offersControllerCreatebulk = function (account, createOfferDto, options) {
581
+ if (options === void 0) { options = { headers: {} }; }
582
+ return __awaiter(this, void 0, void 0, function () {
583
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_8, _i, _a, interceptor;
584
+ var _this = this;
585
+ return __generator(this, function (_b) {
586
+ localVarPath = this.basePath + '/offers/{account}/bulk'
587
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
588
+ localVarQueryParameters = {};
589
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
590
+ localVarFormParams = {};
591
+ if (account === null || account === undefined) {
592
+ throw new Error('Required parameter account was null or undefined when calling offersControllerCreatebulk.');
593
+ }
594
+ if (createOfferDto === null || createOfferDto === undefined) {
595
+ throw new Error('Required parameter createOfferDto was null or undefined when calling offersControllerCreatebulk.');
596
+ }
597
+ Object.assign(localVarHeaderParams, options.headers);
598
+ localVarUseFormData = false;
599
+ localVarRequestOptions = {
600
+ method: 'POST',
601
+ qs: localVarQueryParameters,
602
+ headers: localVarHeaderParams,
603
+ uri: localVarPath,
604
+ useQuerystring: this._useQuerystring,
605
+ json: true,
606
+ body: models_1.ObjectSerializer.serialize(createOfferDto, "Array<CreateOfferDto>")
607
+ };
608
+ authenticationPromise = Promise.resolve();
609
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
610
+ interceptorPromise = authenticationPromise;
611
+ _loop_8 = function (interceptor) {
612
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
613
+ };
614
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
615
+ interceptor = _a[_i];
616
+ _loop_8(interceptor);
617
+ }
618
+ return [2, interceptorPromise.then(function () {
619
+ if (Object.keys(localVarFormParams).length) {
620
+ if (localVarUseFormData) {
621
+ localVarRequestOptions.formData = localVarFormParams;
622
+ }
623
+ else {
624
+ localVarRequestOptions.form = localVarFormParams;
625
+ }
626
+ }
627
+ return new Promise(function (resolve, reject) {
628
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
629
+ if (error) {
630
+ reject(error);
631
+ }
632
+ else {
633
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
634
+ resolve({ response: response, body: body });
635
+ }
636
+ else {
637
+ reject(new apis_1.HttpError(response, body, response.statusCode));
638
+ }
639
+ }
640
+ });
641
+ });
642
+ })];
643
+ });
644
+ });
645
+ };
646
+ OffersApi.prototype.offersControllerDeletebatch = function (account, body, options) {
647
+ if (options === void 0) { options = { headers: {} }; }
648
+ return __awaiter(this, void 0, void 0, function () {
649
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_9, _i, _a, interceptor;
650
+ var _this = this;
651
+ return __generator(this, function (_b) {
652
+ localVarPath = this.basePath + '/offers/{account}'
653
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
654
+ localVarQueryParameters = {};
655
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
656
+ localVarFormParams = {};
657
+ if (account === null || account === undefined) {
658
+ throw new Error('Required parameter account was null or undefined when calling offersControllerDeletebatch.');
659
+ }
660
+ if (body === null || body === undefined) {
661
+ throw new Error('Required parameter body was null or undefined when calling offersControllerDeletebatch.');
662
+ }
663
+ Object.assign(localVarHeaderParams, options.headers);
664
+ localVarUseFormData = false;
665
+ localVarRequestOptions = {
666
+ method: 'DELETE',
667
+ qs: localVarQueryParameters,
668
+ headers: localVarHeaderParams,
669
+ uri: localVarPath,
670
+ useQuerystring: this._useQuerystring,
671
+ json: true,
672
+ body: models_1.ObjectSerializer.serialize(body, "object")
673
+ };
674
+ authenticationPromise = Promise.resolve();
675
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
676
+ interceptorPromise = authenticationPromise;
677
+ _loop_9 = function (interceptor) {
678
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
679
+ };
680
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
681
+ interceptor = _a[_i];
682
+ _loop_9(interceptor);
683
+ }
684
+ return [2, interceptorPromise.then(function () {
685
+ if (Object.keys(localVarFormParams).length) {
686
+ if (localVarUseFormData) {
687
+ localVarRequestOptions.formData = localVarFormParams;
688
+ }
689
+ else {
690
+ localVarRequestOptions.form = localVarFormParams;
691
+ }
692
+ }
693
+ return new Promise(function (resolve, reject) {
694
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
695
+ if (error) {
696
+ reject(error);
697
+ }
698
+ else {
699
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
700
+ resolve({ response: response, body: body });
701
+ }
702
+ else {
703
+ reject(new apis_1.HttpError(response, body, response.statusCode));
704
+ }
705
+ }
706
+ });
707
+ });
708
+ })];
709
+ });
710
+ });
711
+ };
712
+ OffersApi.prototype.offersControllerFilter = function (account, skip, limit, sort, fields, body, options) {
713
+ if (options === void 0) { options = { headers: {} }; }
714
+ return __awaiter(this, void 0, void 0, function () {
715
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_10, _i, _a, interceptor;
716
+ var _this = this;
717
+ return __generator(this, function (_b) {
718
+ localVarPath = this.basePath + '/offers/{account}/search'
719
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
720
+ localVarQueryParameters = {};
721
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
722
+ localVarFormParams = {};
723
+ if (account === null || account === undefined) {
724
+ throw new Error('Required parameter account was null or undefined when calling offersControllerFilter.');
725
+ }
726
+ if (skip !== undefined) {
727
+ localVarQueryParameters['skip'] = models_1.ObjectSerializer.serialize(skip, "number");
728
+ }
729
+ if (limit !== undefined) {
730
+ localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number");
731
+ }
732
+ if (sort !== undefined) {
733
+ localVarQueryParameters['sort'] = models_1.ObjectSerializer.serialize(sort, "string");
734
+ }
735
+ if (fields !== undefined) {
736
+ localVarQueryParameters['fields'] = models_1.ObjectSerializer.serialize(fields, "Array<string>");
737
+ }
738
+ Object.assign(localVarHeaderParams, options.headers);
739
+ localVarUseFormData = false;
740
+ localVarRequestOptions = {
741
+ method: 'POST',
742
+ qs: localVarQueryParameters,
743
+ headers: localVarHeaderParams,
744
+ uri: localVarPath,
745
+ useQuerystring: this._useQuerystring,
746
+ json: true,
747
+ body: models_1.ObjectSerializer.serialize(body, "object")
748
+ };
749
+ authenticationPromise = Promise.resolve();
750
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
751
+ interceptorPromise = authenticationPromise;
752
+ _loop_10 = function (interceptor) {
753
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
754
+ };
755
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
756
+ interceptor = _a[_i];
757
+ _loop_10(interceptor);
758
+ }
759
+ return [2, interceptorPromise.then(function () {
760
+ if (Object.keys(localVarFormParams).length) {
761
+ if (localVarUseFormData) {
762
+ localVarRequestOptions.formData = localVarFormParams;
763
+ }
764
+ else {
765
+ localVarRequestOptions.form = localVarFormParams;
766
+ }
767
+ }
768
+ return new Promise(function (resolve, reject) {
769
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
770
+ if (error) {
771
+ reject(error);
772
+ }
773
+ else {
774
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
775
+ resolve({ response: response, body: body });
776
+ }
777
+ else {
778
+ reject(new apis_1.HttpError(response, body, response.statusCode));
779
+ }
780
+ }
781
+ });
782
+ });
783
+ })];
784
+ });
785
+ });
786
+ };
787
+ OffersApi.prototype.offersControllerFindall = function (account, createOfferDto, skip, limit, sort, fields, options) {
788
+ if (options === void 0) { options = { headers: {} }; }
789
+ return __awaiter(this, void 0, void 0, function () {
790
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_11, _i, _a, interceptor;
791
+ var _this = this;
792
+ return __generator(this, function (_b) {
793
+ localVarPath = this.basePath + '/offers/{account}'
794
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
795
+ localVarQueryParameters = {};
796
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
797
+ localVarFormParams = {};
798
+ if (account === null || account === undefined) {
799
+ throw new Error('Required parameter account was null or undefined when calling offersControllerFindall.');
800
+ }
801
+ if (createOfferDto === null || createOfferDto === undefined) {
802
+ throw new Error('Required parameter createOfferDto was null or undefined when calling offersControllerFindall.');
803
+ }
804
+ if (skip !== undefined) {
805
+ localVarQueryParameters['skip'] = models_1.ObjectSerializer.serialize(skip, "number");
806
+ }
807
+ if (limit !== undefined) {
808
+ localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number");
809
+ }
810
+ if (sort !== undefined) {
811
+ localVarQueryParameters['sort'] = models_1.ObjectSerializer.serialize(sort, "string");
812
+ }
813
+ if (fields !== undefined) {
814
+ localVarQueryParameters['fields'] = models_1.ObjectSerializer.serialize(fields, "Array<string>");
815
+ }
816
+ Object.assign(localVarHeaderParams, options.headers);
817
+ localVarUseFormData = false;
818
+ localVarRequestOptions = {
819
+ method: 'GET',
820
+ qs: localVarQueryParameters,
821
+ headers: localVarHeaderParams,
822
+ uri: localVarPath,
823
+ useQuerystring: this._useQuerystring,
824
+ json: true,
825
+ body: models_1.ObjectSerializer.serialize(createOfferDto, "CreateOfferDto")
826
+ };
827
+ authenticationPromise = Promise.resolve();
828
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
829
+ interceptorPromise = authenticationPromise;
830
+ _loop_11 = function (interceptor) {
831
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
832
+ };
833
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
834
+ interceptor = _a[_i];
835
+ _loop_11(interceptor);
836
+ }
837
+ return [2, interceptorPromise.then(function () {
838
+ if (Object.keys(localVarFormParams).length) {
839
+ if (localVarUseFormData) {
840
+ localVarRequestOptions.formData = localVarFormParams;
841
+ }
842
+ else {
843
+ localVarRequestOptions.form = localVarFormParams;
844
+ }
845
+ }
846
+ return new Promise(function (resolve, reject) {
847
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
848
+ if (error) {
849
+ reject(error);
850
+ }
851
+ else {
852
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
853
+ resolve({ response: response, body: body });
854
+ }
855
+ else {
856
+ reject(new apis_1.HttpError(response, body, response.statusCode));
857
+ }
858
+ }
859
+ });
860
+ });
861
+ })];
862
+ });
863
+ });
864
+ };
865
+ OffersApi.prototype.offersControllerFindcountries = function (account, options) {
866
+ if (options === void 0) { options = { headers: {} }; }
867
+ return __awaiter(this, void 0, void 0, function () {
868
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_12, _i, _a, interceptor;
869
+ var _this = this;
870
+ return __generator(this, function (_b) {
871
+ localVarPath = this.basePath + '/offers/{account}/countries'
872
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
873
+ localVarQueryParameters = {};
874
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
875
+ localVarFormParams = {};
876
+ if (account === null || account === undefined) {
877
+ throw new Error('Required parameter account was null or undefined when calling offersControllerFindcountries.');
878
+ }
879
+ Object.assign(localVarHeaderParams, options.headers);
880
+ localVarUseFormData = false;
881
+ localVarRequestOptions = {
882
+ method: 'GET',
883
+ qs: localVarQueryParameters,
884
+ headers: localVarHeaderParams,
885
+ uri: localVarPath,
886
+ useQuerystring: this._useQuerystring,
887
+ json: true,
888
+ };
889
+ authenticationPromise = Promise.resolve();
890
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
891
+ interceptorPromise = authenticationPromise;
892
+ _loop_12 = function (interceptor) {
893
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
894
+ };
895
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
896
+ interceptor = _a[_i];
897
+ _loop_12(interceptor);
898
+ }
899
+ return [2, interceptorPromise.then(function () {
900
+ if (Object.keys(localVarFormParams).length) {
901
+ if (localVarUseFormData) {
902
+ localVarRequestOptions.formData = localVarFormParams;
903
+ }
904
+ else {
905
+ localVarRequestOptions.form = localVarFormParams;
906
+ }
907
+ }
908
+ return new Promise(function (resolve, reject) {
909
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
910
+ if (error) {
911
+ reject(error);
912
+ }
913
+ else {
914
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
915
+ resolve({ response: response, body: body });
916
+ }
917
+ else {
918
+ reject(new apis_1.HttpError(response, body, response.statusCode));
919
+ }
920
+ }
921
+ });
922
+ });
923
+ })];
924
+ });
925
+ });
926
+ };
927
+ OffersApi.prototype.offersControllerFindone = function (id, account, fields, options) {
928
+ if (options === void 0) { options = { headers: {} }; }
929
+ return __awaiter(this, void 0, void 0, function () {
930
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_13, _i, _a, interceptor;
931
+ var _this = this;
932
+ return __generator(this, function (_b) {
933
+ localVarPath = this.basePath + '/offers/{account}/{id}'
934
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
935
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
936
+ localVarQueryParameters = {};
937
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
938
+ localVarFormParams = {};
939
+ if (id === null || id === undefined) {
940
+ throw new Error('Required parameter id was null or undefined when calling offersControllerFindone.');
941
+ }
942
+ if (account === null || account === undefined) {
943
+ throw new Error('Required parameter account was null or undefined when calling offersControllerFindone.');
944
+ }
945
+ if (fields !== undefined) {
946
+ localVarQueryParameters['fields'] = models_1.ObjectSerializer.serialize(fields, "string");
947
+ }
948
+ Object.assign(localVarHeaderParams, options.headers);
949
+ localVarUseFormData = false;
950
+ localVarRequestOptions = {
951
+ method: 'GET',
952
+ qs: localVarQueryParameters,
953
+ headers: localVarHeaderParams,
954
+ uri: localVarPath,
955
+ useQuerystring: this._useQuerystring,
956
+ json: true,
957
+ };
958
+ authenticationPromise = Promise.resolve();
959
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
960
+ interceptorPromise = authenticationPromise;
961
+ _loop_13 = function (interceptor) {
962
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
963
+ };
964
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
965
+ interceptor = _a[_i];
966
+ _loop_13(interceptor);
967
+ }
968
+ return [2, interceptorPromise.then(function () {
969
+ if (Object.keys(localVarFormParams).length) {
970
+ if (localVarUseFormData) {
971
+ localVarRequestOptions.formData = localVarFormParams;
972
+ }
973
+ else {
974
+ localVarRequestOptions.form = localVarFormParams;
975
+ }
976
+ }
977
+ return new Promise(function (resolve, reject) {
978
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
979
+ if (error) {
980
+ reject(error);
981
+ }
982
+ else {
983
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
984
+ resolve({ response: response, body: body });
985
+ }
986
+ else {
987
+ reject(new apis_1.HttpError(response, body, response.statusCode));
988
+ }
989
+ }
990
+ });
991
+ });
992
+ })];
993
+ });
994
+ });
995
+ };
996
+ OffersApi.prototype.offersControllerLock = function (id, account, body, options) {
997
+ if (options === void 0) { options = { headers: {} }; }
998
+ return __awaiter(this, void 0, void 0, function () {
999
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_14, _i, _a, interceptor;
1000
+ var _this = this;
1001
+ return __generator(this, function (_b) {
1002
+ localVarPath = this.basePath + '/offers/{account}/{id}/lock'
1003
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
1004
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1005
+ localVarQueryParameters = {};
1006
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1007
+ localVarFormParams = {};
1008
+ if (id === null || id === undefined) {
1009
+ throw new Error('Required parameter id was null or undefined when calling offersControllerLock.');
1010
+ }
1011
+ if (account === null || account === undefined) {
1012
+ throw new Error('Required parameter account was null or undefined when calling offersControllerLock.');
1013
+ }
1014
+ Object.assign(localVarHeaderParams, options.headers);
1015
+ localVarUseFormData = false;
1016
+ localVarRequestOptions = {
1017
+ method: 'PUT',
1018
+ qs: localVarQueryParameters,
1019
+ headers: localVarHeaderParams,
1020
+ uri: localVarPath,
1021
+ useQuerystring: this._useQuerystring,
1022
+ json: true,
1023
+ body: models_1.ObjectSerializer.serialize(body, "object")
1024
+ };
1025
+ authenticationPromise = Promise.resolve();
1026
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1027
+ interceptorPromise = authenticationPromise;
1028
+ _loop_14 = function (interceptor) {
1029
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1030
+ };
1031
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1032
+ interceptor = _a[_i];
1033
+ _loop_14(interceptor);
1034
+ }
1035
+ return [2, interceptorPromise.then(function () {
1036
+ if (Object.keys(localVarFormParams).length) {
1037
+ if (localVarUseFormData) {
1038
+ localVarRequestOptions.formData = localVarFormParams;
1039
+ }
1040
+ else {
1041
+ localVarRequestOptions.form = localVarFormParams;
1042
+ }
1043
+ }
1044
+ return new Promise(function (resolve, reject) {
1045
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1046
+ if (error) {
1047
+ reject(error);
1048
+ }
1049
+ else {
1050
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1051
+ resolve({ response: response, body: body });
1052
+ }
1053
+ else {
1054
+ reject(new apis_1.HttpError(response, body, response.statusCode));
1055
+ }
1056
+ }
1057
+ });
1058
+ });
1059
+ })];
1060
+ });
1061
+ });
1062
+ };
1063
+ OffersApi.prototype.offersControllerReload = function (id, account, options) {
1064
+ if (options === void 0) { options = { headers: {} }; }
1065
+ return __awaiter(this, void 0, void 0, function () {
1066
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_15, _i, _a, interceptor;
1067
+ var _this = this;
1068
+ return __generator(this, function (_b) {
1069
+ localVarPath = this.basePath + '/offers/{account}/{id}/reload'
1070
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
1071
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1072
+ localVarQueryParameters = {};
1073
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1074
+ localVarFormParams = {};
1075
+ if (id === null || id === undefined) {
1076
+ throw new Error('Required parameter id was null or undefined when calling offersControllerReload.');
1077
+ }
1078
+ if (account === null || account === undefined) {
1079
+ throw new Error('Required parameter account was null or undefined when calling offersControllerReload.');
1080
+ }
1081
+ Object.assign(localVarHeaderParams, options.headers);
1082
+ localVarUseFormData = false;
1083
+ localVarRequestOptions = {
1084
+ method: 'POST',
1085
+ qs: localVarQueryParameters,
1086
+ headers: localVarHeaderParams,
1087
+ uri: localVarPath,
1088
+ useQuerystring: this._useQuerystring,
1089
+ json: true,
1090
+ };
1091
+ authenticationPromise = Promise.resolve();
1092
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1093
+ interceptorPromise = authenticationPromise;
1094
+ _loop_15 = function (interceptor) {
1095
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1096
+ };
1097
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1098
+ interceptor = _a[_i];
1099
+ _loop_15(interceptor);
1100
+ }
1101
+ return [2, interceptorPromise.then(function () {
1102
+ if (Object.keys(localVarFormParams).length) {
1103
+ if (localVarUseFormData) {
1104
+ localVarRequestOptions.formData = localVarFormParams;
1105
+ }
1106
+ else {
1107
+ localVarRequestOptions.form = localVarFormParams;
1108
+ }
1109
+ }
1110
+ return new Promise(function (resolve, reject) {
1111
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1112
+ if (error) {
1113
+ reject(error);
1114
+ }
1115
+ else {
1116
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1117
+ resolve({ response: response, body: body });
1118
+ }
1119
+ else {
1120
+ reject(new apis_1.HttpError(response, body, response.statusCode));
1121
+ }
1122
+ }
1123
+ });
1124
+ });
1125
+ })];
1126
+ });
1127
+ });
1128
+ };
1129
+ OffersApi.prototype.offersControllerRemove = function (id, account, options) {
1130
+ if (options === void 0) { options = { headers: {} }; }
1131
+ return __awaiter(this, void 0, void 0, function () {
1132
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_16, _i, _a, interceptor;
1133
+ var _this = this;
1134
+ return __generator(this, function (_b) {
1135
+ localVarPath = this.basePath + '/offers/{account}/{id}'
1136
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
1137
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1138
+ localVarQueryParameters = {};
1139
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1140
+ localVarFormParams = {};
1141
+ if (id === null || id === undefined) {
1142
+ throw new Error('Required parameter id was null or undefined when calling offersControllerRemove.');
1143
+ }
1144
+ if (account === null || account === undefined) {
1145
+ throw new Error('Required parameter account was null or undefined when calling offersControllerRemove.');
1146
+ }
1147
+ Object.assign(localVarHeaderParams, options.headers);
1148
+ localVarUseFormData = false;
1149
+ localVarRequestOptions = {
1150
+ method: 'DELETE',
1151
+ qs: localVarQueryParameters,
1152
+ headers: localVarHeaderParams,
1153
+ uri: localVarPath,
1154
+ useQuerystring: this._useQuerystring,
1155
+ json: true,
1156
+ };
1157
+ authenticationPromise = Promise.resolve();
1158
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1159
+ interceptorPromise = authenticationPromise;
1160
+ _loop_16 = function (interceptor) {
1161
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1162
+ };
1163
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1164
+ interceptor = _a[_i];
1165
+ _loop_16(interceptor);
1166
+ }
1167
+ return [2, interceptorPromise.then(function () {
1168
+ if (Object.keys(localVarFormParams).length) {
1169
+ if (localVarUseFormData) {
1170
+ localVarRequestOptions.formData = localVarFormParams;
1171
+ }
1172
+ else {
1173
+ localVarRequestOptions.form = localVarFormParams;
1174
+ }
1175
+ }
1176
+ return new Promise(function (resolve, reject) {
1177
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1178
+ if (error) {
1179
+ reject(error);
1180
+ }
1181
+ else {
1182
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1183
+ resolve({ response: response, body: body });
1184
+ }
1185
+ else {
1186
+ reject(new apis_1.HttpError(response, body, response.statusCode));
1187
+ }
1188
+ }
1189
+ });
1190
+ });
1191
+ })];
1192
+ });
1193
+ });
1194
+ };
1195
+ OffersApi.prototype.offersControllerSetdealid = function (id, account, body, options) {
1196
+ if (options === void 0) { options = { headers: {} }; }
1197
+ return __awaiter(this, void 0, void 0, function () {
1198
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_17, _i, _a, interceptor;
1199
+ var _this = this;
1200
+ return __generator(this, function (_b) {
1201
+ localVarPath = this.basePath + '/offers/{account}/{id}/deal-id'
1202
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
1203
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1204
+ localVarQueryParameters = {};
1205
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1206
+ localVarFormParams = {};
1207
+ if (id === null || id === undefined) {
1208
+ throw new Error('Required parameter id was null or undefined when calling offersControllerSetdealid.');
1209
+ }
1210
+ if (account === null || account === undefined) {
1211
+ throw new Error('Required parameter account was null or undefined when calling offersControllerSetdealid.');
1212
+ }
1213
+ if (body === null || body === undefined) {
1214
+ throw new Error('Required parameter body was null or undefined when calling offersControllerSetdealid.');
1215
+ }
1216
+ Object.assign(localVarHeaderParams, options.headers);
1217
+ localVarUseFormData = false;
1218
+ localVarRequestOptions = {
1219
+ method: 'PUT',
1220
+ qs: localVarQueryParameters,
1221
+ headers: localVarHeaderParams,
1222
+ uri: localVarPath,
1223
+ useQuerystring: this._useQuerystring,
1224
+ json: true,
1225
+ body: models_1.ObjectSerializer.serialize(body, "object")
1226
+ };
1227
+ authenticationPromise = Promise.resolve();
1228
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1229
+ interceptorPromise = authenticationPromise;
1230
+ _loop_17 = function (interceptor) {
1231
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1232
+ };
1233
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1234
+ interceptor = _a[_i];
1235
+ _loop_17(interceptor);
1236
+ }
1237
+ return [2, interceptorPromise.then(function () {
1238
+ if (Object.keys(localVarFormParams).length) {
1239
+ if (localVarUseFormData) {
1240
+ localVarRequestOptions.formData = localVarFormParams;
1241
+ }
1242
+ else {
1243
+ localVarRequestOptions.form = localVarFormParams;
1244
+ }
1245
+ }
1246
+ return new Promise(function (resolve, reject) {
1247
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1248
+ if (error) {
1249
+ reject(error);
1250
+ }
1251
+ else {
1252
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1253
+ resolve({ response: response, body: body });
1254
+ }
1255
+ else {
1256
+ reject(new apis_1.HttpError(response, body, response.statusCode));
1257
+ }
1258
+ }
1259
+ });
1260
+ });
1261
+ })];
1262
+ });
1263
+ });
1264
+ };
1265
+ OffersApi.prototype.offersControllerSethscode = function (id, account, body, options) {
1266
+ if (options === void 0) { options = { headers: {} }; }
1267
+ return __awaiter(this, void 0, void 0, function () {
1268
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_18, _i, _a, interceptor;
1269
+ var _this = this;
1270
+ return __generator(this, function (_b) {
1271
+ localVarPath = this.basePath + '/offers/{account}/{id}/hs-code'
1272
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
1273
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1274
+ localVarQueryParameters = {};
1275
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1276
+ localVarFormParams = {};
1277
+ if (id === null || id === undefined) {
1278
+ throw new Error('Required parameter id was null or undefined when calling offersControllerSethscode.');
1279
+ }
1280
+ if (account === null || account === undefined) {
1281
+ throw new Error('Required parameter account was null or undefined when calling offersControllerSethscode.');
1282
+ }
1283
+ if (body === null || body === undefined) {
1284
+ throw new Error('Required parameter body was null or undefined when calling offersControllerSethscode.');
1285
+ }
1286
+ Object.assign(localVarHeaderParams, options.headers);
1287
+ localVarUseFormData = false;
1288
+ localVarRequestOptions = {
1289
+ method: 'PUT',
1290
+ qs: localVarQueryParameters,
1291
+ headers: localVarHeaderParams,
1292
+ uri: localVarPath,
1293
+ useQuerystring: this._useQuerystring,
1294
+ json: true,
1295
+ body: models_1.ObjectSerializer.serialize(body, "object")
1296
+ };
1297
+ authenticationPromise = Promise.resolve();
1298
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1299
+ interceptorPromise = authenticationPromise;
1300
+ _loop_18 = function (interceptor) {
1301
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1302
+ };
1303
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1304
+ interceptor = _a[_i];
1305
+ _loop_18(interceptor);
1306
+ }
1307
+ return [2, interceptorPromise.then(function () {
1308
+ if (Object.keys(localVarFormParams).length) {
1309
+ if (localVarUseFormData) {
1310
+ localVarRequestOptions.formData = localVarFormParams;
1311
+ }
1312
+ else {
1313
+ localVarRequestOptions.form = localVarFormParams;
1314
+ }
1315
+ }
1316
+ return new Promise(function (resolve, reject) {
1317
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1318
+ if (error) {
1319
+ reject(error);
1320
+ }
1321
+ else {
1322
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1323
+ resolve({ response: response, body: body });
1324
+ }
1325
+ else {
1326
+ reject(new apis_1.HttpError(response, body, response.statusCode));
1327
+ }
1328
+ }
1329
+ });
1330
+ });
1331
+ })];
1332
+ });
1333
+ });
1334
+ };
1335
+ OffersApi.prototype.offersControllerUnlock = function (id, account, options) {
1336
+ if (options === void 0) { options = { headers: {} }; }
1337
+ return __awaiter(this, void 0, void 0, function () {
1338
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_19, _i, _a, interceptor;
1339
+ var _this = this;
1340
+ return __generator(this, function (_b) {
1341
+ localVarPath = this.basePath + '/offers/{account}/{id}/unlock'
1342
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
1343
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1344
+ localVarQueryParameters = {};
1345
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1346
+ localVarFormParams = {};
1347
+ if (id === null || id === undefined) {
1348
+ throw new Error('Required parameter id was null or undefined when calling offersControllerUnlock.');
1349
+ }
1350
+ if (account === null || account === undefined) {
1351
+ throw new Error('Required parameter account was null or undefined when calling offersControllerUnlock.');
1352
+ }
1353
+ Object.assign(localVarHeaderParams, options.headers);
1354
+ localVarUseFormData = false;
1355
+ localVarRequestOptions = {
1356
+ method: 'PUT',
1357
+ qs: localVarQueryParameters,
1358
+ headers: localVarHeaderParams,
1359
+ uri: localVarPath,
1360
+ useQuerystring: this._useQuerystring,
1361
+ json: true,
1362
+ };
1363
+ authenticationPromise = Promise.resolve();
1364
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1365
+ interceptorPromise = authenticationPromise;
1366
+ _loop_19 = function (interceptor) {
1367
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1368
+ };
1369
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1370
+ interceptor = _a[_i];
1371
+ _loop_19(interceptor);
1372
+ }
1373
+ return [2, interceptorPromise.then(function () {
1374
+ if (Object.keys(localVarFormParams).length) {
1375
+ if (localVarUseFormData) {
1376
+ localVarRequestOptions.formData = localVarFormParams;
1377
+ }
1378
+ else {
1379
+ localVarRequestOptions.form = localVarFormParams;
1380
+ }
1381
+ }
1382
+ return new Promise(function (resolve, reject) {
1383
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1384
+ if (error) {
1385
+ reject(error);
1386
+ }
1387
+ else {
1388
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1389
+ resolve({ response: response, body: body });
1390
+ }
1391
+ else {
1392
+ reject(new apis_1.HttpError(response, body, response.statusCode));
1393
+ }
1394
+ }
1395
+ });
1396
+ });
1397
+ })];
1398
+ });
1399
+ });
1400
+ };
1401
+ OffersApi.prototype.offersControllerUpdate = function (id, account, body, options) {
1402
+ if (options === void 0) { options = { headers: {} }; }
1403
+ return __awaiter(this, void 0, void 0, function () {
1404
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_20, _i, _a, interceptor;
1405
+ var _this = this;
1406
+ return __generator(this, function (_b) {
1407
+ localVarPath = this.basePath + '/offers/{account}/{id}'
1408
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
1409
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1410
+ localVarQueryParameters = {};
1411
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1412
+ localVarFormParams = {};
1413
+ if (id === null || id === undefined) {
1414
+ throw new Error('Required parameter id was null or undefined when calling offersControllerUpdate.');
1415
+ }
1416
+ if (account === null || account === undefined) {
1417
+ throw new Error('Required parameter account was null or undefined when calling offersControllerUpdate.');
1418
+ }
1419
+ if (body === null || body === undefined) {
1420
+ throw new Error('Required parameter body was null or undefined when calling offersControllerUpdate.');
1421
+ }
1422
+ Object.assign(localVarHeaderParams, options.headers);
1423
+ localVarUseFormData = false;
1424
+ localVarRequestOptions = {
1425
+ method: 'PUT',
1426
+ qs: localVarQueryParameters,
1427
+ headers: localVarHeaderParams,
1428
+ uri: localVarPath,
1429
+ useQuerystring: this._useQuerystring,
1430
+ json: true,
1431
+ body: models_1.ObjectSerializer.serialize(body, "object")
1432
+ };
1433
+ authenticationPromise = Promise.resolve();
1434
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1435
+ interceptorPromise = authenticationPromise;
1436
+ _loop_20 = function (interceptor) {
1437
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1438
+ };
1439
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1440
+ interceptor = _a[_i];
1441
+ _loop_20(interceptor);
1442
+ }
1443
+ return [2, interceptorPromise.then(function () {
1444
+ if (Object.keys(localVarFormParams).length) {
1445
+ if (localVarUseFormData) {
1446
+ localVarRequestOptions.formData = localVarFormParams;
1447
+ }
1448
+ else {
1449
+ localVarRequestOptions.form = localVarFormParams;
1450
+ }
1451
+ }
1452
+ return new Promise(function (resolve, reject) {
1453
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1454
+ if (error) {
1455
+ reject(error);
1456
+ }
1457
+ else {
1458
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1459
+ resolve({ response: response, body: body });
1460
+ }
1461
+ else {
1462
+ reject(new apis_1.HttpError(response, body, response.statusCode));
1463
+ }
1464
+ }
1465
+ });
1466
+ });
1467
+ })];
1468
+ });
1469
+ });
1470
+ };
1471
+ OffersApi.prototype.offersControllerUpdatestatus = function (account, body, options) {
1472
+ if (options === void 0) { options = { headers: {} }; }
1473
+ return __awaiter(this, void 0, void 0, function () {
1474
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_21, _i, _a, interceptor;
1475
+ var _this = this;
1476
+ return __generator(this, function (_b) {
1477
+ localVarPath = this.basePath + '/offers/{account}/status'
1478
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1479
+ localVarQueryParameters = {};
1480
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1481
+ localVarFormParams = {};
1482
+ if (account === null || account === undefined) {
1483
+ throw new Error('Required parameter account was null or undefined when calling offersControllerUpdatestatus.');
1484
+ }
1485
+ if (body === null || body === undefined) {
1486
+ throw new Error('Required parameter body was null or undefined when calling offersControllerUpdatestatus.');
1487
+ }
1488
+ Object.assign(localVarHeaderParams, options.headers);
1489
+ localVarUseFormData = false;
1490
+ localVarRequestOptions = {
1491
+ method: 'PUT',
1492
+ qs: localVarQueryParameters,
1493
+ headers: localVarHeaderParams,
1494
+ uri: localVarPath,
1495
+ useQuerystring: this._useQuerystring,
1496
+ json: true,
1497
+ body: models_1.ObjectSerializer.serialize(body, "object")
1498
+ };
1499
+ authenticationPromise = Promise.resolve();
1500
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1501
+ interceptorPromise = authenticationPromise;
1502
+ _loop_21 = function (interceptor) {
1503
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1504
+ };
1505
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1506
+ interceptor = _a[_i];
1507
+ _loop_21(interceptor);
1508
+ }
1509
+ return [2, interceptorPromise.then(function () {
1510
+ if (Object.keys(localVarFormParams).length) {
1511
+ if (localVarUseFormData) {
1512
+ localVarRequestOptions.formData = localVarFormParams;
1513
+ }
1514
+ else {
1515
+ localVarRequestOptions.form = localVarFormParams;
1516
+ }
1517
+ }
1518
+ return new Promise(function (resolve, reject) {
1519
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1520
+ if (error) {
1521
+ reject(error);
1522
+ }
1523
+ else {
1524
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1525
+ resolve({ response: response, body: body });
1526
+ }
1527
+ else {
1528
+ reject(new apis_1.HttpError(response, body, response.statusCode));
1529
+ }
1530
+ }
1531
+ });
1532
+ });
1533
+ })];
1534
+ });
1535
+ });
1536
+ };
1537
+ OffersApi.prototype.offersControllerValidatestatus = function (account, body, options) {
1538
+ if (options === void 0) { options = { headers: {} }; }
1539
+ return __awaiter(this, void 0, void 0, function () {
1540
+ var localVarPath, localVarQueryParameters, localVarHeaderParams, localVarFormParams, localVarUseFormData, localVarRequestOptions, authenticationPromise, interceptorPromise, _loop_22, _i, _a, interceptor;
1541
+ var _this = this;
1542
+ return __generator(this, function (_b) {
1543
+ localVarPath = this.basePath + '/offers/{account}/status/validate'
1544
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
1545
+ localVarQueryParameters = {};
1546
+ localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1547
+ localVarFormParams = {};
1548
+ if (account === null || account === undefined) {
1549
+ throw new Error('Required parameter account was null or undefined when calling offersControllerValidatestatus.');
1550
+ }
1551
+ if (body === null || body === undefined) {
1552
+ throw new Error('Required parameter body was null or undefined when calling offersControllerValidatestatus.');
1553
+ }
1554
+ Object.assign(localVarHeaderParams, options.headers);
1555
+ localVarUseFormData = false;
1556
+ localVarRequestOptions = {
1557
+ method: 'POST',
1558
+ qs: localVarQueryParameters,
1559
+ headers: localVarHeaderParams,
1560
+ uri: localVarPath,
1561
+ useQuerystring: this._useQuerystring,
1562
+ json: true,
1563
+ body: models_1.ObjectSerializer.serialize(body, "object")
1564
+ };
1565
+ authenticationPromise = Promise.resolve();
1566
+ authenticationPromise = authenticationPromise.then(function () { return _this.authentications.default.applyToRequest(localVarRequestOptions); });
1567
+ interceptorPromise = authenticationPromise;
1568
+ _loop_22 = function (interceptor) {
1569
+ interceptorPromise = interceptorPromise.then(function () { return interceptor(localVarRequestOptions); });
1570
+ };
1571
+ for (_i = 0, _a = this.interceptors; _i < _a.length; _i++) {
1572
+ interceptor = _a[_i];
1573
+ _loop_22(interceptor);
1574
+ }
1575
+ return [2, interceptorPromise.then(function () {
1576
+ if (Object.keys(localVarFormParams).length) {
1577
+ if (localVarUseFormData) {
1578
+ localVarRequestOptions.formData = localVarFormParams;
1579
+ }
1580
+ else {
1581
+ localVarRequestOptions.form = localVarFormParams;
1582
+ }
1583
+ }
1584
+ return new Promise(function (resolve, reject) {
1585
+ (0, request_1.default)(localVarRequestOptions, function (error, response, body) {
1586
+ if (error) {
1587
+ reject(error);
1588
+ }
1589
+ else {
1590
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1591
+ resolve({ response: response, body: body });
1592
+ }
1593
+ else {
1594
+ reject(new apis_1.HttpError(response, body, response.statusCode));
1595
+ }
1596
+ }
1597
+ });
1598
+ });
1599
+ })];
1600
+ });
1601
+ });
1602
+ };
1603
+ return OffersApi;
1604
+ }());
1605
+ exports.OffersApi = OffersApi;
1606
1606
  //# sourceMappingURL=offersApi.js.map