@emilgroup/discount-sdk 1.1.1-beta.2

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 +51 -0
  5. package/api/campaigns-api.ts +1433 -0
  6. package/api/default-api.ts +124 -0
  7. package/api/policy-vouchers-api.ts +1038 -0
  8. package/api/vouchers-api.ts +691 -0
  9. package/api.ts +33 -0
  10. package/base.ts +278 -0
  11. package/common.ts +198 -0
  12. package/configuration.ts +110 -0
  13. package/dist/api/campaigns-api.d.ts +808 -0
  14. package/dist/api/campaigns-api.js +1304 -0
  15. package/dist/api/default-api.d.ts +70 -0
  16. package/dist/api/default-api.js +213 -0
  17. package/dist/api/policy-vouchers-api.d.ts +582 -0
  18. package/dist/api/policy-vouchers-api.js +974 -0
  19. package/dist/api/vouchers-api.d.ts +393 -0
  20. package/dist/api/vouchers-api.js +671 -0
  21. package/dist/api.d.ts +15 -0
  22. package/dist/api.js +33 -0
  23. package/dist/base.d.ts +77 -0
  24. package/dist/base.js +321 -0
  25. package/dist/common.d.ts +91 -0
  26. package/dist/common.js +276 -0
  27. package/dist/configuration.d.ts +89 -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 +26 -0
  148. package/tsconfig.json +23 -0
