@emilgroup/discount-sdk-node 1.1.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/.openapi-generator/FILES +54 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +84 -0
  5. package/api/campaigns-api.ts +1437 -0
  6. package/api/default-api.ts +128 -0
  7. package/api/policy-vouchers-api.ts +1042 -0
  8. package/api/vouchers-api.ts +695 -0
  9. package/api.ts +37 -0
  10. package/base.ts +286 -0
  11. package/common.ts +199 -0
  12. package/configuration.ts +118 -0
  13. package/dist/api/campaigns-api.d.ts +808 -0
  14. package/dist/api/campaigns-api.js +1308 -0
  15. package/dist/api/default-api.d.ts +70 -0
  16. package/dist/api/default-api.js +217 -0
  17. package/dist/api/policy-vouchers-api.d.ts +582 -0
  18. package/dist/api/policy-vouchers-api.js +978 -0
  19. package/dist/api/vouchers-api.d.ts +393 -0
  20. package/dist/api/vouchers-api.js +675 -0
  21. package/dist/api.d.ts +15 -0
  22. package/dist/api.js +33 -0
  23. package/dist/base.d.ts +79 -0
  24. package/dist/base.js +405 -0
  25. package/dist/common.d.ts +92 -0
  26. package/dist/common.js +277 -0
  27. package/dist/configuration.d.ts +96 -0
  28. package/dist/configuration.js +52 -0
  29. package/dist/index.d.ts +15 -0
  30. package/dist/index.js +36 -0
  31. package/dist/models/campaign-class.d.ts +105 -0
  32. package/dist/models/campaign-class.js +24 -0
  33. package/dist/models/charge-policy-voucher-request-dto.d.ts +48 -0
  34. package/dist/models/charge-policy-voucher-request-dto.js +15 -0
  35. package/dist/models/charge-policy-voucher-response-class.d.ts +90 -0
  36. package/dist/models/charge-policy-voucher-response-class.js +21 -0
  37. package/dist/models/check-account-eligibility-request-dto.d.ts +48 -0
  38. package/dist/models/check-account-eligibility-request-dto.js +15 -0
  39. package/dist/models/check-account-eligibility-response-class.d.ts +57 -0
  40. package/dist/models/check-account-eligibility-response-class.js +24 -0
  41. package/dist/models/create-campaign-request-dto.d.ts +42 -0
  42. package/dist/models/create-campaign-request-dto.js +15 -0
  43. package/dist/models/create-campaign-response-class.d.ts +25 -0
  44. package/dist/models/create-campaign-response-class.js +15 -0
  45. package/dist/models/create-eligible-account-request-dto.d.ts +30 -0
  46. package/dist/models/create-eligible-account-request-dto.js +15 -0
  47. package/dist/models/create-eligible-account-response-class.d.ts +25 -0
  48. package/dist/models/create-eligible-account-response-class.js +15 -0
  49. package/dist/models/create-policy-voucher-request-dto.d.ts +48 -0
  50. package/dist/models/create-policy-voucher-request-dto.js +15 -0
  51. package/dist/models/create-policy-voucher-response-class.d.ts +25 -0
  52. package/dist/models/create-policy-voucher-response-class.js +15 -0
  53. package/dist/models/create-product-discount-dto.d.ts +48 -0
  54. package/dist/models/create-product-discount-dto.js +15 -0
  55. package/dist/models/create-voucher-request-dto.d.ts +66 -0
  56. package/dist/models/create-voucher-request-dto.js +20 -0
  57. package/dist/models/create-voucher-response-class.d.ts +25 -0
  58. package/dist/models/create-voucher-response-class.js +15 -0
  59. package/dist/models/eligible-account-class.d.ts +78 -0
  60. package/dist/models/eligible-account-class.js +15 -0
  61. package/dist/models/get-campaign-response-class.d.ts +25 -0
  62. package/dist/models/get-campaign-response-class.js +15 -0
  63. package/dist/models/get-policy-voucher-response-class.d.ts +25 -0
  64. package/dist/models/get-policy-voucher-response-class.js +15 -0
  65. package/dist/models/get-voucher-response-class.d.ts +25 -0
  66. package/dist/models/get-voucher-response-class.js +15 -0
  67. package/dist/models/index.d.ts +37 -0
  68. package/dist/models/index.js +53 -0
  69. package/dist/models/inline-response200.d.ts +54 -0
  70. package/dist/models/inline-response200.js +15 -0
  71. package/dist/models/inline-response503.d.ts +54 -0
  72. package/dist/models/inline-response503.js +15 -0
  73. package/dist/models/list-campaigns-response-class.d.ts +43 -0
  74. package/dist/models/list-campaigns-response-class.js +15 -0
  75. package/dist/models/list-eligible-accounts-response-class.d.ts +43 -0
  76. package/dist/models/list-eligible-accounts-response-class.js +15 -0
  77. package/dist/models/list-policy-vouchers-response-class.d.ts +43 -0
  78. package/dist/models/list-policy-vouchers-response-class.js +15 -0
  79. package/dist/models/list-vouchers-response-class.d.ts +43 -0
  80. package/dist/models/list-vouchers-response-class.js +15 -0
  81. package/dist/models/policy-voucher-class.d.ts +159 -0
  82. package/dist/models/policy-voucher-class.js +21 -0
  83. package/dist/models/policy-voucher-transaction-class.d.ts +126 -0
  84. package/dist/models/policy-voucher-transaction-class.js +26 -0
  85. package/dist/models/product-discount-class.d.ts +90 -0
  86. package/dist/models/product-discount-class.js +15 -0
  87. package/dist/models/redeem-policy-voucher-request-dto.d.ts +48 -0
  88. package/dist/models/redeem-policy-voucher-request-dto.js +15 -0
  89. package/dist/models/redeem-policy-voucher-response-class.d.ts +84 -0
  90. package/dist/models/redeem-policy-voucher-response-class.js +21 -0
  91. package/dist/models/update-campaign-request-dto.d.ts +42 -0
  92. package/dist/models/update-campaign-request-dto.js +15 -0
  93. package/dist/models/update-campaign-response-class.d.ts +25 -0
  94. package/dist/models/update-campaign-response-class.js +15 -0
  95. package/dist/models/update-campaign-status-request-dto.d.ts +33 -0
  96. package/dist/models/update-campaign-status-request-dto.js +24 -0
  97. package/dist/models/update-voucher-request-dto.d.ts +60 -0
  98. package/dist/models/update-voucher-request-dto.js +20 -0
  99. package/dist/models/update-voucher-response-class.d.ts +25 -0
  100. package/dist/models/update-voucher-response-class.js +15 -0
  101. package/dist/models/voucher-class.d.ts +127 -0
  102. package/dist/models/voucher-class.js +20 -0
  103. package/dist/models/withdraw-policy-voucher-request-dto.d.ts +36 -0
  104. package/dist/models/withdraw-policy-voucher-request-dto.js +15 -0
  105. package/dist/models/withdraw-policy-voucher-response-class.d.ts +78 -0
  106. package/dist/models/withdraw-policy-voucher-response-class.js +21 -0
  107. package/git_push.sh +57 -0
  108. package/index.ts +19 -0
  109. package/models/campaign-class.ts +114 -0
  110. package/models/charge-policy-voucher-request-dto.ts +54 -0
  111. package/models/charge-policy-voucher-response-class.ts +99 -0
  112. package/models/check-account-eligibility-request-dto.ts +54 -0
  113. package/models/check-account-eligibility-response-class.ts +66 -0
  114. package/models/create-campaign-request-dto.ts +48 -0
  115. package/models/create-campaign-response-class.ts +31 -0
  116. package/models/create-eligible-account-request-dto.ts +36 -0
  117. package/models/create-eligible-account-response-class.ts +31 -0
  118. package/models/create-policy-voucher-request-dto.ts +54 -0
  119. package/models/create-policy-voucher-response-class.ts +31 -0
  120. package/models/create-product-discount-dto.ts +54 -0
  121. package/models/create-voucher-request-dto.ts +75 -0
  122. package/models/create-voucher-response-class.ts +31 -0
  123. package/models/eligible-account-class.ts +84 -0
  124. package/models/get-campaign-response-class.ts +31 -0
  125. package/models/get-policy-voucher-response-class.ts +31 -0
  126. package/models/get-voucher-response-class.ts +31 -0
  127. package/models/index.ts +37 -0
  128. package/models/inline-response200.ts +48 -0
  129. package/models/inline-response503.ts +48 -0
  130. package/models/list-campaigns-response-class.ts +49 -0
  131. package/models/list-eligible-accounts-response-class.ts +49 -0
  132. package/models/list-policy-vouchers-response-class.ts +49 -0
  133. package/models/list-vouchers-response-class.ts +49 -0
  134. package/models/policy-voucher-class.ts +168 -0
  135. package/models/policy-voucher-transaction-class.ts +136 -0
  136. package/models/product-discount-class.ts +96 -0
  137. package/models/redeem-policy-voucher-request-dto.ts +54 -0
  138. package/models/redeem-policy-voucher-response-class.ts +93 -0
  139. package/models/update-campaign-request-dto.ts +48 -0
  140. package/models/update-campaign-response-class.ts +31 -0
  141. package/models/update-campaign-status-request-dto.ts +42 -0
  142. package/models/update-voucher-request-dto.ts +69 -0
  143. package/models/update-voucher-response-class.ts +31 -0
  144. package/models/voucher-class.ts +136 -0
  145. package/models/withdraw-policy-voucher-request-dto.ts +42 -0
  146. package/models/withdraw-policy-voucher-response-class.ts +87 -0
  147. package/package.json +29 -0
  148. package/tsconfig.json +23 -0
