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

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