@@ -0,0 +1,671 @@
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
+ /**
98
+ * VouchersApi - axios parameter creator
99
+ * @export
100
+ */
101
+ var VouchersApiAxiosParamCreator = function (configuration) {
102
+ var _this = this;
103
+ return {
104
+ /**
105
+ * This will create a voucher.
106
+ * @summary Create the Voucher
107
+ * @param {CreateVoucherRequestDto} createVoucherRequestDto
108
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
109
+ * @param {*} [options] Override http request option.
110
+ * @throws {RequiredError}
111
+ */
112
+ createVoucher: function (createVoucherRequestDto_1, authorization_1) {
113
+ var args_1 = [];
114
+ for (var _i = 2; _i < arguments.length; _i++) {
115
+ args_1[_i - 2] = arguments[_i];
116
+ }
117
+ return __awaiter(_this, __spreadArray([createVoucherRequestDto_1, authorization_1], args_1, true), void 0, function (createVoucherRequestDto, authorization, options) {
118
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
119
+ if (options === void 0) { options = {}; }
120
+ return __generator(this, function (_a) {
121
+ switch (_a.label) {
122
+ case 0:
123
+ // verify required parameter 'createVoucherRequestDto' is not null or undefined
124
+ (0, common_1.assertParamExists)('createVoucher', 'createVoucherRequestDto', createVoucherRequestDto);
125
+ localVarPath = "/discountservice/v1/vouchers";
126
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
127
+ if (configuration) {
128
+ baseOptions = configuration.baseOptions;
129
+ baseAccessToken = configuration.accessToken;
130
+ }
131
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
132
+ localVarHeaderParameter = {};
133
+ localVarQueryParameter = {};
134
+ // authentication bearer required
135
+ // http bearer authentication required
136
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
137
+ case 1:
138
+ // authentication bearer required
139
+ // http bearer authentication required
140
+ _a.sent();
141
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
142
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
143
+ }
144
+ localVarHeaderParameter['Content-Type'] = 'application/json';
145
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
146
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
147
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
148
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createVoucherRequestDto, localVarRequestOptions, configuration);
149
+ return [2 /*return*/, {
150
+ url: (0, common_1.toPathString)(localVarUrlObj),
151
+ options: localVarRequestOptions,
152
+ }];
153
+ }
154
+ });
155
+ });
156
+ },
157
+ /**
158
+ * This will delete a voucher.
159
+ * @summary Delete the Voucher
160
+ * @param {string} code Unique identifier for the object.
161
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
162
+ * @param {*} [options] Override http request option.
163
+ * @throws {RequiredError}
164
+ */
165
+ deleteVoucher: function (code_1, authorization_1) {
166
+ var args_1 = [];
167
+ for (var _i = 2; _i < arguments.length; _i++) {
168
+ args_1[_i - 2] = arguments[_i];
169
+ }
170
+ return __awaiter(_this, __spreadArray([code_1, authorization_1], args_1, true), void 0, function (code, authorization, options) {
171
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
172
+ if (options === void 0) { options = {}; }
173
+ return __generator(this, function (_a) {
174
+ switch (_a.label) {
175
+ case 0:
176
+ // verify required parameter 'code' is not null or undefined
177
+ (0, common_1.assertParamExists)('deleteVoucher', 'code', code);
178
+ localVarPath = "/discountservice/v1/vouchers/{code}"
179
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
180
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
181
+ if (configuration) {
182
+ baseOptions = configuration.baseOptions;
183
+ baseAccessToken = configuration.accessToken;
184
+ }
185
+ localVarRequestOptions = __assign(__assign({ method: 'DELETE' }, baseOptions), options);
186
+ localVarHeaderParameter = {};
187
+ localVarQueryParameter = {};
188
+ // authentication bearer required
189
+ // http bearer authentication required
190
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
191
+ case 1:
192
+ // authentication bearer required
193
+ // http bearer authentication required
194
+ _a.sent();
195
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
196
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
197
+ }
198
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
199
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
200
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
201
+ return [2 /*return*/, {
202
+ url: (0, common_1.toPathString)(localVarUrlObj),
203
+ options: localVarRequestOptions,
204
+ }];
205
+ }
206
+ });
207
+ });
208
+ },
209
+ /**
210
+ * This will get a voucher.
211
+ * @summary Retrieve the Voucher
212
+ * @param {string} code Unique identifier for the object.
213
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
214
+ * @param {'campaign' | 'productDiscounts'} [expand] You can expand voucher in this endpoint.
215
+ * @param {*} [options] Override http request option.
216
+ * @throws {RequiredError}
217
+ */
218
+ getVoucher: function (code_1, authorization_1, expand_1) {
219
+ var args_1 = [];
220
+ for (var _i = 3; _i < arguments.length; _i++) {
221
+ args_1[_i - 3] = arguments[_i];
222
+ }
223
+ return __awaiter(_this, __spreadArray([code_1, authorization_1, expand_1], args_1, true), void 0, function (code, authorization, expand, options) {
224
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
225
+ if (options === void 0) { options = {}; }
226
+ return __generator(this, function (_a) {
227
+ switch (_a.label) {
228
+ case 0:
229
+ // verify required parameter 'code' is not null or undefined
230
+ (0, common_1.assertParamExists)('getVoucher', 'code', code);
231
+ localVarPath = "/discountservice/v1/vouchers/{code}"
232
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
233
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
234
+ if (configuration) {
235
+ baseOptions = configuration.baseOptions;
236
+ baseAccessToken = configuration.accessToken;
237
+ }
238
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
239
+ localVarHeaderParameter = {};
240
+ localVarQueryParameter = {};
241
+ // authentication bearer required
242
+ // http bearer authentication required
243
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
244
+ case 1:
245
+ // authentication bearer required
246
+ // http bearer authentication required
247
+ _a.sent();
248
+ if (expand !== undefined) {
249
+ localVarQueryParameter['expand'] = expand;
250
+ }
251
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
252
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
253
+ }
254
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
255
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
256
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
257
+ return [2 /*return*/, {
258
+ url: (0, common_1.toPathString)(localVarUrlObj),
259
+ options: localVarRequestOptions,
260
+ }];
261
+ }
262
+ });
263
+ });
264
+ },
265
+ /**
266
+ * 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.
267
+ * @summary List Vouchers
268
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
269
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
270
+ * @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.
271
+ * @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;
272
+ * @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;
273
+ * @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;
274
+ * @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;
275
+ * @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;
276
+ * @param {*} [options] Override http request option.
277
+ * @throws {RequiredError}
278
+ */
279
+ listVouchers: function (authorization_1, pageSize_1, pageToken_1, filter_1, search_1, order_1, expand_1, filters_1) {
280
+ var args_1 = [];
281
+ for (var _i = 8; _i < arguments.length; _i++) {
282
+ args_1[_i - 8] = arguments[_i];
283
+ }
284
+ 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) {
285
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
286
+ if (options === void 0) { options = {}; }
287
+ return __generator(this, function (_a) {
288
+ switch (_a.label) {
289
+ case 0:
290
+ localVarPath = "/discountservice/v1/vouchers";
291
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
292
+ if (configuration) {
293
+ baseOptions = configuration.baseOptions;
294
+ baseAccessToken = configuration.accessToken;
295
+ }
296
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
297
+ localVarHeaderParameter = {};
298
+ localVarQueryParameter = {};
299
+ // authentication bearer required
300
+ // http bearer authentication required
301
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
302
+ case 1:
303
+ // authentication bearer required
304
+ // http bearer authentication required
305
+ _a.sent();
306
+ if (pageSize !== undefined) {
307
+ localVarQueryParameter['pageSize'] = pageSize;
308
+ }
309
+ if (pageToken !== undefined) {
310
+ localVarQueryParameter['pageToken'] = pageToken;
311
+ }
312
+ if (filter !== undefined) {
313
+ localVarQueryParameter['filter'] = filter;
314
+ }
315
+ if (search !== undefined) {
316
+ localVarQueryParameter['search'] = search;
317
+ }
318
+ if (order !== undefined) {
319
+ localVarQueryParameter['order'] = order;
320
+ }
321
+ if (expand !== undefined) {
322
+ localVarQueryParameter['expand'] = expand;
323
+ }
324
+ if (filters !== undefined) {
325
+ localVarQueryParameter['filters'] = filters;
326
+ }
327
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
328
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
329
+ }
330
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
331
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
332
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
333
+ return [2 /*return*/, {
334
+ url: (0, common_1.toPathString)(localVarUrlObj),
335
+ options: localVarRequestOptions,
336
+ }];
337
+ }
338
+ });
339
+ });
340
+ },
341
+ /**
342
+ * This will update a voucher.
343
+ * @summary Update the Voucher
344
+ * @param {string} code Unique identifier for the object.
345
+ * @param {UpdateVoucherRequestDto} updateVoucherRequestDto
346
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
347
+ * @param {*} [options] Override http request option.
348
+ * @throws {RequiredError}
349
+ */
350
+ updateVoucher: function (code_1, updateVoucherRequestDto_1, authorization_1) {
351
+ var args_1 = [];
352
+ for (var _i = 3; _i < arguments.length; _i++) {
353
+ args_1[_i - 3] = arguments[_i];
354
+ }
355
+ return __awaiter(_this, __spreadArray([code_1, updateVoucherRequestDto_1, authorization_1], args_1, true), void 0, function (code, updateVoucherRequestDto, authorization, options) {
356
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
357
+ if (options === void 0) { options = {}; }
358
+ return __generator(this, function (_a) {
359
+ switch (_a.label) {
360
+ case 0:
361
+ // verify required parameter 'code' is not null or undefined
362
+ (0, common_1.assertParamExists)('updateVoucher', 'code', code);
363
+ // verify required parameter 'updateVoucherRequestDto' is not null or undefined
364
+ (0, common_1.assertParamExists)('updateVoucher', 'updateVoucherRequestDto', updateVoucherRequestDto);
365
+ localVarPath = "/discountservice/v1/vouchers/{code}"
366
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
367
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
368
+ if (configuration) {
369
+ baseOptions = configuration.baseOptions;
370
+ baseAccessToken = configuration.accessToken;
371
+ }
372
+ localVarRequestOptions = __assign(__assign({ method: 'PUT' }, baseOptions), options);
373
+ localVarHeaderParameter = {};
374
+ localVarQueryParameter = {};
375
+ // authentication bearer required
376
+ // http bearer authentication required
377
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
378
+ case 1:
379
+ // authentication bearer required
380
+ // http bearer authentication required
381
+ _a.sent();
382
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
383
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
384
+ }
385
+ localVarHeaderParameter['Content-Type'] = 'application/json';
386
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
387
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
388
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
389
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateVoucherRequestDto, localVarRequestOptions, configuration);
390
+ return [2 /*return*/, {
391
+ url: (0, common_1.toPathString)(localVarUrlObj),
392
+ options: localVarRequestOptions,
393
+ }];
394
+ }
395
+ });
396
+ });
397
+ },
398
+ };
399
+ };
400
+ exports.VouchersApiAxiosParamCreator = VouchersApiAxiosParamCreator;
401
+ /**
402
+ * VouchersApi - functional programming interface
403
+ * @export
404
+ */
405
+ var VouchersApiFp = function (configuration) {
406
+ var localVarAxiosParamCreator = (0, exports.VouchersApiAxiosParamCreator)(configuration);
407
+ return {
408
+ /**
409
+ * This will create a voucher.
410
+ * @summary Create the Voucher
411
+ * @param {CreateVoucherRequestDto} createVoucherRequestDto
412
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
413
+ * @param {*} [options] Override http request option.
414
+ * @throws {RequiredError}
415
+ */
416
+ createVoucher: function (createVoucherRequestDto, authorization, options) {
417
+ return __awaiter(this, void 0, void 0, function () {
418
+ var localVarAxiosArgs;
419
+ return __generator(this, function (_a) {
420
+ switch (_a.label) {
421
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.createVoucher(createVoucherRequestDto, authorization, options)];
422
+ case 1:
423
+ localVarAxiosArgs = _a.sent();
424
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
425
+ }
426
+ });
427
+ });
428
+ },
429
+ /**
430
+ * This will delete a voucher.
431
+ * @summary Delete the Voucher
432
+ * @param {string} code Unique identifier for the object.
433
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
434
+ * @param {*} [options] Override http request option.
435
+ * @throws {RequiredError}
436
+ */
437
+ deleteVoucher: function (code, authorization, options) {
438
+ return __awaiter(this, void 0, void 0, function () {
439
+ var localVarAxiosArgs;
440
+ return __generator(this, function (_a) {
441
+ switch (_a.label) {
442
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.deleteVoucher(code, authorization, options)];
443
+ case 1:
444
+ localVarAxiosArgs = _a.sent();
445
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
446
+ }
447
+ });
448
+ });
449
+ },
450
+ /**
451
+ * This will get a voucher.
452
+ * @summary Retrieve the Voucher
453
+ * @param {string} code Unique identifier for the object.
454
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
455
+ * @param {'campaign' | 'productDiscounts'} [expand] You can expand voucher in this endpoint.
456
+ * @param {*} [options] Override http request option.
457
+ * @throws {RequiredError}
458
+ */
459
+ getVoucher: function (code, authorization, expand, options) {
460
+ return __awaiter(this, void 0, void 0, function () {
461
+ var localVarAxiosArgs;
462
+ return __generator(this, function (_a) {
463
+ switch (_a.label) {
464
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getVoucher(code, authorization, expand, options)];
465
+ case 1:
466
+ localVarAxiosArgs = _a.sent();
467
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
468
+ }
469
+ });
470
+ });
471
+ },
472
+ /**
473
+ * 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.
474
+ * @summary List Vouchers
475
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
476
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
477
+ * @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.
478
+ * @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;
479
+ * @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;
480
+ * @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;
481
+ * @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;
482
+ * @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;
483
+ * @param {*} [options] Override http request option.
484
+ * @throws {RequiredError}
485
+ */
486
+ listVouchers: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
487
+ return __awaiter(this, void 0, void 0, function () {
488
+ var localVarAxiosArgs;
489
+ return __generator(this, function (_a) {
490
+ switch (_a.label) {
491
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listVouchers(authorization, pageSize, pageToken, filter, search, order, expand, filters, options)];
492
+ case 1:
493
+ localVarAxiosArgs = _a.sent();
494
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
495
+ }
496
+ });
497
+ });
498
+ },
499
+ /**
500
+ * This will update a voucher.
501
+ * @summary Update the Voucher
502
+ * @param {string} code Unique identifier for the object.
503
+ * @param {UpdateVoucherRequestDto} updateVoucherRequestDto
504
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
505
+ * @param {*} [options] Override http request option.
506
+ * @throws {RequiredError}
507
+ */
508
+ updateVoucher: function (code, updateVoucherRequestDto, authorization, options) {
509
+ return __awaiter(this, void 0, void 0, function () {
510
+ var localVarAxiosArgs;
511
+ return __generator(this, function (_a) {
512
+ switch (_a.label) {
513
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.updateVoucher(code, updateVoucherRequestDto, authorization, options)];
514
+ case 1:
515
+ localVarAxiosArgs = _a.sent();
516
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
517
+ }
518
+ });
519
+ });
520
+ },
521
+ };
522
+ };
523
+ exports.VouchersApiFp = VouchersApiFp;
524
+ /**
525
+ * VouchersApi - factory interface
526
+ * @export
527
+ */
528
+ var VouchersApiFactory = function (configuration, basePath, axios) {
529
+ var localVarFp = (0, exports.VouchersApiFp)(configuration);
530
+ return {
531
+ /**
532
+ * This will create a voucher.
533
+ * @summary Create the Voucher
534
+ * @param {CreateVoucherRequestDto} createVoucherRequestDto
535
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
536
+ * @param {*} [options] Override http request option.
537
+ * @throws {RequiredError}
538
+ */
539
+ createVoucher: function (createVoucherRequestDto, authorization, options) {
540
+ return localVarFp.createVoucher(createVoucherRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
541
+ },
542
+ /**
543
+ * This will delete a voucher.
544
+ * @summary Delete the Voucher
545
+ * @param {string} code Unique identifier for the object.
546
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
547
+ * @param {*} [options] Override http request option.
548
+ * @throws {RequiredError}
549
+ */
550
+ deleteVoucher: function (code, authorization, options) {
551
+ return localVarFp.deleteVoucher(code, authorization, options).then(function (request) { return request(axios, basePath); });
552
+ },
553
+ /**
554
+ * This will get a voucher.
555
+ * @summary Retrieve the Voucher
556
+ * @param {string} code Unique identifier for the object.
557
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
558
+ * @param {'campaign' | 'productDiscounts'} [expand] You can expand voucher in this endpoint.
559
+ * @param {*} [options] Override http request option.
560
+ * @throws {RequiredError}
561
+ */
562
+ getVoucher: function (code, authorization, expand, options) {
563
+ return localVarFp.getVoucher(code, authorization, expand, options).then(function (request) { return request(axios, basePath); });
564
+ },
565
+ /**
566
+ * 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.
567
+ * @summary List Vouchers
568
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
569
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
570
+ * @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.
571
+ * @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;
572
+ * @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;
573
+ * @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;
574
+ * @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;
575
+ * @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;
576
+ * @param {*} [options] Override http request option.
577
+ * @throws {RequiredError}
578
+ */
579
+ listVouchers: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
580
+ return localVarFp.listVouchers(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then(function (request) { return request(axios, basePath); });
581
+ },
582
+ /**
583
+ * This will update a voucher.
584
+ * @summary Update the Voucher
585
+ * @param {string} code Unique identifier for the object.
586
+ * @param {UpdateVoucherRequestDto} updateVoucherRequestDto
587
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
588
+ * @param {*} [options] Override http request option.
589
+ * @throws {RequiredError}
590
+ */
591
+ updateVoucher: function (code, updateVoucherRequestDto, authorization, options) {
592
+ return localVarFp.updateVoucher(code, updateVoucherRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
593
+ },
594
+ };
595
+ };
596
+ exports.VouchersApiFactory = VouchersApiFactory;
597
+ /**
598
+ * VouchersApi - object-oriented interface
599
+ * @export
600
+ * @class VouchersApi
601
+ * @extends {BaseAPI}
602
+ */
603
+ var VouchersApi = /** @class */ (function (_super) {
604
+ __extends(VouchersApi, _super);
605
+ function VouchersApi() {
606
+ return _super !== null && _super.apply(this, arguments) || this;
607
+ }
608
+ /**
609
+ * This will create a voucher.
610
+ * @summary Create the Voucher
611
+ * @param {VouchersApiCreateVoucherRequest} requestParameters Request parameters.
612
+ * @param {*} [options] Override http request option.
613
+ * @throws {RequiredError}
614
+ * @memberof VouchersApi
615
+ */
616
+ VouchersApi.prototype.createVoucher = function (requestParameters, options) {
617
+ var _this = this;
618
+ return (0, exports.VouchersApiFp)(this.configuration).createVoucher(requestParameters.createVoucherRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
619
+ };
620
+ /**
621
+ * This will delete a voucher.
622
+ * @summary Delete the Voucher
623
+ * @param {VouchersApiDeleteVoucherRequest} requestParameters Request parameters.
624
+ * @param {*} [options] Override http request option.
625
+ * @throws {RequiredError}
626
+ * @memberof VouchersApi
627
+ */
628
+ VouchersApi.prototype.deleteVoucher = function (requestParameters, options) {
629
+ var _this = this;
630
+ return (0, exports.VouchersApiFp)(this.configuration).deleteVoucher(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
631
+ };
632
+ /**
633
+ * This will get a voucher.
634
+ * @summary Retrieve the Voucher
635
+ * @param {VouchersApiGetVoucherRequest} requestParameters Request parameters.
636
+ * @param {*} [options] Override http request option.
637
+ * @throws {RequiredError}
638
+ * @memberof VouchersApi
639
+ */
640
+ VouchersApi.prototype.getVoucher = function (requestParameters, options) {
641
+ var _this = this;
642
+ return (0, exports.VouchersApiFp)(this.configuration).getVoucher(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
643
+ };
644
+ /**
645
+ * 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.
646
+ * @summary List Vouchers
647
+ * @param {VouchersApiListVouchersRequest} requestParameters Request parameters.
648
+ * @param {*} [options] Override http request option.
649
+ * @throws {RequiredError}
650
+ * @memberof VouchersApi
651
+ */
652
+ VouchersApi.prototype.listVouchers = function (requestParameters, options) {
653
+ var _this = this;
654
+ if (requestParameters === void 0) { requestParameters = {}; }
655
+ 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); });
656
+ };
657
+ /**
658
+ * This will update a voucher.
659
+ * @summary Update the Voucher
660
+ * @param {VouchersApiUpdateVoucherRequest} requestParameters Request parameters.
661
+ * @param {*} [options] Override http request option.
662
+ * @throws {RequiredError}
663
+ * @memberof VouchersApi
664
+ */
665
+ VouchersApi.prototype.updateVoucher = function (requestParameters, options) {
666
+ var _this = this;
667
+ return (0, exports.VouchersApiFp)(this.configuration).updateVoucher(requestParameters.code, requestParameters.updateVoucherRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
668
+ };
669
+ return VouchersApi;
670
+ }(base_1.BaseAPI));
671
+ exports.VouchersApi = VouchersApi;