@emilgroup/discount-sdk 1.1.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/.openapi-generator/FILES +54 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +51 -0
  5. package/api/campaigns-api.ts +1433 -0
  6. package/api/default-api.ts +124 -0
  7. package/api/policy-vouchers-api.ts +1038 -0
  8. package/api/vouchers-api.ts +691 -0
  9. package/api.ts +33 -0
  10. package/base.ts +278 -0
  11. package/common.ts +198 -0
  12. package/configuration.ts +110 -0
  13. package/dist/api/campaigns-api.d.ts +808 -0
  14. package/dist/api/campaigns-api.js +1304 -0
  15. package/dist/api/default-api.d.ts +70 -0
  16. package/dist/api/default-api.js +213 -0
  17. package/dist/api/policy-vouchers-api.d.ts +582 -0
  18. package/dist/api/policy-vouchers-api.js +974 -0
  19. package/dist/api/vouchers-api.d.ts +393 -0
  20. package/dist/api/vouchers-api.js +671 -0
  21. package/dist/api.d.ts +15 -0
  22. package/dist/api.js +33 -0
  23. package/dist/base.d.ts +77 -0
  24. package/dist/base.js +321 -0
  25. package/dist/common.d.ts +91 -0
  26. package/dist/common.js +276 -0
  27. package/dist/configuration.d.ts +89 -0
  28. package/dist/configuration.js +52 -0
  29. package/dist/index.d.ts +15 -0
  30. package/dist/index.js +36 -0
  31. package/dist/models/campaign-class.d.ts +105 -0
  32. package/dist/models/campaign-class.js +24 -0
  33. package/dist/models/charge-policy-voucher-request-dto.d.ts +48 -0
  34. package/dist/models/charge-policy-voucher-request-dto.js +15 -0
  35. package/dist/models/charge-policy-voucher-response-class.d.ts +90 -0
  36. package/dist/models/charge-policy-voucher-response-class.js +21 -0
  37. package/dist/models/check-account-eligibility-request-dto.d.ts +48 -0
  38. package/dist/models/check-account-eligibility-request-dto.js +15 -0
  39. package/dist/models/check-account-eligibility-response-class.d.ts +57 -0
  40. package/dist/models/check-account-eligibility-response-class.js +24 -0
  41. package/dist/models/create-campaign-request-dto.d.ts +42 -0
  42. package/dist/models/create-campaign-request-dto.js +15 -0
  43. package/dist/models/create-campaign-response-class.d.ts +25 -0
  44. package/dist/models/create-campaign-response-class.js +15 -0
  45. package/dist/models/create-eligible-account-request-dto.d.ts +30 -0
  46. package/dist/models/create-eligible-account-request-dto.js +15 -0
  47. package/dist/models/create-eligible-account-response-class.d.ts +25 -0
  48. package/dist/models/create-eligible-account-response-class.js +15 -0
  49. package/dist/models/create-policy-voucher-request-dto.d.ts +48 -0
  50. package/dist/models/create-policy-voucher-request-dto.js +15 -0
  51. package/dist/models/create-policy-voucher-response-class.d.ts +25 -0
  52. package/dist/models/create-policy-voucher-response-class.js +15 -0
  53. package/dist/models/create-product-discount-dto.d.ts +48 -0
  54. package/dist/models/create-product-discount-dto.js +15 -0
  55. package/dist/models/create-voucher-request-dto.d.ts +66 -0
  56. package/dist/models/create-voucher-request-dto.js +20 -0
  57. package/dist/models/create-voucher-response-class.d.ts +25 -0
  58. package/dist/models/create-voucher-response-class.js +15 -0
  59. package/dist/models/eligible-account-class.d.ts +78 -0
  60. package/dist/models/eligible-account-class.js +15 -0
  61. package/dist/models/get-campaign-response-class.d.ts +25 -0
  62. package/dist/models/get-campaign-response-class.js +15 -0
  63. package/dist/models/get-policy-voucher-response-class.d.ts +25 -0
  64. package/dist/models/get-policy-voucher-response-class.js +15 -0
  65. package/dist/models/get-voucher-response-class.d.ts +25 -0
  66. package/dist/models/get-voucher-response-class.js +15 -0
  67. package/dist/models/index.d.ts +37 -0
  68. package/dist/models/index.js +53 -0
  69. package/dist/models/inline-response200.d.ts +54 -0
  70. package/dist/models/inline-response200.js +15 -0
  71. package/dist/models/inline-response503.d.ts +54 -0
  72. package/dist/models/inline-response503.js +15 -0
  73. package/dist/models/list-campaigns-response-class.d.ts +43 -0
  74. package/dist/models/list-campaigns-response-class.js +15 -0
  75. package/dist/models/list-eligible-accounts-response-class.d.ts +43 -0
  76. package/dist/models/list-eligible-accounts-response-class.js +15 -0
  77. package/dist/models/list-policy-vouchers-response-class.d.ts +43 -0
  78. package/dist/models/list-policy-vouchers-response-class.js +15 -0
  79. package/dist/models/list-vouchers-response-class.d.ts +43 -0
  80. package/dist/models/list-vouchers-response-class.js +15 -0
  81. package/dist/models/policy-voucher-class.d.ts +159 -0
  82. package/dist/models/policy-voucher-class.js +21 -0
  83. package/dist/models/policy-voucher-transaction-class.d.ts +126 -0
  84. package/dist/models/policy-voucher-transaction-class.js +26 -0
  85. package/dist/models/product-discount-class.d.ts +90 -0
  86. package/dist/models/product-discount-class.js +15 -0
  87. package/dist/models/redeem-policy-voucher-request-dto.d.ts +48 -0
  88. package/dist/models/redeem-policy-voucher-request-dto.js +15 -0
  89. package/dist/models/redeem-policy-voucher-response-class.d.ts +84 -0
  90. package/dist/models/redeem-policy-voucher-response-class.js +21 -0
  91. package/dist/models/update-campaign-request-dto.d.ts +42 -0
  92. package/dist/models/update-campaign-request-dto.js +15 -0
  93. package/dist/models/update-campaign-response-class.d.ts +25 -0
  94. package/dist/models/update-campaign-response-class.js +15 -0
  95. package/dist/models/update-campaign-status-request-dto.d.ts +33 -0
  96. package/dist/models/update-campaign-status-request-dto.js +24 -0
  97. package/dist/models/update-voucher-request-dto.d.ts +60 -0
  98. package/dist/models/update-voucher-request-dto.js +20 -0
  99. package/dist/models/update-voucher-response-class.d.ts +25 -0
  100. package/dist/models/update-voucher-response-class.js +15 -0
  101. package/dist/models/voucher-class.d.ts +127 -0
  102. package/dist/models/voucher-class.js +20 -0
  103. package/dist/models/withdraw-policy-voucher-request-dto.d.ts +36 -0
  104. package/dist/models/withdraw-policy-voucher-request-dto.js +15 -0
  105. package/dist/models/withdraw-policy-voucher-response-class.d.ts +78 -0
  106. package/dist/models/withdraw-policy-voucher-response-class.js +21 -0
  107. package/git_push.sh +57 -0
  108. package/index.ts +19 -0
  109. package/models/campaign-class.ts +114 -0
  110. package/models/charge-policy-voucher-request-dto.ts +54 -0
  111. package/models/charge-policy-voucher-response-class.ts +99 -0
  112. package/models/check-account-eligibility-request-dto.ts +54 -0
  113. package/models/check-account-eligibility-response-class.ts +66 -0
  114. package/models/create-campaign-request-dto.ts +48 -0
  115. package/models/create-campaign-response-class.ts +31 -0
  116. package/models/create-eligible-account-request-dto.ts +36 -0
  117. package/models/create-eligible-account-response-class.ts +31 -0
  118. package/models/create-policy-voucher-request-dto.ts +54 -0
  119. package/models/create-policy-voucher-response-class.ts +31 -0
  120. package/models/create-product-discount-dto.ts +54 -0
  121. package/models/create-voucher-request-dto.ts +75 -0
  122. package/models/create-voucher-response-class.ts +31 -0
  123. package/models/eligible-account-class.ts +84 -0
  124. package/models/get-campaign-response-class.ts +31 -0
  125. package/models/get-policy-voucher-response-class.ts +31 -0
  126. package/models/get-voucher-response-class.ts +31 -0
  127. package/models/index.ts +37 -0
  128. package/models/inline-response200.ts +48 -0
  129. package/models/inline-response503.ts +48 -0
  130. package/models/list-campaigns-response-class.ts +49 -0
  131. package/models/list-eligible-accounts-response-class.ts +49 -0
  132. package/models/list-policy-vouchers-response-class.ts +49 -0
  133. package/models/list-vouchers-response-class.ts +49 -0
  134. package/models/policy-voucher-class.ts +168 -0
  135. package/models/policy-voucher-transaction-class.ts +136 -0
  136. package/models/product-discount-class.ts +96 -0
  137. package/models/redeem-policy-voucher-request-dto.ts +54 -0
  138. package/models/redeem-policy-voucher-response-class.ts +93 -0
  139. package/models/update-campaign-request-dto.ts +48 -0
  140. package/models/update-campaign-response-class.ts +31 -0
  141. package/models/update-campaign-status-request-dto.ts +42 -0
  142. package/models/update-voucher-request-dto.ts +69 -0
  143. package/models/update-voucher-response-class.ts +31 -0
  144. package/models/voucher-class.ts +136 -0
  145. package/models/withdraw-policy-voucher-request-dto.ts +42 -0
  146. package/models/withdraw-policy-voucher-response-class.ts +87 -0
  147. package/package.json +26 -0
  148. package/tsconfig.json +23 -0
