@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.
- package/.openapi-generator/FILES +54 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +2 -2
- package/api/campaigns-api.ts +1433 -0
- package/api/default-api.ts +124 -0
- package/api/policy-vouchers-api.ts +999 -0
- package/api/vouchers-api.ts +691 -0
- package/api.ts +33 -0
- package/base.ts +331 -0
- package/common.ts +198 -0
- package/configuration.ts +110 -0
- package/dist/api/campaigns-api.d.ts +808 -0
- package/dist/api/campaigns-api.js +1251 -0
- package/dist/api/default-api.d.ts +70 -0
- package/dist/api/default-api.js +200 -0
- package/dist/api/policy-vouchers-api.d.ts +555 -0
- package/dist/api/policy-vouchers-api.js +915 -0
- package/dist/api/vouchers-api.d.ts +393 -0
- package/dist/api/vouchers-api.js +642 -0
- package/dist/api.d.ts +15 -0
- package/dist/api.js +33 -0
- package/dist/base.d.ts +86 -0
- package/dist/base.js +367 -0
- package/dist/common.d.ts +91 -0
- package/dist/common.js +276 -0
- package/dist/configuration.d.ts +89 -0
- package/dist/configuration.js +52 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +36 -0
- package/dist/models/campaign-class.d.ts +105 -0
- package/dist/models/campaign-class.js +24 -0
- package/dist/models/charge-policy-voucher-request-dto.d.ts +48 -0
- package/dist/models/charge-policy-voucher-request-dto.js +15 -0
- package/dist/models/charge-policy-voucher-response-class.d.ts +96 -0
- package/dist/models/charge-policy-voucher-response-class.js +21 -0
- package/dist/models/check-account-eligibility-request-dto.d.ts +48 -0
- package/dist/models/check-account-eligibility-request-dto.js +15 -0
- package/dist/models/check-account-eligibility-response-class.d.ts +57 -0
- package/dist/models/check-account-eligibility-response-class.js +24 -0
- package/dist/models/create-campaign-request-dto.d.ts +42 -0
- package/dist/models/create-campaign-request-dto.js +15 -0
- package/dist/models/create-campaign-response-class.d.ts +25 -0
- package/dist/models/create-campaign-response-class.js +15 -0
- package/dist/models/create-eligible-account-request-dto.d.ts +30 -0
- package/dist/models/create-eligible-account-request-dto.js +15 -0
- package/dist/models/create-eligible-account-response-class.d.ts +25 -0
- package/dist/models/create-eligible-account-response-class.js +15 -0
- package/dist/models/create-policy-voucher-request-dto.d.ts +48 -0
- package/dist/models/create-policy-voucher-request-dto.js +15 -0
- package/dist/models/create-policy-voucher-response-class.d.ts +25 -0
- package/dist/models/create-policy-voucher-response-class.js +15 -0
- package/dist/models/create-product-discount-dto.d.ts +48 -0
- package/dist/models/create-product-discount-dto.js +15 -0
- package/dist/models/create-voucher-request-dto.d.ts +66 -0
- package/dist/models/create-voucher-request-dto.js +20 -0
- package/dist/models/create-voucher-response-class.d.ts +25 -0
- package/dist/models/create-voucher-response-class.js +15 -0
- package/dist/models/eligible-account-class.d.ts +78 -0
- package/dist/models/eligible-account-class.js +15 -0
- package/dist/models/get-campaign-response-class.d.ts +25 -0
- package/dist/models/get-campaign-response-class.js +15 -0
- package/dist/models/get-policy-voucher-response-class.d.ts +25 -0
- package/dist/models/get-policy-voucher-response-class.js +15 -0
- package/dist/models/get-voucher-response-class.d.ts +25 -0
- package/dist/models/get-voucher-response-class.js +15 -0
- package/dist/models/index.d.ts +37 -0
- package/dist/models/index.js +53 -0
- package/dist/models/inline-response200.d.ts +54 -0
- package/dist/models/inline-response200.js +15 -0
- package/dist/models/inline-response503.d.ts +54 -0
- package/dist/models/inline-response503.js +15 -0
- package/dist/models/list-campaigns-response-class.d.ts +43 -0
- package/dist/models/list-campaigns-response-class.js +15 -0
- package/dist/models/list-eligible-accounts-response-class.d.ts +43 -0
- package/dist/models/list-eligible-accounts-response-class.js +15 -0
- package/dist/models/list-policy-vouchers-response-class.d.ts +43 -0
- package/dist/models/list-policy-vouchers-response-class.js +15 -0
- package/dist/models/list-vouchers-response-class.d.ts +43 -0
- package/dist/models/list-vouchers-response-class.js +15 -0
- package/dist/models/policy-voucher-class.d.ts +165 -0
- package/dist/models/policy-voucher-class.js +21 -0
- package/dist/models/policy-voucher-transaction-class.d.ts +126 -0
- package/dist/models/policy-voucher-transaction-class.js +26 -0
- package/dist/models/product-discount-class.d.ts +90 -0
- package/dist/models/product-discount-class.js +15 -0
- package/dist/models/redeem-policy-voucher-request-dto.d.ts +48 -0
- package/dist/models/redeem-policy-voucher-request-dto.js +15 -0
- package/dist/models/redeem-policy-voucher-response-class.d.ts +84 -0
- package/dist/models/redeem-policy-voucher-response-class.js +21 -0
- package/dist/models/update-campaign-request-dto.d.ts +42 -0
- package/dist/models/update-campaign-request-dto.js +15 -0
- package/dist/models/update-campaign-response-class.d.ts +25 -0
- package/dist/models/update-campaign-response-class.js +15 -0
- package/dist/models/update-campaign-status-request-dto.d.ts +33 -0
- package/dist/models/update-campaign-status-request-dto.js +24 -0
- package/dist/models/update-voucher-request-dto.d.ts +60 -0
- package/dist/models/update-voucher-request-dto.js +20 -0
- package/dist/models/update-voucher-response-class.d.ts +25 -0
- package/dist/models/update-voucher-response-class.js +15 -0
- package/dist/models/voucher-class.d.ts +127 -0
- package/dist/models/voucher-class.js +20 -0
- package/dist/models/withdraw-policy-voucher-request-dto.d.ts +36 -0
- package/dist/models/withdraw-policy-voucher-request-dto.js +15 -0
- package/dist/models/withdraw-policy-voucher-response-class.d.ts +78 -0
- package/dist/models/withdraw-policy-voucher-response-class.js +21 -0
- package/git_push.sh +57 -0
- package/index.ts +19 -0
- package/models/campaign-class.ts +114 -0
- package/models/charge-policy-voucher-request-dto.ts +54 -0
- package/models/charge-policy-voucher-response-class.ts +105 -0
- package/models/check-account-eligibility-request-dto.ts +54 -0
- package/models/check-account-eligibility-response-class.ts +66 -0
- package/models/create-campaign-request-dto.ts +48 -0
- package/models/create-campaign-response-class.ts +31 -0
- package/models/create-eligible-account-request-dto.ts +36 -0
- package/models/create-eligible-account-response-class.ts +31 -0
- package/models/create-policy-voucher-request-dto.ts +54 -0
- package/models/create-policy-voucher-response-class.ts +31 -0
- package/models/create-product-discount-dto.ts +54 -0
- package/models/create-voucher-request-dto.ts +75 -0
- package/models/create-voucher-response-class.ts +31 -0
- package/models/eligible-account-class.ts +84 -0
- package/models/get-campaign-response-class.ts +31 -0
- package/models/get-policy-voucher-response-class.ts +31 -0
- package/models/get-voucher-response-class.ts +31 -0
- package/models/index.ts +37 -0
- package/models/inline-response200.ts +48 -0
- package/models/inline-response503.ts +48 -0
- package/models/list-campaigns-response-class.ts +49 -0
- package/models/list-eligible-accounts-response-class.ts +49 -0
- package/models/list-policy-vouchers-response-class.ts +49 -0
- package/models/list-vouchers-response-class.ts +49 -0
- package/models/policy-voucher-class.ts +174 -0
- package/models/policy-voucher-transaction-class.ts +136 -0
- package/models/product-discount-class.ts +96 -0
- package/models/redeem-policy-voucher-request-dto.ts +54 -0
- package/models/redeem-policy-voucher-response-class.ts +93 -0
- package/models/update-campaign-request-dto.ts +48 -0
- package/models/update-campaign-response-class.ts +31 -0
- package/models/update-campaign-status-request-dto.ts +42 -0
- package/models/update-voucher-request-dto.ts +69 -0
- package/models/update-voucher-response-class.ts +31 -0
- package/models/voucher-class.ts +136 -0
- package/models/withdraw-policy-voucher-request-dto.ts +42 -0
- package/models/withdraw-policy-voucher-response-class.ts +87 -0
- package/package.json +22 -8
- package/tsconfig.json +23 -0
- package/index.js +0 -99
- package/scripts/deploy.js +0 -225
|
@@ -0,0 +1,691 @@
|
|
|
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 { CreateVoucherRequestDto } from '../models';
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
import { CreateVoucherResponseClass } from '../models';
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
import { GetVoucherResponseClass } from '../models';
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
import { ListVouchersResponseClass } from '../models';
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
import { UpdateVoucherRequestDto } from '../models';
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
import { UpdateVoucherResponseClass } from '../models';
|
|
35
|
+
/**
|
|
36
|
+
* VouchersApi - axios parameter creator
|
|
37
|
+
* @export
|
|
38
|
+
*/
|
|
39
|
+
export const VouchersApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
40
|
+
return {
|
|
41
|
+
/**
|
|
42
|
+
* This will create a voucher.
|
|
43
|
+
* @summary Create the Voucher
|
|
44
|
+
* @param {CreateVoucherRequestDto} createVoucherRequestDto
|
|
45
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
46
|
+
* @param {*} [options] Override http request option.
|
|
47
|
+
* @throws {RequiredError}
|
|
48
|
+
*/
|
|
49
|
+
createVoucher: async (createVoucherRequestDto: CreateVoucherRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
50
|
+
// verify required parameter 'createVoucherRequestDto' is not null or undefined
|
|
51
|
+
assertParamExists('createVoucher', 'createVoucherRequestDto', createVoucherRequestDto)
|
|
52
|
+
const localVarPath = `/discountservice/v1/vouchers`;
|
|
53
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
54
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
55
|
+
let baseOptions;
|
|
56
|
+
let baseAccessToken;
|
|
57
|
+
if (configuration) {
|
|
58
|
+
baseOptions = configuration.baseOptions;
|
|
59
|
+
baseAccessToken = configuration.accessToken;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
63
|
+
const localVarHeaderParameter = {} as any;
|
|
64
|
+
const localVarQueryParameter = {} as any;
|
|
65
|
+
|
|
66
|
+
// authentication bearer required
|
|
67
|
+
// http bearer authentication required
|
|
68
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
69
|
+
|
|
70
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
71
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
77
|
+
|
|
78
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
79
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
80
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
81
|
+
localVarRequestOptions.data = serializeDataIfNeeded(createVoucherRequestDto, localVarRequestOptions, configuration)
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
url: toPathString(localVarUrlObj),
|
|
85
|
+
options: localVarRequestOptions,
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
/**
|
|
89
|
+
* This will delete a voucher.
|
|
90
|
+
* @summary Delete the Voucher
|
|
91
|
+
* @param {string} code Unique identifier for the object.
|
|
92
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
93
|
+
* @param {*} [options] Override http request option.
|
|
94
|
+
* @throws {RequiredError}
|
|
95
|
+
*/
|
|
96
|
+
deleteVoucher: async (code: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
97
|
+
// verify required parameter 'code' is not null or undefined
|
|
98
|
+
assertParamExists('deleteVoucher', 'code', code)
|
|
99
|
+
const localVarPath = `/discountservice/v1/vouchers/{code}`
|
|
100
|
+
.replace(`{${"code"}}`, encodeURIComponent(String(code)));
|
|
101
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
102
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
103
|
+
let baseOptions;
|
|
104
|
+
let baseAccessToken;
|
|
105
|
+
if (configuration) {
|
|
106
|
+
baseOptions = configuration.baseOptions;
|
|
107
|
+
baseAccessToken = configuration.accessToken;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
|
|
111
|
+
const localVarHeaderParameter = {} as any;
|
|
112
|
+
const localVarQueryParameter = {} as any;
|
|
113
|
+
|
|
114
|
+
// authentication bearer required
|
|
115
|
+
// http bearer authentication required
|
|
116
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
117
|
+
|
|
118
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
119
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
125
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
126
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
url: toPathString(localVarUrlObj),
|
|
130
|
+
options: localVarRequestOptions,
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
/**
|
|
134
|
+
* This will get a voucher.
|
|
135
|
+
* @summary Retrieve the Voucher
|
|
136
|
+
* @param {string} code Unique identifier for the object.
|
|
137
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
138
|
+
* @param {'campaign' | 'productDiscounts'} [expand] You can expand voucher in this endpoint.
|
|
139
|
+
* @param {*} [options] Override http request option.
|
|
140
|
+
* @throws {RequiredError}
|
|
141
|
+
*/
|
|
142
|
+
getVoucher: async (code: string, authorization?: string, expand?: 'campaign' | 'productDiscounts', options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
143
|
+
// verify required parameter 'code' is not null or undefined
|
|
144
|
+
assertParamExists('getVoucher', 'code', code)
|
|
145
|
+
const localVarPath = `/discountservice/v1/vouchers/{code}`
|
|
146
|
+
.replace(`{${"code"}}`, encodeURIComponent(String(code)));
|
|
147
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
148
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
149
|
+
let baseOptions;
|
|
150
|
+
let baseAccessToken;
|
|
151
|
+
if (configuration) {
|
|
152
|
+
baseOptions = configuration.baseOptions;
|
|
153
|
+
baseAccessToken = configuration.accessToken;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
157
|
+
const localVarHeaderParameter = {} as any;
|
|
158
|
+
const localVarQueryParameter = {} as any;
|
|
159
|
+
|
|
160
|
+
// authentication bearer required
|
|
161
|
+
// http bearer authentication required
|
|
162
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
163
|
+
|
|
164
|
+
if (expand !== undefined) {
|
|
165
|
+
localVarQueryParameter['expand'] = expand;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
169
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
175
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
176
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
177
|
+
|
|
178
|
+
return {
|
|
179
|
+
url: toPathString(localVarUrlObj),
|
|
180
|
+
options: localVarRequestOptions,
|
|
181
|
+
};
|
|
182
|
+
},
|
|
183
|
+
/**
|
|
184
|
+
* Returns a list of Vouchers you have previously created. The Vouchers are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
185
|
+
* @summary List Vouchers
|
|
186
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
187
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
188
|
+
* @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=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
189
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug</i>
|
|
190
|
+
* @param {string} [search] Search the response for matches in any searchable field. Use filter instead where possible for improved performance.<br/> <br/> <i>Searchable fields: code, voucherCode, productSlugsList</i>
|
|
191
|
+
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: code, voucherCode, campaignId, discountPeriodMonths, discountType, discountValue, createdAt</i>
|
|
192
|
+
* @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.<br/> <br/> <i>Allowed values: campaign, productDiscounts<i>
|
|
193
|
+
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug</i>
|
|
194
|
+
* @param {*} [options] Override http request option.
|
|
195
|
+
* @throws {RequiredError}
|
|
196
|
+
*/
|
|
197
|
+
listVouchers: async (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
198
|
+
const localVarPath = `/discountservice/v1/vouchers`;
|
|
199
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
200
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
201
|
+
let baseOptions;
|
|
202
|
+
let baseAccessToken;
|
|
203
|
+
if (configuration) {
|
|
204
|
+
baseOptions = configuration.baseOptions;
|
|
205
|
+
baseAccessToken = configuration.accessToken;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
209
|
+
const localVarHeaderParameter = {} as any;
|
|
210
|
+
const localVarQueryParameter = {} as any;
|
|
211
|
+
|
|
212
|
+
// authentication bearer required
|
|
213
|
+
// http bearer authentication required
|
|
214
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
215
|
+
|
|
216
|
+
if (pageSize !== undefined) {
|
|
217
|
+
localVarQueryParameter['pageSize'] = pageSize;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (pageToken !== undefined) {
|
|
221
|
+
localVarQueryParameter['pageToken'] = pageToken;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
if (filter !== undefined) {
|
|
225
|
+
localVarQueryParameter['filter'] = filter;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
if (search !== undefined) {
|
|
229
|
+
localVarQueryParameter['search'] = search;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if (order !== undefined) {
|
|
233
|
+
localVarQueryParameter['order'] = order;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
if (expand !== undefined) {
|
|
237
|
+
localVarQueryParameter['expand'] = expand;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (filters !== undefined) {
|
|
241
|
+
localVarQueryParameter['filters'] = filters;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
245
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
251
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
252
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
253
|
+
|
|
254
|
+
return {
|
|
255
|
+
url: toPathString(localVarUrlObj),
|
|
256
|
+
options: localVarRequestOptions,
|
|
257
|
+
};
|
|
258
|
+
},
|
|
259
|
+
/**
|
|
260
|
+
* This will update a voucher.
|
|
261
|
+
* @summary Update the Voucher
|
|
262
|
+
* @param {string} code Unique identifier for the object.
|
|
263
|
+
* @param {UpdateVoucherRequestDto} updateVoucherRequestDto
|
|
264
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
265
|
+
* @param {*} [options] Override http request option.
|
|
266
|
+
* @throws {RequiredError}
|
|
267
|
+
*/
|
|
268
|
+
updateVoucher: async (code: string, updateVoucherRequestDto: UpdateVoucherRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
269
|
+
// verify required parameter 'code' is not null or undefined
|
|
270
|
+
assertParamExists('updateVoucher', 'code', code)
|
|
271
|
+
// verify required parameter 'updateVoucherRequestDto' is not null or undefined
|
|
272
|
+
assertParamExists('updateVoucher', 'updateVoucherRequestDto', updateVoucherRequestDto)
|
|
273
|
+
const localVarPath = `/discountservice/v1/vouchers/{code}`
|
|
274
|
+
.replace(`{${"code"}}`, encodeURIComponent(String(code)));
|
|
275
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
276
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
277
|
+
let baseOptions;
|
|
278
|
+
let baseAccessToken;
|
|
279
|
+
if (configuration) {
|
|
280
|
+
baseOptions = configuration.baseOptions;
|
|
281
|
+
baseAccessToken = configuration.accessToken;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
|
|
285
|
+
const localVarHeaderParameter = {} as any;
|
|
286
|
+
const localVarQueryParameter = {} as any;
|
|
287
|
+
|
|
288
|
+
// authentication bearer required
|
|
289
|
+
// http bearer authentication required
|
|
290
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
291
|
+
|
|
292
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
293
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
299
|
+
|
|
300
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
301
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
302
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
303
|
+
localVarRequestOptions.data = serializeDataIfNeeded(updateVoucherRequestDto, localVarRequestOptions, configuration)
|
|
304
|
+
|
|
305
|
+
return {
|
|
306
|
+
url: toPathString(localVarUrlObj),
|
|
307
|
+
options: localVarRequestOptions,
|
|
308
|
+
};
|
|
309
|
+
},
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* VouchersApi - functional programming interface
|
|
315
|
+
* @export
|
|
316
|
+
*/
|
|
317
|
+
export const VouchersApiFp = function(configuration?: Configuration) {
|
|
318
|
+
const localVarAxiosParamCreator = VouchersApiAxiosParamCreator(configuration)
|
|
319
|
+
return {
|
|
320
|
+
/**
|
|
321
|
+
* This will create a voucher.
|
|
322
|
+
* @summary Create the Voucher
|
|
323
|
+
* @param {CreateVoucherRequestDto} createVoucherRequestDto
|
|
324
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
325
|
+
* @param {*} [options] Override http request option.
|
|
326
|
+
* @throws {RequiredError}
|
|
327
|
+
*/
|
|
328
|
+
async createVoucher(createVoucherRequestDto: CreateVoucherRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateVoucherResponseClass>> {
|
|
329
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.createVoucher(createVoucherRequestDto, authorization, options);
|
|
330
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
331
|
+
},
|
|
332
|
+
/**
|
|
333
|
+
* This will delete a voucher.
|
|
334
|
+
* @summary Delete the Voucher
|
|
335
|
+
* @param {string} code Unique identifier for the object.
|
|
336
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
337
|
+
* @param {*} [options] Override http request option.
|
|
338
|
+
* @throws {RequiredError}
|
|
339
|
+
*/
|
|
340
|
+
async deleteVoucher(code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
341
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteVoucher(code, authorization, options);
|
|
342
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
343
|
+
},
|
|
344
|
+
/**
|
|
345
|
+
* This will get a voucher.
|
|
346
|
+
* @summary Retrieve the Voucher
|
|
347
|
+
* @param {string} code Unique identifier for the object.
|
|
348
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
349
|
+
* @param {'campaign' | 'productDiscounts'} [expand] You can expand voucher in this endpoint.
|
|
350
|
+
* @param {*} [options] Override http request option.
|
|
351
|
+
* @throws {RequiredError}
|
|
352
|
+
*/
|
|
353
|
+
async getVoucher(code: string, authorization?: string, expand?: 'campaign' | 'productDiscounts', options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetVoucherResponseClass>> {
|
|
354
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getVoucher(code, authorization, expand, options);
|
|
355
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
356
|
+
},
|
|
357
|
+
/**
|
|
358
|
+
* Returns a list of Vouchers you have previously created. The Vouchers are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
359
|
+
* @summary List Vouchers
|
|
360
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
361
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
362
|
+
* @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=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
363
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug</i>
|
|
364
|
+
* @param {string} [search] Search the response for matches in any searchable field. Use filter instead where possible for improved performance.<br/> <br/> <i>Searchable fields: code, voucherCode, productSlugsList</i>
|
|
365
|
+
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: code, voucherCode, campaignId, discountPeriodMonths, discountType, discountValue, createdAt</i>
|
|
366
|
+
* @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.<br/> <br/> <i>Allowed values: campaign, productDiscounts<i>
|
|
367
|
+
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug</i>
|
|
368
|
+
* @param {*} [options] Override http request option.
|
|
369
|
+
* @throws {RequiredError}
|
|
370
|
+
*/
|
|
371
|
+
async listVouchers(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListVouchersResponseClass>> {
|
|
372
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.listVouchers(authorization, pageSize, pageToken, filter, search, order, expand, filters, options);
|
|
373
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
374
|
+
},
|
|
375
|
+
/**
|
|
376
|
+
* This will update a voucher.
|
|
377
|
+
* @summary Update the Voucher
|
|
378
|
+
* @param {string} code Unique identifier for the object.
|
|
379
|
+
* @param {UpdateVoucherRequestDto} updateVoucherRequestDto
|
|
380
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
381
|
+
* @param {*} [options] Override http request option.
|
|
382
|
+
* @throws {RequiredError}
|
|
383
|
+
*/
|
|
384
|
+
async updateVoucher(code: string, updateVoucherRequestDto: UpdateVoucherRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UpdateVoucherResponseClass>> {
|
|
385
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.updateVoucher(code, updateVoucherRequestDto, authorization, options);
|
|
386
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
387
|
+
},
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* VouchersApi - factory interface
|
|
393
|
+
* @export
|
|
394
|
+
*/
|
|
395
|
+
export const VouchersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
396
|
+
const localVarFp = VouchersApiFp(configuration)
|
|
397
|
+
return {
|
|
398
|
+
/**
|
|
399
|
+
* This will create a voucher.
|
|
400
|
+
* @summary Create the Voucher
|
|
401
|
+
* @param {CreateVoucherRequestDto} createVoucherRequestDto
|
|
402
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
403
|
+
* @param {*} [options] Override http request option.
|
|
404
|
+
* @throws {RequiredError}
|
|
405
|
+
*/
|
|
406
|
+
createVoucher(createVoucherRequestDto: CreateVoucherRequestDto, authorization?: string, options?: any): AxiosPromise<CreateVoucherResponseClass> {
|
|
407
|
+
return localVarFp.createVoucher(createVoucherRequestDto, authorization, options).then((request) => request(axios, basePath));
|
|
408
|
+
},
|
|
409
|
+
/**
|
|
410
|
+
* This will delete a voucher.
|
|
411
|
+
* @summary Delete the Voucher
|
|
412
|
+
* @param {string} code Unique identifier for the object.
|
|
413
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
414
|
+
* @param {*} [options] Override http request option.
|
|
415
|
+
* @throws {RequiredError}
|
|
416
|
+
*/
|
|
417
|
+
deleteVoucher(code: string, authorization?: string, options?: any): AxiosPromise<void> {
|
|
418
|
+
return localVarFp.deleteVoucher(code, authorization, options).then((request) => request(axios, basePath));
|
|
419
|
+
},
|
|
420
|
+
/**
|
|
421
|
+
* This will get a voucher.
|
|
422
|
+
* @summary Retrieve the Voucher
|
|
423
|
+
* @param {string} code Unique identifier for the object.
|
|
424
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
425
|
+
* @param {'campaign' | 'productDiscounts'} [expand] You can expand voucher in this endpoint.
|
|
426
|
+
* @param {*} [options] Override http request option.
|
|
427
|
+
* @throws {RequiredError}
|
|
428
|
+
*/
|
|
429
|
+
getVoucher(code: string, authorization?: string, expand?: 'campaign' | 'productDiscounts', options?: any): AxiosPromise<GetVoucherResponseClass> {
|
|
430
|
+
return localVarFp.getVoucher(code, authorization, expand, options).then((request) => request(axios, basePath));
|
|
431
|
+
},
|
|
432
|
+
/**
|
|
433
|
+
* Returns a list of Vouchers you have previously created. The Vouchers are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
434
|
+
* @summary List Vouchers
|
|
435
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
436
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
437
|
+
* @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=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
438
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug</i>
|
|
439
|
+
* @param {string} [search] Search the response for matches in any searchable field. Use filter instead where possible for improved performance.<br/> <br/> <i>Searchable fields: code, voucherCode, productSlugsList</i>
|
|
440
|
+
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: code, voucherCode, campaignId, discountPeriodMonths, discountType, discountValue, createdAt</i>
|
|
441
|
+
* @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.<br/> <br/> <i>Allowed values: campaign, productDiscounts<i>
|
|
442
|
+
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug</i>
|
|
443
|
+
* @param {*} [options] Override http request option.
|
|
444
|
+
* @throws {RequiredError}
|
|
445
|
+
*/
|
|
446
|
+
listVouchers(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListVouchersResponseClass> {
|
|
447
|
+
return localVarFp.listVouchers(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
|
|
448
|
+
},
|
|
449
|
+
/**
|
|
450
|
+
* This will update a voucher.
|
|
451
|
+
* @summary Update the Voucher
|
|
452
|
+
* @param {string} code Unique identifier for the object.
|
|
453
|
+
* @param {UpdateVoucherRequestDto} updateVoucherRequestDto
|
|
454
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
455
|
+
* @param {*} [options] Override http request option.
|
|
456
|
+
* @throws {RequiredError}
|
|
457
|
+
*/
|
|
458
|
+
updateVoucher(code: string, updateVoucherRequestDto: UpdateVoucherRequestDto, authorization?: string, options?: any): AxiosPromise<UpdateVoucherResponseClass> {
|
|
459
|
+
return localVarFp.updateVoucher(code, updateVoucherRequestDto, authorization, options).then((request) => request(axios, basePath));
|
|
460
|
+
},
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Request parameters for createVoucher operation in VouchersApi.
|
|
466
|
+
* @export
|
|
467
|
+
* @interface VouchersApiCreateVoucherRequest
|
|
468
|
+
*/
|
|
469
|
+
export interface VouchersApiCreateVoucherRequest {
|
|
470
|
+
/**
|
|
471
|
+
*
|
|
472
|
+
* @type {CreateVoucherRequestDto}
|
|
473
|
+
* @memberof VouchersApiCreateVoucher
|
|
474
|
+
*/
|
|
475
|
+
readonly createVoucherRequestDto: CreateVoucherRequestDto
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Bearer Token: provided by the login endpoint under the name accessToken.
|
|
479
|
+
* @type {string}
|
|
480
|
+
* @memberof VouchersApiCreateVoucher
|
|
481
|
+
*/
|
|
482
|
+
readonly authorization?: string
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Request parameters for deleteVoucher operation in VouchersApi.
|
|
487
|
+
* @export
|
|
488
|
+
* @interface VouchersApiDeleteVoucherRequest
|
|
489
|
+
*/
|
|
490
|
+
export interface VouchersApiDeleteVoucherRequest {
|
|
491
|
+
/**
|
|
492
|
+
* Unique identifier for the object.
|
|
493
|
+
* @type {string}
|
|
494
|
+
* @memberof VouchersApiDeleteVoucher
|
|
495
|
+
*/
|
|
496
|
+
readonly code: string
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Bearer Token: provided by the login endpoint under the name accessToken.
|
|
500
|
+
* @type {string}
|
|
501
|
+
* @memberof VouchersApiDeleteVoucher
|
|
502
|
+
*/
|
|
503
|
+
readonly authorization?: string
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Request parameters for getVoucher operation in VouchersApi.
|
|
508
|
+
* @export
|
|
509
|
+
* @interface VouchersApiGetVoucherRequest
|
|
510
|
+
*/
|
|
511
|
+
export interface VouchersApiGetVoucherRequest {
|
|
512
|
+
/**
|
|
513
|
+
* Unique identifier for the object.
|
|
514
|
+
* @type {string}
|
|
515
|
+
* @memberof VouchersApiGetVoucher
|
|
516
|
+
*/
|
|
517
|
+
readonly code: string
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Bearer Token: provided by the login endpoint under the name accessToken.
|
|
521
|
+
* @type {string}
|
|
522
|
+
* @memberof VouchersApiGetVoucher
|
|
523
|
+
*/
|
|
524
|
+
readonly authorization?: string
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* You can expand voucher in this endpoint.
|
|
528
|
+
* @type {'campaign' | 'productDiscounts'}
|
|
529
|
+
* @memberof VouchersApiGetVoucher
|
|
530
|
+
*/
|
|
531
|
+
readonly expand?: 'campaign' | 'productDiscounts'
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Request parameters for listVouchers operation in VouchersApi.
|
|
536
|
+
* @export
|
|
537
|
+
* @interface VouchersApiListVouchersRequest
|
|
538
|
+
*/
|
|
539
|
+
export interface VouchersApiListVouchersRequest {
|
|
540
|
+
/**
|
|
541
|
+
* Bearer Token: provided by the login endpoint under the name accessToken.
|
|
542
|
+
* @type {string}
|
|
543
|
+
* @memberof VouchersApiListVouchers
|
|
544
|
+
*/
|
|
545
|
+
readonly authorization?: string
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
549
|
+
* @type {number}
|
|
550
|
+
* @memberof VouchersApiListVouchers
|
|
551
|
+
*/
|
|
552
|
+
readonly pageSize?: number
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* 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=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
556
|
+
* @type {string}
|
|
557
|
+
* @memberof VouchersApiListVouchers
|
|
558
|
+
*/
|
|
559
|
+
readonly pageToken?: string
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug</i>
|
|
563
|
+
* @type {string}
|
|
564
|
+
* @memberof VouchersApiListVouchers
|
|
565
|
+
*/
|
|
566
|
+
readonly filter?: string
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Search the response for matches in any searchable field. Use filter instead where possible for improved performance.<br/> <br/> <i>Searchable fields: code, voucherCode, productSlugsList</i>
|
|
570
|
+
* @type {string}
|
|
571
|
+
* @memberof VouchersApiListVouchers
|
|
572
|
+
*/
|
|
573
|
+
readonly search?: string
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: code, voucherCode, campaignId, discountPeriodMonths, discountType, discountValue, createdAt</i>
|
|
577
|
+
* @type {string}
|
|
578
|
+
* @memberof VouchersApiListVouchers
|
|
579
|
+
*/
|
|
580
|
+
readonly order?: string
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* 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.<br/> <br/> <i>Allowed values: campaign, productDiscounts<i>
|
|
584
|
+
* @type {string}
|
|
585
|
+
* @memberof VouchersApiListVouchers
|
|
586
|
+
*/
|
|
587
|
+
readonly expand?: string
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, code, voucherCode, campaignId, discountType, createdAt, discountValue, discountPeriodMonths, productDiscounts.productSlug</i>
|
|
591
|
+
* @type {string}
|
|
592
|
+
* @memberof VouchersApiListVouchers
|
|
593
|
+
*/
|
|
594
|
+
readonly filters?: string
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Request parameters for updateVoucher operation in VouchersApi.
|
|
599
|
+
* @export
|
|
600
|
+
* @interface VouchersApiUpdateVoucherRequest
|
|
601
|
+
*/
|
|
602
|
+
export interface VouchersApiUpdateVoucherRequest {
|
|
603
|
+
/**
|
|
604
|
+
* Unique identifier for the object.
|
|
605
|
+
* @type {string}
|
|
606
|
+
* @memberof VouchersApiUpdateVoucher
|
|
607
|
+
*/
|
|
608
|
+
readonly code: string
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
*
|
|
612
|
+
* @type {UpdateVoucherRequestDto}
|
|
613
|
+
* @memberof VouchersApiUpdateVoucher
|
|
614
|
+
*/
|
|
615
|
+
readonly updateVoucherRequestDto: UpdateVoucherRequestDto
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Bearer Token: provided by the login endpoint under the name accessToken.
|
|
619
|
+
* @type {string}
|
|
620
|
+
* @memberof VouchersApiUpdateVoucher
|
|
621
|
+
*/
|
|
622
|
+
readonly authorization?: string
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* VouchersApi - object-oriented interface
|
|
627
|
+
* @export
|
|
628
|
+
* @class VouchersApi
|
|
629
|
+
* @extends {BaseAPI}
|
|
630
|
+
*/
|
|
631
|
+
export class VouchersApi extends BaseAPI {
|
|
632
|
+
/**
|
|
633
|
+
* This will create a voucher.
|
|
634
|
+
* @summary Create the Voucher
|
|
635
|
+
* @param {VouchersApiCreateVoucherRequest} requestParameters Request parameters.
|
|
636
|
+
* @param {*} [options] Override http request option.
|
|
637
|
+
* @throws {RequiredError}
|
|
638
|
+
* @memberof VouchersApi
|
|
639
|
+
*/
|
|
640
|
+
public createVoucher(requestParameters: VouchersApiCreateVoucherRequest, options?: AxiosRequestConfig) {
|
|
641
|
+
return VouchersApiFp(this.configuration).createVoucher(requestParameters.createVoucherRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* This will delete a voucher.
|
|
646
|
+
* @summary Delete the Voucher
|
|
647
|
+
* @param {VouchersApiDeleteVoucherRequest} requestParameters Request parameters.
|
|
648
|
+
* @param {*} [options] Override http request option.
|
|
649
|
+
* @throws {RequiredError}
|
|
650
|
+
* @memberof VouchersApi
|
|
651
|
+
*/
|
|
652
|
+
public deleteVoucher(requestParameters: VouchersApiDeleteVoucherRequest, options?: AxiosRequestConfig) {
|
|
653
|
+
return VouchersApiFp(this.configuration).deleteVoucher(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* This will get a voucher.
|
|
658
|
+
* @summary Retrieve the Voucher
|
|
659
|
+
* @param {VouchersApiGetVoucherRequest} requestParameters Request parameters.
|
|
660
|
+
* @param {*} [options] Override http request option.
|
|
661
|
+
* @throws {RequiredError}
|
|
662
|
+
* @memberof VouchersApi
|
|
663
|
+
*/
|
|
664
|
+
public getVoucher(requestParameters: VouchersApiGetVoucherRequest, options?: AxiosRequestConfig) {
|
|
665
|
+
return VouchersApiFp(this.configuration).getVoucher(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
/**
|
|
669
|
+
* Returns a list of Vouchers you have previously created. The Vouchers are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
670
|
+
* @summary List Vouchers
|
|
671
|
+
* @param {VouchersApiListVouchersRequest} requestParameters Request parameters.
|
|
672
|
+
* @param {*} [options] Override http request option.
|
|
673
|
+
* @throws {RequiredError}
|
|
674
|
+
* @memberof VouchersApi
|
|
675
|
+
*/
|
|
676
|
+
public listVouchers(requestParameters: VouchersApiListVouchersRequest = {}, options?: AxiosRequestConfig) {
|
|
677
|
+
return VouchersApiFp(this.configuration).listVouchers(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then((request) => request(this.axios, this.basePath));
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* This will update a voucher.
|
|
682
|
+
* @summary Update the Voucher
|
|
683
|
+
* @param {VouchersApiUpdateVoucherRequest} requestParameters Request parameters.
|
|
684
|
+
* @param {*} [options] Override http request option.
|
|
685
|
+
* @throws {RequiredError}
|
|
686
|
+
* @memberof VouchersApi
|
|
687
|
+
*/
|
|
688
|
+
public updateVoucher(requestParameters: VouchersApiUpdateVoucherRequest, options?: AxiosRequestConfig) {
|
|
689
|
+
return VouchersApiFp(this.configuration).updateVoucher(requestParameters.code, requestParameters.updateVoucherRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
690
|
+
}
|
|
691
|
+
}
|