@emilgroup/discount-sdk-node 1.1.1-beta.1

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 (148) hide show
  1. package/.openapi-generator/FILES +54 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +84 -0
  5. package/api/campaigns-api.ts +1437 -0
  6. package/api/default-api.ts +128 -0
  7. package/api/policy-vouchers-api.ts +1042 -0
  8. package/api/vouchers-api.ts +695 -0
  9. package/api.ts +37 -0
  10. package/base.ts +286 -0
  11. package/common.ts +199 -0
  12. package/configuration.ts +118 -0
  13. package/dist/api/campaigns-api.d.ts +808 -0
  14. package/dist/api/campaigns-api.js +1308 -0
  15. package/dist/api/default-api.d.ts +70 -0
  16. package/dist/api/default-api.js +217 -0
  17. package/dist/api/policy-vouchers-api.d.ts +582 -0
  18. package/dist/api/policy-vouchers-api.js +978 -0
  19. package/dist/api/vouchers-api.d.ts +393 -0
  20. package/dist/api/vouchers-api.js +675 -0
  21. package/dist/api.d.ts +15 -0
  22. package/dist/api.js +33 -0
  23. package/dist/base.d.ts +79 -0
  24. package/dist/base.js +405 -0
  25. package/dist/common.d.ts +92 -0
  26. package/dist/common.js +277 -0
  27. package/dist/configuration.d.ts +96 -0
  28. package/dist/configuration.js +52 -0
  29. package/dist/index.d.ts +15 -0
  30. package/dist/index.js +36 -0
  31. package/dist/models/campaign-class.d.ts +105 -0
  32. package/dist/models/campaign-class.js +24 -0
  33. package/dist/models/charge-policy-voucher-request-dto.d.ts +48 -0
  34. package/dist/models/charge-policy-voucher-request-dto.js +15 -0
  35. package/dist/models/charge-policy-voucher-response-class.d.ts +90 -0
  36. package/dist/models/charge-policy-voucher-response-class.js +21 -0
  37. package/dist/models/check-account-eligibility-request-dto.d.ts +48 -0
  38. package/dist/models/check-account-eligibility-request-dto.js +15 -0
  39. package/dist/models/check-account-eligibility-response-class.d.ts +57 -0
  40. package/dist/models/check-account-eligibility-response-class.js +24 -0
  41. package/dist/models/create-campaign-request-dto.d.ts +42 -0
  42. package/dist/models/create-campaign-request-dto.js +15 -0
  43. package/dist/models/create-campaign-response-class.d.ts +25 -0
  44. package/dist/models/create-campaign-response-class.js +15 -0
  45. package/dist/models/create-eligible-account-request-dto.d.ts +30 -0
  46. package/dist/models/create-eligible-account-request-dto.js +15 -0
  47. package/dist/models/create-eligible-account-response-class.d.ts +25 -0
  48. package/dist/models/create-eligible-account-response-class.js +15 -0
  49. package/dist/models/create-policy-voucher-request-dto.d.ts +48 -0
  50. package/dist/models/create-policy-voucher-request-dto.js +15 -0
  51. package/dist/models/create-policy-voucher-response-class.d.ts +25 -0
  52. package/dist/models/create-policy-voucher-response-class.js +15 -0
  53. package/dist/models/create-product-discount-dto.d.ts +48 -0
  54. package/dist/models/create-product-discount-dto.js +15 -0
  55. package/dist/models/create-voucher-request-dto.d.ts +66 -0
  56. package/dist/models/create-voucher-request-dto.js +20 -0
  57. package/dist/models/create-voucher-response-class.d.ts +25 -0
  58. package/dist/models/create-voucher-response-class.js +15 -0
  59. package/dist/models/eligible-account-class.d.ts +78 -0
  60. package/dist/models/eligible-account-class.js +15 -0
  61. package/dist/models/get-campaign-response-class.d.ts +25 -0
  62. package/dist/models/get-campaign-response-class.js +15 -0
  63. package/dist/models/get-policy-voucher-response-class.d.ts +25 -0
  64. package/dist/models/get-policy-voucher-response-class.js +15 -0
  65. package/dist/models/get-voucher-response-class.d.ts +25 -0
  66. package/dist/models/get-voucher-response-class.js +15 -0
  67. package/dist/models/index.d.ts +37 -0
  68. package/dist/models/index.js +53 -0
  69. package/dist/models/inline-response200.d.ts +54 -0
  70. package/dist/models/inline-response200.js +15 -0
  71. package/dist/models/inline-response503.d.ts +54 -0
  72. package/dist/models/inline-response503.js +15 -0
  73. package/dist/models/list-campaigns-response-class.d.ts +43 -0
  74. package/dist/models/list-campaigns-response-class.js +15 -0
  75. package/dist/models/list-eligible-accounts-response-class.d.ts +43 -0
  76. package/dist/models/list-eligible-accounts-response-class.js +15 -0
  77. package/dist/models/list-policy-vouchers-response-class.d.ts +43 -0
  78. package/dist/models/list-policy-vouchers-response-class.js +15 -0
  79. package/dist/models/list-vouchers-response-class.d.ts +43 -0
  80. package/dist/models/list-vouchers-response-class.js +15 -0
  81. package/dist/models/policy-voucher-class.d.ts +159 -0
  82. package/dist/models/policy-voucher-class.js +21 -0
  83. package/dist/models/policy-voucher-transaction-class.d.ts +126 -0
  84. package/dist/models/policy-voucher-transaction-class.js +26 -0
  85. package/dist/models/product-discount-class.d.ts +90 -0
  86. package/dist/models/product-discount-class.js +15 -0
  87. package/dist/models/redeem-policy-voucher-request-dto.d.ts +48 -0
  88. package/dist/models/redeem-policy-voucher-request-dto.js +15 -0
  89. package/dist/models/redeem-policy-voucher-response-class.d.ts +84 -0
  90. package/dist/models/redeem-policy-voucher-response-class.js +21 -0
  91. package/dist/models/update-campaign-request-dto.d.ts +42 -0
  92. package/dist/models/update-campaign-request-dto.js +15 -0
  93. package/dist/models/update-campaign-response-class.d.ts +25 -0
  94. package/dist/models/update-campaign-response-class.js +15 -0
  95. package/dist/models/update-campaign-status-request-dto.d.ts +33 -0
  96. package/dist/models/update-campaign-status-request-dto.js +24 -0
  97. package/dist/models/update-voucher-request-dto.d.ts +60 -0
  98. package/dist/models/update-voucher-request-dto.js +20 -0
  99. package/dist/models/update-voucher-response-class.d.ts +25 -0
  100. package/dist/models/update-voucher-response-class.js +15 -0
  101. package/dist/models/voucher-class.d.ts +127 -0
  102. package/dist/models/voucher-class.js +20 -0
  103. package/dist/models/withdraw-policy-voucher-request-dto.d.ts +36 -0
  104. package/dist/models/withdraw-policy-voucher-request-dto.js +15 -0
  105. package/dist/models/withdraw-policy-voucher-response-class.d.ts +78 -0
  106. package/dist/models/withdraw-policy-voucher-response-class.js +21 -0
  107. package/git_push.sh +57 -0
  108. package/index.ts +19 -0
  109. package/models/campaign-class.ts +114 -0
  110. package/models/charge-policy-voucher-request-dto.ts +54 -0
  111. package/models/charge-policy-voucher-response-class.ts +99 -0
  112. package/models/check-account-eligibility-request-dto.ts +54 -0
  113. package/models/check-account-eligibility-response-class.ts +66 -0
  114. package/models/create-campaign-request-dto.ts +48 -0
  115. package/models/create-campaign-response-class.ts +31 -0
  116. package/models/create-eligible-account-request-dto.ts +36 -0
  117. package/models/create-eligible-account-response-class.ts +31 -0
  118. package/models/create-policy-voucher-request-dto.ts +54 -0
  119. package/models/create-policy-voucher-response-class.ts +31 -0
  120. package/models/create-product-discount-dto.ts +54 -0
  121. package/models/create-voucher-request-dto.ts +75 -0
  122. package/models/create-voucher-response-class.ts +31 -0
  123. package/models/eligible-account-class.ts +84 -0
  124. package/models/get-campaign-response-class.ts +31 -0
  125. package/models/get-policy-voucher-response-class.ts +31 -0
  126. package/models/get-voucher-response-class.ts +31 -0
  127. package/models/index.ts +37 -0
  128. package/models/inline-response200.ts +48 -0
  129. package/models/inline-response503.ts +48 -0
  130. package/models/list-campaigns-response-class.ts +49 -0
  131. package/models/list-eligible-accounts-response-class.ts +49 -0
  132. package/models/list-policy-vouchers-response-class.ts +49 -0
  133. package/models/list-vouchers-response-class.ts +49 -0
  134. package/models/policy-voucher-class.ts +168 -0
  135. package/models/policy-voucher-transaction-class.ts +136 -0
  136. package/models/product-discount-class.ts +96 -0
  137. package/models/redeem-policy-voucher-request-dto.ts +54 -0
  138. package/models/redeem-policy-voucher-response-class.ts +93 -0
  139. package/models/update-campaign-request-dto.ts +48 -0
  140. package/models/update-campaign-response-class.ts +31 -0
  141. package/models/update-campaign-status-request-dto.ts +42 -0
  142. package/models/update-voucher-request-dto.ts +69 -0
  143. package/models/update-voucher-response-class.ts +31 -0
  144. package/models/voucher-class.ts +136 -0
  145. package/models/withdraw-policy-voucher-request-dto.ts +42 -0
  146. package/models/withdraw-policy-voucher-response-class.ts +87 -0
  147. package/package.json +29 -0
  148. package/tsconfig.json +23 -0