@@ -0,0 +1,974 @@
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
+ /**
98
+ * PolicyVouchersApi - axios parameter creator
99
+ * @export
100
+ */
101
+ var PolicyVouchersApiAxiosParamCreator = function (configuration) {
102
+ var _this = this;
103
+ return {
104
+ /**
105
+ * This will charge the policy voucher.
106
+ * @summary Charges the policy voucher.
107
+ * @param {any} code Unique identifier for the object.
108
+ * @param {ChargePolicyVoucherRequestDto} chargePolicyVoucherRequestDto
109
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
110
+ * @param {*} [options] Override http request option.
111
+ * @throws {RequiredError}
112
+ */
113
+ chargePolicyVoucher: function (code_1, chargePolicyVoucherRequestDto_1, authorization_1) {
114
+ var args_1 = [];
115
+ for (var _i = 3; _i < arguments.length; _i++) {
116
+ args_1[_i - 3] = arguments[_i];
117
+ }
118
+ return __awaiter(_this, __spreadArray([code_1, chargePolicyVoucherRequestDto_1, authorization_1], args_1, true), void 0, function (code, chargePolicyVoucherRequestDto, authorization, options) {
119
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
120
+ if (options === void 0) { options = {}; }
121
+ return __generator(this, function (_a) {
122
+ switch (_a.label) {
123
+ case 0:
124
+ // verify required parameter 'code' is not null or undefined
125
+ (0, common_1.assertParamExists)('chargePolicyVoucher', 'code', code);
126
+ // verify required parameter 'chargePolicyVoucherRequestDto' is not null or undefined
127
+ (0, common_1.assertParamExists)('chargePolicyVoucher', 'chargePolicyVoucherRequestDto', chargePolicyVoucherRequestDto);
128
+ localVarPath = "/discountservice/v1/policy-vouchers/charge"
129
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
130
+ localVarUrlObj = new 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)(chargePolicyVoucherRequestDto, localVarRequestOptions, configuration);
153
+ return [2 /*return*/, {
154
+ url: (0, common_1.toPathString)(localVarUrlObj),
155
+ options: localVarRequestOptions,
156
+ }];
157
+ }
158
+ });
159
+ });
160
+ },
161
+ /**
162
+ * This will check if the account is eligible for a specific voucher.
163
+ * @summary Checks the account eligibility.
164
+ * @param {CheckAccountEligibilityRequestDto} checkAccountEligibilityRequestDto
165
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
166
+ * @param {*} [options] Override http request option.
167
+ * @throws {RequiredError}
168
+ */
169
+ checkAccountEligibility: function (checkAccountEligibilityRequestDto_1, authorization_1) {
170
+ var args_1 = [];
171
+ for (var _i = 2; _i < arguments.length; _i++) {
172
+ args_1[_i - 2] = arguments[_i];
173
+ }
174
+ return __awaiter(_this, __spreadArray([checkAccountEligibilityRequestDto_1, authorization_1], args_1, true), void 0, function (checkAccountEligibilityRequestDto, authorization, options) {
175
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
176
+ if (options === void 0) { options = {}; }
177
+ return __generator(this, function (_a) {
178
+ switch (_a.label) {
179
+ case 0:
180
+ // verify required parameter 'checkAccountEligibilityRequestDto' is not null or undefined
181
+ (0, common_1.assertParamExists)('checkAccountEligibility', 'checkAccountEligibilityRequestDto', checkAccountEligibilityRequestDto);
182
+ localVarPath = "/discountservice/v1/policy-vouchers/eligibility";
183
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
184
+ if (configuration) {
185
+ baseOptions = configuration.baseOptions;
186
+ baseAccessToken = configuration.accessToken;
187
+ }
188
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
189
+ localVarHeaderParameter = {};
190
+ localVarQueryParameter = {};
191
+ // authentication bearer required
192
+ // http bearer authentication required
193
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
194
+ case 1:
195
+ // authentication bearer required
196
+ // http bearer authentication required
197
+ _a.sent();
198
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
199
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
200
+ }
201
+ localVarHeaderParameter['Content-Type'] = 'application/json';
202
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
203
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
204
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
205
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(checkAccountEligibilityRequestDto, localVarRequestOptions, configuration);
206
+ return [2 /*return*/, {
207
+ url: (0, common_1.toPathString)(localVarUrlObj),
208
+ options: localVarRequestOptions,
209
+ }];
210
+ }
211
+ });
212
+ });
213
+ },
214
+ /**
215
+ * This will create an policy voucher.
216
+ * @summary Create the policy voucher
217
+ * @param {CreatePolicyVoucherRequestDto} createPolicyVoucherRequestDto
218
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
219
+ * @param {*} [options] Override http request option.
220
+ * @throws {RequiredError}
221
+ */
222
+ createPolicyVoucher: function (createPolicyVoucherRequestDto_1, authorization_1) {
223
+ var args_1 = [];
224
+ for (var _i = 2; _i < arguments.length; _i++) {
225
+ args_1[_i - 2] = arguments[_i];
226
+ }
227
+ return __awaiter(_this, __spreadArray([createPolicyVoucherRequestDto_1, authorization_1], args_1, true), void 0, function (createPolicyVoucherRequestDto, authorization, options) {
228
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
229
+ if (options === void 0) { options = {}; }
230
+ return __generator(this, function (_a) {
231
+ switch (_a.label) {
232
+ case 0:
233
+ // verify required parameter 'createPolicyVoucherRequestDto' is not null or undefined
234
+ (0, common_1.assertParamExists)('createPolicyVoucher', 'createPolicyVoucherRequestDto', createPolicyVoucherRequestDto);
235
+ localVarPath = "/discountservice/v1/policy-vouchers";
236
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
237
+ if (configuration) {
238
+ baseOptions = configuration.baseOptions;
239
+ baseAccessToken = configuration.accessToken;
240
+ }
241
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
242
+ localVarHeaderParameter = {};
243
+ localVarQueryParameter = {};
244
+ // authentication bearer required
245
+ // http bearer authentication required
246
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
247
+ case 1:
248
+ // authentication bearer required
249
+ // http bearer authentication required
250
+ _a.sent();
251
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
252
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
253
+ }
254
+ localVarHeaderParameter['Content-Type'] = 'application/json';
255
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
256
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
257
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
258
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createPolicyVoucherRequestDto, localVarRequestOptions, configuration);
259
+ return [2 /*return*/, {
260
+ url: (0, common_1.toPathString)(localVarUrlObj),
261
+ options: localVarRequestOptions,
262
+ }];
263
+ }
264
+ });
265
+ });
266
+ },
267
+ /**
268
+ * This will delete an policy voucher.
269
+ * @summary Delete the policy voucher
270
+ * @param {string} code Unique identifier for the object.
271
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
272
+ * @param {*} [options] Override http request option.
273
+ * @throws {RequiredError}
274
+ */
275
+ deletePolicyVoucher: function (code_1, authorization_1) {
276
+ var args_1 = [];
277
+ for (var _i = 2; _i < arguments.length; _i++) {
278
+ args_1[_i - 2] = arguments[_i];
279
+ }
280
+ return __awaiter(_this, __spreadArray([code_1, authorization_1], args_1, true), void 0, function (code, authorization, options) {
281
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
282
+ if (options === void 0) { options = {}; }
283
+ return __generator(this, function (_a) {
284
+ switch (_a.label) {
285
+ case 0:
286
+ // verify required parameter 'code' is not null or undefined
287
+ (0, common_1.assertParamExists)('deletePolicyVoucher', 'code', code);
288
+ localVarPath = "/discountservice/v1/policy-vouchers/{code}"
289
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
290
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
291
+ if (configuration) {
292
+ baseOptions = configuration.baseOptions;
293
+ baseAccessToken = configuration.accessToken;
294
+ }
295
+ localVarRequestOptions = __assign(__assign({ method: 'DELETE' }, baseOptions), options);
296
+ localVarHeaderParameter = {};
297
+ localVarQueryParameter = {};
298
+ // authentication bearer required
299
+ // http bearer authentication required
300
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
301
+ case 1:
302
+ // authentication bearer required
303
+ // http bearer authentication required
304
+ _a.sent();
305
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
306
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
307
+ }
308
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
309
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
310
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
311
+ return [2 /*return*/, {
312
+ url: (0, common_1.toPathString)(localVarUrlObj),
313
+ options: localVarRequestOptions,
314
+ }];
315
+ }
316
+ });
317
+ });
318
+ },
319
+ /**
320
+ * This will get an policy voucher.
321
+ * @summary Retrieve the policy voucher
322
+ * @param {string} code Unique identifier for the object.
323
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
324
+ * @param {'transactions' | 'campaign' | 'voucher'} [expand] You can expand policy voucher in this endpoint. By default, campaign and voucher will be expanded fields.
325
+ * @param {*} [options] Override http request option.
326
+ * @throws {RequiredError}
327
+ */
328
+ getPolicyVoucher: function (code_1, authorization_1, expand_1) {
329
+ var args_1 = [];
330
+ for (var _i = 3; _i < arguments.length; _i++) {
331
+ args_1[_i - 3] = arguments[_i];
332
+ }
333
+ return __awaiter(_this, __spreadArray([code_1, authorization_1, expand_1], args_1, true), void 0, function (code, authorization, expand, options) {
334
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
335
+ if (options === void 0) { options = {}; }
336
+ return __generator(this, function (_a) {
337
+ switch (_a.label) {
338
+ case 0:
339
+ // verify required parameter 'code' is not null or undefined
340
+ (0, common_1.assertParamExists)('getPolicyVoucher', 'code', code);
341
+ localVarPath = "/discountservice/v1/policy-vouchers/{code}"
342
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
343
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
344
+ if (configuration) {
345
+ baseOptions = configuration.baseOptions;
346
+ baseAccessToken = configuration.accessToken;
347
+ }
348
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
349
+ localVarHeaderParameter = {};
350
+ localVarQueryParameter = {};
351
+ // authentication bearer required
352
+ // http bearer authentication required
353
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
354
+ case 1:
355
+ // authentication bearer required
356
+ // http bearer authentication required
357
+ _a.sent();
358
+ if (expand !== undefined) {
359
+ localVarQueryParameter['expand'] = expand;
360
+ }
361
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
362
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
363
+ }
364
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
365
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
366
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
367
+ return [2 /*return*/, {
368
+ url: (0, common_1.toPathString)(localVarUrlObj),
369
+ options: localVarRequestOptions,
370
+ }];
371
+ }
372
+ });
373
+ });
374
+ },
375
+ /**
376
+ * 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.
377
+ * @summary List policy vouchers
378
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
379
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
380
+ * @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.
381
+ * @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;
382
+ * @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;
383
+ * @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;
384
+ * @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;
385
+ * @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;
386
+ * @param {*} [options] Override http request option.
387
+ * @throws {RequiredError}
388
+ */
389
+ listPolicyVouchers: function (authorization_1, pageSize_1, pageToken_1, filter_1, search_1, order_1, expand_1, filters_1) {
390
+ var args_1 = [];
391
+ for (var _i = 8; _i < arguments.length; _i++) {
392
+ args_1[_i - 8] = arguments[_i];
393
+ }
394
+ 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) {
395
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
396
+ if (options === void 0) { options = {}; }
397
+ return __generator(this, function (_a) {
398
+ switch (_a.label) {
399
+ case 0:
400
+ localVarPath = "/discountservice/v1/policy-vouchers";
401
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
402
+ if (configuration) {
403
+ baseOptions = configuration.baseOptions;
404
+ baseAccessToken = configuration.accessToken;
405
+ }
406
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
407
+ localVarHeaderParameter = {};
408
+ localVarQueryParameter = {};
409
+ // authentication bearer required
410
+ // http bearer authentication required
411
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
412
+ case 1:
413
+ // authentication bearer required
414
+ // http bearer authentication required
415
+ _a.sent();
416
+ if (pageSize !== undefined) {
417
+ localVarQueryParameter['pageSize'] = pageSize;
418
+ }
419
+ if (pageToken !== undefined) {
420
+ localVarQueryParameter['pageToken'] = pageToken;
421
+ }
422
+ if (filter !== undefined) {
423
+ localVarQueryParameter['filter'] = filter;
424
+ }
425
+ if (search !== undefined) {
426
+ localVarQueryParameter['search'] = search;
427
+ }
428
+ if (order !== undefined) {
429
+ localVarQueryParameter['order'] = order;
430
+ }
431
+ if (expand !== undefined) {
432
+ localVarQueryParameter['expand'] = expand;
433
+ }
434
+ if (filters !== undefined) {
435
+ localVarQueryParameter['filters'] = filters;
436
+ }
437
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
438
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
439
+ }
440
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
441
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
442
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
443
+ return [2 /*return*/, {
444
+ url: (0, common_1.toPathString)(localVarUrlObj),
445
+ options: localVarRequestOptions,
446
+ }];
447
+ }
448
+ });
449
+ });
450
+ },
451
+ /**
452
+ * This will redeem the policy voucher.
453
+ * @summary Redeems the policy voucher.
454
+ * @param {any} code Unique identifier for the object.
455
+ * @param {RedeemPolicyVoucherRequestDto} redeemPolicyVoucherRequestDto
456
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
457
+ * @param {*} [options] Override http request option.
458
+ * @throws {RequiredError}
459
+ */
460
+ redeemPolicyVoucher: function (code_1, redeemPolicyVoucherRequestDto_1, authorization_1) {
461
+ var args_1 = [];
462
+ for (var _i = 3; _i < arguments.length; _i++) {
463
+ args_1[_i - 3] = arguments[_i];
464
+ }
465
+ return __awaiter(_this, __spreadArray([code_1, redeemPolicyVoucherRequestDto_1, authorization_1], args_1, true), void 0, function (code, redeemPolicyVoucherRequestDto, authorization, options) {
466
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
467
+ if (options === void 0) { options = {}; }
468
+ return __generator(this, function (_a) {
469
+ switch (_a.label) {
470
+ case 0:
471
+ // verify required parameter 'code' is not null or undefined
472
+ (0, common_1.assertParamExists)('redeemPolicyVoucher', 'code', code);
473
+ // verify required parameter 'redeemPolicyVoucherRequestDto' is not null or undefined
474
+ (0, common_1.assertParamExists)('redeemPolicyVoucher', 'redeemPolicyVoucherRequestDto', redeemPolicyVoucherRequestDto);
475
+ localVarPath = "/discountservice/v1/policy-vouchers/redeem"
476
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
477
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
478
+ if (configuration) {
479
+ baseOptions = configuration.baseOptions;
480
+ baseAccessToken = configuration.accessToken;
481
+ }
482
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
483
+ localVarHeaderParameter = {};
484
+ localVarQueryParameter = {};
485
+ // authentication bearer required
486
+ // http bearer authentication required
487
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
488
+ case 1:
489
+ // authentication bearer required
490
+ // http bearer authentication required
491
+ _a.sent();
492
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
493
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
494
+ }
495
+ localVarHeaderParameter['Content-Type'] = 'application/json';
496
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
497
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
498
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
499
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(redeemPolicyVoucherRequestDto, localVarRequestOptions, configuration);
500
+ return [2 /*return*/, {
501
+ url: (0, common_1.toPathString)(localVarUrlObj),
502
+ options: localVarRequestOptions,
503
+ }];
504
+ }
505
+ });
506
+ });
507
+ },
508
+ /**
509
+ * This will withdraw the policy voucher.
510
+ * @summary Withdraws the policy voucher.
511
+ * @param {any} code Unique identifier for the object.
512
+ * @param {WithdrawPolicyVoucherRequestDto} withdrawPolicyVoucherRequestDto
513
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
514
+ * @param {*} [options] Override http request option.
515
+ * @throws {RequiredError}
516
+ */
517
+ withdrawPolicyVoucher: function (code_1, withdrawPolicyVoucherRequestDto_1, authorization_1) {
518
+ var args_1 = [];
519
+ for (var _i = 3; _i < arguments.length; _i++) {
520
+ args_1[_i - 3] = arguments[_i];
521
+ }
522
+ return __awaiter(_this, __spreadArray([code_1, withdrawPolicyVoucherRequestDto_1, authorization_1], args_1, true), void 0, function (code, withdrawPolicyVoucherRequestDto, authorization, options) {
523
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
524
+ if (options === void 0) { options = {}; }
525
+ return __generator(this, function (_a) {
526
+ switch (_a.label) {
527
+ case 0:
528
+ // verify required parameter 'code' is not null or undefined
529
+ (0, common_1.assertParamExists)('withdrawPolicyVoucher', 'code', code);
530
+ // verify required parameter 'withdrawPolicyVoucherRequestDto' is not null or undefined
531
+ (0, common_1.assertParamExists)('withdrawPolicyVoucher', 'withdrawPolicyVoucherRequestDto', withdrawPolicyVoucherRequestDto);
532
+ localVarPath = "/discountservice/v1/policy-vouchers/withdraw"
533
+ .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
534
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
535
+ if (configuration) {
536
+ baseOptions = configuration.baseOptions;
537
+ baseAccessToken = configuration.accessToken;
538
+ }
539
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
540
+ localVarHeaderParameter = {};
541
+ localVarQueryParameter = {};
542
+ // authentication bearer required
543
+ // http bearer authentication required
544
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
545
+ case 1:
546
+ // authentication bearer required
547
+ // http bearer authentication required
548
+ _a.sent();
549
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
550
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
551
+ }
552
+ localVarHeaderParameter['Content-Type'] = 'application/json';
553
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
554
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
555
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
556
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(withdrawPolicyVoucherRequestDto, localVarRequestOptions, configuration);
557
+ return [2 /*return*/, {
558
+ url: (0, common_1.toPathString)(localVarUrlObj),
559
+ options: localVarRequestOptions,
560
+ }];
561
+ }
562
+ });
563
+ });
564
+ },
565
+ };
566
+ };
567
+ exports.PolicyVouchersApiAxiosParamCreator = PolicyVouchersApiAxiosParamCreator;
568
+ /**
569
+ * PolicyVouchersApi - functional programming interface
570
+ * @export
571
+ */
572
+ var PolicyVouchersApiFp = function (configuration) {
573
+ var localVarAxiosParamCreator = (0, exports.PolicyVouchersApiAxiosParamCreator)(configuration);
574
+ return {
575
+ /**
576
+ * This will charge the policy voucher.
577
+ * @summary Charges the policy voucher.
578
+ * @param {any} code Unique identifier for the object.
579
+ * @param {ChargePolicyVoucherRequestDto} chargePolicyVoucherRequestDto
580
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
581
+ * @param {*} [options] Override http request option.
582
+ * @throws {RequiredError}
583
+ */
584
+ chargePolicyVoucher: function (code, chargePolicyVoucherRequestDto, authorization, options) {
585
+ return __awaiter(this, void 0, void 0, function () {
586
+ var localVarAxiosArgs;
587
+ return __generator(this, function (_a) {
588
+ switch (_a.label) {
589
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.chargePolicyVoucher(code, chargePolicyVoucherRequestDto, authorization, options)];
590
+ case 1:
591
+ localVarAxiosArgs = _a.sent();
592
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
593
+ }
594
+ });
595
+ });
596
+ },
597
+ /**
598
+ * This will check if the account is eligible for a specific voucher.
599
+ * @summary Checks the account eligibility.
600
+ * @param {CheckAccountEligibilityRequestDto} checkAccountEligibilityRequestDto
601
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
602
+ * @param {*} [options] Override http request option.
603
+ * @throws {RequiredError}
604
+ */
605
+ checkAccountEligibility: function (checkAccountEligibilityRequestDto, authorization, options) {
606
+ return __awaiter(this, void 0, void 0, function () {
607
+ var localVarAxiosArgs;
608
+ return __generator(this, function (_a) {
609
+ switch (_a.label) {
610
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.checkAccountEligibility(checkAccountEligibilityRequestDto, authorization, options)];
611
+ case 1:
612
+ localVarAxiosArgs = _a.sent();
613
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
614
+ }
615
+ });
616
+ });
617
+ },
618
+ /**
619
+ * This will create an policy voucher.
620
+ * @summary Create the policy voucher
621
+ * @param {CreatePolicyVoucherRequestDto} createPolicyVoucherRequestDto
622
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
623
+ * @param {*} [options] Override http request option.
624
+ * @throws {RequiredError}
625
+ */
626
+ createPolicyVoucher: function (createPolicyVoucherRequestDto, authorization, options) {
627
+ return __awaiter(this, void 0, void 0, function () {
628
+ var localVarAxiosArgs;
629
+ return __generator(this, function (_a) {
630
+ switch (_a.label) {
631
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.createPolicyVoucher(createPolicyVoucherRequestDto, authorization, options)];
632
+ case 1:
633
+ localVarAxiosArgs = _a.sent();
634
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
635
+ }
636
+ });
637
+ });
638
+ },
639
+ /**
640
+ * This will delete an policy voucher.
641
+ * @summary Delete the policy voucher
642
+ * @param {string} code Unique identifier for the object.
643
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
644
+ * @param {*} [options] Override http request option.
645
+ * @throws {RequiredError}
646
+ */
647
+ deletePolicyVoucher: function (code, authorization, options) {
648
+ return __awaiter(this, void 0, void 0, function () {
649
+ var localVarAxiosArgs;
650
+ return __generator(this, function (_a) {
651
+ switch (_a.label) {
652
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.deletePolicyVoucher(code, authorization, options)];
653
+ case 1:
654
+ localVarAxiosArgs = _a.sent();
655
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
656
+ }
657
+ });
658
+ });
659
+ },
660
+ /**
661
+ * This will get an policy voucher.
662
+ * @summary Retrieve the policy voucher
663
+ * @param {string} code Unique identifier for the object.
664
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
665
+ * @param {'transactions' | 'campaign' | 'voucher'} [expand] You can expand policy voucher in this endpoint. By default, campaign and voucher will be expanded fields.
666
+ * @param {*} [options] Override http request option.
667
+ * @throws {RequiredError}
668
+ */
669
+ getPolicyVoucher: function (code, authorization, expand, options) {
670
+ return __awaiter(this, void 0, void 0, function () {
671
+ var localVarAxiosArgs;
672
+ return __generator(this, function (_a) {
673
+ switch (_a.label) {
674
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getPolicyVoucher(code, authorization, expand, options)];
675
+ case 1:
676
+ localVarAxiosArgs = _a.sent();
677
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
678
+ }
679
+ });
680
+ });
681
+ },
682
+ /**
683
+ * 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.
684
+ * @summary List policy vouchers
685
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
686
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
687
+ * @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.
688
+ * @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;
689
+ * @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;
690
+ * @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;
691
+ * @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;
692
+ * @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;
693
+ * @param {*} [options] Override http request option.
694
+ * @throws {RequiredError}
695
+ */
696
+ listPolicyVouchers: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
697
+ return __awaiter(this, void 0, void 0, function () {
698
+ var localVarAxiosArgs;
699
+ return __generator(this, function (_a) {
700
+ switch (_a.label) {
701
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listPolicyVouchers(authorization, pageSize, pageToken, filter, search, order, expand, filters, options)];
702
+ case 1:
703
+ localVarAxiosArgs = _a.sent();
704
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
705
+ }
706
+ });
707
+ });
708
+ },
709
+ /**
710
+ * This will redeem the policy voucher.
711
+ * @summary Redeems the policy voucher.
712
+ * @param {any} code Unique identifier for the object.
713
+ * @param {RedeemPolicyVoucherRequestDto} redeemPolicyVoucherRequestDto
714
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
715
+ * @param {*} [options] Override http request option.
716
+ * @throws {RequiredError}
717
+ */
718
+ redeemPolicyVoucher: function (code, redeemPolicyVoucherRequestDto, authorization, options) {
719
+ return __awaiter(this, void 0, void 0, function () {
720
+ var localVarAxiosArgs;
721
+ return __generator(this, function (_a) {
722
+ switch (_a.label) {
723
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.redeemPolicyVoucher(code, redeemPolicyVoucherRequestDto, authorization, options)];
724
+ case 1:
725
+ localVarAxiosArgs = _a.sent();
726
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
727
+ }
728
+ });
729
+ });
730
+ },
731
+ /**
732
+ * This will withdraw the policy voucher.
733
+ * @summary Withdraws the policy voucher.
734
+ * @param {any} code Unique identifier for the object.
735
+ * @param {WithdrawPolicyVoucherRequestDto} withdrawPolicyVoucherRequestDto
736
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
737
+ * @param {*} [options] Override http request option.
738
+ * @throws {RequiredError}
739
+ */
740
+ withdrawPolicyVoucher: function (code, withdrawPolicyVoucherRequestDto, authorization, options) {
741
+ return __awaiter(this, void 0, void 0, function () {
742
+ var localVarAxiosArgs;
743
+ return __generator(this, function (_a) {
744
+ switch (_a.label) {
745
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.withdrawPolicyVoucher(code, withdrawPolicyVoucherRequestDto, authorization, options)];
746
+ case 1:
747
+ localVarAxiosArgs = _a.sent();
748
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
749
+ }
750
+ });
751
+ });
752
+ },
753
+ };
754
+ };
755
+ exports.PolicyVouchersApiFp = PolicyVouchersApiFp;
756
+ /**
757
+ * PolicyVouchersApi - factory interface
758
+ * @export
759
+ */
760
+ var PolicyVouchersApiFactory = function (configuration, basePath, axios) {
761
+ var localVarFp = (0, exports.PolicyVouchersApiFp)(configuration);
762
+ return {
763
+ /**
764
+ * This will charge the policy voucher.
765
+ * @summary Charges the policy voucher.
766
+ * @param {any} code Unique identifier for the object.
767
+ * @param {ChargePolicyVoucherRequestDto} chargePolicyVoucherRequestDto
768
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
769
+ * @param {*} [options] Override http request option.
770
+ * @throws {RequiredError}
771
+ */
772
+ chargePolicyVoucher: function (code, chargePolicyVoucherRequestDto, authorization, options) {
773
+ return localVarFp.chargePolicyVoucher(code, chargePolicyVoucherRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
774
+ },
775
+ /**
776
+ * This will check if the account is eligible for a specific voucher.
777
+ * @summary Checks the account eligibility.
778
+ * @param {CheckAccountEligibilityRequestDto} checkAccountEligibilityRequestDto
779
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
780
+ * @param {*} [options] Override http request option.
781
+ * @throws {RequiredError}
782
+ */
783
+ checkAccountEligibility: function (checkAccountEligibilityRequestDto, authorization, options) {
784
+ return localVarFp.checkAccountEligibility(checkAccountEligibilityRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
785
+ },
786
+ /**
787
+ * This will create an policy voucher.
788
+ * @summary Create the policy voucher
789
+ * @param {CreatePolicyVoucherRequestDto} createPolicyVoucherRequestDto
790
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
791
+ * @param {*} [options] Override http request option.
792
+ * @throws {RequiredError}
793
+ */
794
+ createPolicyVoucher: function (createPolicyVoucherRequestDto, authorization, options) {
795
+ return localVarFp.createPolicyVoucher(createPolicyVoucherRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
796
+ },
797
+ /**
798
+ * This will delete an policy voucher.
799
+ * @summary Delete the policy voucher
800
+ * @param {string} code Unique identifier for the object.
801
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
802
+ * @param {*} [options] Override http request option.
803
+ * @throws {RequiredError}
804
+ */
805
+ deletePolicyVoucher: function (code, authorization, options) {
806
+ return localVarFp.deletePolicyVoucher(code, authorization, options).then(function (request) { return request(axios, basePath); });
807
+ },
808
+ /**
809
+ * This will get an policy voucher.
810
+ * @summary Retrieve the policy voucher
811
+ * @param {string} code Unique identifier for the object.
812
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
813
+ * @param {'transactions' | 'campaign' | 'voucher'} [expand] You can expand policy voucher in this endpoint. By default, campaign and voucher will be expanded fields.
814
+ * @param {*} [options] Override http request option.
815
+ * @throws {RequiredError}
816
+ */
817
+ getPolicyVoucher: function (code, authorization, expand, options) {
818
+ return localVarFp.getPolicyVoucher(code, authorization, expand, options).then(function (request) { return request(axios, basePath); });
819
+ },
820
+ /**
821
+ * 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.
822
+ * @summary List policy vouchers
823
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
824
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
825
+ * @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.
826
+ * @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;
827
+ * @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;
828
+ * @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;
829
+ * @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;
830
+ * @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;
831
+ * @param {*} [options] Override http request option.
832
+ * @throws {RequiredError}
833
+ */
834
+ listPolicyVouchers: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
835
+ return localVarFp.listPolicyVouchers(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then(function (request) { return request(axios, basePath); });
836
+ },
837
+ /**
838
+ * This will redeem the policy voucher.
839
+ * @summary Redeems the policy voucher.
840
+ * @param {any} code Unique identifier for the object.
841
+ * @param {RedeemPolicyVoucherRequestDto} redeemPolicyVoucherRequestDto
842
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
843
+ * @param {*} [options] Override http request option.
844
+ * @throws {RequiredError}
845
+ */
846
+ redeemPolicyVoucher: function (code, redeemPolicyVoucherRequestDto, authorization, options) {
847
+ return localVarFp.redeemPolicyVoucher(code, redeemPolicyVoucherRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
848
+ },
849
+ /**
850
+ * This will withdraw the policy voucher.
851
+ * @summary Withdraws the policy voucher.
852
+ * @param {any} code Unique identifier for the object.
853
+ * @param {WithdrawPolicyVoucherRequestDto} withdrawPolicyVoucherRequestDto
854
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
855
+ * @param {*} [options] Override http request option.
856
+ * @throws {RequiredError}
857
+ */
858
+ withdrawPolicyVoucher: function (code, withdrawPolicyVoucherRequestDto, authorization, options) {
859
+ return localVarFp.withdrawPolicyVoucher(code, withdrawPolicyVoucherRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
860
+ },
861
+ };
862
+ };
863
+ exports.PolicyVouchersApiFactory = PolicyVouchersApiFactory;
864
+ /**
865
+ * PolicyVouchersApi - object-oriented interface
866
+ * @export
867
+ * @class PolicyVouchersApi
868
+ * @extends {BaseAPI}
869
+ */
870
+ var PolicyVouchersApi = /** @class */ (function (_super) {
871
+ __extends(PolicyVouchersApi, _super);
872
+ function PolicyVouchersApi() {
873
+ return _super !== null && _super.apply(this, arguments) || this;
874
+ }
875
+ /**
876
+ * This will charge the policy voucher.
877
+ * @summary Charges the policy voucher.
878
+ * @param {PolicyVouchersApiChargePolicyVoucherRequest} requestParameters Request parameters.
879
+ * @param {*} [options] Override http request option.
880
+ * @throws {RequiredError}
881
+ * @memberof PolicyVouchersApi
882
+ */
883
+ PolicyVouchersApi.prototype.chargePolicyVoucher = function (requestParameters, options) {
884
+ var _this = this;
885
+ return (0, exports.PolicyVouchersApiFp)(this.configuration).chargePolicyVoucher(requestParameters.code, requestParameters.chargePolicyVoucherRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
886
+ };
887
+ /**
888
+ * This will check if the account is eligible for a specific voucher.
889
+ * @summary Checks the account eligibility.
890
+ * @param {PolicyVouchersApiCheckAccountEligibilityRequest} requestParameters Request parameters.
891
+ * @param {*} [options] Override http request option.
892
+ * @throws {RequiredError}
893
+ * @memberof PolicyVouchersApi
894
+ */
895
+ PolicyVouchersApi.prototype.checkAccountEligibility = function (requestParameters, options) {
896
+ var _this = this;
897
+ return (0, exports.PolicyVouchersApiFp)(this.configuration).checkAccountEligibility(requestParameters.checkAccountEligibilityRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
898
+ };
899
+ /**
900
+ * This will create an policy voucher.
901
+ * @summary Create the policy voucher
902
+ * @param {PolicyVouchersApiCreatePolicyVoucherRequest} requestParameters Request parameters.
903
+ * @param {*} [options] Override http request option.
904
+ * @throws {RequiredError}
905
+ * @memberof PolicyVouchersApi
906
+ */
907
+ PolicyVouchersApi.prototype.createPolicyVoucher = function (requestParameters, options) {
908
+ var _this = this;
909
+ return (0, exports.PolicyVouchersApiFp)(this.configuration).createPolicyVoucher(requestParameters.createPolicyVoucherRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
910
+ };
911
+ /**
912
+ * This will delete an policy voucher.
913
+ * @summary Delete the policy voucher
914
+ * @param {PolicyVouchersApiDeletePolicyVoucherRequest} requestParameters Request parameters.
915
+ * @param {*} [options] Override http request option.
916
+ * @throws {RequiredError}
917
+ * @memberof PolicyVouchersApi
918
+ */
919
+ PolicyVouchersApi.prototype.deletePolicyVoucher = function (requestParameters, options) {
920
+ var _this = this;
921
+ return (0, exports.PolicyVouchersApiFp)(this.configuration).deletePolicyVoucher(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
922
+ };
923
+ /**
924
+ * This will get an policy voucher.
925
+ * @summary Retrieve the policy voucher
926
+ * @param {PolicyVouchersApiGetPolicyVoucherRequest} requestParameters Request parameters.
927
+ * @param {*} [options] Override http request option.
928
+ * @throws {RequiredError}
929
+ * @memberof PolicyVouchersApi
930
+ */
931
+ PolicyVouchersApi.prototype.getPolicyVoucher = function (requestParameters, options) {
932
+ var _this = this;
933
+ return (0, exports.PolicyVouchersApiFp)(this.configuration).getPolicyVoucher(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
934
+ };
935
+ /**
936
+ * 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.
937
+ * @summary List policy vouchers
938
+ * @param {PolicyVouchersApiListPolicyVouchersRequest} requestParameters Request parameters.
939
+ * @param {*} [options] Override http request option.
940
+ * @throws {RequiredError}
941
+ * @memberof PolicyVouchersApi
942
+ */
943
+ PolicyVouchersApi.prototype.listPolicyVouchers = function (requestParameters, options) {
944
+ var _this = this;
945
+ if (requestParameters === void 0) { requestParameters = {}; }
946
+ 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); });
947
+ };
948
+ /**
949
+ * This will redeem the policy voucher.
950
+ * @summary Redeems the policy voucher.
951
+ * @param {PolicyVouchersApiRedeemPolicyVoucherRequest} requestParameters Request parameters.
952
+ * @param {*} [options] Override http request option.
953
+ * @throws {RequiredError}
954
+ * @memberof PolicyVouchersApi
955
+ */
956
+ PolicyVouchersApi.prototype.redeemPolicyVoucher = function (requestParameters, options) {
957
+ var _this = this;
958
+ return (0, exports.PolicyVouchersApiFp)(this.configuration).redeemPolicyVoucher(requestParameters.code, requestParameters.redeemPolicyVoucherRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
959
+ };
960
+ /**
961
+ * This will withdraw the policy voucher.
962
+ * @summary Withdraws the policy voucher.
963
+ * @param {PolicyVouchersApiWithdrawPolicyVoucherRequest} requestParameters Request parameters.
964
+ * @param {*} [options] Override http request option.
965
+ * @throws {RequiredError}
966
+ * @memberof PolicyVouchersApi
967
+ */
968
+ PolicyVouchersApi.prototype.withdrawPolicyVoucher = function (requestParameters, options) {
969
+ var _this = this;
970
+ return (0, exports.PolicyVouchersApiFp)(this.configuration).withdrawPolicyVoucher(requestParameters.code, requestParameters.withdrawPolicyVoucherRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
971
+ };
972
+ return PolicyVouchersApi;
973
+ }(base_1.BaseAPI));
974
+ exports.PolicyVouchersApi = PolicyVouchersApi;