@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,978 @@
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.PolicyVouchersApi = exports.PolicyVouchersApiFactory = exports.PolicyVouchersApiFp = exports.PolicyVouchersApiAxiosParamCreator = 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
+ * PolicyVouchersApi - axios parameter creator
103
+ * @export
104
+ */
105
+ var PolicyVouchersApiAxiosParamCreator = function (configuration) {
106
+ var _this = this;
107
+ return {
108
+ /**
109
+ * This will charge the policy voucher.
110
+ * @summary Charges the policy voucher.
111
+ * @param {any} code Unique identifier for the object.
112
+ * @param {ChargePolicyVoucherRequestDto} chargePolicyVoucherRequestDto
113
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
114
+ * @param {*} [options] Override http request option.
115
+ * @throws {RequiredError}
116
+ */
117
+ chargePolicyVoucher: function (code_1, chargePolicyVoucherRequestDto_1, authorization_1) {
118
+ var args_1 = [];
119
+ for (var _i = 3; _i < arguments.length; _i++) {
120
+ args_1[_i - 3] = arguments[_i];
121
+ }
122
+ return __awaiter(_this, __spreadArray([code_1, chargePolicyVoucherRequestDto_1, authorization_1], args_1, true), void 0, function (code, chargePolicyVoucherRequestDto, authorization, options) {
123
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
124
+ if (options === void 0) { options = {}; }
125
+ return __generator(this, function (_a) {
126
+ switch (_a.label) {
127
+ case 0:
128
+ // verify required parameter 'code' is not null or undefined
129
+ (0, common_1.assertParamExists)('chargePolicyVoucher', 'code', code);
130
+ // verify required parameter 'chargePolicyVoucherRequestDto' is not null or undefined
131
+ (0, common_1.assertParamExists)('chargePolicyVoucher', 'chargePolicyVoucherRequestDto', chargePolicyVoucherRequestDto);
132
+ localVarPath = "/discountservice/v1/policy-vouchers/charge"
133
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
134
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
135
+ if (configuration) {
136
+ baseOptions = configuration.baseOptions;
137
+ baseAccessToken = configuration.accessToken;
138
+ }
139
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
140
+ localVarHeaderParameter = {};
141
+ localVarQueryParameter = {};
142
+ // authentication bearer required
143
+ // http bearer authentication required
144
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
145
+ case 1:
146
+ // authentication bearer required
147
+ // http bearer authentication required
148
+ _a.sent();
149
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
150
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
151
+ }
152
+ localVarHeaderParameter['Content-Type'] = 'application/json';
153
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
154
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
155
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
156
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(chargePolicyVoucherRequestDto, localVarRequestOptions, configuration);
157
+ return [2 /*return*/, {
158
+ url: (0, common_1.toPathString)(localVarUrlObj),
159
+ options: localVarRequestOptions,
160
+ }];
161
+ }
162
+ });
163
+ });
164
+ },
165
+ /**
166
+ * This will check if the account is eligible for a specific voucher.
167
+ * @summary Checks the account eligibility.
168
+ * @param {CheckAccountEligibilityRequestDto} checkAccountEligibilityRequestDto
169
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
170
+ * @param {*} [options] Override http request option.
171
+ * @throws {RequiredError}
172
+ */
173
+ checkAccountEligibility: function (checkAccountEligibilityRequestDto_1, authorization_1) {
174
+ var args_1 = [];
175
+ for (var _i = 2; _i < arguments.length; _i++) {
176
+ args_1[_i - 2] = arguments[_i];
177
+ }
178
+ return __awaiter(_this, __spreadArray([checkAccountEligibilityRequestDto_1, authorization_1], args_1, true), void 0, function (checkAccountEligibilityRequestDto, authorization, options) {
179
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
180
+ if (options === void 0) { options = {}; }
181
+ return __generator(this, function (_a) {
182
+ switch (_a.label) {
183
+ case 0:
184
+ // verify required parameter 'checkAccountEligibilityRequestDto' is not null or undefined
185
+ (0, common_1.assertParamExists)('checkAccountEligibility', 'checkAccountEligibilityRequestDto', checkAccountEligibilityRequestDto);
186
+ localVarPath = "/discountservice/v1/policy-vouchers/eligibility";
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)(checkAccountEligibilityRequestDto, localVarRequestOptions, configuration);
210
+ return [2 /*return*/, {
211
+ url: (0, common_1.toPathString)(localVarUrlObj),
212
+ options: localVarRequestOptions,
213
+ }];
214
+ }
215
+ });
216
+ });
217
+ },
218
+ /**
219
+ * This will create an policy voucher.
220
+ * @summary Create the policy voucher
221
+ * @param {CreatePolicyVoucherRequestDto} createPolicyVoucherRequestDto
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
+ createPolicyVoucher: function (createPolicyVoucherRequestDto_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([createPolicyVoucherRequestDto_1, authorization_1], args_1, true), void 0, function (createPolicyVoucherRequestDto, 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 'createPolicyVoucherRequestDto' is not null or undefined
238
+ (0, common_1.assertParamExists)('createPolicyVoucher', 'createPolicyVoucherRequestDto', createPolicyVoucherRequestDto);
239
+ localVarPath = "/discountservice/v1/policy-vouchers";
240
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
241
+ if (configuration) {
242
+ baseOptions = configuration.baseOptions;
243
+ baseAccessToken = configuration.accessToken;
244
+ }
245
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
246
+ localVarHeaderParameter = {};
247
+ localVarQueryParameter = {};
248
+ // authentication bearer required
249
+ // http bearer authentication required
250
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
251
+ case 1:
252
+ // authentication bearer required
253
+ // http bearer authentication required
254
+ _a.sent();
255
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
256
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
257
+ }
258
+ localVarHeaderParameter['Content-Type'] = 'application/json';
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
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createPolicyVoucherRequestDto, localVarRequestOptions, configuration);
263
+ return [2 /*return*/, {
264
+ url: (0, common_1.toPathString)(localVarUrlObj),
265
+ options: localVarRequestOptions,
266
+ }];
267
+ }
268
+ });
269
+ });
270
+ },
271
+ /**
272
+ * This will delete an policy voucher.
273
+ * @summary Delete the policy voucher
274
+ * @param {string} code Unique identifier for the object.
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
+ deletePolicyVoucher: function (code_1, authorization_1) {
280
+ var args_1 = [];
281
+ for (var _i = 2; _i < arguments.length; _i++) {
282
+ args_1[_i - 2] = arguments[_i];
283
+ }
284
+ return __awaiter(_this, __spreadArray([code_1, authorization_1], args_1, true), void 0, function (code, 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)('deletePolicyVoucher', 'code', code);
292
+ localVarPath = "/discountservice/v1/policy-vouchers/{code}"
293
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
294
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
295
+ if (configuration) {
296
+ baseOptions = configuration.baseOptions;
297
+ baseAccessToken = configuration.accessToken;
298
+ }
299
+ localVarRequestOptions = __assign(__assign({ method: 'DELETE' }, baseOptions), options);
300
+ localVarHeaderParameter = {};
301
+ localVarQueryParameter = {};
302
+ // authentication bearer required
303
+ // http bearer authentication required
304
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
305
+ case 1:
306
+ // authentication bearer required
307
+ // http bearer authentication required
308
+ _a.sent();
309
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
310
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
311
+ }
312
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
313
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
314
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
315
+ return [2 /*return*/, {
316
+ url: (0, common_1.toPathString)(localVarUrlObj),
317
+ options: localVarRequestOptions,
318
+ }];
319
+ }
320
+ });
321
+ });
322
+ },
323
+ /**
324
+ * This will get an policy voucher.
325
+ * @summary Retrieve the policy voucher
326
+ * @param {string} code Unique identifier for the object.
327
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
328
+ * @param {'transactions' | 'campaign' | 'voucher'} [expand] You can expand policy voucher in this endpoint. By default, campaign and voucher will be expanded fields.
329
+ * @param {*} [options] Override http request option.
330
+ * @throws {RequiredError}
331
+ */
332
+ getPolicyVoucher: function (code_1, authorization_1, expand_1) {
333
+ var args_1 = [];
334
+ for (var _i = 3; _i < arguments.length; _i++) {
335
+ args_1[_i - 3] = arguments[_i];
336
+ }
337
+ return __awaiter(_this, __spreadArray([code_1, authorization_1, expand_1], args_1, true), void 0, function (code, authorization, expand, options) {
338
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
339
+ if (options === void 0) { options = {}; }
340
+ return __generator(this, function (_a) {
341
+ switch (_a.label) {
342
+ case 0:
343
+ // verify required parameter 'code' is not null or undefined
344
+ (0, common_1.assertParamExists)('getPolicyVoucher', 'code', code);
345
+ localVarPath = "/discountservice/v1/policy-vouchers/{code}"
346
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
347
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
348
+ if (configuration) {
349
+ baseOptions = configuration.baseOptions;
350
+ baseAccessToken = configuration.accessToken;
351
+ }
352
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
353
+ localVarHeaderParameter = {};
354
+ localVarQueryParameter = {};
355
+ // authentication bearer required
356
+ // http bearer authentication required
357
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
358
+ case 1:
359
+ // authentication bearer required
360
+ // http bearer authentication required
361
+ _a.sent();
362
+ if (expand !== undefined) {
363
+ localVarQueryParameter['expand'] = expand;
364
+ }
365
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
366
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
367
+ }
368
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
369
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
370
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
371
+ return [2 /*return*/, {
372
+ url: (0, common_1.toPathString)(localVarUrlObj),
373
+ options: localVarRequestOptions,
374
+ }];
375
+ }
376
+ });
377
+ });
378
+ },
379
+ /**
380
+ * Returns a list of policy vouchers you have previously created. The policy vouchers are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
381
+ * @summary List policy vouchers
382
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
383
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
384
+ * @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.
385
+ * @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, voucherId, productSlug, version, remainingMonths, remainingCredits, yearlyPremium, redeemedAt, createdAt, campaignSlug&lt;/i&gt;
386
+ * @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, productSlug, partnerNumber&lt;/i&gt;
387
+ * @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: id, voucherCode, productSlug, partnerNumber, remainingCredits, remainingMonths, yearlyPremium, redeemedAt, createdAt&lt;/i&gt;
388
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: transactions, campaign, voucher&lt;i&gt;
389
+ * @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, voucherId, productSlug, version, remainingMonths, remainingCredits, yearlyPremium, redeemedAt, createdAt, campaignSlug&lt;/i&gt;
390
+ * @param {*} [options] Override http request option.
391
+ * @throws {RequiredError}
392
+ */
393
+ listPolicyVouchers: function (authorization_1, pageSize_1, pageToken_1, filter_1, search_1, order_1, expand_1, filters_1) {
394
+ var args_1 = [];
395
+ for (var _i = 8; _i < arguments.length; _i++) {
396
+ args_1[_i - 8] = arguments[_i];
397
+ }
398
+ 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) {
399
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
400
+ if (options === void 0) { options = {}; }
401
+ return __generator(this, function (_a) {
402
+ switch (_a.label) {
403
+ case 0:
404
+ localVarPath = "/discountservice/v1/policy-vouchers";
405
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
406
+ if (configuration) {
407
+ baseOptions = configuration.baseOptions;
408
+ baseAccessToken = configuration.accessToken;
409
+ }
410
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
411
+ localVarHeaderParameter = {};
412
+ localVarQueryParameter = {};
413
+ // authentication bearer required
414
+ // http bearer authentication required
415
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
416
+ case 1:
417
+ // authentication bearer required
418
+ // http bearer authentication required
419
+ _a.sent();
420
+ if (pageSize !== undefined) {
421
+ localVarQueryParameter['pageSize'] = pageSize;
422
+ }
423
+ if (pageToken !== undefined) {
424
+ localVarQueryParameter['pageToken'] = pageToken;
425
+ }
426
+ if (filter !== undefined) {
427
+ localVarQueryParameter['filter'] = filter;
428
+ }
429
+ if (search !== undefined) {
430
+ localVarQueryParameter['search'] = search;
431
+ }
432
+ if (order !== undefined) {
433
+ localVarQueryParameter['order'] = order;
434
+ }
435
+ if (expand !== undefined) {
436
+ localVarQueryParameter['expand'] = expand;
437
+ }
438
+ if (filters !== undefined) {
439
+ localVarQueryParameter['filters'] = filters;
440
+ }
441
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
442
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
443
+ }
444
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
445
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
446
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
447
+ return [2 /*return*/, {
448
+ url: (0, common_1.toPathString)(localVarUrlObj),
449
+ options: localVarRequestOptions,
450
+ }];
451
+ }
452
+ });
453
+ });
454
+ },
455
+ /**
456
+ * This will redeem the policy voucher.
457
+ * @summary Redeems the policy voucher.
458
+ * @param {any} code Unique identifier for the object.
459
+ * @param {RedeemPolicyVoucherRequestDto} redeemPolicyVoucherRequestDto
460
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
461
+ * @param {*} [options] Override http request option.
462
+ * @throws {RequiredError}
463
+ */
464
+ redeemPolicyVoucher: function (code_1, redeemPolicyVoucherRequestDto_1, authorization_1) {
465
+ var args_1 = [];
466
+ for (var _i = 3; _i < arguments.length; _i++) {
467
+ args_1[_i - 3] = arguments[_i];
468
+ }
469
+ return __awaiter(_this, __spreadArray([code_1, redeemPolicyVoucherRequestDto_1, authorization_1], args_1, true), void 0, function (code, redeemPolicyVoucherRequestDto, authorization, options) {
470
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
471
+ if (options === void 0) { options = {}; }
472
+ return __generator(this, function (_a) {
473
+ switch (_a.label) {
474
+ case 0:
475
+ // verify required parameter 'code' is not null or undefined
476
+ (0, common_1.assertParamExists)('redeemPolicyVoucher', 'code', code);
477
+ // verify required parameter 'redeemPolicyVoucherRequestDto' is not null or undefined
478
+ (0, common_1.assertParamExists)('redeemPolicyVoucher', 'redeemPolicyVoucherRequestDto', redeemPolicyVoucherRequestDto);
479
+ localVarPath = "/discountservice/v1/policy-vouchers/redeem"
480
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
481
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
482
+ if (configuration) {
483
+ baseOptions = configuration.baseOptions;
484
+ baseAccessToken = configuration.accessToken;
485
+ }
486
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
487
+ localVarHeaderParameter = {};
488
+ localVarQueryParameter = {};
489
+ // authentication bearer required
490
+ // http bearer authentication required
491
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
492
+ case 1:
493
+ // authentication bearer required
494
+ // http bearer authentication required
495
+ _a.sent();
496
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
497
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
498
+ }
499
+ localVarHeaderParameter['Content-Type'] = 'application/json';
500
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
501
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
502
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
503
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(redeemPolicyVoucherRequestDto, localVarRequestOptions, configuration);
504
+ return [2 /*return*/, {
505
+ url: (0, common_1.toPathString)(localVarUrlObj),
506
+ options: localVarRequestOptions,
507
+ }];
508
+ }
509
+ });
510
+ });
511
+ },
512
+ /**
513
+ * This will withdraw the policy voucher.
514
+ * @summary Withdraws the policy voucher.
515
+ * @param {any} code Unique identifier for the object.
516
+ * @param {WithdrawPolicyVoucherRequestDto} withdrawPolicyVoucherRequestDto
517
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
518
+ * @param {*} [options] Override http request option.
519
+ * @throws {RequiredError}
520
+ */
521
+ withdrawPolicyVoucher: function (code_1, withdrawPolicyVoucherRequestDto_1, authorization_1) {
522
+ var args_1 = [];
523
+ for (var _i = 3; _i < arguments.length; _i++) {
524
+ args_1[_i - 3] = arguments[_i];
525
+ }
526
+ return __awaiter(_this, __spreadArray([code_1, withdrawPolicyVoucherRequestDto_1, authorization_1], args_1, true), void 0, function (code, withdrawPolicyVoucherRequestDto, authorization, options) {
527
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
528
+ if (options === void 0) { options = {}; }
529
+ return __generator(this, function (_a) {
530
+ switch (_a.label) {
531
+ case 0:
532
+ // verify required parameter 'code' is not null or undefined
533
+ (0, common_1.assertParamExists)('withdrawPolicyVoucher', 'code', code);
534
+ // verify required parameter 'withdrawPolicyVoucherRequestDto' is not null or undefined
535
+ (0, common_1.assertParamExists)('withdrawPolicyVoucher', 'withdrawPolicyVoucherRequestDto', withdrawPolicyVoucherRequestDto);
536
+ localVarPath = "/discountservice/v1/policy-vouchers/withdraw"
537
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
538
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
539
+ if (configuration) {
540
+ baseOptions = configuration.baseOptions;
541
+ baseAccessToken = configuration.accessToken;
542
+ }
543
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
544
+ localVarHeaderParameter = {};
545
+ localVarQueryParameter = {};
546
+ // authentication bearer required
547
+ // http bearer authentication required
548
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
549
+ case 1:
550
+ // authentication bearer required
551
+ // http bearer authentication required
552
+ _a.sent();
553
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
554
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
555
+ }
556
+ localVarHeaderParameter['Content-Type'] = 'application/json';
557
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
558
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
559
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
560
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(withdrawPolicyVoucherRequestDto, localVarRequestOptions, configuration);
561
+ return [2 /*return*/, {
562
+ url: (0, common_1.toPathString)(localVarUrlObj),
563
+ options: localVarRequestOptions,
564
+ }];
565
+ }
566
+ });
567
+ });
568
+ },
569
+ };
570
+ };
571
+ exports.PolicyVouchersApiAxiosParamCreator = PolicyVouchersApiAxiosParamCreator;
572
+ /**
573
+ * PolicyVouchersApi - functional programming interface
574
+ * @export
575
+ */
576
+ var PolicyVouchersApiFp = function (configuration) {
577
+ var localVarAxiosParamCreator = (0, exports.PolicyVouchersApiAxiosParamCreator)(configuration);
578
+ return {
579
+ /**
580
+ * This will charge the policy voucher.
581
+ * @summary Charges the policy voucher.
582
+ * @param {any} code Unique identifier for the object.
583
+ * @param {ChargePolicyVoucherRequestDto} chargePolicyVoucherRequestDto
584
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
585
+ * @param {*} [options] Override http request option.
586
+ * @throws {RequiredError}
587
+ */
588
+ chargePolicyVoucher: function (code, chargePolicyVoucherRequestDto, authorization, options) {
589
+ return __awaiter(this, void 0, void 0, function () {
590
+ var localVarAxiosArgs;
591
+ return __generator(this, function (_a) {
592
+ switch (_a.label) {
593
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.chargePolicyVoucher(code, chargePolicyVoucherRequestDto, authorization, options)];
594
+ case 1:
595
+ localVarAxiosArgs = _a.sent();
596
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
597
+ }
598
+ });
599
+ });
600
+ },
601
+ /**
602
+ * This will check if the account is eligible for a specific voucher.
603
+ * @summary Checks the account eligibility.
604
+ * @param {CheckAccountEligibilityRequestDto} checkAccountEligibilityRequestDto
605
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
606
+ * @param {*} [options] Override http request option.
607
+ * @throws {RequiredError}
608
+ */
609
+ checkAccountEligibility: function (checkAccountEligibilityRequestDto, authorization, options) {
610
+ return __awaiter(this, void 0, void 0, function () {
611
+ var localVarAxiosArgs;
612
+ return __generator(this, function (_a) {
613
+ switch (_a.label) {
614
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.checkAccountEligibility(checkAccountEligibilityRequestDto, authorization, options)];
615
+ case 1:
616
+ localVarAxiosArgs = _a.sent();
617
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
618
+ }
619
+ });
620
+ });
621
+ },
622
+ /**
623
+ * This will create an policy voucher.
624
+ * @summary Create the policy voucher
625
+ * @param {CreatePolicyVoucherRequestDto} createPolicyVoucherRequestDto
626
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
627
+ * @param {*} [options] Override http request option.
628
+ * @throws {RequiredError}
629
+ */
630
+ createPolicyVoucher: function (createPolicyVoucherRequestDto, authorization, options) {
631
+ return __awaiter(this, void 0, void 0, function () {
632
+ var localVarAxiosArgs;
633
+ return __generator(this, function (_a) {
634
+ switch (_a.label) {
635
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.createPolicyVoucher(createPolicyVoucherRequestDto, authorization, options)];
636
+ case 1:
637
+ localVarAxiosArgs = _a.sent();
638
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
639
+ }
640
+ });
641
+ });
642
+ },
643
+ /**
644
+ * This will delete an policy voucher.
645
+ * @summary Delete the policy voucher
646
+ * @param {string} code Unique identifier for the object.
647
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
648
+ * @param {*} [options] Override http request option.
649
+ * @throws {RequiredError}
650
+ */
651
+ deletePolicyVoucher: function (code, authorization, options) {
652
+ return __awaiter(this, void 0, void 0, function () {
653
+ var localVarAxiosArgs;
654
+ return __generator(this, function (_a) {
655
+ switch (_a.label) {
656
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.deletePolicyVoucher(code, authorization, options)];
657
+ case 1:
658
+ localVarAxiosArgs = _a.sent();
659
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
660
+ }
661
+ });
662
+ });
663
+ },
664
+ /**
665
+ * This will get an policy voucher.
666
+ * @summary Retrieve the policy voucher
667
+ * @param {string} code Unique identifier for the object.
668
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
669
+ * @param {'transactions' | 'campaign' | 'voucher'} [expand] You can expand policy voucher in this endpoint. By default, campaign and voucher will be expanded fields.
670
+ * @param {*} [options] Override http request option.
671
+ * @throws {RequiredError}
672
+ */
673
+ getPolicyVoucher: function (code, authorization, expand, options) {
674
+ return __awaiter(this, void 0, void 0, function () {
675
+ var localVarAxiosArgs;
676
+ return __generator(this, function (_a) {
677
+ switch (_a.label) {
678
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getPolicyVoucher(code, authorization, expand, options)];
679
+ case 1:
680
+ localVarAxiosArgs = _a.sent();
681
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
682
+ }
683
+ });
684
+ });
685
+ },
686
+ /**
687
+ * Returns a list of policy vouchers you have previously created. The policy vouchers are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
688
+ * @summary List policy vouchers
689
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
690
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
691
+ * @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.
692
+ * @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, voucherId, productSlug, version, remainingMonths, remainingCredits, yearlyPremium, redeemedAt, createdAt, campaignSlug&lt;/i&gt;
693
+ * @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, productSlug, partnerNumber&lt;/i&gt;
694
+ * @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: id, voucherCode, productSlug, partnerNumber, remainingCredits, remainingMonths, yearlyPremium, redeemedAt, createdAt&lt;/i&gt;
695
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: transactions, campaign, voucher&lt;i&gt;
696
+ * @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, voucherId, productSlug, version, remainingMonths, remainingCredits, yearlyPremium, redeemedAt, createdAt, campaignSlug&lt;/i&gt;
697
+ * @param {*} [options] Override http request option.
698
+ * @throws {RequiredError}
699
+ */
700
+ listPolicyVouchers: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
701
+ return __awaiter(this, void 0, void 0, function () {
702
+ var localVarAxiosArgs;
703
+ return __generator(this, function (_a) {
704
+ switch (_a.label) {
705
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listPolicyVouchers(authorization, pageSize, pageToken, filter, search, order, expand, filters, options)];
706
+ case 1:
707
+ localVarAxiosArgs = _a.sent();
708
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
709
+ }
710
+ });
711
+ });
712
+ },
713
+ /**
714
+ * This will redeem the policy voucher.
715
+ * @summary Redeems the policy voucher.
716
+ * @param {any} code Unique identifier for the object.
717
+ * @param {RedeemPolicyVoucherRequestDto} redeemPolicyVoucherRequestDto
718
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
719
+ * @param {*} [options] Override http request option.
720
+ * @throws {RequiredError}
721
+ */
722
+ redeemPolicyVoucher: function (code, redeemPolicyVoucherRequestDto, authorization, options) {
723
+ return __awaiter(this, void 0, void 0, function () {
724
+ var localVarAxiosArgs;
725
+ return __generator(this, function (_a) {
726
+ switch (_a.label) {
727
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.redeemPolicyVoucher(code, redeemPolicyVoucherRequestDto, authorization, options)];
728
+ case 1:
729
+ localVarAxiosArgs = _a.sent();
730
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
731
+ }
732
+ });
733
+ });
734
+ },
735
+ /**
736
+ * This will withdraw the policy voucher.
737
+ * @summary Withdraws the policy voucher.
738
+ * @param {any} code Unique identifier for the object.
739
+ * @param {WithdrawPolicyVoucherRequestDto} withdrawPolicyVoucherRequestDto
740
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
741
+ * @param {*} [options] Override http request option.
742
+ * @throws {RequiredError}
743
+ */
744
+ withdrawPolicyVoucher: function (code, withdrawPolicyVoucherRequestDto, authorization, options) {
745
+ return __awaiter(this, void 0, void 0, function () {
746
+ var localVarAxiosArgs;
747
+ return __generator(this, function (_a) {
748
+ switch (_a.label) {
749
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.withdrawPolicyVoucher(code, withdrawPolicyVoucherRequestDto, authorization, options)];
750
+ case 1:
751
+ localVarAxiosArgs = _a.sent();
752
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
753
+ }
754
+ });
755
+ });
756
+ },
757
+ };
758
+ };
759
+ exports.PolicyVouchersApiFp = PolicyVouchersApiFp;
760
+ /**
761
+ * PolicyVouchersApi - factory interface
762
+ * @export
763
+ */
764
+ var PolicyVouchersApiFactory = function (configuration, basePath, axios) {
765
+ var localVarFp = (0, exports.PolicyVouchersApiFp)(configuration);
766
+ return {
767
+ /**
768
+ * This will charge the policy voucher.
769
+ * @summary Charges the policy voucher.
770
+ * @param {any} code Unique identifier for the object.
771
+ * @param {ChargePolicyVoucherRequestDto} chargePolicyVoucherRequestDto
772
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
773
+ * @param {*} [options] Override http request option.
774
+ * @throws {RequiredError}
775
+ */
776
+ chargePolicyVoucher: function (code, chargePolicyVoucherRequestDto, authorization, options) {
777
+ return localVarFp.chargePolicyVoucher(code, chargePolicyVoucherRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
778
+ },
779
+ /**
780
+ * This will check if the account is eligible for a specific voucher.
781
+ * @summary Checks the account eligibility.
782
+ * @param {CheckAccountEligibilityRequestDto} checkAccountEligibilityRequestDto
783
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
784
+ * @param {*} [options] Override http request option.
785
+ * @throws {RequiredError}
786
+ */
787
+ checkAccountEligibility: function (checkAccountEligibilityRequestDto, authorization, options) {
788
+ return localVarFp.checkAccountEligibility(checkAccountEligibilityRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
789
+ },
790
+ /**
791
+ * This will create an policy voucher.
792
+ * @summary Create the policy voucher
793
+ * @param {CreatePolicyVoucherRequestDto} createPolicyVoucherRequestDto
794
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
795
+ * @param {*} [options] Override http request option.
796
+ * @throws {RequiredError}
797
+ */
798
+ createPolicyVoucher: function (createPolicyVoucherRequestDto, authorization, options) {
799
+ return localVarFp.createPolicyVoucher(createPolicyVoucherRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
800
+ },
801
+ /**
802
+ * This will delete an policy voucher.
803
+ * @summary Delete the policy voucher
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
+ deletePolicyVoucher: function (code, authorization, options) {
810
+ return localVarFp.deletePolicyVoucher(code, authorization, options).then(function (request) { return request(axios, basePath); });
811
+ },
812
+ /**
813
+ * This will get an policy voucher.
814
+ * @summary Retrieve the policy voucher
815
+ * @param {string} code Unique identifier for the object.
816
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
817
+ * @param {'transactions' | 'campaign' | 'voucher'} [expand] You can expand policy voucher in this endpoint. By default, campaign and voucher will be expanded fields.
818
+ * @param {*} [options] Override http request option.
819
+ * @throws {RequiredError}
820
+ */
821
+ getPolicyVoucher: function (code, authorization, expand, options) {
822
+ return localVarFp.getPolicyVoucher(code, authorization, expand, options).then(function (request) { return request(axios, basePath); });
823
+ },
824
+ /**
825
+ * Returns a list of policy vouchers you have previously created. The policy vouchers are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
826
+ * @summary List policy vouchers
827
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
828
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
829
+ * @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.
830
+ * @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, voucherId, productSlug, version, remainingMonths, remainingCredits, yearlyPremium, redeemedAt, createdAt, campaignSlug&lt;/i&gt;
831
+ * @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, productSlug, partnerNumber&lt;/i&gt;
832
+ * @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: id, voucherCode, productSlug, partnerNumber, remainingCredits, remainingMonths, yearlyPremium, redeemedAt, createdAt&lt;/i&gt;
833
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: transactions, campaign, voucher&lt;i&gt;
834
+ * @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, voucherId, productSlug, version, remainingMonths, remainingCredits, yearlyPremium, redeemedAt, createdAt, campaignSlug&lt;/i&gt;
835
+ * @param {*} [options] Override http request option.
836
+ * @throws {RequiredError}
837
+ */
838
+ listPolicyVouchers: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
839
+ return localVarFp.listPolicyVouchers(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then(function (request) { return request(axios, basePath); });
840
+ },
841
+ /**
842
+ * This will redeem the policy voucher.
843
+ * @summary Redeems the policy voucher.
844
+ * @param {any} code Unique identifier for the object.
845
+ * @param {RedeemPolicyVoucherRequestDto} redeemPolicyVoucherRequestDto
846
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
847
+ * @param {*} [options] Override http request option.
848
+ * @throws {RequiredError}
849
+ */
850
+ redeemPolicyVoucher: function (code, redeemPolicyVoucherRequestDto, authorization, options) {
851
+ return localVarFp.redeemPolicyVoucher(code, redeemPolicyVoucherRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
852
+ },
853
+ /**
854
+ * This will withdraw the policy voucher.
855
+ * @summary Withdraws the policy voucher.
856
+ * @param {any} code Unique identifier for the object.
857
+ * @param {WithdrawPolicyVoucherRequestDto} withdrawPolicyVoucherRequestDto
858
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
859
+ * @param {*} [options] Override http request option.
860
+ * @throws {RequiredError}
861
+ */
862
+ withdrawPolicyVoucher: function (code, withdrawPolicyVoucherRequestDto, authorization, options) {
863
+ return localVarFp.withdrawPolicyVoucher(code, withdrawPolicyVoucherRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
864
+ },
865
+ };
866
+ };
867
+ exports.PolicyVouchersApiFactory = PolicyVouchersApiFactory;
868
+ /**
869
+ * PolicyVouchersApi - object-oriented interface
870
+ * @export
871
+ * @class PolicyVouchersApi
872
+ * @extends {BaseAPI}
873
+ */
874
+ var PolicyVouchersApi = /** @class */ (function (_super) {
875
+ __extends(PolicyVouchersApi, _super);
876
+ function PolicyVouchersApi() {
877
+ return _super !== null && _super.apply(this, arguments) || this;
878
+ }
879
+ /**
880
+ * This will charge the policy voucher.
881
+ * @summary Charges the policy voucher.
882
+ * @param {PolicyVouchersApiChargePolicyVoucherRequest} requestParameters Request parameters.
883
+ * @param {*} [options] Override http request option.
884
+ * @throws {RequiredError}
885
+ * @memberof PolicyVouchersApi
886
+ */
887
+ PolicyVouchersApi.prototype.chargePolicyVoucher = function (requestParameters, options) {
888
+ var _this = this;
889
+ return (0, exports.PolicyVouchersApiFp)(this.configuration).chargePolicyVoucher(requestParameters.code, requestParameters.chargePolicyVoucherRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
890
+ };
891
+ /**
892
+ * This will check if the account is eligible for a specific voucher.
893
+ * @summary Checks the account eligibility.
894
+ * @param {PolicyVouchersApiCheckAccountEligibilityRequest} requestParameters Request parameters.
895
+ * @param {*} [options] Override http request option.
896
+ * @throws {RequiredError}
897
+ * @memberof PolicyVouchersApi
898
+ */
899
+ PolicyVouchersApi.prototype.checkAccountEligibility = function (requestParameters, options) {
900
+ var _this = this;
901
+ return (0, exports.PolicyVouchersApiFp)(this.configuration).checkAccountEligibility(requestParameters.checkAccountEligibilityRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
902
+ };
903
+ /**
904
+ * This will create an policy voucher.
905
+ * @summary Create the policy voucher
906
+ * @param {PolicyVouchersApiCreatePolicyVoucherRequest} requestParameters Request parameters.
907
+ * @param {*} [options] Override http request option.
908
+ * @throws {RequiredError}
909
+ * @memberof PolicyVouchersApi
910
+ */
911
+ PolicyVouchersApi.prototype.createPolicyVoucher = function (requestParameters, options) {
912
+ var _this = this;
913
+ return (0, exports.PolicyVouchersApiFp)(this.configuration).createPolicyVoucher(requestParameters.createPolicyVoucherRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
914
+ };
915
+ /**
916
+ * This will delete an policy voucher.
917
+ * @summary Delete the policy voucher
918
+ * @param {PolicyVouchersApiDeletePolicyVoucherRequest} requestParameters Request parameters.
919
+ * @param {*} [options] Override http request option.
920
+ * @throws {RequiredError}
921
+ * @memberof PolicyVouchersApi
922
+ */
923
+ PolicyVouchersApi.prototype.deletePolicyVoucher = function (requestParameters, options) {
924
+ var _this = this;
925
+ return (0, exports.PolicyVouchersApiFp)(this.configuration).deletePolicyVoucher(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
926
+ };
927
+ /**
928
+ * This will get an policy voucher.
929
+ * @summary Retrieve the policy voucher
930
+ * @param {PolicyVouchersApiGetPolicyVoucherRequest} requestParameters Request parameters.
931
+ * @param {*} [options] Override http request option.
932
+ * @throws {RequiredError}
933
+ * @memberof PolicyVouchersApi
934
+ */
935
+ PolicyVouchersApi.prototype.getPolicyVoucher = function (requestParameters, options) {
936
+ var _this = this;
937
+ return (0, exports.PolicyVouchersApiFp)(this.configuration).getPolicyVoucher(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
938
+ };
939
+ /**
940
+ * Returns a list of policy vouchers you have previously created. The policy vouchers are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
941
+ * @summary List policy vouchers
942
+ * @param {PolicyVouchersApiListPolicyVouchersRequest} requestParameters Request parameters.
943
+ * @param {*} [options] Override http request option.
944
+ * @throws {RequiredError}
945
+ * @memberof PolicyVouchersApi
946
+ */
947
+ PolicyVouchersApi.prototype.listPolicyVouchers = function (requestParameters, options) {
948
+ var _this = this;
949
+ if (requestParameters === void 0) { requestParameters = {}; }
950
+ return (0, exports.PolicyVouchersApiFp)(this.configuration).listPolicyVouchers(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); });
951
+ };
952
+ /**
953
+ * This will redeem the policy voucher.
954
+ * @summary Redeems the policy voucher.
955
+ * @param {PolicyVouchersApiRedeemPolicyVoucherRequest} requestParameters Request parameters.
956
+ * @param {*} [options] Override http request option.
957
+ * @throws {RequiredError}
958
+ * @memberof PolicyVouchersApi
959
+ */
960
+ PolicyVouchersApi.prototype.redeemPolicyVoucher = function (requestParameters, options) {
961
+ var _this = this;
962
+ return (0, exports.PolicyVouchersApiFp)(this.configuration).redeemPolicyVoucher(requestParameters.code, requestParameters.redeemPolicyVoucherRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
963
+ };
964
+ /**
965
+ * This will withdraw the policy voucher.
966
+ * @summary Withdraws the policy voucher.
967
+ * @param {PolicyVouchersApiWithdrawPolicyVoucherRequest} requestParameters Request parameters.
968
+ * @param {*} [options] Override http request option.
969
+ * @throws {RequiredError}
970
+ * @memberof PolicyVouchersApi
971
+ */
972
+ PolicyVouchersApi.prototype.withdrawPolicyVoucher = function (requestParameters, options) {
973
+ var _this = this;
974
+ return (0, exports.PolicyVouchersApiFp)(this.configuration).withdrawPolicyVoucher(requestParameters.code, requestParameters.withdrawPolicyVoucherRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
975
+ };
976
+ return PolicyVouchersApi;
977
+ }(base_1.BaseAPI));
978
+ exports.PolicyVouchersApi = PolicyVouchersApi;