@@ -0,0 +1,675 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * EMIL DiscountService
6
+ * The EMIL DiscountService API description
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ * Contact: kontakt@emil.de
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __assign = (this && this.__assign) || function () {
31
+ __assign = Object.assign || function(t) {
32
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
33
+ s = arguments[i];
34
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
35
+ t[p] = s[p];
36
+ }
37
+ return t;
38
+ };
39
+ return __assign.apply(this, arguments);
40
+ };
41
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
42
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
43
+ return new (P || (P = Promise))(function (resolve, reject) {
44
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
45
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
46
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
47
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
48
+ });
49
+ };
50
+ var __generator = (this && this.__generator) || function (thisArg, body) {
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
52
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
+ function verb(n) { return function (v) { return step([n, v]); }; }
54
+ function step(op) {
55
+ if (f) throw new TypeError("Generator is already executing.");
56
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
57
+ 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;
58
+ if (y = 0, t) op = [op[0] & 2, t.value];
59
+ switch (op[0]) {
60
+ case 0: case 1: t = op; break;
61
+ case 4: _.label++; return { value: op[1], done: false };
62
+ case 5: _.label++; y = op[1]; op = [0]; continue;
63
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
64
+ default:
65
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
66
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
67
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
68
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
69
+ if (t[2]) _.ops.pop();
70
+ _.trys.pop(); continue;
71
+ }
72
+ op = body.call(thisArg, _);
73
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
74
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
+ }
76
+ };
77
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
78
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
79
+ if (ar || !(i in from)) {
80
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
81
+ ar[i] = from[i];
82
+ }
83
+ }
84
+ return to.concat(ar || Array.prototype.slice.call(from));
85
+ };
86
+ var __importDefault = (this && this.__importDefault) || function (mod) {
87
+ return (mod && mod.__esModule) ? mod : { "default": mod };
88
+ };
89
+ Object.defineProperty(exports, "__esModule", { value: true });
90
+ exports.VouchersApi = exports.VouchersApiFactory = exports.VouchersApiFp = exports.VouchersApiAxiosParamCreator = void 0;
91
+ var axios_1 = __importDefault(require("axios"));
92
+ // Some imports not used depending on template conditions
93
+ // @ts-ignore
94
+ var common_1 = require("../common");
95
+ // @ts-ignore
96
+ var base_1 = require("../base");
97
+ // URLSearchParams not necessarily used
98
+ // @ts-ignore
99
+ var url_1 = require("url");
100
+ var FormData = require('form-data');
101
+ /**
102
+ * VouchersApi - axios parameter creator
103
+ * @export
104
+ */
105
+ var VouchersApiAxiosParamCreator = function (configuration) {
106
+ var _this = this;
107
+ return {
108
+ /**
109
+ * This will create a voucher.
110
+ * @summary Create the Voucher
111
+ * @param {CreateVoucherRequestDto} createVoucherRequestDto
112
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
113
+ * @param {*} [options] Override http request option.
114
+ * @throws {RequiredError}
115
+ */
116
+ createVoucher: function (createVoucherRequestDto_1, authorization_1) {
117
+ var args_1 = [];
118
+ for (var _i = 2; _i < arguments.length; _i++) {
119
+ args_1[_i - 2] = arguments[_i];
120
+ }
121
+ return __awaiter(_this, __spreadArray([createVoucherRequestDto_1, authorization_1], args_1, true), void 0, function (createVoucherRequestDto, authorization, options) {
122
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
123
+ if (options === void 0) { options = {}; }
124
+ return __generator(this, function (_a) {
125
+ switch (_a.label) {
126
+ case 0:
127
+ // verify required parameter 'createVoucherRequestDto' is not null or undefined
128
+ (0, common_1.assertParamExists)('createVoucher', 'createVoucherRequestDto', createVoucherRequestDto);
129
+ localVarPath = "/discountservice/v1/vouchers";
130
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
131
+ if (configuration) {
132
+ baseOptions = configuration.baseOptions;
133
+ baseAccessToken = configuration.accessToken;
134
+ }
135
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
136
+ localVarHeaderParameter = {};
137
+ localVarQueryParameter = {};
138
+ // authentication bearer required
139
+ // http bearer authentication required
140
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
141
+ case 1:
142
+ // authentication bearer required
143
+ // http bearer authentication required
144
+ _a.sent();
145
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
146
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
147
+ }
148
+ localVarHeaderParameter['Content-Type'] = 'application/json';
149
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
150
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
151
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
152
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createVoucherRequestDto, localVarRequestOptions, configuration);
153
+ return [2 /*return*/, {
154
+ url: (0, common_1.toPathString)(localVarUrlObj),
155
+ options: localVarRequestOptions,
156
+ }];
157
+ }
158
+ });
159
+ });
160
+ },
161
+ /**
162
+ * This will delete a voucher.
163
+ * @summary Delete the Voucher
164
+ * @param {string} code Unique identifier for the object.
165
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
166
+ * @param {*} [options] Override http request option.
167
+ * @throws {RequiredError}
168
+ */
169
+ deleteVoucher: function (code_1, authorization_1) {
170
+ var args_1 = [];
171
+ for (var _i = 2; _i < arguments.length; _i++) {
172
+ args_1[_i - 2] = arguments[_i];
173
+ }
174
+ return __awaiter(_this, __spreadArray([code_1, authorization_1], args_1, true), void 0, function (code, authorization, options) {
175
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
176
+ if (options === void 0) { options = {}; }
177
+ return __generator(this, function (_a) {
178
+ switch (_a.label) {
179
+ case 0:
180
+ // verify required parameter 'code' is not null or undefined
181
+ (0, common_1.assertParamExists)('deleteVoucher', 'code', code);
182
+ localVarPath = "/discountservice/v1/vouchers/{code}"
183
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
184
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
185
+ if (configuration) {
186
+ baseOptions = configuration.baseOptions;
187
+ baseAccessToken = configuration.accessToken;
188
+ }
189
+ localVarRequestOptions = __assign(__assign({ method: 'DELETE' }, baseOptions), options);
190
+ localVarHeaderParameter = {};
191
+ localVarQueryParameter = {};
192
+ // authentication bearer required
193
+ // http bearer authentication required
194
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
195
+ case 1:
196
+ // authentication bearer required
197
+ // http bearer authentication required
198
+ _a.sent();
199
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
200
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
201
+ }
202
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
203
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
204
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
205
+ return [2 /*return*/, {
206
+ url: (0, common_1.toPathString)(localVarUrlObj),
207
+ options: localVarRequestOptions,
208
+ }];
209
+ }
210
+ });
211
+ });
212
+ },
213
+ /**
214
+ * This will get a voucher.
215
+ * @summary Retrieve the Voucher
216
+ * @param {string} code Unique identifier for the object.
217
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
218
+ * @param {'campaign' | 'productDiscounts'} [expand] You can expand voucher in this endpoint.
219
+ * @param {*} [options] Override http request option.
220
+ * @throws {RequiredError}
221
+ */
222
+ getVoucher: function (code_1, authorization_1, expand_1) {
223
+ var args_1 = [];
224
+ for (var _i = 3; _i < arguments.length; _i++) {
225
+ args_1[_i - 3] = arguments[_i];
226
+ }
227
+ return __awaiter(_this, __spreadArray([code_1, authorization_1, expand_1], args_1, true), void 0, function (code, authorization, expand, options) {
228
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
229
+ if (options === void 0) { options = {}; }
230
+ return __generator(this, function (_a) {
231
+ switch (_a.label) {
232
+ case 0:
233
+ // verify required parameter 'code' is not null or undefined
234
+ (0, common_1.assertParamExists)('getVoucher', 'code', code);
235
+ localVarPath = "/discountservice/v1/vouchers/{code}"
236
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
237
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
238
+ if (configuration) {
239
+ baseOptions = configuration.baseOptions;
240
+ baseAccessToken = configuration.accessToken;
241
+ }
242
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
243
+ localVarHeaderParameter = {};
244
+ localVarQueryParameter = {};
245
+ // authentication bearer required
246
+ // http bearer authentication required
247
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
248
+ case 1:
249
+ // authentication bearer required
250
+ // http bearer authentication required
251
+ _a.sent();
252
+ if (expand !== undefined) {
253
+ localVarQueryParameter['expand'] = expand;
254
+ }
255
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
256
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
257
+ }
258
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
259
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
260
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
261
+ return [2 /*return*/, {
262
+ url: (0, common_1.toPathString)(localVarUrlObj),
263
+ options: localVarRequestOptions,
264
+ }];
265
+ }
266
+ });
267
+ });
268
+ },
269
+ /**
270
+ * Returns a list of Vouchers you have previously created. The Vouchers are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
271
+ * @summary List Vouchers
272
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
273
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
274
+ * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
275
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug&lt;/i&gt;
276
+ * @param {string} [search] Search the response for matches in any searchable field. Use filter instead where possible for improved performance.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Searchable fields: code, voucherCode, productSlugsList&lt;/i&gt;
277
+ * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, voucherCode, campaignId, discountPeriodMonths, discountType, discountValue, createdAt&lt;/i&gt;
278
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: campaign, productDiscounts&lt;i&gt;
279
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug&lt;/i&gt;
280
+ * @param {*} [options] Override http request option.
281
+ * @throws {RequiredError}
282
+ */
283
+ listVouchers: function (authorization_1, pageSize_1, pageToken_1, filter_1, search_1, order_1, expand_1, filters_1) {
284
+ var args_1 = [];
285
+ for (var _i = 8; _i < arguments.length; _i++) {
286
+ args_1[_i - 8] = arguments[_i];
287
+ }
288
+ return __awaiter(_this, __spreadArray([authorization_1, pageSize_1, pageToken_1, filter_1, search_1, order_1, expand_1, filters_1], args_1, true), void 0, function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
289
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
290
+ if (options === void 0) { options = {}; }
291
+ return __generator(this, function (_a) {
292
+ switch (_a.label) {
293
+ case 0:
294
+ localVarPath = "/discountservice/v1/vouchers";
295
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
296
+ if (configuration) {
297
+ baseOptions = configuration.baseOptions;
298
+ baseAccessToken = configuration.accessToken;
299
+ }
300
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
301
+ localVarHeaderParameter = {};
302
+ localVarQueryParameter = {};
303
+ // authentication bearer required
304
+ // http bearer authentication required
305
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
306
+ case 1:
307
+ // authentication bearer required
308
+ // http bearer authentication required
309
+ _a.sent();
310
+ if (pageSize !== undefined) {
311
+ localVarQueryParameter['pageSize'] = pageSize;
312
+ }
313
+ if (pageToken !== undefined) {
314
+ localVarQueryParameter['pageToken'] = pageToken;
315
+ }
316
+ if (filter !== undefined) {
317
+ localVarQueryParameter['filter'] = filter;
318
+ }
319
+ if (search !== undefined) {
320
+ localVarQueryParameter['search'] = search;
321
+ }
322
+ if (order !== undefined) {
323
+ localVarQueryParameter['order'] = order;
324
+ }
325
+ if (expand !== undefined) {
326
+ localVarQueryParameter['expand'] = expand;
327
+ }
328
+ if (filters !== undefined) {
329
+ localVarQueryParameter['filters'] = filters;
330
+ }
331
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
332
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
333
+ }
334
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
335
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
336
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
337
+ return [2 /*return*/, {
338
+ url: (0, common_1.toPathString)(localVarUrlObj),
339
+ options: localVarRequestOptions,
340
+ }];
341
+ }
342
+ });
343
+ });
344
+ },
345
+ /**
346
+ * This will update a voucher.
347
+ * @summary Update the Voucher
348
+ * @param {string} code Unique identifier for the object.
349
+ * @param {UpdateVoucherRequestDto} updateVoucherRequestDto
350
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
351
+ * @param {*} [options] Override http request option.
352
+ * @throws {RequiredError}
353
+ */
354
+ updateVoucher: function (code_1, updateVoucherRequestDto_1, authorization_1) {
355
+ var args_1 = [];
356
+ for (var _i = 3; _i < arguments.length; _i++) {
357
+ args_1[_i - 3] = arguments[_i];
358
+ }
359
+ return __awaiter(_this, __spreadArray([code_1, updateVoucherRequestDto_1, authorization_1], args_1, true), void 0, function (code, updateVoucherRequestDto, authorization, options) {
360
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
361
+ if (options === void 0) { options = {}; }
362
+ return __generator(this, function (_a) {
363
+ switch (_a.label) {
364
+ case 0:
365
+ // verify required parameter 'code' is not null or undefined
366
+ (0, common_1.assertParamExists)('updateVoucher', 'code', code);
367
+ // verify required parameter 'updateVoucherRequestDto' is not null or undefined
368
+ (0, common_1.assertParamExists)('updateVoucher', 'updateVoucherRequestDto', updateVoucherRequestDto);
369
+ localVarPath = "/discountservice/v1/vouchers/{code}"
370
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
371
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
372
+ if (configuration) {
373
+ baseOptions = configuration.baseOptions;
374
+ baseAccessToken = configuration.accessToken;
375
+ }
376
+ localVarRequestOptions = __assign(__assign({ method: 'PUT' }, baseOptions), options);
377
+ localVarHeaderParameter = {};
378
+ localVarQueryParameter = {};
379
+ // authentication bearer required
380
+ // http bearer authentication required
381
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
382
+ case 1:
383
+ // authentication bearer required
384
+ // http bearer authentication required
385
+ _a.sent();
386
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
387
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
388
+ }
389
+ localVarHeaderParameter['Content-Type'] = 'application/json';
390
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
391
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
392
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
393
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateVoucherRequestDto, localVarRequestOptions, configuration);
394
+ return [2 /*return*/, {
395
+ url: (0, common_1.toPathString)(localVarUrlObj),
396
+ options: localVarRequestOptions,
397
+ }];
398
+ }
399
+ });
400
+ });
401
+ },
402
+ };
403
+ };
404
+ exports.VouchersApiAxiosParamCreator = VouchersApiAxiosParamCreator;
405
+ /**
406
+ * VouchersApi - functional programming interface
407
+ * @export
408
+ */
409
+ var VouchersApiFp = function (configuration) {
410
+ var localVarAxiosParamCreator = (0, exports.VouchersApiAxiosParamCreator)(configuration);
411
+ return {
412
+ /**
413
+ * This will create a voucher.
414
+ * @summary Create the Voucher
415
+ * @param {CreateVoucherRequestDto} createVoucherRequestDto
416
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
417
+ * @param {*} [options] Override http request option.
418
+ * @throws {RequiredError}
419
+ */
420
+ createVoucher: function (createVoucherRequestDto, authorization, options) {
421
+ return __awaiter(this, void 0, void 0, function () {
422
+ var localVarAxiosArgs;
423
+ return __generator(this, function (_a) {
424
+ switch (_a.label) {
425
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.createVoucher(createVoucherRequestDto, authorization, options)];
426
+ case 1:
427
+ localVarAxiosArgs = _a.sent();
428
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
429
+ }
430
+ });
431
+ });
432
+ },
433
+ /**
434
+ * This will delete a voucher.
435
+ * @summary Delete the Voucher
436
+ * @param {string} code Unique identifier for the object.
437
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
438
+ * @param {*} [options] Override http request option.
439
+ * @throws {RequiredError}
440
+ */
441
+ deleteVoucher: function (code, authorization, options) {
442
+ return __awaiter(this, void 0, void 0, function () {
443
+ var localVarAxiosArgs;
444
+ return __generator(this, function (_a) {
445
+ switch (_a.label) {
446
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.deleteVoucher(code, authorization, options)];
447
+ case 1:
448
+ localVarAxiosArgs = _a.sent();
449
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
450
+ }
451
+ });
452
+ });
453
+ },
454
+ /**
455
+ * This will get a voucher.
456
+ * @summary Retrieve the Voucher
457
+ * @param {string} code Unique identifier for the object.
458
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
459
+ * @param {'campaign' | 'productDiscounts'} [expand] You can expand voucher in this endpoint.
460
+ * @param {*} [options] Override http request option.
461
+ * @throws {RequiredError}
462
+ */
463
+ getVoucher: function (code, authorization, expand, options) {
464
+ return __awaiter(this, void 0, void 0, function () {
465
+ var localVarAxiosArgs;
466
+ return __generator(this, function (_a) {
467
+ switch (_a.label) {
468
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getVoucher(code, authorization, expand, options)];
469
+ case 1:
470
+ localVarAxiosArgs = _a.sent();
471
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
472
+ }
473
+ });
474
+ });
475
+ },
476
+ /**
477
+ * Returns a list of Vouchers you have previously created. The Vouchers are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
478
+ * @summary List Vouchers
479
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
480
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
481
+ * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
482
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug&lt;/i&gt;
483
+ * @param {string} [search] Search the response for matches in any searchable field. Use filter instead where possible for improved performance.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Searchable fields: code, voucherCode, productSlugsList&lt;/i&gt;
484
+ * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, voucherCode, campaignId, discountPeriodMonths, discountType, discountValue, createdAt&lt;/i&gt;
485
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: campaign, productDiscounts&lt;i&gt;
486
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug&lt;/i&gt;
487
+ * @param {*} [options] Override http request option.
488
+ * @throws {RequiredError}
489
+ */
490
+ listVouchers: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
491
+ return __awaiter(this, void 0, void 0, function () {
492
+ var localVarAxiosArgs;
493
+ return __generator(this, function (_a) {
494
+ switch (_a.label) {
495
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listVouchers(authorization, pageSize, pageToken, filter, search, order, expand, filters, options)];
496
+ case 1:
497
+ localVarAxiosArgs = _a.sent();
498
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
499
+ }
500
+ });
501
+ });
502
+ },
503
+ /**
504
+ * This will update a voucher.
505
+ * @summary Update the Voucher
506
+ * @param {string} code Unique identifier for the object.
507
+ * @param {UpdateVoucherRequestDto} updateVoucherRequestDto
508
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
509
+ * @param {*} [options] Override http request option.
510
+ * @throws {RequiredError}
511
+ */
512
+ updateVoucher: function (code, updateVoucherRequestDto, authorization, options) {
513
+ return __awaiter(this, void 0, void 0, function () {
514
+ var localVarAxiosArgs;
515
+ return __generator(this, function (_a) {
516
+ switch (_a.label) {
517
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.updateVoucher(code, updateVoucherRequestDto, authorization, options)];
518
+ case 1:
519
+ localVarAxiosArgs = _a.sent();
520
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
521
+ }
522
+ });
523
+ });
524
+ },
525
+ };
526
+ };
527
+ exports.VouchersApiFp = VouchersApiFp;
528
+ /**
529
+ * VouchersApi - factory interface
530
+ * @export
531
+ */
532
+ var VouchersApiFactory = function (configuration, basePath, axios) {
533
+ var localVarFp = (0, exports.VouchersApiFp)(configuration);
534
+ return {
535
+ /**
536
+ * This will create a voucher.
537
+ * @summary Create the Voucher
538
+ * @param {CreateVoucherRequestDto} createVoucherRequestDto
539
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
540
+ * @param {*} [options] Override http request option.
541
+ * @throws {RequiredError}
542
+ */
543
+ createVoucher: function (createVoucherRequestDto, authorization, options) {
544
+ return localVarFp.createVoucher(createVoucherRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
545
+ },
546
+ /**
547
+ * This will delete a voucher.
548
+ * @summary Delete the Voucher
549
+ * @param {string} code Unique identifier for the object.
550
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
551
+ * @param {*} [options] Override http request option.
552
+ * @throws {RequiredError}
553
+ */
554
+ deleteVoucher: function (code, authorization, options) {
555
+ return localVarFp.deleteVoucher(code, authorization, options).then(function (request) { return request(axios, basePath); });
556
+ },
557
+ /**
558
+ * This will get a voucher.
559
+ * @summary Retrieve the Voucher
560
+ * @param {string} code Unique identifier for the object.
561
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
562
+ * @param {'campaign' | 'productDiscounts'} [expand] You can expand voucher in this endpoint.
563
+ * @param {*} [options] Override http request option.
564
+ * @throws {RequiredError}
565
+ */
566
+ getVoucher: function (code, authorization, expand, options) {
567
+ return localVarFp.getVoucher(code, authorization, expand, options).then(function (request) { return request(axios, basePath); });
568
+ },
569
+ /**
570
+ * Returns a list of Vouchers you have previously created. The Vouchers are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
571
+ * @summary List Vouchers
572
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
573
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
574
+ * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
575
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug&lt;/i&gt;
576
+ * @param {string} [search] Search the response for matches in any searchable field. Use filter instead where possible for improved performance.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Searchable fields: code, voucherCode, productSlugsList&lt;/i&gt;
577
+ * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, voucherCode, campaignId, discountPeriodMonths, discountType, discountValue, createdAt&lt;/i&gt;
578
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: campaign, productDiscounts&lt;i&gt;
579
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug&lt;/i&gt;
580
+ * @param {*} [options] Override http request option.
581
+ * @throws {RequiredError}
582
+ */
583
+ listVouchers: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
584
+ return localVarFp.listVouchers(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then(function (request) { return request(axios, basePath); });
585
+ },
586
+ /**
587
+ * This will update a voucher.
588
+ * @summary Update the Voucher
589
+ * @param {string} code Unique identifier for the object.
590
+ * @param {UpdateVoucherRequestDto} updateVoucherRequestDto
591
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
592
+ * @param {*} [options] Override http request option.
593
+ * @throws {RequiredError}
594
+ */
595
+ updateVoucher: function (code, updateVoucherRequestDto, authorization, options) {
596
+ return localVarFp.updateVoucher(code, updateVoucherRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
597
+ },
598
+ };
599
+ };
600
+ exports.VouchersApiFactory = VouchersApiFactory;
601
+ /**
602
+ * VouchersApi - object-oriented interface
603
+ * @export
604
+ * @class VouchersApi
605
+ * @extends {BaseAPI}
606
+ */
607
+ var VouchersApi = /** @class */ (function (_super) {
608
+ __extends(VouchersApi, _super);
609
+ function VouchersApi() {
610
+ return _super !== null && _super.apply(this, arguments) || this;
611
+ }
612
+ /**
613
+ * This will create a voucher.
614
+ * @summary Create the Voucher
615
+ * @param {VouchersApiCreateVoucherRequest} requestParameters Request parameters.
616
+ * @param {*} [options] Override http request option.
617
+ * @throws {RequiredError}
618
+ * @memberof VouchersApi
619
+ */
620
+ VouchersApi.prototype.createVoucher = function (requestParameters, options) {
621
+ var _this = this;
622
+ return (0, exports.VouchersApiFp)(this.configuration).createVoucher(requestParameters.createVoucherRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
623
+ };
624
+ /**
625
+ * This will delete a voucher.
626
+ * @summary Delete the Voucher
627
+ * @param {VouchersApiDeleteVoucherRequest} requestParameters Request parameters.
628
+ * @param {*} [options] Override http request option.
629
+ * @throws {RequiredError}
630
+ * @memberof VouchersApi
631
+ */
632
+ VouchersApi.prototype.deleteVoucher = function (requestParameters, options) {
633
+ var _this = this;
634
+ return (0, exports.VouchersApiFp)(this.configuration).deleteVoucher(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
635
+ };
636
+ /**
637
+ * This will get a voucher.
638
+ * @summary Retrieve the Voucher
639
+ * @param {VouchersApiGetVoucherRequest} requestParameters Request parameters.
640
+ * @param {*} [options] Override http request option.
641
+ * @throws {RequiredError}
642
+ * @memberof VouchersApi
643
+ */
644
+ VouchersApi.prototype.getVoucher = function (requestParameters, options) {
645
+ var _this = this;
646
+ return (0, exports.VouchersApiFp)(this.configuration).getVoucher(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
647
+ };
648
+ /**
649
+ * Returns a list of Vouchers you have previously created. The Vouchers are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
650
+ * @summary List Vouchers
651
+ * @param {VouchersApiListVouchersRequest} requestParameters Request parameters.
652
+ * @param {*} [options] Override http request option.
653
+ * @throws {RequiredError}
654
+ * @memberof VouchersApi
655
+ */
656
+ VouchersApi.prototype.listVouchers = function (requestParameters, options) {
657
+ var _this = this;
658
+ if (requestParameters === void 0) { requestParameters = {}; }
659
+ return (0, exports.VouchersApiFp)(this.configuration).listVouchers(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then(function (request) { return request(_this.axios, _this.basePath); });
660
+ };
661
+ /**
662
+ * This will update a voucher.
663
+ * @summary Update the Voucher
664
+ * @param {VouchersApiUpdateVoucherRequest} requestParameters Request parameters.
665
+ * @param {*} [options] Override http request option.
666
+ * @throws {RequiredError}
667
+ * @memberof VouchersApi
668
+ */
669
+ VouchersApi.prototype.updateVoucher = function (requestParameters, options) {
670
+ var _this = this;
671
+ return (0, exports.VouchersApiFp)(this.configuration).updateVoucher(requestParameters.code, requestParameters.updateVoucherRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
672
+ };
673
+ return VouchersApi;
674
+ }(base_1.BaseAPI));
675
+ exports.VouchersApi = VouchersApi;