@@ -0,0 +1,1437 @@
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 { CreateCampaignRequestDto } from '../models';
25
+ // @ts-ignore
26
+ import { CreateCampaignResponseClass } from '../models';
27
+ // @ts-ignore
28
+ import { CreateEligibleAccountRequestDto } from '../models';
29
+ // @ts-ignore
30
+ import { CreateEligibleAccountResponseClass } from '../models';
31
+ // @ts-ignore
32
+ import { GetCampaignResponseClass } from '../models';
33
+ // @ts-ignore
34
+ import { ListCampaignsResponseClass } from '../models';
35
+ // @ts-ignore
36
+ import { ListEligibleAccountsResponseClass } from '../models';
37
+ // @ts-ignore
38
+ import { UpdateCampaignRequestDto } from '../models';
39
+ // @ts-ignore
40
+ import { UpdateCampaignResponseClass } from '../models';
41
+ // @ts-ignore
42
+ import { UpdateCampaignStatusRequestDto } from '../models';
43
+ // URLSearchParams not necessarily used
44
+ // @ts-ignore
45
+ import { URL, URLSearchParams } from 'url';
46
+ const FormData = require('form-data');
47
+ /**
48
+ * CampaignsApi - axios parameter creator
49
+ * @export
50
+ */
51
+ export const CampaignsApiAxiosParamCreator = function (configuration?: Configuration) {
52
+ return {
53
+ /**
54
+ * Creates a new campaign that can contain multiple vouchers for eligible accounts to redeem.
55
+ * @summary Create the Campaign
56
+ * @param {CreateCampaignRequestDto} createCampaignRequestDto
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
+ createCampaign: async (createCampaignRequestDto: CreateCampaignRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
62
+ // verify required parameter 'createCampaignRequestDto' is not null or undefined
63
+ assertParamExists('createCampaign', 'createCampaignRequestDto', createCampaignRequestDto)
64
+ const localVarPath = `/discountservice/v1/campaigns`;
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(createCampaignRequestDto, localVarRequestOptions, configuration)
94
+
95
+ return {
96
+ url: toPathString(localVarUrlObj),
97
+ options: localVarRequestOptions,
98
+ };
99
+ },
100
+ /**
101
+ * Creates an account that is eligible to redeem a vouchers from a specific campaign.
102
+ * @summary Create the Eligible Account
103
+ * @param {string} code Unique identifier for the object.
104
+ * @param {CreateEligibleAccountRequestDto} createEligibleAccountRequestDto
105
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
106
+ * @param {*} [options] Override http request option.
107
+ * @throws {RequiredError}
108
+ */
109
+ createEligibleAccount: async (code: string, createEligibleAccountRequestDto: CreateEligibleAccountRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
110
+ // verify required parameter 'code' is not null or undefined
111
+ assertParamExists('createEligibleAccount', 'code', code)
112
+ // verify required parameter 'createEligibleAccountRequestDto' is not null or undefined
113
+ assertParamExists('createEligibleAccount', 'createEligibleAccountRequestDto', createEligibleAccountRequestDto)
114
+ const localVarPath = `/discountservice/v1/campaigns/{code}/eligible-accounts`
115
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)));
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(createEligibleAccountRequestDto, localVarRequestOptions, configuration)
145
+
146
+ return {
147
+ url: toPathString(localVarUrlObj),
148
+ options: localVarRequestOptions,
149
+ };
150
+ },
151
+ /**
152
+ * Removes a campaign and its associated vouchers. This will prevent any further voucher redemptions.
153
+ * @summary Delete the Campaign
154
+ * @param {string} code Unique identifier for the object.
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
+ deleteCampaign: async (code: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
160
+ // verify required parameter 'code' is not null or undefined
161
+ assertParamExists('deleteCampaign', 'code', code)
162
+ const localVarPath = `/discountservice/v1/campaigns/{code}`
163
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)));
164
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
165
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
166
+ let baseOptions;
167
+ let baseAccessToken;
168
+ if (configuration) {
169
+ baseOptions = configuration.baseOptions;
170
+ baseAccessToken = configuration.accessToken;
171
+ }
172
+
173
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
174
+ const localVarHeaderParameter = {} as any;
175
+ const localVarQueryParameter = {} as any;
176
+
177
+ // authentication bearer required
178
+ // http bearer authentication required
179
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
180
+
181
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
182
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
183
+ }
184
+
185
+
186
+
187
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
188
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
189
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
190
+
191
+ return {
192
+ url: toPathString(localVarUrlObj),
193
+ options: localVarRequestOptions,
194
+ };
195
+ },
196
+ /**
197
+ * Removes an eligible account from a campaign. This will prevent the account from using the assigned voucher code for discounts when the campaign is released.
198
+ * @summary Delete the Eligible Account
199
+ * @param {string} code Unique identifier for the object.
200
+ * @param {string} accountCode The code of the eligible account
201
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
202
+ * @param {*} [options] Override http request option.
203
+ * @throws {RequiredError}
204
+ */
205
+ deleteEligibleAccount: async (code: string, accountCode: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
206
+ // verify required parameter 'code' is not null or undefined
207
+ assertParamExists('deleteEligibleAccount', 'code', code)
208
+ // verify required parameter 'accountCode' is not null or undefined
209
+ assertParamExists('deleteEligibleAccount', 'accountCode', accountCode)
210
+ const localVarPath = `/discountservice/v1/campaigns/{code}/eligible-accounts/{accountCode}`
211
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)))
212
+ .replace(`{${"accountCode"}}`, encodeURIComponent(String(accountCode)));
213
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
214
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
215
+ let baseOptions;
216
+ let baseAccessToken;
217
+ if (configuration) {
218
+ baseOptions = configuration.baseOptions;
219
+ baseAccessToken = configuration.accessToken;
220
+ }
221
+
222
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
223
+ const localVarHeaderParameter = {} as any;
224
+ const localVarQueryParameter = {} as any;
225
+
226
+ // authentication bearer required
227
+ // http bearer authentication required
228
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
229
+
230
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
231
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
232
+ }
233
+
234
+
235
+
236
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
237
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
238
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
239
+
240
+ return {
241
+ url: toPathString(localVarUrlObj),
242
+ options: localVarRequestOptions,
243
+ };
244
+ },
245
+ /**
246
+ * Removes all eligible accounts from a campaign. This will prevent these accounts from using their assigned voucher codes for discounts when the campaign is released.
247
+ * @summary Delete the Eligible Accounts
248
+ * @param {string} code Unique identifier for the object.
249
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
250
+ * @param {*} [options] Override http request option.
251
+ * @throws {RequiredError}
252
+ */
253
+ deleteEligibleAccounts: async (code: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
254
+ // verify required parameter 'code' is not null or undefined
255
+ assertParamExists('deleteEligibleAccounts', 'code', code)
256
+ const localVarPath = `/discountservice/v1/campaigns/{code}/eligible-accounts`
257
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)));
258
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
259
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
260
+ let baseOptions;
261
+ let baseAccessToken;
262
+ if (configuration) {
263
+ baseOptions = configuration.baseOptions;
264
+ baseAccessToken = configuration.accessToken;
265
+ }
266
+
267
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
268
+ const localVarHeaderParameter = {} as any;
269
+ const localVarQueryParameter = {} as any;
270
+
271
+ // authentication bearer required
272
+ // http bearer authentication required
273
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
274
+
275
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
276
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
277
+ }
278
+
279
+
280
+
281
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
282
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
283
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
284
+
285
+ return {
286
+ url: toPathString(localVarUrlObj),
287
+ options: localVarRequestOptions,
288
+ };
289
+ },
290
+ /**
291
+ * Retrieves detailed information about a specific campaign.
292
+ * @summary Retrieve the Campaign
293
+ * @param {string} code Unique identifier for the object.
294
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
295
+ * @param {number} [expand] You can expand campaign in this endpoint.
296
+ * @param {*} [options] Override http request option.
297
+ * @throws {RequiredError}
298
+ */
299
+ getCampaign: async (code: string, authorization?: string, expand?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
300
+ // verify required parameter 'code' is not null or undefined
301
+ assertParamExists('getCampaign', 'code', code)
302
+ const localVarPath = `/discountservice/v1/campaigns/{code}`
303
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)));
304
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
305
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
306
+ let baseOptions;
307
+ let baseAccessToken;
308
+ if (configuration) {
309
+ baseOptions = configuration.baseOptions;
310
+ baseAccessToken = configuration.accessToken;
311
+ }
312
+
313
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
314
+ const localVarHeaderParameter = {} as any;
315
+ const localVarQueryParameter = {} as any;
316
+
317
+ // authentication bearer required
318
+ // http bearer authentication required
319
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
320
+
321
+ if (expand !== undefined) {
322
+ localVarQueryParameter['expand'] = expand;
323
+ }
324
+
325
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
326
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
327
+ }
328
+
329
+
330
+
331
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
332
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
333
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
334
+
335
+ return {
336
+ url: toPathString(localVarUrlObj),
337
+ options: localVarRequestOptions,
338
+ };
339
+ },
340
+ /**
341
+ * Retrieves a list of campaigns.
342
+ * @summary List Campaigns
343
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
344
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
345
+ * @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.
346
+ * @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, name, status, slug, startDate, endDate, createdAt&lt;/i&gt;
347
+ * @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: name, slug&lt;/i&gt;
348
+ * @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: name, status, startDate, endDate, createdAt&lt;/i&gt;
349
+ * @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;
350
+ * @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, name, status, slug, startDate, endDate, createdAt&lt;/i&gt;
351
+ * @param {*} [options] Override http request option.
352
+ * @throws {RequiredError}
353
+ */
354
+ listCampaigns: async (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
355
+ const localVarPath = `/discountservice/v1/campaigns`;
356
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
357
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
358
+ let baseOptions;
359
+ let baseAccessToken;
360
+ if (configuration) {
361
+ baseOptions = configuration.baseOptions;
362
+ baseAccessToken = configuration.accessToken;
363
+ }
364
+
365
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
366
+ const localVarHeaderParameter = {} as any;
367
+ const localVarQueryParameter = {} as any;
368
+
369
+ // authentication bearer required
370
+ // http bearer authentication required
371
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
372
+
373
+ if (pageSize !== undefined) {
374
+ localVarQueryParameter['pageSize'] = pageSize;
375
+ }
376
+
377
+ if (pageToken !== undefined) {
378
+ localVarQueryParameter['pageToken'] = pageToken;
379
+ }
380
+
381
+ if (filter !== undefined) {
382
+ localVarQueryParameter['filter'] = filter;
383
+ }
384
+
385
+ if (search !== undefined) {
386
+ localVarQueryParameter['search'] = search;
387
+ }
388
+
389
+ if (order !== undefined) {
390
+ localVarQueryParameter['order'] = order;
391
+ }
392
+
393
+ if (expand !== undefined) {
394
+ localVarQueryParameter['expand'] = expand;
395
+ }
396
+
397
+ if (filters !== undefined) {
398
+ localVarQueryParameter['filters'] = filters;
399
+ }
400
+
401
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
402
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
403
+ }
404
+
405
+
406
+
407
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
408
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
409
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
410
+
411
+ return {
412
+ url: toPathString(localVarUrlObj),
413
+ options: localVarRequestOptions,
414
+ };
415
+ },
416
+ /**
417
+ * Retrieves a list of eligible accounts.
418
+ * @summary List Eligible Accounts
419
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
420
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
421
+ * @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.
422
+ * @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, createdAt, updatedAt&lt;/i&gt;
423
+ * @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, partnerNumber&lt;/i&gt;
424
+ * @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: voucherCode, partnerNumber, createdAt&lt;/i&gt;
425
+ * @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;
426
+ * @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, createdAt, updatedAt&lt;/i&gt;
427
+ * @param {*} [options] Override http request option.
428
+ * @throws {RequiredError}
429
+ */
430
+ listEligibleAccounts: async (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
431
+ const localVarPath = `/discountservice/v1/campaigns/eligible-accounts`;
432
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
433
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
434
+ let baseOptions;
435
+ let baseAccessToken;
436
+ if (configuration) {
437
+ baseOptions = configuration.baseOptions;
438
+ baseAccessToken = configuration.accessToken;
439
+ }
440
+
441
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
442
+ const localVarHeaderParameter = {} as any;
443
+ const localVarQueryParameter = {} as any;
444
+
445
+ // authentication bearer required
446
+ // http bearer authentication required
447
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
448
+
449
+ if (pageSize !== undefined) {
450
+ localVarQueryParameter['pageSize'] = pageSize;
451
+ }
452
+
453
+ if (pageToken !== undefined) {
454
+ localVarQueryParameter['pageToken'] = pageToken;
455
+ }
456
+
457
+ if (filter !== undefined) {
458
+ localVarQueryParameter['filter'] = filter;
459
+ }
460
+
461
+ if (search !== undefined) {
462
+ localVarQueryParameter['search'] = search;
463
+ }
464
+
465
+ if (order !== undefined) {
466
+ localVarQueryParameter['order'] = order;
467
+ }
468
+
469
+ if (expand !== undefined) {
470
+ localVarQueryParameter['expand'] = expand;
471
+ }
472
+
473
+ if (filters !== undefined) {
474
+ localVarQueryParameter['filters'] = filters;
475
+ }
476
+
477
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
478
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
479
+ }
480
+
481
+
482
+
483
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
484
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
485
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
486
+
487
+ return {
488
+ url: toPathString(localVarUrlObj),
489
+ options: localVarRequestOptions,
490
+ };
491
+ },
492
+ /**
493
+ * Updates the data of an existing campaign. Only DRAFT campaigns can be updated.
494
+ * @summary Update the Campaign
495
+ * @param {string} code Unique identifier for the object.
496
+ * @param {UpdateCampaignRequestDto} updateCampaignRequestDto
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
+ updateCampaign: async (code: string, updateCampaignRequestDto: UpdateCampaignRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
502
+ // verify required parameter 'code' is not null or undefined
503
+ assertParamExists('updateCampaign', 'code', code)
504
+ // verify required parameter 'updateCampaignRequestDto' is not null or undefined
505
+ assertParamExists('updateCampaign', 'updateCampaignRequestDto', updateCampaignRequestDto)
506
+ const localVarPath = `/discountservice/v1/campaigns/{code}`
507
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)));
508
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
509
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
510
+ let baseOptions;
511
+ let baseAccessToken;
512
+ if (configuration) {
513
+ baseOptions = configuration.baseOptions;
514
+ baseAccessToken = configuration.accessToken;
515
+ }
516
+
517
+ const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
518
+ const localVarHeaderParameter = {} as any;
519
+ const localVarQueryParameter = {} as any;
520
+
521
+ // authentication bearer required
522
+ // http bearer authentication required
523
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
524
+
525
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
526
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
527
+ }
528
+
529
+
530
+
531
+ localVarHeaderParameter['Content-Type'] = 'application/json';
532
+
533
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
534
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
535
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
536
+ localVarRequestOptions.data = serializeDataIfNeeded(updateCampaignRequestDto, localVarRequestOptions, configuration)
537
+
538
+ return {
539
+ url: toPathString(localVarUrlObj),
540
+ options: localVarRequestOptions,
541
+ };
542
+ },
543
+ /**
544
+ * Updates the status of a campaign, which affects whether vouchers can be redeemed.
545
+ * @summary Updates the status of a campaign.
546
+ * @param {string} code Unique identifier for the object.
547
+ * @param {UpdateCampaignStatusRequestDto} updateCampaignStatusRequestDto
548
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
549
+ * @param {*} [options] Override http request option.
550
+ * @throws {RequiredError}
551
+ */
552
+ updateCampaignStatus: async (code: string, updateCampaignStatusRequestDto: UpdateCampaignStatusRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
553
+ // verify required parameter 'code' is not null or undefined
554
+ assertParamExists('updateCampaignStatus', 'code', code)
555
+ // verify required parameter 'updateCampaignStatusRequestDto' is not null or undefined
556
+ assertParamExists('updateCampaignStatus', 'updateCampaignStatusRequestDto', updateCampaignStatusRequestDto)
557
+ const localVarPath = `/discountservice/v1/campaigns/{code}/status`
558
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)));
559
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
560
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
561
+ let baseOptions;
562
+ let baseAccessToken;
563
+ if (configuration) {
564
+ baseOptions = configuration.baseOptions;
565
+ baseAccessToken = configuration.accessToken;
566
+ }
567
+
568
+ const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
569
+ const localVarHeaderParameter = {} as any;
570
+ const localVarQueryParameter = {} as any;
571
+
572
+ // authentication bearer required
573
+ // http bearer authentication required
574
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
575
+
576
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
577
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
578
+ }
579
+
580
+
581
+
582
+ localVarHeaderParameter['Content-Type'] = 'application/json';
583
+
584
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
585
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
586
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
587
+ localVarRequestOptions.data = serializeDataIfNeeded(updateCampaignStatusRequestDto, localVarRequestOptions, configuration)
588
+
589
+ return {
590
+ url: toPathString(localVarUrlObj),
591
+ options: localVarRequestOptions,
592
+ };
593
+ },
594
+ /**
595
+ * Uploads accounts that are eligible to redeem vouchers from a specific campaign using a CSV file. The CSV file must contain a header row with the following columns: partnerNumber, voucherCode. Separate each column with a comma.
596
+ * @summary Uploads the eligible accounts.
597
+ * @param {string} code Unique identifier for the object.
598
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
599
+ * @param {*} [options] Override http request option.
600
+ * @throws {RequiredError}
601
+ */
602
+ uploadEligibleAccounts: async (code: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
603
+ // verify required parameter 'code' is not null or undefined
604
+ assertParamExists('uploadEligibleAccounts', 'code', code)
605
+ const localVarPath = `/discountservice/v1/campaigns/{code}/eligible-accounts/batch`
606
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)));
607
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
608
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
609
+ let baseOptions;
610
+ let baseAccessToken;
611
+ if (configuration) {
612
+ baseOptions = configuration.baseOptions;
613
+ baseAccessToken = configuration.accessToken;
614
+ }
615
+
616
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
617
+ const localVarHeaderParameter = {} as any;
618
+ const localVarQueryParameter = {} as any;
619
+
620
+ // authentication bearer required
621
+ // http bearer authentication required
622
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
623
+
624
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
625
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
626
+ }
627
+
628
+
629
+
630
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
631
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
632
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
633
+
634
+ return {
635
+ url: toPathString(localVarUrlObj),
636
+ options: localVarRequestOptions,
637
+ };
638
+ },
639
+ }
640
+ };
641
+
642
+ /**
643
+ * CampaignsApi - functional programming interface
644
+ * @export
645
+ */
646
+ export const CampaignsApiFp = function(configuration?: Configuration) {
647
+ const localVarAxiosParamCreator = CampaignsApiAxiosParamCreator(configuration)
648
+ return {
649
+ /**
650
+ * Creates a new campaign that can contain multiple vouchers for eligible accounts to redeem.
651
+ * @summary Create the Campaign
652
+ * @param {CreateCampaignRequestDto} createCampaignRequestDto
653
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
654
+ * @param {*} [options] Override http request option.
655
+ * @throws {RequiredError}
656
+ */
657
+ async createCampaign(createCampaignRequestDto: CreateCampaignRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateCampaignResponseClass>> {
658
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createCampaign(createCampaignRequestDto, authorization, options);
659
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
660
+ },
661
+ /**
662
+ * Creates an account that is eligible to redeem a vouchers from a specific campaign.
663
+ * @summary Create the Eligible Account
664
+ * @param {string} code Unique identifier for the object.
665
+ * @param {CreateEligibleAccountRequestDto} createEligibleAccountRequestDto
666
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
667
+ * @param {*} [options] Override http request option.
668
+ * @throws {RequiredError}
669
+ */
670
+ async createEligibleAccount(code: string, createEligibleAccountRequestDto: CreateEligibleAccountRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateEligibleAccountResponseClass>> {
671
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createEligibleAccount(code, createEligibleAccountRequestDto, authorization, options);
672
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
673
+ },
674
+ /**
675
+ * Removes a campaign and its associated vouchers. This will prevent any further voucher redemptions.
676
+ * @summary Delete the Campaign
677
+ * @param {string} code Unique identifier for the object.
678
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
679
+ * @param {*} [options] Override http request option.
680
+ * @throws {RequiredError}
681
+ */
682
+ async deleteCampaign(code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
683
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteCampaign(code, authorization, options);
684
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
685
+ },
686
+ /**
687
+ * Removes an eligible account from a campaign. This will prevent the account from using the assigned voucher code for discounts when the campaign is released.
688
+ * @summary Delete the Eligible Account
689
+ * @param {string} code Unique identifier for the object.
690
+ * @param {string} accountCode The code of the eligible account
691
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
692
+ * @param {*} [options] Override http request option.
693
+ * @throws {RequiredError}
694
+ */
695
+ async deleteEligibleAccount(code: string, accountCode: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
696
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteEligibleAccount(code, accountCode, authorization, options);
697
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
698
+ },
699
+ /**
700
+ * Removes all eligible accounts from a campaign. This will prevent these accounts from using their assigned voucher codes for discounts when the campaign is released.
701
+ * @summary Delete the Eligible Accounts
702
+ * @param {string} code Unique identifier for the object.
703
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
704
+ * @param {*} [options] Override http request option.
705
+ * @throws {RequiredError}
706
+ */
707
+ async deleteEligibleAccounts(code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
708
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteEligibleAccounts(code, authorization, options);
709
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
710
+ },
711
+ /**
712
+ * Retrieves detailed information about a specific campaign.
713
+ * @summary Retrieve the Campaign
714
+ * @param {string} code Unique identifier for the object.
715
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
716
+ * @param {number} [expand] You can expand campaign in this endpoint.
717
+ * @param {*} [options] Override http request option.
718
+ * @throws {RequiredError}
719
+ */
720
+ async getCampaign(code: string, authorization?: string, expand?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetCampaignResponseClass>> {
721
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getCampaign(code, authorization, expand, options);
722
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
723
+ },
724
+ /**
725
+ * Retrieves a list of campaigns.
726
+ * @summary List Campaigns
727
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
728
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
729
+ * @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.
730
+ * @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, name, status, slug, startDate, endDate, createdAt&lt;/i&gt;
731
+ * @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: name, slug&lt;/i&gt;
732
+ * @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: name, status, startDate, endDate, createdAt&lt;/i&gt;
733
+ * @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;
734
+ * @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, name, status, slug, startDate, endDate, createdAt&lt;/i&gt;
735
+ * @param {*} [options] Override http request option.
736
+ * @throws {RequiredError}
737
+ */
738
+ async listCampaigns(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListCampaignsResponseClass>> {
739
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listCampaigns(authorization, pageSize, pageToken, filter, search, order, expand, filters, options);
740
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
741
+ },
742
+ /**
743
+ * Retrieves a list of eligible accounts.
744
+ * @summary List Eligible Accounts
745
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
746
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
747
+ * @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.
748
+ * @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, createdAt, updatedAt&lt;/i&gt;
749
+ * @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, partnerNumber&lt;/i&gt;
750
+ * @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: voucherCode, partnerNumber, createdAt&lt;/i&gt;
751
+ * @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;
752
+ * @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, createdAt, updatedAt&lt;/i&gt;
753
+ * @param {*} [options] Override http request option.
754
+ * @throws {RequiredError}
755
+ */
756
+ async listEligibleAccounts(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListEligibleAccountsResponseClass>> {
757
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listEligibleAccounts(authorization, pageSize, pageToken, filter, search, order, expand, filters, options);
758
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
759
+ },
760
+ /**
761
+ * Updates the data of an existing campaign. Only DRAFT campaigns can be updated.
762
+ * @summary Update the Campaign
763
+ * @param {string} code Unique identifier for the object.
764
+ * @param {UpdateCampaignRequestDto} updateCampaignRequestDto
765
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
766
+ * @param {*} [options] Override http request option.
767
+ * @throws {RequiredError}
768
+ */
769
+ async updateCampaign(code: string, updateCampaignRequestDto: UpdateCampaignRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UpdateCampaignResponseClass>> {
770
+ const localVarAxiosArgs = await localVarAxiosParamCreator.updateCampaign(code, updateCampaignRequestDto, authorization, options);
771
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
772
+ },
773
+ /**
774
+ * Updates the status of a campaign, which affects whether vouchers can be redeemed.
775
+ * @summary Updates the status of a campaign.
776
+ * @param {string} code Unique identifier for the object.
777
+ * @param {UpdateCampaignStatusRequestDto} updateCampaignStatusRequestDto
778
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
779
+ * @param {*} [options] Override http request option.
780
+ * @throws {RequiredError}
781
+ */
782
+ async updateCampaignStatus(code: string, updateCampaignStatusRequestDto: UpdateCampaignStatusRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
783
+ const localVarAxiosArgs = await localVarAxiosParamCreator.updateCampaignStatus(code, updateCampaignStatusRequestDto, authorization, options);
784
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
785
+ },
786
+ /**
787
+ * Uploads accounts that are eligible to redeem vouchers from a specific campaign using a CSV file. The CSV file must contain a header row with the following columns: partnerNumber, voucherCode. Separate each column with a comma.
788
+ * @summary Uploads the eligible accounts.
789
+ * @param {string} code Unique identifier for the object.
790
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
791
+ * @param {*} [options] Override http request option.
792
+ * @throws {RequiredError}
793
+ */
794
+ async uploadEligibleAccounts(code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
795
+ const localVarAxiosArgs = await localVarAxiosParamCreator.uploadEligibleAccounts(code, authorization, options);
796
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
797
+ },
798
+ }
799
+ };
800
+
801
+ /**
802
+ * CampaignsApi - factory interface
803
+ * @export
804
+ */
805
+ export const CampaignsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
806
+ const localVarFp = CampaignsApiFp(configuration)
807
+ return {
808
+ /**
809
+ * Creates a new campaign that can contain multiple vouchers for eligible accounts to redeem.
810
+ * @summary Create the Campaign
811
+ * @param {CreateCampaignRequestDto} createCampaignRequestDto
812
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
813
+ * @param {*} [options] Override http request option.
814
+ * @throws {RequiredError}
815
+ */
816
+ createCampaign(createCampaignRequestDto: CreateCampaignRequestDto, authorization?: string, options?: any): AxiosPromise<CreateCampaignResponseClass> {
817
+ return localVarFp.createCampaign(createCampaignRequestDto, authorization, options).then((request) => request(axios, basePath));
818
+ },
819
+ /**
820
+ * Creates an account that is eligible to redeem a vouchers from a specific campaign.
821
+ * @summary Create the Eligible Account
822
+ * @param {string} code Unique identifier for the object.
823
+ * @param {CreateEligibleAccountRequestDto} createEligibleAccountRequestDto
824
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
825
+ * @param {*} [options] Override http request option.
826
+ * @throws {RequiredError}
827
+ */
828
+ createEligibleAccount(code: string, createEligibleAccountRequestDto: CreateEligibleAccountRequestDto, authorization?: string, options?: any): AxiosPromise<CreateEligibleAccountResponseClass> {
829
+ return localVarFp.createEligibleAccount(code, createEligibleAccountRequestDto, authorization, options).then((request) => request(axios, basePath));
830
+ },
831
+ /**
832
+ * Removes a campaign and its associated vouchers. This will prevent any further voucher redemptions.
833
+ * @summary Delete the Campaign
834
+ * @param {string} code Unique identifier for the object.
835
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
836
+ * @param {*} [options] Override http request option.
837
+ * @throws {RequiredError}
838
+ */
839
+ deleteCampaign(code: string, authorization?: string, options?: any): AxiosPromise<void> {
840
+ return localVarFp.deleteCampaign(code, authorization, options).then((request) => request(axios, basePath));
841
+ },
842
+ /**
843
+ * Removes an eligible account from a campaign. This will prevent the account from using the assigned voucher code for discounts when the campaign is released.
844
+ * @summary Delete the Eligible Account
845
+ * @param {string} code Unique identifier for the object.
846
+ * @param {string} accountCode The code of the eligible account
847
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
848
+ * @param {*} [options] Override http request option.
849
+ * @throws {RequiredError}
850
+ */
851
+ deleteEligibleAccount(code: string, accountCode: string, authorization?: string, options?: any): AxiosPromise<void> {
852
+ return localVarFp.deleteEligibleAccount(code, accountCode, authorization, options).then((request) => request(axios, basePath));
853
+ },
854
+ /**
855
+ * Removes all eligible accounts from a campaign. This will prevent these accounts from using their assigned voucher codes for discounts when the campaign is released.
856
+ * @summary Delete the Eligible Accounts
857
+ * @param {string} code Unique identifier for the object.
858
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
859
+ * @param {*} [options] Override http request option.
860
+ * @throws {RequiredError}
861
+ */
862
+ deleteEligibleAccounts(code: string, authorization?: string, options?: any): AxiosPromise<void> {
863
+ return localVarFp.deleteEligibleAccounts(code, authorization, options).then((request) => request(axios, basePath));
864
+ },
865
+ /**
866
+ * Retrieves detailed information about a specific campaign.
867
+ * @summary Retrieve the Campaign
868
+ * @param {string} code Unique identifier for the object.
869
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
870
+ * @param {number} [expand] You can expand campaign in this endpoint.
871
+ * @param {*} [options] Override http request option.
872
+ * @throws {RequiredError}
873
+ */
874
+ getCampaign(code: string, authorization?: string, expand?: number, options?: any): AxiosPromise<GetCampaignResponseClass> {
875
+ return localVarFp.getCampaign(code, authorization, expand, options).then((request) => request(axios, basePath));
876
+ },
877
+ /**
878
+ * Retrieves a list of campaigns.
879
+ * @summary List Campaigns
880
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
881
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
882
+ * @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.
883
+ * @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, name, status, slug, startDate, endDate, createdAt&lt;/i&gt;
884
+ * @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: name, slug&lt;/i&gt;
885
+ * @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: name, status, startDate, endDate, createdAt&lt;/i&gt;
886
+ * @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;
887
+ * @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, name, status, slug, startDate, endDate, createdAt&lt;/i&gt;
888
+ * @param {*} [options] Override http request option.
889
+ * @throws {RequiredError}
890
+ */
891
+ listCampaigns(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListCampaignsResponseClass> {
892
+ return localVarFp.listCampaigns(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
893
+ },
894
+ /**
895
+ * Retrieves a list of eligible accounts.
896
+ * @summary List Eligible Accounts
897
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
898
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
899
+ * @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.
900
+ * @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, createdAt, updatedAt&lt;/i&gt;
901
+ * @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, partnerNumber&lt;/i&gt;
902
+ * @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: voucherCode, partnerNumber, createdAt&lt;/i&gt;
903
+ * @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;
904
+ * @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, createdAt, updatedAt&lt;/i&gt;
905
+ * @param {*} [options] Override http request option.
906
+ * @throws {RequiredError}
907
+ */
908
+ listEligibleAccounts(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListEligibleAccountsResponseClass> {
909
+ return localVarFp.listEligibleAccounts(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
910
+ },
911
+ /**
912
+ * Updates the data of an existing campaign. Only DRAFT campaigns can be updated.
913
+ * @summary Update the Campaign
914
+ * @param {string} code Unique identifier for the object.
915
+ * @param {UpdateCampaignRequestDto} updateCampaignRequestDto
916
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
917
+ * @param {*} [options] Override http request option.
918
+ * @throws {RequiredError}
919
+ */
920
+ updateCampaign(code: string, updateCampaignRequestDto: UpdateCampaignRequestDto, authorization?: string, options?: any): AxiosPromise<UpdateCampaignResponseClass> {
921
+ return localVarFp.updateCampaign(code, updateCampaignRequestDto, authorization, options).then((request) => request(axios, basePath));
922
+ },
923
+ /**
924
+ * Updates the status of a campaign, which affects whether vouchers can be redeemed.
925
+ * @summary Updates the status of a campaign.
926
+ * @param {string} code Unique identifier for the object.
927
+ * @param {UpdateCampaignStatusRequestDto} updateCampaignStatusRequestDto
928
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
929
+ * @param {*} [options] Override http request option.
930
+ * @throws {RequiredError}
931
+ */
932
+ updateCampaignStatus(code: string, updateCampaignStatusRequestDto: UpdateCampaignStatusRequestDto, authorization?: string, options?: any): AxiosPromise<void> {
933
+ return localVarFp.updateCampaignStatus(code, updateCampaignStatusRequestDto, authorization, options).then((request) => request(axios, basePath));
934
+ },
935
+ /**
936
+ * Uploads accounts that are eligible to redeem vouchers from a specific campaign using a CSV file. The CSV file must contain a header row with the following columns: partnerNumber, voucherCode. Separate each column with a comma.
937
+ * @summary Uploads the eligible accounts.
938
+ * @param {string} code Unique identifier for the object.
939
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
940
+ * @param {*} [options] Override http request option.
941
+ * @throws {RequiredError}
942
+ */
943
+ uploadEligibleAccounts(code: string, authorization?: string, options?: any): AxiosPromise<void> {
944
+ return localVarFp.uploadEligibleAccounts(code, authorization, options).then((request) => request(axios, basePath));
945
+ },
946
+ };
947
+ };
948
+
949
+ /**
950
+ * Request parameters for createCampaign operation in CampaignsApi.
951
+ * @export
952
+ * @interface CampaignsApiCreateCampaignRequest
953
+ */
954
+ export interface CampaignsApiCreateCampaignRequest {
955
+ /**
956
+ *
957
+ * @type {CreateCampaignRequestDto}
958
+ * @memberof CampaignsApiCreateCampaign
959
+ */
960
+ readonly createCampaignRequestDto: CreateCampaignRequestDto
961
+
962
+ /**
963
+ * Bearer Token: provided by the login endpoint under the name accessToken.
964
+ * @type {string}
965
+ * @memberof CampaignsApiCreateCampaign
966
+ */
967
+ readonly authorization?: string
968
+ }
969
+
970
+ /**
971
+ * Request parameters for createEligibleAccount operation in CampaignsApi.
972
+ * @export
973
+ * @interface CampaignsApiCreateEligibleAccountRequest
974
+ */
975
+ export interface CampaignsApiCreateEligibleAccountRequest {
976
+ /**
977
+ * Unique identifier for the object.
978
+ * @type {string}
979
+ * @memberof CampaignsApiCreateEligibleAccount
980
+ */
981
+ readonly code: string
982
+
983
+ /**
984
+ *
985
+ * @type {CreateEligibleAccountRequestDto}
986
+ * @memberof CampaignsApiCreateEligibleAccount
987
+ */
988
+ readonly createEligibleAccountRequestDto: CreateEligibleAccountRequestDto
989
+
990
+ /**
991
+ * Bearer Token: provided by the login endpoint under the name accessToken.
992
+ * @type {string}
993
+ * @memberof CampaignsApiCreateEligibleAccount
994
+ */
995
+ readonly authorization?: string
996
+ }
997
+
998
+ /**
999
+ * Request parameters for deleteCampaign operation in CampaignsApi.
1000
+ * @export
1001
+ * @interface CampaignsApiDeleteCampaignRequest
1002
+ */
1003
+ export interface CampaignsApiDeleteCampaignRequest {
1004
+ /**
1005
+ * Unique identifier for the object.
1006
+ * @type {string}
1007
+ * @memberof CampaignsApiDeleteCampaign
1008
+ */
1009
+ readonly code: string
1010
+
1011
+ /**
1012
+ * Bearer Token: provided by the login endpoint under the name accessToken.
1013
+ * @type {string}
1014
+ * @memberof CampaignsApiDeleteCampaign
1015
+ */
1016
+ readonly authorization?: string
1017
+ }
1018
+
1019
+ /**
1020
+ * Request parameters for deleteEligibleAccount operation in CampaignsApi.
1021
+ * @export
1022
+ * @interface CampaignsApiDeleteEligibleAccountRequest
1023
+ */
1024
+ export interface CampaignsApiDeleteEligibleAccountRequest {
1025
+ /**
1026
+ * Unique identifier for the object.
1027
+ * @type {string}
1028
+ * @memberof CampaignsApiDeleteEligibleAccount
1029
+ */
1030
+ readonly code: string
1031
+
1032
+ /**
1033
+ * The code of the eligible account
1034
+ * @type {string}
1035
+ * @memberof CampaignsApiDeleteEligibleAccount
1036
+ */
1037
+ readonly accountCode: string
1038
+
1039
+ /**
1040
+ * Bearer Token: provided by the login endpoint under the name accessToken.
1041
+ * @type {string}
1042
+ * @memberof CampaignsApiDeleteEligibleAccount
1043
+ */
1044
+ readonly authorization?: string
1045
+ }
1046
+
1047
+ /**
1048
+ * Request parameters for deleteEligibleAccounts operation in CampaignsApi.
1049
+ * @export
1050
+ * @interface CampaignsApiDeleteEligibleAccountsRequest
1051
+ */
1052
+ export interface CampaignsApiDeleteEligibleAccountsRequest {
1053
+ /**
1054
+ * Unique identifier for the object.
1055
+ * @type {string}
1056
+ * @memberof CampaignsApiDeleteEligibleAccounts
1057
+ */
1058
+ readonly code: string
1059
+
1060
+ /**
1061
+ * Bearer Token: provided by the login endpoint under the name accessToken.
1062
+ * @type {string}
1063
+ * @memberof CampaignsApiDeleteEligibleAccounts
1064
+ */
1065
+ readonly authorization?: string
1066
+ }
1067
+
1068
+ /**
1069
+ * Request parameters for getCampaign operation in CampaignsApi.
1070
+ * @export
1071
+ * @interface CampaignsApiGetCampaignRequest
1072
+ */
1073
+ export interface CampaignsApiGetCampaignRequest {
1074
+ /**
1075
+ * Unique identifier for the object.
1076
+ * @type {string}
1077
+ * @memberof CampaignsApiGetCampaign
1078
+ */
1079
+ readonly code: string
1080
+
1081
+ /**
1082
+ * Bearer Token: provided by the login endpoint under the name accessToken.
1083
+ * @type {string}
1084
+ * @memberof CampaignsApiGetCampaign
1085
+ */
1086
+ readonly authorization?: string
1087
+
1088
+ /**
1089
+ * You can expand campaign in this endpoint.
1090
+ * @type {number}
1091
+ * @memberof CampaignsApiGetCampaign
1092
+ */
1093
+ readonly expand?: number
1094
+ }
1095
+
1096
+ /**
1097
+ * Request parameters for listCampaigns operation in CampaignsApi.
1098
+ * @export
1099
+ * @interface CampaignsApiListCampaignsRequest
1100
+ */
1101
+ export interface CampaignsApiListCampaignsRequest {
1102
+ /**
1103
+ * Bearer Token: provided by the login endpoint under the name accessToken.
1104
+ * @type {string}
1105
+ * @memberof CampaignsApiListCampaigns
1106
+ */
1107
+ readonly authorization?: string
1108
+
1109
+ /**
1110
+ * A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
1111
+ * @type {number}
1112
+ * @memberof CampaignsApiListCampaigns
1113
+ */
1114
+ readonly pageSize?: number
1115
+
1116
+ /**
1117
+ * 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.
1118
+ * @type {string}
1119
+ * @memberof CampaignsApiListCampaigns
1120
+ */
1121
+ readonly pageToken?: string
1122
+
1123
+ /**
1124
+ * 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, name, status, slug, startDate, endDate, createdAt&lt;/i&gt;
1125
+ * @type {string}
1126
+ * @memberof CampaignsApiListCampaigns
1127
+ */
1128
+ readonly filter?: string
1129
+
1130
+ /**
1131
+ * 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: name, slug&lt;/i&gt;
1132
+ * @type {string}
1133
+ * @memberof CampaignsApiListCampaigns
1134
+ */
1135
+ readonly search?: string
1136
+
1137
+ /**
1138
+ * 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: name, status, startDate, endDate, createdAt&lt;/i&gt;
1139
+ * @type {string}
1140
+ * @memberof CampaignsApiListCampaigns
1141
+ */
1142
+ readonly order?: string
1143
+
1144
+ /**
1145
+ * 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;
1146
+ * @type {string}
1147
+ * @memberof CampaignsApiListCampaigns
1148
+ */
1149
+ readonly expand?: string
1150
+
1151
+ /**
1152
+ * 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, name, status, slug, startDate, endDate, createdAt&lt;/i&gt;
1153
+ * @type {string}
1154
+ * @memberof CampaignsApiListCampaigns
1155
+ */
1156
+ readonly filters?: string
1157
+ }
1158
+
1159
+ /**
1160
+ * Request parameters for listEligibleAccounts operation in CampaignsApi.
1161
+ * @export
1162
+ * @interface CampaignsApiListEligibleAccountsRequest
1163
+ */
1164
+ export interface CampaignsApiListEligibleAccountsRequest {
1165
+ /**
1166
+ * Bearer Token: provided by the login endpoint under the name accessToken.
1167
+ * @type {string}
1168
+ * @memberof CampaignsApiListEligibleAccounts
1169
+ */
1170
+ readonly authorization?: string
1171
+
1172
+ /**
1173
+ * A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
1174
+ * @type {number}
1175
+ * @memberof CampaignsApiListEligibleAccounts
1176
+ */
1177
+ readonly pageSize?: number
1178
+
1179
+ /**
1180
+ * 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.
1181
+ * @type {string}
1182
+ * @memberof CampaignsApiListEligibleAccounts
1183
+ */
1184
+ readonly pageToken?: string
1185
+
1186
+ /**
1187
+ * 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, createdAt, updatedAt&lt;/i&gt;
1188
+ * @type {string}
1189
+ * @memberof CampaignsApiListEligibleAccounts
1190
+ */
1191
+ readonly filter?: string
1192
+
1193
+ /**
1194
+ * 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, partnerNumber&lt;/i&gt;
1195
+ * @type {string}
1196
+ * @memberof CampaignsApiListEligibleAccounts
1197
+ */
1198
+ readonly search?: string
1199
+
1200
+ /**
1201
+ * 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: voucherCode, partnerNumber, createdAt&lt;/i&gt;
1202
+ * @type {string}
1203
+ * @memberof CampaignsApiListEligibleAccounts
1204
+ */
1205
+ readonly order?: string
1206
+
1207
+ /**
1208
+ * 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;
1209
+ * @type {string}
1210
+ * @memberof CampaignsApiListEligibleAccounts
1211
+ */
1212
+ readonly expand?: string
1213
+
1214
+ /**
1215
+ * 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, createdAt, updatedAt&lt;/i&gt;
1216
+ * @type {string}
1217
+ * @memberof CampaignsApiListEligibleAccounts
1218
+ */
1219
+ readonly filters?: string
1220
+ }
1221
+
1222
+ /**
1223
+ * Request parameters for updateCampaign operation in CampaignsApi.
1224
+ * @export
1225
+ * @interface CampaignsApiUpdateCampaignRequest
1226
+ */
1227
+ export interface CampaignsApiUpdateCampaignRequest {
1228
+ /**
1229
+ * Unique identifier for the object.
1230
+ * @type {string}
1231
+ * @memberof CampaignsApiUpdateCampaign
1232
+ */
1233
+ readonly code: string
1234
+
1235
+ /**
1236
+ *
1237
+ * @type {UpdateCampaignRequestDto}
1238
+ * @memberof CampaignsApiUpdateCampaign
1239
+ */
1240
+ readonly updateCampaignRequestDto: UpdateCampaignRequestDto
1241
+
1242
+ /**
1243
+ * Bearer Token: provided by the login endpoint under the name accessToken.
1244
+ * @type {string}
1245
+ * @memberof CampaignsApiUpdateCampaign
1246
+ */
1247
+ readonly authorization?: string
1248
+ }
1249
+
1250
+ /**
1251
+ * Request parameters for updateCampaignStatus operation in CampaignsApi.
1252
+ * @export
1253
+ * @interface CampaignsApiUpdateCampaignStatusRequest
1254
+ */
1255
+ export interface CampaignsApiUpdateCampaignStatusRequest {
1256
+ /**
1257
+ * Unique identifier for the object.
1258
+ * @type {string}
1259
+ * @memberof CampaignsApiUpdateCampaignStatus
1260
+ */
1261
+ readonly code: string
1262
+
1263
+ /**
1264
+ *
1265
+ * @type {UpdateCampaignStatusRequestDto}
1266
+ * @memberof CampaignsApiUpdateCampaignStatus
1267
+ */
1268
+ readonly updateCampaignStatusRequestDto: UpdateCampaignStatusRequestDto
1269
+
1270
+ /**
1271
+ * Bearer Token: provided by the login endpoint under the name accessToken.
1272
+ * @type {string}
1273
+ * @memberof CampaignsApiUpdateCampaignStatus
1274
+ */
1275
+ readonly authorization?: string
1276
+ }
1277
+
1278
+ /**
1279
+ * Request parameters for uploadEligibleAccounts operation in CampaignsApi.
1280
+ * @export
1281
+ * @interface CampaignsApiUploadEligibleAccountsRequest
1282
+ */
1283
+ export interface CampaignsApiUploadEligibleAccountsRequest {
1284
+ /**
1285
+ * Unique identifier for the object.
1286
+ * @type {string}
1287
+ * @memberof CampaignsApiUploadEligibleAccounts
1288
+ */
1289
+ readonly code: string
1290
+
1291
+ /**
1292
+ * Bearer Token: provided by the login endpoint under the name accessToken.
1293
+ * @type {string}
1294
+ * @memberof CampaignsApiUploadEligibleAccounts
1295
+ */
1296
+ readonly authorization?: string
1297
+ }
1298
+
1299
+ /**
1300
+ * CampaignsApi - object-oriented interface
1301
+ * @export
1302
+ * @class CampaignsApi
1303
+ * @extends {BaseAPI}
1304
+ */
1305
+ export class CampaignsApi extends BaseAPI {
1306
+ /**
1307
+ * Creates a new campaign that can contain multiple vouchers for eligible accounts to redeem.
1308
+ * @summary Create the Campaign
1309
+ * @param {CampaignsApiCreateCampaignRequest} requestParameters Request parameters.
1310
+ * @param {*} [options] Override http request option.
1311
+ * @throws {RequiredError}
1312
+ * @memberof CampaignsApi
1313
+ */
1314
+ public createCampaign(requestParameters: CampaignsApiCreateCampaignRequest, options?: AxiosRequestConfig) {
1315
+ return CampaignsApiFp(this.configuration).createCampaign(requestParameters.createCampaignRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1316
+ }
1317
+
1318
+ /**
1319
+ * Creates an account that is eligible to redeem a vouchers from a specific campaign.
1320
+ * @summary Create the Eligible Account
1321
+ * @param {CampaignsApiCreateEligibleAccountRequest} requestParameters Request parameters.
1322
+ * @param {*} [options] Override http request option.
1323
+ * @throws {RequiredError}
1324
+ * @memberof CampaignsApi
1325
+ */
1326
+ public createEligibleAccount(requestParameters: CampaignsApiCreateEligibleAccountRequest, options?: AxiosRequestConfig) {
1327
+ return CampaignsApiFp(this.configuration).createEligibleAccount(requestParameters.code, requestParameters.createEligibleAccountRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1328
+ }
1329
+
1330
+ /**
1331
+ * Removes a campaign and its associated vouchers. This will prevent any further voucher redemptions.
1332
+ * @summary Delete the Campaign
1333
+ * @param {CampaignsApiDeleteCampaignRequest} requestParameters Request parameters.
1334
+ * @param {*} [options] Override http request option.
1335
+ * @throws {RequiredError}
1336
+ * @memberof CampaignsApi
1337
+ */
1338
+ public deleteCampaign(requestParameters: CampaignsApiDeleteCampaignRequest, options?: AxiosRequestConfig) {
1339
+ return CampaignsApiFp(this.configuration).deleteCampaign(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1340
+ }
1341
+
1342
+ /**
1343
+ * Removes an eligible account from a campaign. This will prevent the account from using the assigned voucher code for discounts when the campaign is released.
1344
+ * @summary Delete the Eligible Account
1345
+ * @param {CampaignsApiDeleteEligibleAccountRequest} requestParameters Request parameters.
1346
+ * @param {*} [options] Override http request option.
1347
+ * @throws {RequiredError}
1348
+ * @memberof CampaignsApi
1349
+ */
1350
+ public deleteEligibleAccount(requestParameters: CampaignsApiDeleteEligibleAccountRequest, options?: AxiosRequestConfig) {
1351
+ return CampaignsApiFp(this.configuration).deleteEligibleAccount(requestParameters.code, requestParameters.accountCode, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1352
+ }
1353
+
1354
+ /**
1355
+ * Removes all eligible accounts from a campaign. This will prevent these accounts from using their assigned voucher codes for discounts when the campaign is released.
1356
+ * @summary Delete the Eligible Accounts
1357
+ * @param {CampaignsApiDeleteEligibleAccountsRequest} requestParameters Request parameters.
1358
+ * @param {*} [options] Override http request option.
1359
+ * @throws {RequiredError}
1360
+ * @memberof CampaignsApi
1361
+ */
1362
+ public deleteEligibleAccounts(requestParameters: CampaignsApiDeleteEligibleAccountsRequest, options?: AxiosRequestConfig) {
1363
+ return CampaignsApiFp(this.configuration).deleteEligibleAccounts(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1364
+ }
1365
+
1366
+ /**
1367
+ * Retrieves detailed information about a specific campaign.
1368
+ * @summary Retrieve the Campaign
1369
+ * @param {CampaignsApiGetCampaignRequest} requestParameters Request parameters.
1370
+ * @param {*} [options] Override http request option.
1371
+ * @throws {RequiredError}
1372
+ * @memberof CampaignsApi
1373
+ */
1374
+ public getCampaign(requestParameters: CampaignsApiGetCampaignRequest, options?: AxiosRequestConfig) {
1375
+ return CampaignsApiFp(this.configuration).getCampaign(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
1376
+ }
1377
+
1378
+ /**
1379
+ * Retrieves a list of campaigns.
1380
+ * @summary List Campaigns
1381
+ * @param {CampaignsApiListCampaignsRequest} requestParameters Request parameters.
1382
+ * @param {*} [options] Override http request option.
1383
+ * @throws {RequiredError}
1384
+ * @memberof CampaignsApi
1385
+ */
1386
+ public listCampaigns(requestParameters: CampaignsApiListCampaignsRequest = {}, options?: AxiosRequestConfig) {
1387
+ return CampaignsApiFp(this.configuration).listCampaigns(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then((request) => request(this.axios, this.basePath));
1388
+ }
1389
+
1390
+ /**
1391
+ * Retrieves a list of eligible accounts.
1392
+ * @summary List Eligible Accounts
1393
+ * @param {CampaignsApiListEligibleAccountsRequest} requestParameters Request parameters.
1394
+ * @param {*} [options] Override http request option.
1395
+ * @throws {RequiredError}
1396
+ * @memberof CampaignsApi
1397
+ */
1398
+ public listEligibleAccounts(requestParameters: CampaignsApiListEligibleAccountsRequest = {}, options?: AxiosRequestConfig) {
1399
+ return CampaignsApiFp(this.configuration).listEligibleAccounts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then((request) => request(this.axios, this.basePath));
1400
+ }
1401
+
1402
+ /**
1403
+ * Updates the data of an existing campaign. Only DRAFT campaigns can be updated.
1404
+ * @summary Update the Campaign
1405
+ * @param {CampaignsApiUpdateCampaignRequest} requestParameters Request parameters.
1406
+ * @param {*} [options] Override http request option.
1407
+ * @throws {RequiredError}
1408
+ * @memberof CampaignsApi
1409
+ */
1410
+ public updateCampaign(requestParameters: CampaignsApiUpdateCampaignRequest, options?: AxiosRequestConfig) {
1411
+ return CampaignsApiFp(this.configuration).updateCampaign(requestParameters.code, requestParameters.updateCampaignRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1412
+ }
1413
+
1414
+ /**
1415
+ * Updates the status of a campaign, which affects whether vouchers can be redeemed.
1416
+ * @summary Updates the status of a campaign.
1417
+ * @param {CampaignsApiUpdateCampaignStatusRequest} requestParameters Request parameters.
1418
+ * @param {*} [options] Override http request option.
1419
+ * @throws {RequiredError}
1420
+ * @memberof CampaignsApi
1421
+ */
1422
+ public updateCampaignStatus(requestParameters: CampaignsApiUpdateCampaignStatusRequest, options?: AxiosRequestConfig) {
1423
+ return CampaignsApiFp(this.configuration).updateCampaignStatus(requestParameters.code, requestParameters.updateCampaignStatusRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1424
+ }
1425
+
1426
+ /**
1427
+ * Uploads accounts that are eligible to redeem vouchers from a specific campaign using a CSV file. The CSV file must contain a header row with the following columns: partnerNumber, voucherCode. Separate each column with a comma.
1428
+ * @summary Uploads the eligible accounts.
1429
+ * @param {CampaignsApiUploadEligibleAccountsRequest} requestParameters Request parameters.
1430
+ * @param {*} [options] Override http request option.
1431
+ * @throws {RequiredError}
1432
+ * @memberof CampaignsApi
1433
+ */
1434
+ public uploadEligibleAccounts(requestParameters: CampaignsApiUploadEligibleAccountsRequest, options?: AxiosRequestConfig) {
1435
+ return CampaignsApiFp(this.configuration).uploadEligibleAccounts(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1436
+ }
1437
+ }