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