@emilgroup/discount-sdk 1.5.0 → 1.5.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.
- package/index.js +99 -0
- package/package.json +8 -21
- package/scripts/deploy.js +225 -0
- package/.openapi-generator/FILES +0 -54
- package/.openapi-generator/VERSION +0 -1
- package/.openapi-generator-ignore +0 -23
- package/api/campaigns-api.ts +0 -1433
- package/api/default-api.ts +0 -124
- package/api/policy-vouchers-api.ts +0 -999
- package/api/vouchers-api.ts +0 -691
- package/api.ts +0 -33
- package/base.ts +0 -331
- package/common.ts +0 -198
- package/configuration.ts +0 -110
- package/dist/api/campaigns-api.d.ts +0 -808
- package/dist/api/campaigns-api.js +0 -1251
- package/dist/api/default-api.d.ts +0 -70
- package/dist/api/default-api.js +0 -200
- package/dist/api/policy-vouchers-api.d.ts +0 -555
- package/dist/api/policy-vouchers-api.js +0 -915
- package/dist/api/vouchers-api.d.ts +0 -393
- package/dist/api/vouchers-api.js +0 -642
- package/dist/api.d.ts +0 -15
- package/dist/api.js +0 -33
- package/dist/base.d.ts +0 -86
- package/dist/base.js +0 -367
- package/dist/common.d.ts +0 -91
- package/dist/common.js +0 -276
- package/dist/configuration.d.ts +0 -89
- package/dist/configuration.js +0 -52
- package/dist/index.d.ts +0 -15
- package/dist/index.js +0 -36
- package/dist/models/campaign-class.d.ts +0 -105
- package/dist/models/campaign-class.js +0 -24
- package/dist/models/charge-policy-voucher-request-dto.d.ts +0 -48
- package/dist/models/charge-policy-voucher-request-dto.js +0 -15
- package/dist/models/charge-policy-voucher-response-class.d.ts +0 -96
- package/dist/models/charge-policy-voucher-response-class.js +0 -21
- package/dist/models/check-account-eligibility-request-dto.d.ts +0 -48
- package/dist/models/check-account-eligibility-request-dto.js +0 -15
- package/dist/models/check-account-eligibility-response-class.d.ts +0 -57
- package/dist/models/check-account-eligibility-response-class.js +0 -24
- package/dist/models/create-campaign-request-dto.d.ts +0 -42
- package/dist/models/create-campaign-request-dto.js +0 -15
- package/dist/models/create-campaign-response-class.d.ts +0 -25
- package/dist/models/create-campaign-response-class.js +0 -15
- package/dist/models/create-eligible-account-request-dto.d.ts +0 -30
- package/dist/models/create-eligible-account-request-dto.js +0 -15
- package/dist/models/create-eligible-account-response-class.d.ts +0 -25
- package/dist/models/create-eligible-account-response-class.js +0 -15
- package/dist/models/create-policy-voucher-request-dto.d.ts +0 -48
- package/dist/models/create-policy-voucher-request-dto.js +0 -15
- package/dist/models/create-policy-voucher-response-class.d.ts +0 -25
- package/dist/models/create-policy-voucher-response-class.js +0 -15
- package/dist/models/create-product-discount-dto.d.ts +0 -48
- package/dist/models/create-product-discount-dto.js +0 -15
- package/dist/models/create-voucher-request-dto.d.ts +0 -66
- package/dist/models/create-voucher-request-dto.js +0 -20
- package/dist/models/create-voucher-response-class.d.ts +0 -25
- package/dist/models/create-voucher-response-class.js +0 -15
- package/dist/models/eligible-account-class.d.ts +0 -78
- package/dist/models/eligible-account-class.js +0 -15
- package/dist/models/get-campaign-response-class.d.ts +0 -25
- package/dist/models/get-campaign-response-class.js +0 -15
- package/dist/models/get-policy-voucher-response-class.d.ts +0 -25
- package/dist/models/get-policy-voucher-response-class.js +0 -15
- package/dist/models/get-voucher-response-class.d.ts +0 -25
- package/dist/models/get-voucher-response-class.js +0 -15
- package/dist/models/index.d.ts +0 -37
- package/dist/models/index.js +0 -53
- package/dist/models/inline-response200.d.ts +0 -54
- package/dist/models/inline-response200.js +0 -15
- package/dist/models/inline-response503.d.ts +0 -54
- package/dist/models/inline-response503.js +0 -15
- package/dist/models/list-campaigns-response-class.d.ts +0 -43
- package/dist/models/list-campaigns-response-class.js +0 -15
- package/dist/models/list-eligible-accounts-response-class.d.ts +0 -43
- package/dist/models/list-eligible-accounts-response-class.js +0 -15
- package/dist/models/list-policy-vouchers-response-class.d.ts +0 -43
- package/dist/models/list-policy-vouchers-response-class.js +0 -15
- package/dist/models/list-vouchers-response-class.d.ts +0 -43
- package/dist/models/list-vouchers-response-class.js +0 -15
- package/dist/models/policy-voucher-class.d.ts +0 -165
- package/dist/models/policy-voucher-class.js +0 -21
- package/dist/models/policy-voucher-transaction-class.d.ts +0 -126
- package/dist/models/policy-voucher-transaction-class.js +0 -26
- package/dist/models/product-discount-class.d.ts +0 -90
- package/dist/models/product-discount-class.js +0 -15
- package/dist/models/redeem-policy-voucher-request-dto.d.ts +0 -48
- package/dist/models/redeem-policy-voucher-request-dto.js +0 -15
- package/dist/models/redeem-policy-voucher-response-class.d.ts +0 -84
- package/dist/models/redeem-policy-voucher-response-class.js +0 -21
- package/dist/models/update-campaign-request-dto.d.ts +0 -42
- package/dist/models/update-campaign-request-dto.js +0 -15
- package/dist/models/update-campaign-response-class.d.ts +0 -25
- package/dist/models/update-campaign-response-class.js +0 -15
- package/dist/models/update-campaign-status-request-dto.d.ts +0 -33
- package/dist/models/update-campaign-status-request-dto.js +0 -24
- package/dist/models/update-voucher-request-dto.d.ts +0 -60
- package/dist/models/update-voucher-request-dto.js +0 -20
- package/dist/models/update-voucher-response-class.d.ts +0 -25
- package/dist/models/update-voucher-response-class.js +0 -15
- package/dist/models/voucher-class.d.ts +0 -127
- package/dist/models/voucher-class.js +0 -20
- package/dist/models/withdraw-policy-voucher-request-dto.d.ts +0 -36
- package/dist/models/withdraw-policy-voucher-request-dto.js +0 -15
- package/dist/models/withdraw-policy-voucher-response-class.d.ts +0 -78
- package/dist/models/withdraw-policy-voucher-response-class.js +0 -21
- package/git_push.sh +0 -57
- package/index.ts +0 -19
- package/models/campaign-class.ts +0 -114
- package/models/charge-policy-voucher-request-dto.ts +0 -54
- package/models/charge-policy-voucher-response-class.ts +0 -105
- package/models/check-account-eligibility-request-dto.ts +0 -54
- package/models/check-account-eligibility-response-class.ts +0 -66
- package/models/create-campaign-request-dto.ts +0 -48
- package/models/create-campaign-response-class.ts +0 -31
- package/models/create-eligible-account-request-dto.ts +0 -36
- package/models/create-eligible-account-response-class.ts +0 -31
- package/models/create-policy-voucher-request-dto.ts +0 -54
- package/models/create-policy-voucher-response-class.ts +0 -31
- package/models/create-product-discount-dto.ts +0 -54
- package/models/create-voucher-request-dto.ts +0 -75
- package/models/create-voucher-response-class.ts +0 -31
- package/models/eligible-account-class.ts +0 -84
- package/models/get-campaign-response-class.ts +0 -31
- package/models/get-policy-voucher-response-class.ts +0 -31
- package/models/get-voucher-response-class.ts +0 -31
- package/models/index.ts +0 -37
- package/models/inline-response200.ts +0 -48
- package/models/inline-response503.ts +0 -48
- package/models/list-campaigns-response-class.ts +0 -49
- package/models/list-eligible-accounts-response-class.ts +0 -49
- package/models/list-policy-vouchers-response-class.ts +0 -49
- package/models/list-vouchers-response-class.ts +0 -49
- package/models/policy-voucher-class.ts +0 -174
- package/models/policy-voucher-transaction-class.ts +0 -136
- package/models/product-discount-class.ts +0 -96
- package/models/redeem-policy-voucher-request-dto.ts +0 -54
- package/models/redeem-policy-voucher-response-class.ts +0 -93
- package/models/update-campaign-request-dto.ts +0 -48
- package/models/update-campaign-response-class.ts +0 -31
- package/models/update-campaign-status-request-dto.ts +0 -42
- package/models/update-voucher-request-dto.ts +0 -69
- package/models/update-voucher-response-class.ts +0 -31
- package/models/voucher-class.ts +0 -136
- package/models/withdraw-policy-voucher-request-dto.ts +0 -42
- package/models/withdraw-policy-voucher-response-class.ts +0 -87
- package/tsconfig.json +0 -23
|
@@ -1,1251 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
/**
|
|
5
|
-
* EMIL DiscountService
|
|
6
|
-
* The EMIL DiscountService API description
|
|
7
|
-
*
|
|
8
|
-
* The version of the OpenAPI document: 1.0
|
|
9
|
-
* Contact: kontakt@emil.de
|
|
10
|
-
*
|
|
11
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
-
* https://openapi-generator.tech
|
|
13
|
-
* Do not edit the class manually.
|
|
14
|
-
*/
|
|
15
|
-
var __extends = (this && this.__extends) || (function () {
|
|
16
|
-
var extendStatics = function (d, b) {
|
|
17
|
-
extendStatics = Object.setPrototypeOf ||
|
|
18
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
19
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
20
|
-
return extendStatics(d, b);
|
|
21
|
-
};
|
|
22
|
-
return function (d, b) {
|
|
23
|
-
if (typeof b !== "function" && b !== null)
|
|
24
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
25
|
-
extendStatics(d, b);
|
|
26
|
-
function __() { this.constructor = d; }
|
|
27
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
-
};
|
|
29
|
-
})();
|
|
30
|
-
var __assign = (this && this.__assign) || function () {
|
|
31
|
-
__assign = Object.assign || function(t) {
|
|
32
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
33
|
-
s = arguments[i];
|
|
34
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
35
|
-
t[p] = s[p];
|
|
36
|
-
}
|
|
37
|
-
return t;
|
|
38
|
-
};
|
|
39
|
-
return __assign.apply(this, arguments);
|
|
40
|
-
};
|
|
41
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
42
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
43
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
44
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
45
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
46
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
47
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
51
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
52
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
53
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
54
|
-
function step(op) {
|
|
55
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
56
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
57
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
58
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
59
|
-
switch (op[0]) {
|
|
60
|
-
case 0: case 1: t = op; break;
|
|
61
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
62
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
63
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
64
|
-
default:
|
|
65
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
66
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
67
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
68
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
69
|
-
if (t[2]) _.ops.pop();
|
|
70
|
-
_.trys.pop(); continue;
|
|
71
|
-
}
|
|
72
|
-
op = body.call(thisArg, _);
|
|
73
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
74
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
78
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
79
|
-
};
|
|
80
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
81
|
-
exports.CampaignsApi = exports.CampaignsApiFactory = exports.CampaignsApiFp = exports.CampaignsApiAxiosParamCreator = void 0;
|
|
82
|
-
var axios_1 = __importDefault(require("axios"));
|
|
83
|
-
// Some imports not used depending on template conditions
|
|
84
|
-
// @ts-ignore
|
|
85
|
-
var common_1 = require("../common");
|
|
86
|
-
// @ts-ignore
|
|
87
|
-
var base_1 = require("../base");
|
|
88
|
-
/**
|
|
89
|
-
* CampaignsApi - axios parameter creator
|
|
90
|
-
* @export
|
|
91
|
-
*/
|
|
92
|
-
var CampaignsApiAxiosParamCreator = function (configuration) {
|
|
93
|
-
var _this = this;
|
|
94
|
-
return {
|
|
95
|
-
/**
|
|
96
|
-
* Creates a new campaign that can contain multiple vouchers for eligible accounts to redeem.
|
|
97
|
-
* @summary Create the Campaign
|
|
98
|
-
* @param {CreateCampaignRequestDto} createCampaignRequestDto
|
|
99
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
100
|
-
* @param {*} [options] Override http request option.
|
|
101
|
-
* @throws {RequiredError}
|
|
102
|
-
*/
|
|
103
|
-
createCampaign: function (createCampaignRequestDto, authorization, options) {
|
|
104
|
-
if (options === void 0) { options = {}; }
|
|
105
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
106
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
107
|
-
return __generator(this, function (_a) {
|
|
108
|
-
switch (_a.label) {
|
|
109
|
-
case 0:
|
|
110
|
-
// verify required parameter 'createCampaignRequestDto' is not null or undefined
|
|
111
|
-
(0, common_1.assertParamExists)('createCampaign', 'createCampaignRequestDto', createCampaignRequestDto);
|
|
112
|
-
localVarPath = "/discountservice/v1/campaigns";
|
|
113
|
-
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
114
|
-
if (configuration) {
|
|
115
|
-
baseOptions = configuration.baseOptions;
|
|
116
|
-
baseAccessToken = configuration.accessToken;
|
|
117
|
-
}
|
|
118
|
-
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
|
|
119
|
-
localVarHeaderParameter = {};
|
|
120
|
-
localVarQueryParameter = {};
|
|
121
|
-
// authentication bearer required
|
|
122
|
-
// http bearer authentication required
|
|
123
|
-
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
124
|
-
case 1:
|
|
125
|
-
// authentication bearer required
|
|
126
|
-
// http bearer authentication required
|
|
127
|
-
_a.sent();
|
|
128
|
-
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
129
|
-
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
130
|
-
}
|
|
131
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
132
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
133
|
-
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
134
|
-
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
135
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createCampaignRequestDto, localVarRequestOptions, configuration);
|
|
136
|
-
return [2 /*return*/, {
|
|
137
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
138
|
-
options: localVarRequestOptions,
|
|
139
|
-
}];
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
},
|
|
144
|
-
/**
|
|
145
|
-
* Creates an account that is eligible to redeem a vouchers from a specific campaign.
|
|
146
|
-
* @summary Create the Eligible Account
|
|
147
|
-
* @param {string} code Unique identifier for the object.
|
|
148
|
-
* @param {CreateEligibleAccountRequestDto} createEligibleAccountRequestDto
|
|
149
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
150
|
-
* @param {*} [options] Override http request option.
|
|
151
|
-
* @throws {RequiredError}
|
|
152
|
-
*/
|
|
153
|
-
createEligibleAccount: function (code, createEligibleAccountRequestDto, authorization, options) {
|
|
154
|
-
if (options === void 0) { options = {}; }
|
|
155
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
156
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
157
|
-
return __generator(this, function (_a) {
|
|
158
|
-
switch (_a.label) {
|
|
159
|
-
case 0:
|
|
160
|
-
// verify required parameter 'code' is not null or undefined
|
|
161
|
-
(0, common_1.assertParamExists)('createEligibleAccount', 'code', code);
|
|
162
|
-
// verify required parameter 'createEligibleAccountRequestDto' is not null or undefined
|
|
163
|
-
(0, common_1.assertParamExists)('createEligibleAccount', 'createEligibleAccountRequestDto', createEligibleAccountRequestDto);
|
|
164
|
-
localVarPath = "/discountservice/v1/campaigns/{code}/eligible-accounts"
|
|
165
|
-
.replace("{".concat("code", "}"), encodeURIComponent(String(code)));
|
|
166
|
-
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
167
|
-
if (configuration) {
|
|
168
|
-
baseOptions = configuration.baseOptions;
|
|
169
|
-
baseAccessToken = configuration.accessToken;
|
|
170
|
-
}
|
|
171
|
-
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
|
|
172
|
-
localVarHeaderParameter = {};
|
|
173
|
-
localVarQueryParameter = {};
|
|
174
|
-
// authentication bearer required
|
|
175
|
-
// http bearer authentication required
|
|
176
|
-
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
177
|
-
case 1:
|
|
178
|
-
// authentication bearer required
|
|
179
|
-
// http bearer authentication required
|
|
180
|
-
_a.sent();
|
|
181
|
-
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
182
|
-
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
183
|
-
}
|
|
184
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
185
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
186
|
-
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
187
|
-
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
188
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createEligibleAccountRequestDto, localVarRequestOptions, configuration);
|
|
189
|
-
return [2 /*return*/, {
|
|
190
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
191
|
-
options: localVarRequestOptions,
|
|
192
|
-
}];
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
},
|
|
197
|
-
/**
|
|
198
|
-
* Removes a campaign and its associated vouchers. This will prevent any further voucher redemptions.
|
|
199
|
-
* @summary Delete the Campaign
|
|
200
|
-
* @param {string} code Unique identifier for the object.
|
|
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
|
-
deleteCampaign: function (code, authorization, options) {
|
|
206
|
-
if (options === void 0) { options = {}; }
|
|
207
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
208
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
209
|
-
return __generator(this, function (_a) {
|
|
210
|
-
switch (_a.label) {
|
|
211
|
-
case 0:
|
|
212
|
-
// verify required parameter 'code' is not null or undefined
|
|
213
|
-
(0, common_1.assertParamExists)('deleteCampaign', 'code', code);
|
|
214
|
-
localVarPath = "/discountservice/v1/campaigns/{code}"
|
|
215
|
-
.replace("{".concat("code", "}"), encodeURIComponent(String(code)));
|
|
216
|
-
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
217
|
-
if (configuration) {
|
|
218
|
-
baseOptions = configuration.baseOptions;
|
|
219
|
-
baseAccessToken = configuration.accessToken;
|
|
220
|
-
}
|
|
221
|
-
localVarRequestOptions = __assign(__assign({ method: 'DELETE' }, baseOptions), options);
|
|
222
|
-
localVarHeaderParameter = {};
|
|
223
|
-
localVarQueryParameter = {};
|
|
224
|
-
// authentication bearer required
|
|
225
|
-
// http bearer authentication required
|
|
226
|
-
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
227
|
-
case 1:
|
|
228
|
-
// authentication bearer required
|
|
229
|
-
// http bearer authentication required
|
|
230
|
-
_a.sent();
|
|
231
|
-
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
232
|
-
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
233
|
-
}
|
|
234
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
235
|
-
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
236
|
-
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
237
|
-
return [2 /*return*/, {
|
|
238
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
239
|
-
options: localVarRequestOptions,
|
|
240
|
-
}];
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
});
|
|
244
|
-
},
|
|
245
|
-
/**
|
|
246
|
-
* 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.
|
|
247
|
-
* @summary Delete the Eligible Account
|
|
248
|
-
* @param {string} code Unique identifier for the object.
|
|
249
|
-
* @param {string} accountCode The code of the eligible account
|
|
250
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
251
|
-
* @param {*} [options] Override http request option.
|
|
252
|
-
* @throws {RequiredError}
|
|
253
|
-
*/
|
|
254
|
-
deleteEligibleAccount: function (code, accountCode, authorization, options) {
|
|
255
|
-
if (options === void 0) { options = {}; }
|
|
256
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
257
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
258
|
-
return __generator(this, function (_a) {
|
|
259
|
-
switch (_a.label) {
|
|
260
|
-
case 0:
|
|
261
|
-
// verify required parameter 'code' is not null or undefined
|
|
262
|
-
(0, common_1.assertParamExists)('deleteEligibleAccount', 'code', code);
|
|
263
|
-
// verify required parameter 'accountCode' is not null or undefined
|
|
264
|
-
(0, common_1.assertParamExists)('deleteEligibleAccount', 'accountCode', accountCode);
|
|
265
|
-
localVarPath = "/discountservice/v1/campaigns/{code}/eligible-accounts/{accountCode}"
|
|
266
|
-
.replace("{".concat("code", "}"), encodeURIComponent(String(code)))
|
|
267
|
-
.replace("{".concat("accountCode", "}"), encodeURIComponent(String(accountCode)));
|
|
268
|
-
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
269
|
-
if (configuration) {
|
|
270
|
-
baseOptions = configuration.baseOptions;
|
|
271
|
-
baseAccessToken = configuration.accessToken;
|
|
272
|
-
}
|
|
273
|
-
localVarRequestOptions = __assign(__assign({ method: 'DELETE' }, baseOptions), options);
|
|
274
|
-
localVarHeaderParameter = {};
|
|
275
|
-
localVarQueryParameter = {};
|
|
276
|
-
// authentication bearer required
|
|
277
|
-
// http bearer authentication required
|
|
278
|
-
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
279
|
-
case 1:
|
|
280
|
-
// authentication bearer required
|
|
281
|
-
// http bearer authentication required
|
|
282
|
-
_a.sent();
|
|
283
|
-
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
284
|
-
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
285
|
-
}
|
|
286
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
287
|
-
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
288
|
-
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
289
|
-
return [2 /*return*/, {
|
|
290
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
291
|
-
options: localVarRequestOptions,
|
|
292
|
-
}];
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
});
|
|
296
|
-
},
|
|
297
|
-
/**
|
|
298
|
-
* 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.
|
|
299
|
-
* @summary Delete the Eligible Accounts
|
|
300
|
-
* @param {string} code Unique identifier for the object.
|
|
301
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
302
|
-
* @param {*} [options] Override http request option.
|
|
303
|
-
* @throws {RequiredError}
|
|
304
|
-
*/
|
|
305
|
-
deleteEligibleAccounts: function (code, authorization, options) {
|
|
306
|
-
if (options === void 0) { options = {}; }
|
|
307
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
308
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
309
|
-
return __generator(this, function (_a) {
|
|
310
|
-
switch (_a.label) {
|
|
311
|
-
case 0:
|
|
312
|
-
// verify required parameter 'code' is not null or undefined
|
|
313
|
-
(0, common_1.assertParamExists)('deleteEligibleAccounts', 'code', code);
|
|
314
|
-
localVarPath = "/discountservice/v1/campaigns/{code}/eligible-accounts"
|
|
315
|
-
.replace("{".concat("code", "}"), encodeURIComponent(String(code)));
|
|
316
|
-
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
317
|
-
if (configuration) {
|
|
318
|
-
baseOptions = configuration.baseOptions;
|
|
319
|
-
baseAccessToken = configuration.accessToken;
|
|
320
|
-
}
|
|
321
|
-
localVarRequestOptions = __assign(__assign({ method: 'DELETE' }, baseOptions), options);
|
|
322
|
-
localVarHeaderParameter = {};
|
|
323
|
-
localVarQueryParameter = {};
|
|
324
|
-
// authentication bearer required
|
|
325
|
-
// http bearer authentication required
|
|
326
|
-
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
327
|
-
case 1:
|
|
328
|
-
// authentication bearer required
|
|
329
|
-
// http bearer authentication required
|
|
330
|
-
_a.sent();
|
|
331
|
-
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
332
|
-
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
333
|
-
}
|
|
334
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
335
|
-
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
336
|
-
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
337
|
-
return [2 /*return*/, {
|
|
338
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
339
|
-
options: localVarRequestOptions,
|
|
340
|
-
}];
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
});
|
|
344
|
-
},
|
|
345
|
-
/**
|
|
346
|
-
* Retrieves detailed information about a specific campaign.
|
|
347
|
-
* @summary Retrieve the Campaign
|
|
348
|
-
* @param {string} code Unique identifier for the object.
|
|
349
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
350
|
-
* @param {string} [expand] You can expand campaign in this endpoint.
|
|
351
|
-
* @param {*} [options] Override http request option.
|
|
352
|
-
* @throws {RequiredError}
|
|
353
|
-
*/
|
|
354
|
-
getCampaign: function (code, authorization, expand, options) {
|
|
355
|
-
if (options === void 0) { options = {}; }
|
|
356
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
357
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
358
|
-
return __generator(this, function (_a) {
|
|
359
|
-
switch (_a.label) {
|
|
360
|
-
case 0:
|
|
361
|
-
// verify required parameter 'code' is not null or undefined
|
|
362
|
-
(0, common_1.assertParamExists)('getCampaign', 'code', code);
|
|
363
|
-
localVarPath = "/discountservice/v1/campaigns/{code}"
|
|
364
|
-
.replace("{".concat("code", "}"), encodeURIComponent(String(code)));
|
|
365
|
-
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
366
|
-
if (configuration) {
|
|
367
|
-
baseOptions = configuration.baseOptions;
|
|
368
|
-
baseAccessToken = configuration.accessToken;
|
|
369
|
-
}
|
|
370
|
-
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
|
|
371
|
-
localVarHeaderParameter = {};
|
|
372
|
-
localVarQueryParameter = {};
|
|
373
|
-
// authentication bearer required
|
|
374
|
-
// http bearer authentication required
|
|
375
|
-
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
376
|
-
case 1:
|
|
377
|
-
// authentication bearer required
|
|
378
|
-
// http bearer authentication required
|
|
379
|
-
_a.sent();
|
|
380
|
-
if (expand !== undefined) {
|
|
381
|
-
localVarQueryParameter['expand'] = expand;
|
|
382
|
-
}
|
|
383
|
-
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
384
|
-
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
385
|
-
}
|
|
386
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
387
|
-
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
388
|
-
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
389
|
-
return [2 /*return*/, {
|
|
390
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
391
|
-
options: localVarRequestOptions,
|
|
392
|
-
}];
|
|
393
|
-
}
|
|
394
|
-
});
|
|
395
|
-
});
|
|
396
|
-
},
|
|
397
|
-
/**
|
|
398
|
-
* Retrieves a list of campaigns.
|
|
399
|
-
* @summary List Campaigns
|
|
400
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
401
|
-
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
402
|
-
* @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.
|
|
403
|
-
* @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, name, status, slug, startDate, endDate, createdAt</i>
|
|
404
|
-
* @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: name, slug</i>
|
|
405
|
-
* @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: name, status, startDate, endDate, createdAt</i>
|
|
406
|
-
* @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/>
|
|
407
|
-
* @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, name, status, slug, startDate, endDate, createdAt</i>
|
|
408
|
-
* @param {*} [options] Override http request option.
|
|
409
|
-
* @throws {RequiredError}
|
|
410
|
-
*/
|
|
411
|
-
listCampaigns: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
|
|
412
|
-
if (options === void 0) { options = {}; }
|
|
413
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
414
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
415
|
-
return __generator(this, function (_a) {
|
|
416
|
-
switch (_a.label) {
|
|
417
|
-
case 0:
|
|
418
|
-
localVarPath = "/discountservice/v1/campaigns";
|
|
419
|
-
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
420
|
-
if (configuration) {
|
|
421
|
-
baseOptions = configuration.baseOptions;
|
|
422
|
-
baseAccessToken = configuration.accessToken;
|
|
423
|
-
}
|
|
424
|
-
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
|
|
425
|
-
localVarHeaderParameter = {};
|
|
426
|
-
localVarQueryParameter = {};
|
|
427
|
-
// authentication bearer required
|
|
428
|
-
// http bearer authentication required
|
|
429
|
-
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
430
|
-
case 1:
|
|
431
|
-
// authentication bearer required
|
|
432
|
-
// http bearer authentication required
|
|
433
|
-
_a.sent();
|
|
434
|
-
if (pageSize !== undefined) {
|
|
435
|
-
localVarQueryParameter['pageSize'] = pageSize;
|
|
436
|
-
}
|
|
437
|
-
if (pageToken !== undefined) {
|
|
438
|
-
localVarQueryParameter['pageToken'] = pageToken;
|
|
439
|
-
}
|
|
440
|
-
if (filter !== undefined) {
|
|
441
|
-
localVarQueryParameter['filter'] = filter;
|
|
442
|
-
}
|
|
443
|
-
if (search !== undefined) {
|
|
444
|
-
localVarQueryParameter['search'] = search;
|
|
445
|
-
}
|
|
446
|
-
if (order !== undefined) {
|
|
447
|
-
localVarQueryParameter['order'] = order;
|
|
448
|
-
}
|
|
449
|
-
if (expand !== undefined) {
|
|
450
|
-
localVarQueryParameter['expand'] = expand;
|
|
451
|
-
}
|
|
452
|
-
if (filters !== undefined) {
|
|
453
|
-
localVarQueryParameter['filters'] = filters;
|
|
454
|
-
}
|
|
455
|
-
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
456
|
-
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
457
|
-
}
|
|
458
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
459
|
-
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
460
|
-
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
461
|
-
return [2 /*return*/, {
|
|
462
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
463
|
-
options: localVarRequestOptions,
|
|
464
|
-
}];
|
|
465
|
-
}
|
|
466
|
-
});
|
|
467
|
-
});
|
|
468
|
-
},
|
|
469
|
-
/**
|
|
470
|
-
* Retrieves a list of eligible accounts.
|
|
471
|
-
* @summary List Eligible Accounts
|
|
472
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
473
|
-
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
474
|
-
* @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.
|
|
475
|
-
* @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, partnerNumber, campaignId, createdAt, updatedAt</i>
|
|
476
|
-
* @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: voucherCode, partnerNumber</i>
|
|
477
|
-
* @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: voucherCode, partnerNumber, createdAt</i>
|
|
478
|
-
* @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/>
|
|
479
|
-
* @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, partnerNumber, campaignId, createdAt, updatedAt</i>
|
|
480
|
-
* @param {*} [options] Override http request option.
|
|
481
|
-
* @throws {RequiredError}
|
|
482
|
-
*/
|
|
483
|
-
listEligibleAccounts: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
|
|
484
|
-
if (options === void 0) { options = {}; }
|
|
485
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
486
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
487
|
-
return __generator(this, function (_a) {
|
|
488
|
-
switch (_a.label) {
|
|
489
|
-
case 0:
|
|
490
|
-
localVarPath = "/discountservice/v1/campaigns/eligible-accounts";
|
|
491
|
-
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
492
|
-
if (configuration) {
|
|
493
|
-
baseOptions = configuration.baseOptions;
|
|
494
|
-
baseAccessToken = configuration.accessToken;
|
|
495
|
-
}
|
|
496
|
-
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
|
|
497
|
-
localVarHeaderParameter = {};
|
|
498
|
-
localVarQueryParameter = {};
|
|
499
|
-
// authentication bearer required
|
|
500
|
-
// http bearer authentication required
|
|
501
|
-
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
502
|
-
case 1:
|
|
503
|
-
// authentication bearer required
|
|
504
|
-
// http bearer authentication required
|
|
505
|
-
_a.sent();
|
|
506
|
-
if (pageSize !== undefined) {
|
|
507
|
-
localVarQueryParameter['pageSize'] = pageSize;
|
|
508
|
-
}
|
|
509
|
-
if (pageToken !== undefined) {
|
|
510
|
-
localVarQueryParameter['pageToken'] = pageToken;
|
|
511
|
-
}
|
|
512
|
-
if (filter !== undefined) {
|
|
513
|
-
localVarQueryParameter['filter'] = filter;
|
|
514
|
-
}
|
|
515
|
-
if (search !== undefined) {
|
|
516
|
-
localVarQueryParameter['search'] = search;
|
|
517
|
-
}
|
|
518
|
-
if (order !== undefined) {
|
|
519
|
-
localVarQueryParameter['order'] = order;
|
|
520
|
-
}
|
|
521
|
-
if (expand !== undefined) {
|
|
522
|
-
localVarQueryParameter['expand'] = expand;
|
|
523
|
-
}
|
|
524
|
-
if (filters !== undefined) {
|
|
525
|
-
localVarQueryParameter['filters'] = filters;
|
|
526
|
-
}
|
|
527
|
-
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
528
|
-
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
529
|
-
}
|
|
530
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
531
|
-
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
532
|
-
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
533
|
-
return [2 /*return*/, {
|
|
534
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
535
|
-
options: localVarRequestOptions,
|
|
536
|
-
}];
|
|
537
|
-
}
|
|
538
|
-
});
|
|
539
|
-
});
|
|
540
|
-
},
|
|
541
|
-
/**
|
|
542
|
-
* Updates the data of an existing campaign. Only DRAFT campaigns can be updated.
|
|
543
|
-
* @summary Update the Campaign
|
|
544
|
-
* @param {string} code Unique identifier for the object.
|
|
545
|
-
* @param {UpdateCampaignRequestDto} updateCampaignRequestDto
|
|
546
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
547
|
-
* @param {*} [options] Override http request option.
|
|
548
|
-
* @throws {RequiredError}
|
|
549
|
-
*/
|
|
550
|
-
updateCampaign: function (code, updateCampaignRequestDto, authorization, options) {
|
|
551
|
-
if (options === void 0) { options = {}; }
|
|
552
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
553
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
554
|
-
return __generator(this, function (_a) {
|
|
555
|
-
switch (_a.label) {
|
|
556
|
-
case 0:
|
|
557
|
-
// verify required parameter 'code' is not null or undefined
|
|
558
|
-
(0, common_1.assertParamExists)('updateCampaign', 'code', code);
|
|
559
|
-
// verify required parameter 'updateCampaignRequestDto' is not null or undefined
|
|
560
|
-
(0, common_1.assertParamExists)('updateCampaign', 'updateCampaignRequestDto', updateCampaignRequestDto);
|
|
561
|
-
localVarPath = "/discountservice/v1/campaigns/{code}"
|
|
562
|
-
.replace("{".concat("code", "}"), encodeURIComponent(String(code)));
|
|
563
|
-
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
564
|
-
if (configuration) {
|
|
565
|
-
baseOptions = configuration.baseOptions;
|
|
566
|
-
baseAccessToken = configuration.accessToken;
|
|
567
|
-
}
|
|
568
|
-
localVarRequestOptions = __assign(__assign({ method: 'PUT' }, baseOptions), options);
|
|
569
|
-
localVarHeaderParameter = {};
|
|
570
|
-
localVarQueryParameter = {};
|
|
571
|
-
// authentication bearer required
|
|
572
|
-
// http bearer authentication required
|
|
573
|
-
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
574
|
-
case 1:
|
|
575
|
-
// authentication bearer required
|
|
576
|
-
// http bearer authentication required
|
|
577
|
-
_a.sent();
|
|
578
|
-
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
579
|
-
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
580
|
-
}
|
|
581
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
582
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
583
|
-
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
584
|
-
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
585
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateCampaignRequestDto, localVarRequestOptions, configuration);
|
|
586
|
-
return [2 /*return*/, {
|
|
587
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
588
|
-
options: localVarRequestOptions,
|
|
589
|
-
}];
|
|
590
|
-
}
|
|
591
|
-
});
|
|
592
|
-
});
|
|
593
|
-
},
|
|
594
|
-
/**
|
|
595
|
-
* Updates the status of a campaign, which affects whether vouchers can be redeemed.
|
|
596
|
-
* @summary Updates the status of a campaign.
|
|
597
|
-
* @param {string} code Unique identifier for the object.
|
|
598
|
-
* @param {UpdateCampaignStatusRequestDto} updateCampaignStatusRequestDto
|
|
599
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
600
|
-
* @param {*} [options] Override http request option.
|
|
601
|
-
* @throws {RequiredError}
|
|
602
|
-
*/
|
|
603
|
-
updateCampaignStatus: function (code, updateCampaignStatusRequestDto, authorization, options) {
|
|
604
|
-
if (options === void 0) { options = {}; }
|
|
605
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
606
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
607
|
-
return __generator(this, function (_a) {
|
|
608
|
-
switch (_a.label) {
|
|
609
|
-
case 0:
|
|
610
|
-
// verify required parameter 'code' is not null or undefined
|
|
611
|
-
(0, common_1.assertParamExists)('updateCampaignStatus', 'code', code);
|
|
612
|
-
// verify required parameter 'updateCampaignStatusRequestDto' is not null or undefined
|
|
613
|
-
(0, common_1.assertParamExists)('updateCampaignStatus', 'updateCampaignStatusRequestDto', updateCampaignStatusRequestDto);
|
|
614
|
-
localVarPath = "/discountservice/v1/campaigns/{code}/status"
|
|
615
|
-
.replace("{".concat("code", "}"), encodeURIComponent(String(code)));
|
|
616
|
-
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
617
|
-
if (configuration) {
|
|
618
|
-
baseOptions = configuration.baseOptions;
|
|
619
|
-
baseAccessToken = configuration.accessToken;
|
|
620
|
-
}
|
|
621
|
-
localVarRequestOptions = __assign(__assign({ method: 'PATCH' }, baseOptions), options);
|
|
622
|
-
localVarHeaderParameter = {};
|
|
623
|
-
localVarQueryParameter = {};
|
|
624
|
-
// authentication bearer required
|
|
625
|
-
// http bearer authentication required
|
|
626
|
-
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
627
|
-
case 1:
|
|
628
|
-
// authentication bearer required
|
|
629
|
-
// http bearer authentication required
|
|
630
|
-
_a.sent();
|
|
631
|
-
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
632
|
-
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
633
|
-
}
|
|
634
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
635
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
636
|
-
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
637
|
-
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
638
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateCampaignStatusRequestDto, localVarRequestOptions, configuration);
|
|
639
|
-
return [2 /*return*/, {
|
|
640
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
641
|
-
options: localVarRequestOptions,
|
|
642
|
-
}];
|
|
643
|
-
}
|
|
644
|
-
});
|
|
645
|
-
});
|
|
646
|
-
},
|
|
647
|
-
/**
|
|
648
|
-
* 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.
|
|
649
|
-
* @summary Uploads the eligible accounts.
|
|
650
|
-
* @param {string} code Unique identifier for the object.
|
|
651
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
652
|
-
* @param {*} [options] Override http request option.
|
|
653
|
-
* @throws {RequiredError}
|
|
654
|
-
*/
|
|
655
|
-
uploadEligibleAccounts: function (code, authorization, options) {
|
|
656
|
-
if (options === void 0) { options = {}; }
|
|
657
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
658
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
659
|
-
return __generator(this, function (_a) {
|
|
660
|
-
switch (_a.label) {
|
|
661
|
-
case 0:
|
|
662
|
-
// verify required parameter 'code' is not null or undefined
|
|
663
|
-
(0, common_1.assertParamExists)('uploadEligibleAccounts', 'code', code);
|
|
664
|
-
localVarPath = "/discountservice/v1/campaigns/{code}/eligible-accounts/batch"
|
|
665
|
-
.replace("{".concat("code", "}"), encodeURIComponent(String(code)));
|
|
666
|
-
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
667
|
-
if (configuration) {
|
|
668
|
-
baseOptions = configuration.baseOptions;
|
|
669
|
-
baseAccessToken = configuration.accessToken;
|
|
670
|
-
}
|
|
671
|
-
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
|
|
672
|
-
localVarHeaderParameter = {};
|
|
673
|
-
localVarQueryParameter = {};
|
|
674
|
-
// authentication bearer required
|
|
675
|
-
// http bearer authentication required
|
|
676
|
-
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
677
|
-
case 1:
|
|
678
|
-
// authentication bearer required
|
|
679
|
-
// http bearer authentication required
|
|
680
|
-
_a.sent();
|
|
681
|
-
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
682
|
-
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
683
|
-
}
|
|
684
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
685
|
-
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
686
|
-
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
687
|
-
return [2 /*return*/, {
|
|
688
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
689
|
-
options: localVarRequestOptions,
|
|
690
|
-
}];
|
|
691
|
-
}
|
|
692
|
-
});
|
|
693
|
-
});
|
|
694
|
-
},
|
|
695
|
-
};
|
|
696
|
-
};
|
|
697
|
-
exports.CampaignsApiAxiosParamCreator = CampaignsApiAxiosParamCreator;
|
|
698
|
-
/**
|
|
699
|
-
* CampaignsApi - functional programming interface
|
|
700
|
-
* @export
|
|
701
|
-
*/
|
|
702
|
-
var CampaignsApiFp = function (configuration) {
|
|
703
|
-
var localVarAxiosParamCreator = (0, exports.CampaignsApiAxiosParamCreator)(configuration);
|
|
704
|
-
return {
|
|
705
|
-
/**
|
|
706
|
-
* Creates a new campaign that can contain multiple vouchers for eligible accounts to redeem.
|
|
707
|
-
* @summary Create the Campaign
|
|
708
|
-
* @param {CreateCampaignRequestDto} createCampaignRequestDto
|
|
709
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
710
|
-
* @param {*} [options] Override http request option.
|
|
711
|
-
* @throws {RequiredError}
|
|
712
|
-
*/
|
|
713
|
-
createCampaign: function (createCampaignRequestDto, authorization, options) {
|
|
714
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
715
|
-
var localVarAxiosArgs;
|
|
716
|
-
return __generator(this, function (_a) {
|
|
717
|
-
switch (_a.label) {
|
|
718
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.createCampaign(createCampaignRequestDto, authorization, options)];
|
|
719
|
-
case 1:
|
|
720
|
-
localVarAxiosArgs = _a.sent();
|
|
721
|
-
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
722
|
-
}
|
|
723
|
-
});
|
|
724
|
-
});
|
|
725
|
-
},
|
|
726
|
-
/**
|
|
727
|
-
* Creates an account that is eligible to redeem a vouchers from a specific campaign.
|
|
728
|
-
* @summary Create the Eligible Account
|
|
729
|
-
* @param {string} code Unique identifier for the object.
|
|
730
|
-
* @param {CreateEligibleAccountRequestDto} createEligibleAccountRequestDto
|
|
731
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
732
|
-
* @param {*} [options] Override http request option.
|
|
733
|
-
* @throws {RequiredError}
|
|
734
|
-
*/
|
|
735
|
-
createEligibleAccount: function (code, createEligibleAccountRequestDto, authorization, options) {
|
|
736
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
737
|
-
var localVarAxiosArgs;
|
|
738
|
-
return __generator(this, function (_a) {
|
|
739
|
-
switch (_a.label) {
|
|
740
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.createEligibleAccount(code, createEligibleAccountRequestDto, authorization, options)];
|
|
741
|
-
case 1:
|
|
742
|
-
localVarAxiosArgs = _a.sent();
|
|
743
|
-
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
744
|
-
}
|
|
745
|
-
});
|
|
746
|
-
});
|
|
747
|
-
},
|
|
748
|
-
/**
|
|
749
|
-
* Removes a campaign and its associated vouchers. This will prevent any further voucher redemptions.
|
|
750
|
-
* @summary Delete the Campaign
|
|
751
|
-
* @param {string} code Unique identifier for the object.
|
|
752
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
753
|
-
* @param {*} [options] Override http request option.
|
|
754
|
-
* @throws {RequiredError}
|
|
755
|
-
*/
|
|
756
|
-
deleteCampaign: function (code, authorization, options) {
|
|
757
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
758
|
-
var localVarAxiosArgs;
|
|
759
|
-
return __generator(this, function (_a) {
|
|
760
|
-
switch (_a.label) {
|
|
761
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.deleteCampaign(code, authorization, options)];
|
|
762
|
-
case 1:
|
|
763
|
-
localVarAxiosArgs = _a.sent();
|
|
764
|
-
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
765
|
-
}
|
|
766
|
-
});
|
|
767
|
-
});
|
|
768
|
-
},
|
|
769
|
-
/**
|
|
770
|
-
* 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.
|
|
771
|
-
* @summary Delete the Eligible Account
|
|
772
|
-
* @param {string} code Unique identifier for the object.
|
|
773
|
-
* @param {string} accountCode The code of the eligible account
|
|
774
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
775
|
-
* @param {*} [options] Override http request option.
|
|
776
|
-
* @throws {RequiredError}
|
|
777
|
-
*/
|
|
778
|
-
deleteEligibleAccount: function (code, accountCode, authorization, options) {
|
|
779
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
780
|
-
var localVarAxiosArgs;
|
|
781
|
-
return __generator(this, function (_a) {
|
|
782
|
-
switch (_a.label) {
|
|
783
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.deleteEligibleAccount(code, accountCode, authorization, options)];
|
|
784
|
-
case 1:
|
|
785
|
-
localVarAxiosArgs = _a.sent();
|
|
786
|
-
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
787
|
-
}
|
|
788
|
-
});
|
|
789
|
-
});
|
|
790
|
-
},
|
|
791
|
-
/**
|
|
792
|
-
* 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.
|
|
793
|
-
* @summary Delete the Eligible Accounts
|
|
794
|
-
* @param {string} code Unique identifier for the object.
|
|
795
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
796
|
-
* @param {*} [options] Override http request option.
|
|
797
|
-
* @throws {RequiredError}
|
|
798
|
-
*/
|
|
799
|
-
deleteEligibleAccounts: function (code, authorization, options) {
|
|
800
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
801
|
-
var localVarAxiosArgs;
|
|
802
|
-
return __generator(this, function (_a) {
|
|
803
|
-
switch (_a.label) {
|
|
804
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.deleteEligibleAccounts(code, authorization, options)];
|
|
805
|
-
case 1:
|
|
806
|
-
localVarAxiosArgs = _a.sent();
|
|
807
|
-
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
808
|
-
}
|
|
809
|
-
});
|
|
810
|
-
});
|
|
811
|
-
},
|
|
812
|
-
/**
|
|
813
|
-
* Retrieves detailed information about a specific campaign.
|
|
814
|
-
* @summary Retrieve the Campaign
|
|
815
|
-
* @param {string} code Unique identifier for the object.
|
|
816
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
817
|
-
* @param {string} [expand] You can expand campaign in this endpoint.
|
|
818
|
-
* @param {*} [options] Override http request option.
|
|
819
|
-
* @throws {RequiredError}
|
|
820
|
-
*/
|
|
821
|
-
getCampaign: function (code, authorization, expand, options) {
|
|
822
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
823
|
-
var localVarAxiosArgs;
|
|
824
|
-
return __generator(this, function (_a) {
|
|
825
|
-
switch (_a.label) {
|
|
826
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.getCampaign(code, authorization, expand, options)];
|
|
827
|
-
case 1:
|
|
828
|
-
localVarAxiosArgs = _a.sent();
|
|
829
|
-
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
830
|
-
}
|
|
831
|
-
});
|
|
832
|
-
});
|
|
833
|
-
},
|
|
834
|
-
/**
|
|
835
|
-
* Retrieves a list of campaigns.
|
|
836
|
-
* @summary List Campaigns
|
|
837
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
838
|
-
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
839
|
-
* @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.
|
|
840
|
-
* @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, name, status, slug, startDate, endDate, createdAt</i>
|
|
841
|
-
* @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: name, slug</i>
|
|
842
|
-
* @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: name, status, startDate, endDate, createdAt</i>
|
|
843
|
-
* @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/>
|
|
844
|
-
* @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, name, status, slug, startDate, endDate, createdAt</i>
|
|
845
|
-
* @param {*} [options] Override http request option.
|
|
846
|
-
* @throws {RequiredError}
|
|
847
|
-
*/
|
|
848
|
-
listCampaigns: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
|
|
849
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
850
|
-
var localVarAxiosArgs;
|
|
851
|
-
return __generator(this, function (_a) {
|
|
852
|
-
switch (_a.label) {
|
|
853
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.listCampaigns(authorization, pageSize, pageToken, filter, search, order, expand, filters, options)];
|
|
854
|
-
case 1:
|
|
855
|
-
localVarAxiosArgs = _a.sent();
|
|
856
|
-
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
857
|
-
}
|
|
858
|
-
});
|
|
859
|
-
});
|
|
860
|
-
},
|
|
861
|
-
/**
|
|
862
|
-
* Retrieves a list of eligible accounts.
|
|
863
|
-
* @summary List Eligible Accounts
|
|
864
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
865
|
-
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
866
|
-
* @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.
|
|
867
|
-
* @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, partnerNumber, campaignId, createdAt, updatedAt</i>
|
|
868
|
-
* @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: voucherCode, partnerNumber</i>
|
|
869
|
-
* @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: voucherCode, partnerNumber, createdAt</i>
|
|
870
|
-
* @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/>
|
|
871
|
-
* @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, partnerNumber, campaignId, createdAt, updatedAt</i>
|
|
872
|
-
* @param {*} [options] Override http request option.
|
|
873
|
-
* @throws {RequiredError}
|
|
874
|
-
*/
|
|
875
|
-
listEligibleAccounts: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
|
|
876
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
877
|
-
var localVarAxiosArgs;
|
|
878
|
-
return __generator(this, function (_a) {
|
|
879
|
-
switch (_a.label) {
|
|
880
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.listEligibleAccounts(authorization, pageSize, pageToken, filter, search, order, expand, filters, options)];
|
|
881
|
-
case 1:
|
|
882
|
-
localVarAxiosArgs = _a.sent();
|
|
883
|
-
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
884
|
-
}
|
|
885
|
-
});
|
|
886
|
-
});
|
|
887
|
-
},
|
|
888
|
-
/**
|
|
889
|
-
* Updates the data of an existing campaign. Only DRAFT campaigns can be updated.
|
|
890
|
-
* @summary Update the Campaign
|
|
891
|
-
* @param {string} code Unique identifier for the object.
|
|
892
|
-
* @param {UpdateCampaignRequestDto} updateCampaignRequestDto
|
|
893
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
894
|
-
* @param {*} [options] Override http request option.
|
|
895
|
-
* @throws {RequiredError}
|
|
896
|
-
*/
|
|
897
|
-
updateCampaign: function (code, updateCampaignRequestDto, authorization, options) {
|
|
898
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
899
|
-
var localVarAxiosArgs;
|
|
900
|
-
return __generator(this, function (_a) {
|
|
901
|
-
switch (_a.label) {
|
|
902
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.updateCampaign(code, updateCampaignRequestDto, authorization, options)];
|
|
903
|
-
case 1:
|
|
904
|
-
localVarAxiosArgs = _a.sent();
|
|
905
|
-
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
906
|
-
}
|
|
907
|
-
});
|
|
908
|
-
});
|
|
909
|
-
},
|
|
910
|
-
/**
|
|
911
|
-
* Updates the status of a campaign, which affects whether vouchers can be redeemed.
|
|
912
|
-
* @summary Updates the status of a campaign.
|
|
913
|
-
* @param {string} code Unique identifier for the object.
|
|
914
|
-
* @param {UpdateCampaignStatusRequestDto} updateCampaignStatusRequestDto
|
|
915
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
916
|
-
* @param {*} [options] Override http request option.
|
|
917
|
-
* @throws {RequiredError}
|
|
918
|
-
*/
|
|
919
|
-
updateCampaignStatus: function (code, updateCampaignStatusRequestDto, authorization, options) {
|
|
920
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
921
|
-
var localVarAxiosArgs;
|
|
922
|
-
return __generator(this, function (_a) {
|
|
923
|
-
switch (_a.label) {
|
|
924
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.updateCampaignStatus(code, updateCampaignStatusRequestDto, authorization, options)];
|
|
925
|
-
case 1:
|
|
926
|
-
localVarAxiosArgs = _a.sent();
|
|
927
|
-
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
928
|
-
}
|
|
929
|
-
});
|
|
930
|
-
});
|
|
931
|
-
},
|
|
932
|
-
/**
|
|
933
|
-
* 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.
|
|
934
|
-
* @summary Uploads the eligible accounts.
|
|
935
|
-
* @param {string} code Unique identifier for the object.
|
|
936
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
937
|
-
* @param {*} [options] Override http request option.
|
|
938
|
-
* @throws {RequiredError}
|
|
939
|
-
*/
|
|
940
|
-
uploadEligibleAccounts: function (code, authorization, options) {
|
|
941
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
942
|
-
var localVarAxiosArgs;
|
|
943
|
-
return __generator(this, function (_a) {
|
|
944
|
-
switch (_a.label) {
|
|
945
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.uploadEligibleAccounts(code, authorization, options)];
|
|
946
|
-
case 1:
|
|
947
|
-
localVarAxiosArgs = _a.sent();
|
|
948
|
-
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
949
|
-
}
|
|
950
|
-
});
|
|
951
|
-
});
|
|
952
|
-
},
|
|
953
|
-
};
|
|
954
|
-
};
|
|
955
|
-
exports.CampaignsApiFp = CampaignsApiFp;
|
|
956
|
-
/**
|
|
957
|
-
* CampaignsApi - factory interface
|
|
958
|
-
* @export
|
|
959
|
-
*/
|
|
960
|
-
var CampaignsApiFactory = function (configuration, basePath, axios) {
|
|
961
|
-
var localVarFp = (0, exports.CampaignsApiFp)(configuration);
|
|
962
|
-
return {
|
|
963
|
-
/**
|
|
964
|
-
* Creates a new campaign that can contain multiple vouchers for eligible accounts to redeem.
|
|
965
|
-
* @summary Create the Campaign
|
|
966
|
-
* @param {CreateCampaignRequestDto} createCampaignRequestDto
|
|
967
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
968
|
-
* @param {*} [options] Override http request option.
|
|
969
|
-
* @throws {RequiredError}
|
|
970
|
-
*/
|
|
971
|
-
createCampaign: function (createCampaignRequestDto, authorization, options) {
|
|
972
|
-
return localVarFp.createCampaign(createCampaignRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
973
|
-
},
|
|
974
|
-
/**
|
|
975
|
-
* Creates an account that is eligible to redeem a vouchers from a specific campaign.
|
|
976
|
-
* @summary Create the Eligible Account
|
|
977
|
-
* @param {string} code Unique identifier for the object.
|
|
978
|
-
* @param {CreateEligibleAccountRequestDto} createEligibleAccountRequestDto
|
|
979
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
980
|
-
* @param {*} [options] Override http request option.
|
|
981
|
-
* @throws {RequiredError}
|
|
982
|
-
*/
|
|
983
|
-
createEligibleAccount: function (code, createEligibleAccountRequestDto, authorization, options) {
|
|
984
|
-
return localVarFp.createEligibleAccount(code, createEligibleAccountRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
985
|
-
},
|
|
986
|
-
/**
|
|
987
|
-
* Removes a campaign and its associated vouchers. This will prevent any further voucher redemptions.
|
|
988
|
-
* @summary Delete the Campaign
|
|
989
|
-
* @param {string} code Unique identifier for the object.
|
|
990
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
991
|
-
* @param {*} [options] Override http request option.
|
|
992
|
-
* @throws {RequiredError}
|
|
993
|
-
*/
|
|
994
|
-
deleteCampaign: function (code, authorization, options) {
|
|
995
|
-
return localVarFp.deleteCampaign(code, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
996
|
-
},
|
|
997
|
-
/**
|
|
998
|
-
* 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.
|
|
999
|
-
* @summary Delete the Eligible Account
|
|
1000
|
-
* @param {string} code Unique identifier for the object.
|
|
1001
|
-
* @param {string} accountCode The code of the eligible account
|
|
1002
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
1003
|
-
* @param {*} [options] Override http request option.
|
|
1004
|
-
* @throws {RequiredError}
|
|
1005
|
-
*/
|
|
1006
|
-
deleteEligibleAccount: function (code, accountCode, authorization, options) {
|
|
1007
|
-
return localVarFp.deleteEligibleAccount(code, accountCode, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
1008
|
-
},
|
|
1009
|
-
/**
|
|
1010
|
-
* 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.
|
|
1011
|
-
* @summary Delete the Eligible Accounts
|
|
1012
|
-
* @param {string} code Unique identifier for the object.
|
|
1013
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
1014
|
-
* @param {*} [options] Override http request option.
|
|
1015
|
-
* @throws {RequiredError}
|
|
1016
|
-
*/
|
|
1017
|
-
deleteEligibleAccounts: function (code, authorization, options) {
|
|
1018
|
-
return localVarFp.deleteEligibleAccounts(code, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
1019
|
-
},
|
|
1020
|
-
/**
|
|
1021
|
-
* Retrieves detailed information about a specific campaign.
|
|
1022
|
-
* @summary Retrieve the Campaign
|
|
1023
|
-
* @param {string} code Unique identifier for the object.
|
|
1024
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
1025
|
-
* @param {string} [expand] You can expand campaign in this endpoint.
|
|
1026
|
-
* @param {*} [options] Override http request option.
|
|
1027
|
-
* @throws {RequiredError}
|
|
1028
|
-
*/
|
|
1029
|
-
getCampaign: function (code, authorization, expand, options) {
|
|
1030
|
-
return localVarFp.getCampaign(code, authorization, expand, options).then(function (request) { return request(axios, basePath); });
|
|
1031
|
-
},
|
|
1032
|
-
/**
|
|
1033
|
-
* Retrieves a list of campaigns.
|
|
1034
|
-
* @summary List Campaigns
|
|
1035
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
1036
|
-
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
1037
|
-
* @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.
|
|
1038
|
-
* @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, name, status, slug, startDate, endDate, createdAt</i>
|
|
1039
|
-
* @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: name, slug</i>
|
|
1040
|
-
* @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: name, status, startDate, endDate, createdAt</i>
|
|
1041
|
-
* @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/>
|
|
1042
|
-
* @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, name, status, slug, startDate, endDate, createdAt</i>
|
|
1043
|
-
* @param {*} [options] Override http request option.
|
|
1044
|
-
* @throws {RequiredError}
|
|
1045
|
-
*/
|
|
1046
|
-
listCampaigns: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
|
|
1047
|
-
return localVarFp.listCampaigns(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then(function (request) { return request(axios, basePath); });
|
|
1048
|
-
},
|
|
1049
|
-
/**
|
|
1050
|
-
* Retrieves a list of eligible accounts.
|
|
1051
|
-
* @summary List Eligible Accounts
|
|
1052
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
1053
|
-
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
1054
|
-
* @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.
|
|
1055
|
-
* @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, partnerNumber, campaignId, createdAt, updatedAt</i>
|
|
1056
|
-
* @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: voucherCode, partnerNumber</i>
|
|
1057
|
-
* @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: voucherCode, partnerNumber, createdAt</i>
|
|
1058
|
-
* @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/>
|
|
1059
|
-
* @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, partnerNumber, campaignId, createdAt, updatedAt</i>
|
|
1060
|
-
* @param {*} [options] Override http request option.
|
|
1061
|
-
* @throws {RequiredError}
|
|
1062
|
-
*/
|
|
1063
|
-
listEligibleAccounts: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
|
|
1064
|
-
return localVarFp.listEligibleAccounts(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then(function (request) { return request(axios, basePath); });
|
|
1065
|
-
},
|
|
1066
|
-
/**
|
|
1067
|
-
* Updates the data of an existing campaign. Only DRAFT campaigns can be updated.
|
|
1068
|
-
* @summary Update the Campaign
|
|
1069
|
-
* @param {string} code Unique identifier for the object.
|
|
1070
|
-
* @param {UpdateCampaignRequestDto} updateCampaignRequestDto
|
|
1071
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
1072
|
-
* @param {*} [options] Override http request option.
|
|
1073
|
-
* @throws {RequiredError}
|
|
1074
|
-
*/
|
|
1075
|
-
updateCampaign: function (code, updateCampaignRequestDto, authorization, options) {
|
|
1076
|
-
return localVarFp.updateCampaign(code, updateCampaignRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
1077
|
-
},
|
|
1078
|
-
/**
|
|
1079
|
-
* Updates the status of a campaign, which affects whether vouchers can be redeemed.
|
|
1080
|
-
* @summary Updates the status of a campaign.
|
|
1081
|
-
* @param {string} code Unique identifier for the object.
|
|
1082
|
-
* @param {UpdateCampaignStatusRequestDto} updateCampaignStatusRequestDto
|
|
1083
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
1084
|
-
* @param {*} [options] Override http request option.
|
|
1085
|
-
* @throws {RequiredError}
|
|
1086
|
-
*/
|
|
1087
|
-
updateCampaignStatus: function (code, updateCampaignStatusRequestDto, authorization, options) {
|
|
1088
|
-
return localVarFp.updateCampaignStatus(code, updateCampaignStatusRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
1089
|
-
},
|
|
1090
|
-
/**
|
|
1091
|
-
* 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.
|
|
1092
|
-
* @summary Uploads the eligible accounts.
|
|
1093
|
-
* @param {string} code Unique identifier for the object.
|
|
1094
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
1095
|
-
* @param {*} [options] Override http request option.
|
|
1096
|
-
* @throws {RequiredError}
|
|
1097
|
-
*/
|
|
1098
|
-
uploadEligibleAccounts: function (code, authorization, options) {
|
|
1099
|
-
return localVarFp.uploadEligibleAccounts(code, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
1100
|
-
},
|
|
1101
|
-
};
|
|
1102
|
-
};
|
|
1103
|
-
exports.CampaignsApiFactory = CampaignsApiFactory;
|
|
1104
|
-
/**
|
|
1105
|
-
* CampaignsApi - object-oriented interface
|
|
1106
|
-
* @export
|
|
1107
|
-
* @class CampaignsApi
|
|
1108
|
-
* @extends {BaseAPI}
|
|
1109
|
-
*/
|
|
1110
|
-
var CampaignsApi = /** @class */ (function (_super) {
|
|
1111
|
-
__extends(CampaignsApi, _super);
|
|
1112
|
-
function CampaignsApi() {
|
|
1113
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1114
|
-
}
|
|
1115
|
-
/**
|
|
1116
|
-
* Creates a new campaign that can contain multiple vouchers for eligible accounts to redeem.
|
|
1117
|
-
* @summary Create the Campaign
|
|
1118
|
-
* @param {CampaignsApiCreateCampaignRequest} requestParameters Request parameters.
|
|
1119
|
-
* @param {*} [options] Override http request option.
|
|
1120
|
-
* @throws {RequiredError}
|
|
1121
|
-
* @memberof CampaignsApi
|
|
1122
|
-
*/
|
|
1123
|
-
CampaignsApi.prototype.createCampaign = function (requestParameters, options) {
|
|
1124
|
-
var _this = this;
|
|
1125
|
-
return (0, exports.CampaignsApiFp)(this.configuration).createCampaign(requestParameters.createCampaignRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1126
|
-
};
|
|
1127
|
-
/**
|
|
1128
|
-
* Creates an account that is eligible to redeem a vouchers from a specific campaign.
|
|
1129
|
-
* @summary Create the Eligible Account
|
|
1130
|
-
* @param {CampaignsApiCreateEligibleAccountRequest} requestParameters Request parameters.
|
|
1131
|
-
* @param {*} [options] Override http request option.
|
|
1132
|
-
* @throws {RequiredError}
|
|
1133
|
-
* @memberof CampaignsApi
|
|
1134
|
-
*/
|
|
1135
|
-
CampaignsApi.prototype.createEligibleAccount = function (requestParameters, options) {
|
|
1136
|
-
var _this = this;
|
|
1137
|
-
return (0, exports.CampaignsApiFp)(this.configuration).createEligibleAccount(requestParameters.code, requestParameters.createEligibleAccountRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1138
|
-
};
|
|
1139
|
-
/**
|
|
1140
|
-
* Removes a campaign and its associated vouchers. This will prevent any further voucher redemptions.
|
|
1141
|
-
* @summary Delete the Campaign
|
|
1142
|
-
* @param {CampaignsApiDeleteCampaignRequest} requestParameters Request parameters.
|
|
1143
|
-
* @param {*} [options] Override http request option.
|
|
1144
|
-
* @throws {RequiredError}
|
|
1145
|
-
* @memberof CampaignsApi
|
|
1146
|
-
*/
|
|
1147
|
-
CampaignsApi.prototype.deleteCampaign = function (requestParameters, options) {
|
|
1148
|
-
var _this = this;
|
|
1149
|
-
return (0, exports.CampaignsApiFp)(this.configuration).deleteCampaign(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1150
|
-
};
|
|
1151
|
-
/**
|
|
1152
|
-
* 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.
|
|
1153
|
-
* @summary Delete the Eligible Account
|
|
1154
|
-
* @param {CampaignsApiDeleteEligibleAccountRequest} requestParameters Request parameters.
|
|
1155
|
-
* @param {*} [options] Override http request option.
|
|
1156
|
-
* @throws {RequiredError}
|
|
1157
|
-
* @memberof CampaignsApi
|
|
1158
|
-
*/
|
|
1159
|
-
CampaignsApi.prototype.deleteEligibleAccount = function (requestParameters, options) {
|
|
1160
|
-
var _this = this;
|
|
1161
|
-
return (0, exports.CampaignsApiFp)(this.configuration).deleteEligibleAccount(requestParameters.code, requestParameters.accountCode, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1162
|
-
};
|
|
1163
|
-
/**
|
|
1164
|
-
* 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.
|
|
1165
|
-
* @summary Delete the Eligible Accounts
|
|
1166
|
-
* @param {CampaignsApiDeleteEligibleAccountsRequest} requestParameters Request parameters.
|
|
1167
|
-
* @param {*} [options] Override http request option.
|
|
1168
|
-
* @throws {RequiredError}
|
|
1169
|
-
* @memberof CampaignsApi
|
|
1170
|
-
*/
|
|
1171
|
-
CampaignsApi.prototype.deleteEligibleAccounts = function (requestParameters, options) {
|
|
1172
|
-
var _this = this;
|
|
1173
|
-
return (0, exports.CampaignsApiFp)(this.configuration).deleteEligibleAccounts(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1174
|
-
};
|
|
1175
|
-
/**
|
|
1176
|
-
* Retrieves detailed information about a specific campaign.
|
|
1177
|
-
* @summary Retrieve the Campaign
|
|
1178
|
-
* @param {CampaignsApiGetCampaignRequest} requestParameters Request parameters.
|
|
1179
|
-
* @param {*} [options] Override http request option.
|
|
1180
|
-
* @throws {RequiredError}
|
|
1181
|
-
* @memberof CampaignsApi
|
|
1182
|
-
*/
|
|
1183
|
-
CampaignsApi.prototype.getCampaign = function (requestParameters, options) {
|
|
1184
|
-
var _this = this;
|
|
1185
|
-
return (0, exports.CampaignsApiFp)(this.configuration).getCampaign(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1186
|
-
};
|
|
1187
|
-
/**
|
|
1188
|
-
* Retrieves a list of campaigns.
|
|
1189
|
-
* @summary List Campaigns
|
|
1190
|
-
* @param {CampaignsApiListCampaignsRequest} requestParameters Request parameters.
|
|
1191
|
-
* @param {*} [options] Override http request option.
|
|
1192
|
-
* @throws {RequiredError}
|
|
1193
|
-
* @memberof CampaignsApi
|
|
1194
|
-
*/
|
|
1195
|
-
CampaignsApi.prototype.listCampaigns = function (requestParameters, options) {
|
|
1196
|
-
var _this = this;
|
|
1197
|
-
if (requestParameters === void 0) { requestParameters = {}; }
|
|
1198
|
-
return (0, exports.CampaignsApiFp)(this.configuration).listCampaigns(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1199
|
-
};
|
|
1200
|
-
/**
|
|
1201
|
-
* Retrieves a list of eligible accounts.
|
|
1202
|
-
* @summary List Eligible Accounts
|
|
1203
|
-
* @param {CampaignsApiListEligibleAccountsRequest} requestParameters Request parameters.
|
|
1204
|
-
* @param {*} [options] Override http request option.
|
|
1205
|
-
* @throws {RequiredError}
|
|
1206
|
-
* @memberof CampaignsApi
|
|
1207
|
-
*/
|
|
1208
|
-
CampaignsApi.prototype.listEligibleAccounts = function (requestParameters, options) {
|
|
1209
|
-
var _this = this;
|
|
1210
|
-
if (requestParameters === void 0) { requestParameters = {}; }
|
|
1211
|
-
return (0, exports.CampaignsApiFp)(this.configuration).listEligibleAccounts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1212
|
-
};
|
|
1213
|
-
/**
|
|
1214
|
-
* Updates the data of an existing campaign. Only DRAFT campaigns can be updated.
|
|
1215
|
-
* @summary Update the Campaign
|
|
1216
|
-
* @param {CampaignsApiUpdateCampaignRequest} requestParameters Request parameters.
|
|
1217
|
-
* @param {*} [options] Override http request option.
|
|
1218
|
-
* @throws {RequiredError}
|
|
1219
|
-
* @memberof CampaignsApi
|
|
1220
|
-
*/
|
|
1221
|
-
CampaignsApi.prototype.updateCampaign = function (requestParameters, options) {
|
|
1222
|
-
var _this = this;
|
|
1223
|
-
return (0, exports.CampaignsApiFp)(this.configuration).updateCampaign(requestParameters.code, requestParameters.updateCampaignRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1224
|
-
};
|
|
1225
|
-
/**
|
|
1226
|
-
* Updates the status of a campaign, which affects whether vouchers can be redeemed.
|
|
1227
|
-
* @summary Updates the status of a campaign.
|
|
1228
|
-
* @param {CampaignsApiUpdateCampaignStatusRequest} requestParameters Request parameters.
|
|
1229
|
-
* @param {*} [options] Override http request option.
|
|
1230
|
-
* @throws {RequiredError}
|
|
1231
|
-
* @memberof CampaignsApi
|
|
1232
|
-
*/
|
|
1233
|
-
CampaignsApi.prototype.updateCampaignStatus = function (requestParameters, options) {
|
|
1234
|
-
var _this = this;
|
|
1235
|
-
return (0, exports.CampaignsApiFp)(this.configuration).updateCampaignStatus(requestParameters.code, requestParameters.updateCampaignStatusRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1236
|
-
};
|
|
1237
|
-
/**
|
|
1238
|
-
* 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.
|
|
1239
|
-
* @summary Uploads the eligible accounts.
|
|
1240
|
-
* @param {CampaignsApiUploadEligibleAccountsRequest} requestParameters Request parameters.
|
|
1241
|
-
* @param {*} [options] Override http request option.
|
|
1242
|
-
* @throws {RequiredError}
|
|
1243
|
-
* @memberof CampaignsApi
|
|
1244
|
-
*/
|
|
1245
|
-
CampaignsApi.prototype.uploadEligibleAccounts = function (requestParameters, options) {
|
|
1246
|
-
var _this = this;
|
|
1247
|
-
return (0, exports.CampaignsApiFp)(this.configuration).uploadEligibleAccounts(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1248
|
-
};
|
|
1249
|
-
return CampaignsApi;
|
|
1250
|
-
}(base_1.BaseAPI));
|
|
1251
|
-
exports.CampaignsApi = CampaignsApi;
|