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