@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,1304 @@
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.CampaignsApi = exports.CampaignsApiFactory = exports.CampaignsApiFp = exports.CampaignsApiAxiosParamCreator = 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
+ * CampaignsApi - axios parameter creator
99
+ * @export
100
+ */
101
+ var CampaignsApiAxiosParamCreator = function (configuration) {
102
+ var _this = this;
103
+ return {
104
+ /**
105
+ * Creates a new campaign that can contain multiple vouchers for eligible accounts to redeem.
106
+ * @summary Create the Campaign
107
+ * @param {CreateCampaignRequestDto} createCampaignRequestDto
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
+ createCampaign: function (createCampaignRequestDto_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([createCampaignRequestDto_1, authorization_1], args_1, true), void 0, function (createCampaignRequestDto, 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 'createCampaignRequestDto' is not null or undefined
124
+ (0, common_1.assertParamExists)('createCampaign', 'createCampaignRequestDto', createCampaignRequestDto);
125
+ localVarPath = "/discountservice/v1/campaigns";
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)(createCampaignRequestDto, localVarRequestOptions, configuration);
149
+ return [2 /*return*/, {
150
+ url: (0, common_1.toPathString)(localVarUrlObj),
151
+ options: localVarRequestOptions,
152
+ }];
153
+ }
154
+ });
155
+ });
156
+ },
157
+ /**
158
+ * Creates an account that is eligible to redeem a vouchers from a specific campaign.
159
+ * @summary Create the Eligible Account
160
+ * @param {string} code Unique identifier for the object.
161
+ * @param {CreateEligibleAccountRequestDto} createEligibleAccountRequestDto
162
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
163
+ * @param {*} [options] Override http request option.
164
+ * @throws {RequiredError}
165
+ */
166
+ createEligibleAccount: function (code_1, createEligibleAccountRequestDto_1, authorization_1) {
167
+ var args_1 = [];
168
+ for (var _i = 3; _i < arguments.length; _i++) {
169
+ args_1[_i - 3] = arguments[_i];
170
+ }
171
+ return __awaiter(_this, __spreadArray([code_1, createEligibleAccountRequestDto_1, authorization_1], args_1, true), void 0, function (code, createEligibleAccountRequestDto, authorization, options) {
172
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
173
+ if (options === void 0) { options = {}; }
174
+ return __generator(this, function (_a) {
175
+ switch (_a.label) {
176
+ case 0:
177
+ // verify required parameter 'code' is not null or undefined
178
+ (0, common_1.assertParamExists)('createEligibleAccount', 'code', code);
179
+ // verify required parameter 'createEligibleAccountRequestDto' is not null or undefined
180
+ (0, common_1.assertParamExists)('createEligibleAccount', 'createEligibleAccountRequestDto', createEligibleAccountRequestDto);
181
+ localVarPath = "/discountservice/v1/campaigns/{code}/eligible-accounts"
182
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
183
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
184
+ if (configuration) {
185
+ baseOptions = configuration.baseOptions;
186
+ baseAccessToken = configuration.accessToken;
187
+ }
188
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
189
+ localVarHeaderParameter = {};
190
+ localVarQueryParameter = {};
191
+ // authentication bearer required
192
+ // http bearer authentication required
193
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
194
+ case 1:
195
+ // authentication bearer required
196
+ // http bearer authentication required
197
+ _a.sent();
198
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
199
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
200
+ }
201
+ localVarHeaderParameter['Content-Type'] = 'application/json';
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
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createEligibleAccountRequestDto, localVarRequestOptions, configuration);
206
+ return [2 /*return*/, {
207
+ url: (0, common_1.toPathString)(localVarUrlObj),
208
+ options: localVarRequestOptions,
209
+ }];
210
+ }
211
+ });
212
+ });
213
+ },
214
+ /**
215
+ * Removes a campaign and its associated vouchers. This will prevent any further voucher redemptions.
216
+ * @summary Delete the Campaign
217
+ * @param {string} code Unique identifier for the object.
218
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
219
+ * @param {*} [options] Override http request option.
220
+ * @throws {RequiredError}
221
+ */
222
+ deleteCampaign: function (code_1, authorization_1) {
223
+ var args_1 = [];
224
+ for (var _i = 2; _i < arguments.length; _i++) {
225
+ args_1[_i - 2] = arguments[_i];
226
+ }
227
+ return __awaiter(_this, __spreadArray([code_1, authorization_1], args_1, true), void 0, function (code, authorization, 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)('deleteCampaign', 'code', code);
235
+ localVarPath = "/discountservice/v1/campaigns/{code}"
236
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
237
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
238
+ if (configuration) {
239
+ baseOptions = configuration.baseOptions;
240
+ baseAccessToken = configuration.accessToken;
241
+ }
242
+ localVarRequestOptions = __assign(__assign({ method: 'DELETE' }, 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 (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
253
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
254
+ }
255
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
256
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
257
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
258
+ return [2 /*return*/, {
259
+ url: (0, common_1.toPathString)(localVarUrlObj),
260
+ options: localVarRequestOptions,
261
+ }];
262
+ }
263
+ });
264
+ });
265
+ },
266
+ /**
267
+ * Removes an eligible account from a campaign. This will prevent the account from using the assigned voucher code for discounts when the campaign is released.
268
+ * @summary Delete the Eligible Account
269
+ * @param {string} code Unique identifier for the object.
270
+ * @param {string} accountCode The code of the eligible account
271
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
272
+ * @param {*} [options] Override http request option.
273
+ * @throws {RequiredError}
274
+ */
275
+ deleteEligibleAccount: function (code_1, accountCode_1, authorization_1) {
276
+ var args_1 = [];
277
+ for (var _i = 3; _i < arguments.length; _i++) {
278
+ args_1[_i - 3] = arguments[_i];
279
+ }
280
+ return __awaiter(_this, __spreadArray([code_1, accountCode_1, authorization_1], args_1, true), void 0, function (code, accountCode, authorization, options) {
281
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
282
+ if (options === void 0) { options = {}; }
283
+ return __generator(this, function (_a) {
284
+ switch (_a.label) {
285
+ case 0:
286
+ // verify required parameter 'code' is not null or undefined
287
+ (0, common_1.assertParamExists)('deleteEligibleAccount', 'code', code);
288
+ // verify required parameter 'accountCode' is not null or undefined
289
+ (0, common_1.assertParamExists)('deleteEligibleAccount', 'accountCode', accountCode);
290
+ localVarPath = "/discountservice/v1/campaigns/{code}/eligible-accounts/{accountCode}"
291
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)))
292
+ .replace("{".concat("accountCode", "}"), encodeURIComponent(String(accountCode)));
293
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
294
+ if (configuration) {
295
+ baseOptions = configuration.baseOptions;
296
+ baseAccessToken = configuration.accessToken;
297
+ }
298
+ localVarRequestOptions = __assign(__assign({ method: 'DELETE' }, baseOptions), options);
299
+ localVarHeaderParameter = {};
300
+ localVarQueryParameter = {};
301
+ // authentication bearer required
302
+ // http bearer authentication required
303
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
304
+ case 1:
305
+ // authentication bearer required
306
+ // http bearer authentication required
307
+ _a.sent();
308
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
309
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
310
+ }
311
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
312
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
313
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
314
+ return [2 /*return*/, {
315
+ url: (0, common_1.toPathString)(localVarUrlObj),
316
+ options: localVarRequestOptions,
317
+ }];
318
+ }
319
+ });
320
+ });
321
+ },
322
+ /**
323
+ * Removes all eligible accounts from a campaign. This will prevent these accounts from using their assigned voucher codes for discounts when the campaign is released.
324
+ * @summary Delete the Eligible Accounts
325
+ * @param {string} code Unique identifier for the object.
326
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
327
+ * @param {*} [options] Override http request option.
328
+ * @throws {RequiredError}
329
+ */
330
+ deleteEligibleAccounts: function (code_1, authorization_1) {
331
+ var args_1 = [];
332
+ for (var _i = 2; _i < arguments.length; _i++) {
333
+ args_1[_i - 2] = arguments[_i];
334
+ }
335
+ return __awaiter(_this, __spreadArray([code_1, authorization_1], args_1, true), void 0, function (code, authorization, options) {
336
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
337
+ if (options === void 0) { options = {}; }
338
+ return __generator(this, function (_a) {
339
+ switch (_a.label) {
340
+ case 0:
341
+ // verify required parameter 'code' is not null or undefined
342
+ (0, common_1.assertParamExists)('deleteEligibleAccounts', 'code', code);
343
+ localVarPath = "/discountservice/v1/campaigns/{code}/eligible-accounts"
344
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
345
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
346
+ if (configuration) {
347
+ baseOptions = configuration.baseOptions;
348
+ baseAccessToken = configuration.accessToken;
349
+ }
350
+ localVarRequestOptions = __assign(__assign({ method: 'DELETE' }, baseOptions), options);
351
+ localVarHeaderParameter = {};
352
+ localVarQueryParameter = {};
353
+ // authentication bearer required
354
+ // http bearer authentication required
355
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
356
+ case 1:
357
+ // authentication bearer required
358
+ // http bearer authentication required
359
+ _a.sent();
360
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
361
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
362
+ }
363
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
364
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
365
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
366
+ return [2 /*return*/, {
367
+ url: (0, common_1.toPathString)(localVarUrlObj),
368
+ options: localVarRequestOptions,
369
+ }];
370
+ }
371
+ });
372
+ });
373
+ },
374
+ /**
375
+ * Retrieves detailed information about a specific campaign.
376
+ * @summary Retrieve the Campaign
377
+ * @param {string} code Unique identifier for the object.
378
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
379
+ * @param {number} [expand] You can expand campaign in this endpoint.
380
+ * @param {*} [options] Override http request option.
381
+ * @throws {RequiredError}
382
+ */
383
+ getCampaign: function (code_1, authorization_1, expand_1) {
384
+ var args_1 = [];
385
+ for (var _i = 3; _i < arguments.length; _i++) {
386
+ args_1[_i - 3] = arguments[_i];
387
+ }
388
+ return __awaiter(_this, __spreadArray([code_1, authorization_1, expand_1], args_1, true), void 0, function (code, authorization, expand, options) {
389
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
390
+ if (options === void 0) { options = {}; }
391
+ return __generator(this, function (_a) {
392
+ switch (_a.label) {
393
+ case 0:
394
+ // verify required parameter 'code' is not null or undefined
395
+ (0, common_1.assertParamExists)('getCampaign', 'code', code);
396
+ localVarPath = "/discountservice/v1/campaigns/{code}"
397
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
398
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
399
+ if (configuration) {
400
+ baseOptions = configuration.baseOptions;
401
+ baseAccessToken = configuration.accessToken;
402
+ }
403
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
404
+ localVarHeaderParameter = {};
405
+ localVarQueryParameter = {};
406
+ // authentication bearer required
407
+ // http bearer authentication required
408
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
409
+ case 1:
410
+ // authentication bearer required
411
+ // http bearer authentication required
412
+ _a.sent();
413
+ if (expand !== undefined) {
414
+ localVarQueryParameter['expand'] = expand;
415
+ }
416
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
417
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
418
+ }
419
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
420
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
421
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
422
+ return [2 /*return*/, {
423
+ url: (0, common_1.toPathString)(localVarUrlObj),
424
+ options: localVarRequestOptions,
425
+ }];
426
+ }
427
+ });
428
+ });
429
+ },
430
+ /**
431
+ * Retrieves a list of campaigns.
432
+ * @summary List Campaigns
433
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
434
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
435
+ * @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.
436
+ * @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, name, status, slug, startDate, endDate, createdAt&lt;/i&gt;
437
+ * @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: name, slug&lt;/i&gt;
438
+ * @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: name, status, startDate, endDate, createdAt&lt;/i&gt;
439
+ * @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;
440
+ * @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, name, status, slug, startDate, endDate, createdAt&lt;/i&gt;
441
+ * @param {*} [options] Override http request option.
442
+ * @throws {RequiredError}
443
+ */
444
+ listCampaigns: function (authorization_1, pageSize_1, pageToken_1, filter_1, search_1, order_1, expand_1, filters_1) {
445
+ var args_1 = [];
446
+ for (var _i = 8; _i < arguments.length; _i++) {
447
+ args_1[_i - 8] = arguments[_i];
448
+ }
449
+ 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) {
450
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
451
+ if (options === void 0) { options = {}; }
452
+ return __generator(this, function (_a) {
453
+ switch (_a.label) {
454
+ case 0:
455
+ localVarPath = "/discountservice/v1/campaigns";
456
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
457
+ if (configuration) {
458
+ baseOptions = configuration.baseOptions;
459
+ baseAccessToken = configuration.accessToken;
460
+ }
461
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
462
+ localVarHeaderParameter = {};
463
+ localVarQueryParameter = {};
464
+ // authentication bearer required
465
+ // http bearer authentication required
466
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
467
+ case 1:
468
+ // authentication bearer required
469
+ // http bearer authentication required
470
+ _a.sent();
471
+ if (pageSize !== undefined) {
472
+ localVarQueryParameter['pageSize'] = pageSize;
473
+ }
474
+ if (pageToken !== undefined) {
475
+ localVarQueryParameter['pageToken'] = pageToken;
476
+ }
477
+ if (filter !== undefined) {
478
+ localVarQueryParameter['filter'] = filter;
479
+ }
480
+ if (search !== undefined) {
481
+ localVarQueryParameter['search'] = search;
482
+ }
483
+ if (order !== undefined) {
484
+ localVarQueryParameter['order'] = order;
485
+ }
486
+ if (expand !== undefined) {
487
+ localVarQueryParameter['expand'] = expand;
488
+ }
489
+ if (filters !== undefined) {
490
+ localVarQueryParameter['filters'] = filters;
491
+ }
492
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
493
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
494
+ }
495
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
496
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
497
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
498
+ return [2 /*return*/, {
499
+ url: (0, common_1.toPathString)(localVarUrlObj),
500
+ options: localVarRequestOptions,
501
+ }];
502
+ }
503
+ });
504
+ });
505
+ },
506
+ /**
507
+ * Retrieves a list of eligible accounts.
508
+ * @summary List Eligible Accounts
509
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
510
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
511
+ * @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.
512
+ * @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, partnerNumber, campaignId, createdAt, updatedAt&lt;/i&gt;
513
+ * @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: voucherCode, partnerNumber&lt;/i&gt;
514
+ * @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: voucherCode, partnerNumber, createdAt&lt;/i&gt;
515
+ * @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;
516
+ * @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, partnerNumber, campaignId, createdAt, updatedAt&lt;/i&gt;
517
+ * @param {*} [options] Override http request option.
518
+ * @throws {RequiredError}
519
+ */
520
+ listEligibleAccounts: function (authorization_1, pageSize_1, pageToken_1, filter_1, search_1, order_1, expand_1, filters_1) {
521
+ var args_1 = [];
522
+ for (var _i = 8; _i < arguments.length; _i++) {
523
+ args_1[_i - 8] = arguments[_i];
524
+ }
525
+ 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) {
526
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
527
+ if (options === void 0) { options = {}; }
528
+ return __generator(this, function (_a) {
529
+ switch (_a.label) {
530
+ case 0:
531
+ localVarPath = "/discountservice/v1/campaigns/eligible-accounts";
532
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
533
+ if (configuration) {
534
+ baseOptions = configuration.baseOptions;
535
+ baseAccessToken = configuration.accessToken;
536
+ }
537
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
538
+ localVarHeaderParameter = {};
539
+ localVarQueryParameter = {};
540
+ // authentication bearer required
541
+ // http bearer authentication required
542
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
543
+ case 1:
544
+ // authentication bearer required
545
+ // http bearer authentication required
546
+ _a.sent();
547
+ if (pageSize !== undefined) {
548
+ localVarQueryParameter['pageSize'] = pageSize;
549
+ }
550
+ if (pageToken !== undefined) {
551
+ localVarQueryParameter['pageToken'] = pageToken;
552
+ }
553
+ if (filter !== undefined) {
554
+ localVarQueryParameter['filter'] = filter;
555
+ }
556
+ if (search !== undefined) {
557
+ localVarQueryParameter['search'] = search;
558
+ }
559
+ if (order !== undefined) {
560
+ localVarQueryParameter['order'] = order;
561
+ }
562
+ if (expand !== undefined) {
563
+ localVarQueryParameter['expand'] = expand;
564
+ }
565
+ if (filters !== undefined) {
566
+ localVarQueryParameter['filters'] = filters;
567
+ }
568
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
569
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
570
+ }
571
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
572
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
573
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
574
+ return [2 /*return*/, {
575
+ url: (0, common_1.toPathString)(localVarUrlObj),
576
+ options: localVarRequestOptions,
577
+ }];
578
+ }
579
+ });
580
+ });
581
+ },
582
+ /**
583
+ * Updates the data of an existing campaign. Only DRAFT campaigns can be updated.
584
+ * @summary Update the Campaign
585
+ * @param {string} code Unique identifier for the object.
586
+ * @param {UpdateCampaignRequestDto} updateCampaignRequestDto
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
+ updateCampaign: function (code_1, updateCampaignRequestDto_1, authorization_1) {
592
+ var args_1 = [];
593
+ for (var _i = 3; _i < arguments.length; _i++) {
594
+ args_1[_i - 3] = arguments[_i];
595
+ }
596
+ return __awaiter(_this, __spreadArray([code_1, updateCampaignRequestDto_1, authorization_1], args_1, true), void 0, function (code, updateCampaignRequestDto, authorization, options) {
597
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
598
+ if (options === void 0) { options = {}; }
599
+ return __generator(this, function (_a) {
600
+ switch (_a.label) {
601
+ case 0:
602
+ // verify required parameter 'code' is not null or undefined
603
+ (0, common_1.assertParamExists)('updateCampaign', 'code', code);
604
+ // verify required parameter 'updateCampaignRequestDto' is not null or undefined
605
+ (0, common_1.assertParamExists)('updateCampaign', 'updateCampaignRequestDto', updateCampaignRequestDto);
606
+ localVarPath = "/discountservice/v1/campaigns/{code}"
607
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
608
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
609
+ if (configuration) {
610
+ baseOptions = configuration.baseOptions;
611
+ baseAccessToken = configuration.accessToken;
612
+ }
613
+ localVarRequestOptions = __assign(__assign({ method: 'PUT' }, baseOptions), options);
614
+ localVarHeaderParameter = {};
615
+ localVarQueryParameter = {};
616
+ // authentication bearer required
617
+ // http bearer authentication required
618
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
619
+ case 1:
620
+ // authentication bearer required
621
+ // http bearer authentication required
622
+ _a.sent();
623
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
624
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
625
+ }
626
+ localVarHeaderParameter['Content-Type'] = 'application/json';
627
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
628
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
629
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
630
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateCampaignRequestDto, localVarRequestOptions, configuration);
631
+ return [2 /*return*/, {
632
+ url: (0, common_1.toPathString)(localVarUrlObj),
633
+ options: localVarRequestOptions,
634
+ }];
635
+ }
636
+ });
637
+ });
638
+ },
639
+ /**
640
+ * Updates the status of a campaign, which affects whether vouchers can be redeemed.
641
+ * @summary Updates the status of a campaign.
642
+ * @param {string} code Unique identifier for the object.
643
+ * @param {UpdateCampaignStatusRequestDto} updateCampaignStatusRequestDto
644
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
645
+ * @param {*} [options] Override http request option.
646
+ * @throws {RequiredError}
647
+ */
648
+ updateCampaignStatus: function (code_1, updateCampaignStatusRequestDto_1, authorization_1) {
649
+ var args_1 = [];
650
+ for (var _i = 3; _i < arguments.length; _i++) {
651
+ args_1[_i - 3] = arguments[_i];
652
+ }
653
+ return __awaiter(_this, __spreadArray([code_1, updateCampaignStatusRequestDto_1, authorization_1], args_1, true), void 0, function (code, updateCampaignStatusRequestDto, authorization, options) {
654
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
655
+ if (options === void 0) { options = {}; }
656
+ return __generator(this, function (_a) {
657
+ switch (_a.label) {
658
+ case 0:
659
+ // verify required parameter 'code' is not null or undefined
660
+ (0, common_1.assertParamExists)('updateCampaignStatus', 'code', code);
661
+ // verify required parameter 'updateCampaignStatusRequestDto' is not null or undefined
662
+ (0, common_1.assertParamExists)('updateCampaignStatus', 'updateCampaignStatusRequestDto', updateCampaignStatusRequestDto);
663
+ localVarPath = "/discountservice/v1/campaigns/{code}/status"
664
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
665
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
666
+ if (configuration) {
667
+ baseOptions = configuration.baseOptions;
668
+ baseAccessToken = configuration.accessToken;
669
+ }
670
+ localVarRequestOptions = __assign(__assign({ method: 'PATCH' }, baseOptions), options);
671
+ localVarHeaderParameter = {};
672
+ localVarQueryParameter = {};
673
+ // authentication bearer required
674
+ // http bearer authentication required
675
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
676
+ case 1:
677
+ // authentication bearer required
678
+ // http bearer authentication required
679
+ _a.sent();
680
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
681
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
682
+ }
683
+ localVarHeaderParameter['Content-Type'] = 'application/json';
684
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
685
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
686
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
687
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateCampaignStatusRequestDto, localVarRequestOptions, configuration);
688
+ return [2 /*return*/, {
689
+ url: (0, common_1.toPathString)(localVarUrlObj),
690
+ options: localVarRequestOptions,
691
+ }];
692
+ }
693
+ });
694
+ });
695
+ },
696
+ /**
697
+ * Uploads accounts that are eligible to redeem vouchers from a specific campaign using a CSV file. The CSV file must contain a header row with the following columns: partnerNumber, voucherCode. Separate each column with a comma.
698
+ * @summary Uploads the eligible accounts.
699
+ * @param {string} code Unique identifier for the object.
700
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
701
+ * @param {*} [options] Override http request option.
702
+ * @throws {RequiredError}
703
+ */
704
+ uploadEligibleAccounts: function (code_1, authorization_1) {
705
+ var args_1 = [];
706
+ for (var _i = 2; _i < arguments.length; _i++) {
707
+ args_1[_i - 2] = arguments[_i];
708
+ }
709
+ return __awaiter(_this, __spreadArray([code_1, authorization_1], args_1, true), void 0, function (code, authorization, options) {
710
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
711
+ if (options === void 0) { options = {}; }
712
+ return __generator(this, function (_a) {
713
+ switch (_a.label) {
714
+ case 0:
715
+ // verify required parameter 'code' is not null or undefined
716
+ (0, common_1.assertParamExists)('uploadEligibleAccounts', 'code', code);
717
+ localVarPath = "/discountservice/v1/campaigns/{code}/eligible-accounts/batch"
718
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
719
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
720
+ if (configuration) {
721
+ baseOptions = configuration.baseOptions;
722
+ baseAccessToken = configuration.accessToken;
723
+ }
724
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
725
+ localVarHeaderParameter = {};
726
+ localVarQueryParameter = {};
727
+ // authentication bearer required
728
+ // http bearer authentication required
729
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
730
+ case 1:
731
+ // authentication bearer required
732
+ // http bearer authentication required
733
+ _a.sent();
734
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
735
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
736
+ }
737
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
738
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
739
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
740
+ return [2 /*return*/, {
741
+ url: (0, common_1.toPathString)(localVarUrlObj),
742
+ options: localVarRequestOptions,
743
+ }];
744
+ }
745
+ });
746
+ });
747
+ },
748
+ };
749
+ };
750
+ exports.CampaignsApiAxiosParamCreator = CampaignsApiAxiosParamCreator;
751
+ /**
752
+ * CampaignsApi - functional programming interface
753
+ * @export
754
+ */
755
+ var CampaignsApiFp = function (configuration) {
756
+ var localVarAxiosParamCreator = (0, exports.CampaignsApiAxiosParamCreator)(configuration);
757
+ return {
758
+ /**
759
+ * Creates a new campaign that can contain multiple vouchers for eligible accounts to redeem.
760
+ * @summary Create the Campaign
761
+ * @param {CreateCampaignRequestDto} createCampaignRequestDto
762
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
763
+ * @param {*} [options] Override http request option.
764
+ * @throws {RequiredError}
765
+ */
766
+ createCampaign: function (createCampaignRequestDto, authorization, options) {
767
+ return __awaiter(this, void 0, void 0, function () {
768
+ var localVarAxiosArgs;
769
+ return __generator(this, function (_a) {
770
+ switch (_a.label) {
771
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.createCampaign(createCampaignRequestDto, authorization, options)];
772
+ case 1:
773
+ localVarAxiosArgs = _a.sent();
774
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
775
+ }
776
+ });
777
+ });
778
+ },
779
+ /**
780
+ * Creates an account that is eligible to redeem a vouchers from a specific campaign.
781
+ * @summary Create the Eligible Account
782
+ * @param {string} code Unique identifier for the object.
783
+ * @param {CreateEligibleAccountRequestDto} createEligibleAccountRequestDto
784
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
785
+ * @param {*} [options] Override http request option.
786
+ * @throws {RequiredError}
787
+ */
788
+ createEligibleAccount: function (code, createEligibleAccountRequestDto, authorization, options) {
789
+ return __awaiter(this, void 0, void 0, function () {
790
+ var localVarAxiosArgs;
791
+ return __generator(this, function (_a) {
792
+ switch (_a.label) {
793
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.createEligibleAccount(code, createEligibleAccountRequestDto, authorization, options)];
794
+ case 1:
795
+ localVarAxiosArgs = _a.sent();
796
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
797
+ }
798
+ });
799
+ });
800
+ },
801
+ /**
802
+ * Removes a campaign and its associated vouchers. This will prevent any further voucher redemptions.
803
+ * @summary Delete the Campaign
804
+ * @param {string} code Unique identifier for the object.
805
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
806
+ * @param {*} [options] Override http request option.
807
+ * @throws {RequiredError}
808
+ */
809
+ deleteCampaign: function (code, authorization, options) {
810
+ return __awaiter(this, void 0, void 0, function () {
811
+ var localVarAxiosArgs;
812
+ return __generator(this, function (_a) {
813
+ switch (_a.label) {
814
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.deleteCampaign(code, authorization, options)];
815
+ case 1:
816
+ localVarAxiosArgs = _a.sent();
817
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
818
+ }
819
+ });
820
+ });
821
+ },
822
+ /**
823
+ * Removes an eligible account from a campaign. This will prevent the account from using the assigned voucher code for discounts when the campaign is released.
824
+ * @summary Delete the Eligible Account
825
+ * @param {string} code Unique identifier for the object.
826
+ * @param {string} accountCode The code of the eligible account
827
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
828
+ * @param {*} [options] Override http request option.
829
+ * @throws {RequiredError}
830
+ */
831
+ deleteEligibleAccount: function (code, accountCode, authorization, options) {
832
+ return __awaiter(this, void 0, void 0, function () {
833
+ var localVarAxiosArgs;
834
+ return __generator(this, function (_a) {
835
+ switch (_a.label) {
836
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.deleteEligibleAccount(code, accountCode, authorization, options)];
837
+ case 1:
838
+ localVarAxiosArgs = _a.sent();
839
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
840
+ }
841
+ });
842
+ });
843
+ },
844
+ /**
845
+ * Removes all eligible accounts from a campaign. This will prevent these accounts from using their assigned voucher codes for discounts when the campaign is released.
846
+ * @summary Delete the Eligible Accounts
847
+ * @param {string} code Unique identifier for the object.
848
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
849
+ * @param {*} [options] Override http request option.
850
+ * @throws {RequiredError}
851
+ */
852
+ deleteEligibleAccounts: function (code, authorization, options) {
853
+ return __awaiter(this, void 0, void 0, function () {
854
+ var localVarAxiosArgs;
855
+ return __generator(this, function (_a) {
856
+ switch (_a.label) {
857
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.deleteEligibleAccounts(code, authorization, options)];
858
+ case 1:
859
+ localVarAxiosArgs = _a.sent();
860
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
861
+ }
862
+ });
863
+ });
864
+ },
865
+ /**
866
+ * Retrieves detailed information about a specific campaign.
867
+ * @summary Retrieve the Campaign
868
+ * @param {string} code Unique identifier for the object.
869
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
870
+ * @param {number} [expand] You can expand campaign in this endpoint.
871
+ * @param {*} [options] Override http request option.
872
+ * @throws {RequiredError}
873
+ */
874
+ getCampaign: function (code, authorization, expand, options) {
875
+ return __awaiter(this, void 0, void 0, function () {
876
+ var localVarAxiosArgs;
877
+ return __generator(this, function (_a) {
878
+ switch (_a.label) {
879
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getCampaign(code, authorization, expand, options)];
880
+ case 1:
881
+ localVarAxiosArgs = _a.sent();
882
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
883
+ }
884
+ });
885
+ });
886
+ },
887
+ /**
888
+ * Retrieves a list of campaigns.
889
+ * @summary List Campaigns
890
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
891
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
892
+ * @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.
893
+ * @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, name, status, slug, startDate, endDate, createdAt&lt;/i&gt;
894
+ * @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: name, slug&lt;/i&gt;
895
+ * @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: name, status, startDate, endDate, createdAt&lt;/i&gt;
896
+ * @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;
897
+ * @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, name, status, slug, startDate, endDate, createdAt&lt;/i&gt;
898
+ * @param {*} [options] Override http request option.
899
+ * @throws {RequiredError}
900
+ */
901
+ listCampaigns: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
902
+ return __awaiter(this, void 0, void 0, function () {
903
+ var localVarAxiosArgs;
904
+ return __generator(this, function (_a) {
905
+ switch (_a.label) {
906
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listCampaigns(authorization, pageSize, pageToken, filter, search, order, expand, filters, options)];
907
+ case 1:
908
+ localVarAxiosArgs = _a.sent();
909
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
910
+ }
911
+ });
912
+ });
913
+ },
914
+ /**
915
+ * Retrieves a list of eligible accounts.
916
+ * @summary List Eligible Accounts
917
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
918
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
919
+ * @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.
920
+ * @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, partnerNumber, campaignId, createdAt, updatedAt&lt;/i&gt;
921
+ * @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: voucherCode, partnerNumber&lt;/i&gt;
922
+ * @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: voucherCode, partnerNumber, createdAt&lt;/i&gt;
923
+ * @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;
924
+ * @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, partnerNumber, campaignId, createdAt, updatedAt&lt;/i&gt;
925
+ * @param {*} [options] Override http request option.
926
+ * @throws {RequiredError}
927
+ */
928
+ listEligibleAccounts: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
929
+ return __awaiter(this, void 0, void 0, function () {
930
+ var localVarAxiosArgs;
931
+ return __generator(this, function (_a) {
932
+ switch (_a.label) {
933
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listEligibleAccounts(authorization, pageSize, pageToken, filter, search, order, expand, filters, options)];
934
+ case 1:
935
+ localVarAxiosArgs = _a.sent();
936
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
937
+ }
938
+ });
939
+ });
940
+ },
941
+ /**
942
+ * Updates the data of an existing campaign. Only DRAFT campaigns can be updated.
943
+ * @summary Update the Campaign
944
+ * @param {string} code Unique identifier for the object.
945
+ * @param {UpdateCampaignRequestDto} updateCampaignRequestDto
946
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
947
+ * @param {*} [options] Override http request option.
948
+ * @throws {RequiredError}
949
+ */
950
+ updateCampaign: function (code, updateCampaignRequestDto, authorization, options) {
951
+ return __awaiter(this, void 0, void 0, function () {
952
+ var localVarAxiosArgs;
953
+ return __generator(this, function (_a) {
954
+ switch (_a.label) {
955
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.updateCampaign(code, updateCampaignRequestDto, authorization, options)];
956
+ case 1:
957
+ localVarAxiosArgs = _a.sent();
958
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
959
+ }
960
+ });
961
+ });
962
+ },
963
+ /**
964
+ * Updates the status of a campaign, which affects whether vouchers can be redeemed.
965
+ * @summary Updates the status of a campaign.
966
+ * @param {string} code Unique identifier for the object.
967
+ * @param {UpdateCampaignStatusRequestDto} updateCampaignStatusRequestDto
968
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
969
+ * @param {*} [options] Override http request option.
970
+ * @throws {RequiredError}
971
+ */
972
+ updateCampaignStatus: function (code, updateCampaignStatusRequestDto, authorization, options) {
973
+ return __awaiter(this, void 0, void 0, function () {
974
+ var localVarAxiosArgs;
975
+ return __generator(this, function (_a) {
976
+ switch (_a.label) {
977
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.updateCampaignStatus(code, updateCampaignStatusRequestDto, authorization, options)];
978
+ case 1:
979
+ localVarAxiosArgs = _a.sent();
980
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
981
+ }
982
+ });
983
+ });
984
+ },
985
+ /**
986
+ * Uploads accounts that are eligible to redeem vouchers from a specific campaign using a CSV file. The CSV file must contain a header row with the following columns: partnerNumber, voucherCode. Separate each column with a comma.
987
+ * @summary Uploads the eligible accounts.
988
+ * @param {string} code Unique identifier for the object.
989
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
990
+ * @param {*} [options] Override http request option.
991
+ * @throws {RequiredError}
992
+ */
993
+ uploadEligibleAccounts: function (code, authorization, options) {
994
+ return __awaiter(this, void 0, void 0, function () {
995
+ var localVarAxiosArgs;
996
+ return __generator(this, function (_a) {
997
+ switch (_a.label) {
998
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.uploadEligibleAccounts(code, authorization, options)];
999
+ case 1:
1000
+ localVarAxiosArgs = _a.sent();
1001
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
1002
+ }
1003
+ });
1004
+ });
1005
+ },
1006
+ };
1007
+ };
1008
+ exports.CampaignsApiFp = CampaignsApiFp;
1009
+ /**
1010
+ * CampaignsApi - factory interface
1011
+ * @export
1012
+ */
1013
+ var CampaignsApiFactory = function (configuration, basePath, axios) {
1014
+ var localVarFp = (0, exports.CampaignsApiFp)(configuration);
1015
+ return {
1016
+ /**
1017
+ * Creates a new campaign that can contain multiple vouchers for eligible accounts to redeem.
1018
+ * @summary Create the Campaign
1019
+ * @param {CreateCampaignRequestDto} createCampaignRequestDto
1020
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1021
+ * @param {*} [options] Override http request option.
1022
+ * @throws {RequiredError}
1023
+ */
1024
+ createCampaign: function (createCampaignRequestDto, authorization, options) {
1025
+ return localVarFp.createCampaign(createCampaignRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
1026
+ },
1027
+ /**
1028
+ * Creates an account that is eligible to redeem a vouchers from a specific campaign.
1029
+ * @summary Create the Eligible Account
1030
+ * @param {string} code Unique identifier for the object.
1031
+ * @param {CreateEligibleAccountRequestDto} createEligibleAccountRequestDto
1032
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1033
+ * @param {*} [options] Override http request option.
1034
+ * @throws {RequiredError}
1035
+ */
1036
+ createEligibleAccount: function (code, createEligibleAccountRequestDto, authorization, options) {
1037
+ return localVarFp.createEligibleAccount(code, createEligibleAccountRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
1038
+ },
1039
+ /**
1040
+ * Removes a campaign and its associated vouchers. This will prevent any further voucher redemptions.
1041
+ * @summary Delete the Campaign
1042
+ * @param {string} code Unique identifier for the object.
1043
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1044
+ * @param {*} [options] Override http request option.
1045
+ * @throws {RequiredError}
1046
+ */
1047
+ deleteCampaign: function (code, authorization, options) {
1048
+ return localVarFp.deleteCampaign(code, authorization, options).then(function (request) { return request(axios, basePath); });
1049
+ },
1050
+ /**
1051
+ * Removes an eligible account from a campaign. This will prevent the account from using the assigned voucher code for discounts when the campaign is released.
1052
+ * @summary Delete the Eligible Account
1053
+ * @param {string} code Unique identifier for the object.
1054
+ * @param {string} accountCode The code of the eligible account
1055
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1056
+ * @param {*} [options] Override http request option.
1057
+ * @throws {RequiredError}
1058
+ */
1059
+ deleteEligibleAccount: function (code, accountCode, authorization, options) {
1060
+ return localVarFp.deleteEligibleAccount(code, accountCode, authorization, options).then(function (request) { return request(axios, basePath); });
1061
+ },
1062
+ /**
1063
+ * Removes all eligible accounts from a campaign. This will prevent these accounts from using their assigned voucher codes for discounts when the campaign is released.
1064
+ * @summary Delete the Eligible Accounts
1065
+ * @param {string} code Unique identifier for the object.
1066
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1067
+ * @param {*} [options] Override http request option.
1068
+ * @throws {RequiredError}
1069
+ */
1070
+ deleteEligibleAccounts: function (code, authorization, options) {
1071
+ return localVarFp.deleteEligibleAccounts(code, authorization, options).then(function (request) { return request(axios, basePath); });
1072
+ },
1073
+ /**
1074
+ * Retrieves detailed information about a specific campaign.
1075
+ * @summary Retrieve the Campaign
1076
+ * @param {string} code Unique identifier for the object.
1077
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1078
+ * @param {number} [expand] You can expand campaign in this endpoint.
1079
+ * @param {*} [options] Override http request option.
1080
+ * @throws {RequiredError}
1081
+ */
1082
+ getCampaign: function (code, authorization, expand, options) {
1083
+ return localVarFp.getCampaign(code, authorization, expand, options).then(function (request) { return request(axios, basePath); });
1084
+ },
1085
+ /**
1086
+ * Retrieves a list of campaigns.
1087
+ * @summary List Campaigns
1088
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1089
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
1090
+ * @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.
1091
+ * @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, name, status, slug, startDate, endDate, createdAt&lt;/i&gt;
1092
+ * @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: name, slug&lt;/i&gt;
1093
+ * @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: name, status, startDate, endDate, createdAt&lt;/i&gt;
1094
+ * @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;
1095
+ * @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, name, status, slug, startDate, endDate, createdAt&lt;/i&gt;
1096
+ * @param {*} [options] Override http request option.
1097
+ * @throws {RequiredError}
1098
+ */
1099
+ listCampaigns: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
1100
+ return localVarFp.listCampaigns(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then(function (request) { return request(axios, basePath); });
1101
+ },
1102
+ /**
1103
+ * Retrieves a list of eligible accounts.
1104
+ * @summary List Eligible Accounts
1105
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1106
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
1107
+ * @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.
1108
+ * @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, partnerNumber, campaignId, createdAt, updatedAt&lt;/i&gt;
1109
+ * @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: voucherCode, partnerNumber&lt;/i&gt;
1110
+ * @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: voucherCode, partnerNumber, createdAt&lt;/i&gt;
1111
+ * @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;
1112
+ * @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, partnerNumber, campaignId, createdAt, updatedAt&lt;/i&gt;
1113
+ * @param {*} [options] Override http request option.
1114
+ * @throws {RequiredError}
1115
+ */
1116
+ listEligibleAccounts: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
1117
+ return localVarFp.listEligibleAccounts(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then(function (request) { return request(axios, basePath); });
1118
+ },
1119
+ /**
1120
+ * Updates the data of an existing campaign. Only DRAFT campaigns can be updated.
1121
+ * @summary Update the Campaign
1122
+ * @param {string} code Unique identifier for the object.
1123
+ * @param {UpdateCampaignRequestDto} updateCampaignRequestDto
1124
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1125
+ * @param {*} [options] Override http request option.
1126
+ * @throws {RequiredError}
1127
+ */
1128
+ updateCampaign: function (code, updateCampaignRequestDto, authorization, options) {
1129
+ return localVarFp.updateCampaign(code, updateCampaignRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
1130
+ },
1131
+ /**
1132
+ * Updates the status of a campaign, which affects whether vouchers can be redeemed.
1133
+ * @summary Updates the status of a campaign.
1134
+ * @param {string} code Unique identifier for the object.
1135
+ * @param {UpdateCampaignStatusRequestDto} updateCampaignStatusRequestDto
1136
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1137
+ * @param {*} [options] Override http request option.
1138
+ * @throws {RequiredError}
1139
+ */
1140
+ updateCampaignStatus: function (code, updateCampaignStatusRequestDto, authorization, options) {
1141
+ return localVarFp.updateCampaignStatus(code, updateCampaignStatusRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
1142
+ },
1143
+ /**
1144
+ * Uploads accounts that are eligible to redeem vouchers from a specific campaign using a CSV file. The CSV file must contain a header row with the following columns: partnerNumber, voucherCode. Separate each column with a comma.
1145
+ * @summary Uploads the eligible accounts.
1146
+ * @param {string} code Unique identifier for the object.
1147
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1148
+ * @param {*} [options] Override http request option.
1149
+ * @throws {RequiredError}
1150
+ */
1151
+ uploadEligibleAccounts: function (code, authorization, options) {
1152
+ return localVarFp.uploadEligibleAccounts(code, authorization, options).then(function (request) { return request(axios, basePath); });
1153
+ },
1154
+ };
1155
+ };
1156
+ exports.CampaignsApiFactory = CampaignsApiFactory;
1157
+ /**
1158
+ * CampaignsApi - object-oriented interface
1159
+ * @export
1160
+ * @class CampaignsApi
1161
+ * @extends {BaseAPI}
1162
+ */
1163
+ var CampaignsApi = /** @class */ (function (_super) {
1164
+ __extends(CampaignsApi, _super);
1165
+ function CampaignsApi() {
1166
+ return _super !== null && _super.apply(this, arguments) || this;
1167
+ }
1168
+ /**
1169
+ * Creates a new campaign that can contain multiple vouchers for eligible accounts to redeem.
1170
+ * @summary Create the Campaign
1171
+ * @param {CampaignsApiCreateCampaignRequest} requestParameters Request parameters.
1172
+ * @param {*} [options] Override http request option.
1173
+ * @throws {RequiredError}
1174
+ * @memberof CampaignsApi
1175
+ */
1176
+ CampaignsApi.prototype.createCampaign = function (requestParameters, options) {
1177
+ var _this = this;
1178
+ return (0, exports.CampaignsApiFp)(this.configuration).createCampaign(requestParameters.createCampaignRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1179
+ };
1180
+ /**
1181
+ * Creates an account that is eligible to redeem a vouchers from a specific campaign.
1182
+ * @summary Create the Eligible Account
1183
+ * @param {CampaignsApiCreateEligibleAccountRequest} requestParameters Request parameters.
1184
+ * @param {*} [options] Override http request option.
1185
+ * @throws {RequiredError}
1186
+ * @memberof CampaignsApi
1187
+ */
1188
+ CampaignsApi.prototype.createEligibleAccount = function (requestParameters, options) {
1189
+ var _this = this;
1190
+ return (0, exports.CampaignsApiFp)(this.configuration).createEligibleAccount(requestParameters.code, requestParameters.createEligibleAccountRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1191
+ };
1192
+ /**
1193
+ * Removes a campaign and its associated vouchers. This will prevent any further voucher redemptions.
1194
+ * @summary Delete the Campaign
1195
+ * @param {CampaignsApiDeleteCampaignRequest} requestParameters Request parameters.
1196
+ * @param {*} [options] Override http request option.
1197
+ * @throws {RequiredError}
1198
+ * @memberof CampaignsApi
1199
+ */
1200
+ CampaignsApi.prototype.deleteCampaign = function (requestParameters, options) {
1201
+ var _this = this;
1202
+ return (0, exports.CampaignsApiFp)(this.configuration).deleteCampaign(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1203
+ };
1204
+ /**
1205
+ * Removes an eligible account from a campaign. This will prevent the account from using the assigned voucher code for discounts when the campaign is released.
1206
+ * @summary Delete the Eligible Account
1207
+ * @param {CampaignsApiDeleteEligibleAccountRequest} requestParameters Request parameters.
1208
+ * @param {*} [options] Override http request option.
1209
+ * @throws {RequiredError}
1210
+ * @memberof CampaignsApi
1211
+ */
1212
+ CampaignsApi.prototype.deleteEligibleAccount = function (requestParameters, options) {
1213
+ var _this = this;
1214
+ return (0, exports.CampaignsApiFp)(this.configuration).deleteEligibleAccount(requestParameters.code, requestParameters.accountCode, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1215
+ };
1216
+ /**
1217
+ * Removes all eligible accounts from a campaign. This will prevent these accounts from using their assigned voucher codes for discounts when the campaign is released.
1218
+ * @summary Delete the Eligible Accounts
1219
+ * @param {CampaignsApiDeleteEligibleAccountsRequest} requestParameters Request parameters.
1220
+ * @param {*} [options] Override http request option.
1221
+ * @throws {RequiredError}
1222
+ * @memberof CampaignsApi
1223
+ */
1224
+ CampaignsApi.prototype.deleteEligibleAccounts = function (requestParameters, options) {
1225
+ var _this = this;
1226
+ return (0, exports.CampaignsApiFp)(this.configuration).deleteEligibleAccounts(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1227
+ };
1228
+ /**
1229
+ * Retrieves detailed information about a specific campaign.
1230
+ * @summary Retrieve the Campaign
1231
+ * @param {CampaignsApiGetCampaignRequest} requestParameters Request parameters.
1232
+ * @param {*} [options] Override http request option.
1233
+ * @throws {RequiredError}
1234
+ * @memberof CampaignsApi
1235
+ */
1236
+ CampaignsApi.prototype.getCampaign = function (requestParameters, options) {
1237
+ var _this = this;
1238
+ return (0, exports.CampaignsApiFp)(this.configuration).getCampaign(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
1239
+ };
1240
+ /**
1241
+ * Retrieves a list of campaigns.
1242
+ * @summary List Campaigns
1243
+ * @param {CampaignsApiListCampaignsRequest} requestParameters Request parameters.
1244
+ * @param {*} [options] Override http request option.
1245
+ * @throws {RequiredError}
1246
+ * @memberof CampaignsApi
1247
+ */
1248
+ CampaignsApi.prototype.listCampaigns = function (requestParameters, options) {
1249
+ var _this = this;
1250
+ if (requestParameters === void 0) { requestParameters = {}; }
1251
+ return (0, exports.CampaignsApiFp)(this.configuration).listCampaigns(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); });
1252
+ };
1253
+ /**
1254
+ * Retrieves a list of eligible accounts.
1255
+ * @summary List Eligible Accounts
1256
+ * @param {CampaignsApiListEligibleAccountsRequest} requestParameters Request parameters.
1257
+ * @param {*} [options] Override http request option.
1258
+ * @throws {RequiredError}
1259
+ * @memberof CampaignsApi
1260
+ */
1261
+ CampaignsApi.prototype.listEligibleAccounts = function (requestParameters, options) {
1262
+ var _this = this;
1263
+ if (requestParameters === void 0) { requestParameters = {}; }
1264
+ return (0, exports.CampaignsApiFp)(this.configuration).listEligibleAccounts(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); });
1265
+ };
1266
+ /**
1267
+ * Updates the data of an existing campaign. Only DRAFT campaigns can be updated.
1268
+ * @summary Update the Campaign
1269
+ * @param {CampaignsApiUpdateCampaignRequest} requestParameters Request parameters.
1270
+ * @param {*} [options] Override http request option.
1271
+ * @throws {RequiredError}
1272
+ * @memberof CampaignsApi
1273
+ */
1274
+ CampaignsApi.prototype.updateCampaign = function (requestParameters, options) {
1275
+ var _this = this;
1276
+ return (0, exports.CampaignsApiFp)(this.configuration).updateCampaign(requestParameters.code, requestParameters.updateCampaignRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1277
+ };
1278
+ /**
1279
+ * Updates the status of a campaign, which affects whether vouchers can be redeemed.
1280
+ * @summary Updates the status of a campaign.
1281
+ * @param {CampaignsApiUpdateCampaignStatusRequest} requestParameters Request parameters.
1282
+ * @param {*} [options] Override http request option.
1283
+ * @throws {RequiredError}
1284
+ * @memberof CampaignsApi
1285
+ */
1286
+ CampaignsApi.prototype.updateCampaignStatus = function (requestParameters, options) {
1287
+ var _this = this;
1288
+ return (0, exports.CampaignsApiFp)(this.configuration).updateCampaignStatus(requestParameters.code, requestParameters.updateCampaignStatusRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1289
+ };
1290
+ /**
1291
+ * Uploads accounts that are eligible to redeem vouchers from a specific campaign using a CSV file. The CSV file must contain a header row with the following columns: partnerNumber, voucherCode. Separate each column with a comma.
1292
+ * @summary Uploads the eligible accounts.
1293
+ * @param {CampaignsApiUploadEligibleAccountsRequest} requestParameters Request parameters.
1294
+ * @param {*} [options] Override http request option.
1295
+ * @throws {RequiredError}
1296
+ * @memberof CampaignsApi
1297
+ */
1298
+ CampaignsApi.prototype.uploadEligibleAccounts = function (requestParameters, options) {
1299
+ var _this = this;
1300
+ return (0, exports.CampaignsApiFp)(this.configuration).uploadEligibleAccounts(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1301
+ };
1302
+ return CampaignsApi;
1303
+ }(base_1.BaseAPI));
1304
+ exports.CampaignsApi = CampaignsApi;