@emilgroup/discount-sdk 1.5.1 → 1.8.0

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