tremendous 2.1.0 → 3.0.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/README.md +79 -55
- package/dist/api.d.ts +5920 -0
- package/dist/api.js +3888 -0
- package/dist/base.d.ts +66 -0
- package/dist/base.js +65 -0
- package/dist/common.d.ts +65 -0
- package/dist/common.js +161 -0
- package/dist/configuration.d.ts +91 -0
- package/dist/configuration.js +47 -0
- package/dist/environments.d.ts +5 -0
- package/dist/environments.js +7 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +32 -0
- package/package.json +20 -23
- package/Makefile +0 -24
- package/index.js +0 -3
- package/lib/index.js +0 -72
package/dist/api.js
ADDED
|
@@ -0,0 +1,3888 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* API Endpoints
|
|
6
|
+
* Deliver monetary rewards and incentives to employees, customers, survey participants, and more through the Tremendous API. For organizational tasks, like managing your organization and it\'s members within Tremendous, please see the Tremendous Organizational API.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 2
|
|
9
|
+
* Contact: developers@tremendous.com
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.OrderWithoutLinkStatusEnum = exports.OrderWithLinkStatusEnum = exports.OrderStatus = exports.OrderBasePaymentChannelEnum = exports.OrderBaseStatusEnum = exports.OrderStatusEnum = exports.MemberWithoutEventsStatusEnum = exports.MemberWithoutEventsRoleEnum = exports.MemberWithEventsStatusEnum = exports.MemberWithEventsRoleEnum = exports.MemberBaseStatusEnum = exports.MemberBaseRoleEnum = exports.MemberStatusEnum = exports.MemberRoleEnum = exports.ListRewards200ResponseRewardsInnerValueCurrencyCodeEnum = exports.ListRewards200ResponseRewardsInnerDeliveryStatusEnum = exports.ListRewards200ResponseRewardsInnerDeliveryMethodEnum = exports.ListProducts200ResponseProductsInnerImagesInnerTypeEnum = exports.ListProducts200ResponseProductsInnerCurrencyCodesEnum = exports.ListProducts200ResponseProductsInnerCategoryEnum = exports.ListOrganizations200ResponseOrganizationsInnerStatusEnum = exports.ListOrders200ResponseOrdersInnerPaymentChannelEnum = exports.ListOrders200ResponseOrdersInnerStatusEnum = exports.ListMembers200ResponseMembersInnerStatusEnum = exports.ListMembers200ResponseMembersInnerRoleEnum = exports.ListInvoices200ResponseInvoicesInnerStatusEnum = exports.ListFundingSources200ResponseFundingSourcesInnerMetaNetworkEnum = exports.ListFundingSources200ResponseFundingSourcesInnerMetaAccountTypeEnum = exports.ListFundingSources200ResponseFundingSourcesInnerTypeEnum = exports.ListFundingSources200ResponseFundingSourcesInnerMethodEnum = exports.InvoiceStatusEnum = exports.GetMember200ResponseMemberEventsInnerTypeEnum = exports.GetMember200ResponseMemberStatusEnum = exports.GetMember200ResponseMemberRoleEnum = exports.FundingSourceTypeEnum = exports.FundingSourceMethodEnum = exports.DeliveryStatus = exports.DeliveryMethod = exports.DeliveryDetailsWithLinkStatusEnum = exports.DeliveryDetailsWithLinkMethodEnum = exports.DeliveryDetailsStatusEnum = exports.DeliveryDetailsMethodEnum = exports.CurrencyCodes = exports.CreateOrganization200ResponseOrganizationStatusEnum = exports.CreateOrderRequestRewardDeliveryMethodEnum = exports.CreateOrder200ResponseOrderRewardsInnerDeliveryStatusEnum = exports.CreateOrder200ResponseOrderRewardsInnerDeliveryMethodEnum = exports.CreateOrder200ResponseOrderStatusEnum = exports.CreateMemberRequestRoleEnum = exports.CreateMemberRoleEnum = void 0;
|
|
26
|
+
exports.WebhooksApiAxiosParamCreator = exports.RewardsApi = exports.RewardsApiFactory = exports.RewardsApiFp = exports.RewardsApiAxiosParamCreator = exports.ProductsApi = exports.ProductsApiFactory = exports.ProductsApiFp = exports.ProductsApiAxiosParamCreator = exports.OrganizationsApi = exports.OrganizationsApiFactory = exports.OrganizationsApiFp = exports.OrganizationsApiAxiosParamCreator = exports.OrdersApi = exports.OrdersApiFactory = exports.OrdersApiFp = exports.OrdersApiAxiosParamCreator = exports.MembersApi = exports.MembersApiFactory = exports.MembersApiFp = exports.MembersApiAxiosParamCreator = exports.InvoicesApi = exports.InvoicesApiFactory = exports.InvoicesApiFp = exports.InvoicesApiAxiosParamCreator = exports.FundingSourcesApi = exports.FundingSourcesApiFactory = exports.FundingSourcesApiFp = exports.FundingSourcesApiAxiosParamCreator = exports.FieldsApi = exports.FieldsApiFactory = exports.FieldsApiFp = exports.FieldsApiAxiosParamCreator = exports.CampaignsApi = exports.CampaignsApiFactory = exports.CampaignsApiFp = exports.CampaignsApiAxiosParamCreator = exports.BalanceTransactionsApi = exports.BalanceTransactionsApiFactory = exports.BalanceTransactionsApiFp = exports.BalanceTransactionsApiAxiosParamCreator = exports.RewardWithoutLinkDeliveryStatusEnum = exports.RewardWithoutLinkDeliveryMethodEnum = exports.RewardWithLinkDeliveryStatusEnum = exports.RewardWithLinkDeliveryMethodEnum = exports.RewardValueCurrencyCodeEnum = exports.ProductCurrencyCodesEnum = exports.ProductCategoryEnum = exports.PaymentDetailsChannelEnum = exports.OrganizationStatusEnum = void 0;
|
|
27
|
+
exports.WebhooksApi = exports.WebhooksApiFactory = exports.WebhooksApiFp = void 0;
|
|
28
|
+
const axios_1 = require("axios");
|
|
29
|
+
// Some imports not used depending on template conditions
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
const common_1 = require("./common");
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
const base_1 = require("./base");
|
|
34
|
+
exports.CreateMemberRoleEnum = {
|
|
35
|
+
Member: 'MEMBER',
|
|
36
|
+
Admin: 'ADMIN'
|
|
37
|
+
};
|
|
38
|
+
exports.CreateMemberRequestRoleEnum = {
|
|
39
|
+
Member: 'MEMBER',
|
|
40
|
+
Admin: 'ADMIN'
|
|
41
|
+
};
|
|
42
|
+
exports.CreateOrder200ResponseOrderStatusEnum = {
|
|
43
|
+
Canceled: 'CANCELED',
|
|
44
|
+
Cart: 'CART',
|
|
45
|
+
Executed: 'EXECUTED',
|
|
46
|
+
Failed: 'FAILED',
|
|
47
|
+
PendingApproval: 'PENDING APPROVAL'
|
|
48
|
+
};
|
|
49
|
+
exports.CreateOrder200ResponseOrderRewardsInnerDeliveryMethodEnum = {
|
|
50
|
+
Email: 'EMAIL',
|
|
51
|
+
Link: 'LINK',
|
|
52
|
+
Phone: 'PHONE'
|
|
53
|
+
};
|
|
54
|
+
exports.CreateOrder200ResponseOrderRewardsInnerDeliveryStatusEnum = {
|
|
55
|
+
Scheduled: 'SCHEDULED',
|
|
56
|
+
Failed: 'FAILED',
|
|
57
|
+
Succeeded: 'SUCCEEDED',
|
|
58
|
+
Pending: 'PENDING'
|
|
59
|
+
};
|
|
60
|
+
exports.CreateOrderRequestRewardDeliveryMethodEnum = {
|
|
61
|
+
Email: 'EMAIL',
|
|
62
|
+
Link: 'LINK',
|
|
63
|
+
Phone: 'PHONE'
|
|
64
|
+
};
|
|
65
|
+
exports.CreateOrganization200ResponseOrganizationStatusEnum = {
|
|
66
|
+
Pending: 'PENDING',
|
|
67
|
+
Approved: 'APPROVED',
|
|
68
|
+
Rejected: 'REJECTED'
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
* @export
|
|
73
|
+
* @enum {string}
|
|
74
|
+
*/
|
|
75
|
+
exports.CurrencyCodes = {
|
|
76
|
+
Usd: 'USD',
|
|
77
|
+
Cad: 'CAD',
|
|
78
|
+
Eur: 'EUR',
|
|
79
|
+
Aed: 'AED',
|
|
80
|
+
Afn: 'AFN',
|
|
81
|
+
All: 'ALL',
|
|
82
|
+
Amd: 'AMD',
|
|
83
|
+
Ars: 'ARS',
|
|
84
|
+
Aud: 'AUD',
|
|
85
|
+
Azn: 'AZN',
|
|
86
|
+
Bam: 'BAM',
|
|
87
|
+
Bdt: 'BDT',
|
|
88
|
+
Bgn: 'BGN',
|
|
89
|
+
Bhd: 'BHD',
|
|
90
|
+
Bif: 'BIF',
|
|
91
|
+
Bnd: 'BND',
|
|
92
|
+
Bob: 'BOB',
|
|
93
|
+
Brl: 'BRL',
|
|
94
|
+
Bwp: 'BWP',
|
|
95
|
+
Byr: 'BYR',
|
|
96
|
+
Bzd: 'BZD',
|
|
97
|
+
Cdf: 'CDF',
|
|
98
|
+
Chf: 'CHF',
|
|
99
|
+
Clp: 'CLP',
|
|
100
|
+
Cny: 'CNY',
|
|
101
|
+
Cop: 'COP',
|
|
102
|
+
Crc: 'CRC',
|
|
103
|
+
Cve: 'CVE',
|
|
104
|
+
Czk: 'CZK',
|
|
105
|
+
Djf: 'DJF',
|
|
106
|
+
Dkk: 'DKK',
|
|
107
|
+
Dop: 'DOP',
|
|
108
|
+
Dzd: 'DZD',
|
|
109
|
+
Eek: 'EEK',
|
|
110
|
+
Egp: 'EGP',
|
|
111
|
+
Ern: 'ERN',
|
|
112
|
+
Etb: 'ETB',
|
|
113
|
+
Gbp: 'GBP',
|
|
114
|
+
Gel: 'GEL',
|
|
115
|
+
Ghs: 'GHS',
|
|
116
|
+
Gnf: 'GNF',
|
|
117
|
+
Gtq: 'GTQ',
|
|
118
|
+
Hkd: 'HKD',
|
|
119
|
+
Hnl: 'HNL',
|
|
120
|
+
Hrk: 'HRK',
|
|
121
|
+
Huf: 'HUF',
|
|
122
|
+
Idr: 'IDR',
|
|
123
|
+
Ils: 'ILS',
|
|
124
|
+
Inr: 'INR',
|
|
125
|
+
Iqd: 'IQD',
|
|
126
|
+
Irr: 'IRR',
|
|
127
|
+
Isk: 'ISK',
|
|
128
|
+
Jmd: 'JMD',
|
|
129
|
+
Jod: 'JOD',
|
|
130
|
+
Jpy: 'JPY',
|
|
131
|
+
Kes: 'KES',
|
|
132
|
+
Khr: 'KHR',
|
|
133
|
+
Krw: 'KRW',
|
|
134
|
+
Kwd: 'KWD',
|
|
135
|
+
Kzt: 'KZT',
|
|
136
|
+
Lbp: 'LBP',
|
|
137
|
+
Lkr: 'LKR',
|
|
138
|
+
Ltl: 'LTL',
|
|
139
|
+
Lvl: 'LVL',
|
|
140
|
+
Mad: 'MAD',
|
|
141
|
+
Mdl: 'MDL',
|
|
142
|
+
Mga: 'MGA',
|
|
143
|
+
Mkd: 'MKD',
|
|
144
|
+
Mmk: 'MMK',
|
|
145
|
+
Mop: 'MOP',
|
|
146
|
+
Mur: 'MUR',
|
|
147
|
+
Mxn: 'MXN',
|
|
148
|
+
Myr: 'MYR',
|
|
149
|
+
Mzn: 'MZN',
|
|
150
|
+
Nad: 'NAD',
|
|
151
|
+
Ngn: 'NGN',
|
|
152
|
+
Nio: 'NIO',
|
|
153
|
+
Nok: 'NOK',
|
|
154
|
+
Npr: 'NPR',
|
|
155
|
+
Nzd: 'NZD',
|
|
156
|
+
Omr: 'OMR',
|
|
157
|
+
Pab: 'PAB',
|
|
158
|
+
Pen: 'PEN',
|
|
159
|
+
Php: 'PHP',
|
|
160
|
+
Pkr: 'PKR',
|
|
161
|
+
Pln: 'PLN',
|
|
162
|
+
Pyg: 'PYG',
|
|
163
|
+
Qar: 'QAR',
|
|
164
|
+
Ron: 'RON',
|
|
165
|
+
Rsd: 'RSD',
|
|
166
|
+
Rub: 'RUB',
|
|
167
|
+
Rwf: 'RWF',
|
|
168
|
+
Sar: 'SAR',
|
|
169
|
+
Sdg: 'SDG',
|
|
170
|
+
Sek: 'SEK',
|
|
171
|
+
Sgd: 'SGD',
|
|
172
|
+
Sos: 'SOS',
|
|
173
|
+
Syp: 'SYP',
|
|
174
|
+
Thb: 'THB',
|
|
175
|
+
Tnd: 'TND',
|
|
176
|
+
Top: 'TOP',
|
|
177
|
+
Try: 'TRY',
|
|
178
|
+
Ttd: 'TTD',
|
|
179
|
+
Twd: 'TWD',
|
|
180
|
+
Tzs: 'TZS',
|
|
181
|
+
Uah: 'UAH',
|
|
182
|
+
Ugx: 'UGX',
|
|
183
|
+
Uyu: 'UYU',
|
|
184
|
+
Uzs: 'UZS',
|
|
185
|
+
Vef: 'VEF',
|
|
186
|
+
Vnd: 'VND',
|
|
187
|
+
Xaf: 'XAF',
|
|
188
|
+
Xof: 'XOF',
|
|
189
|
+
Yer: 'YER',
|
|
190
|
+
Zar: 'ZAR',
|
|
191
|
+
Zmk: 'ZMK'
|
|
192
|
+
};
|
|
193
|
+
exports.DeliveryDetailsMethodEnum = {
|
|
194
|
+
Email: 'EMAIL',
|
|
195
|
+
Link: 'LINK',
|
|
196
|
+
Phone: 'PHONE'
|
|
197
|
+
};
|
|
198
|
+
exports.DeliveryDetailsStatusEnum = {
|
|
199
|
+
Scheduled: 'SCHEDULED',
|
|
200
|
+
Failed: 'FAILED',
|
|
201
|
+
Succeeded: 'SUCCEEDED',
|
|
202
|
+
Pending: 'PENDING'
|
|
203
|
+
};
|
|
204
|
+
exports.DeliveryDetailsWithLinkMethodEnum = {
|
|
205
|
+
Email: 'EMAIL',
|
|
206
|
+
Link: 'LINK',
|
|
207
|
+
Phone: 'PHONE'
|
|
208
|
+
};
|
|
209
|
+
exports.DeliveryDetailsWithLinkStatusEnum = {
|
|
210
|
+
Scheduled: 'SCHEDULED',
|
|
211
|
+
Failed: 'FAILED',
|
|
212
|
+
Succeeded: 'SUCCEEDED',
|
|
213
|
+
Pending: 'PENDING'
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* How to deliver the reward to the recipient. <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table>
|
|
217
|
+
* @export
|
|
218
|
+
* @enum {string}
|
|
219
|
+
*/
|
|
220
|
+
exports.DeliveryMethod = {
|
|
221
|
+
Email: 'EMAIL',
|
|
222
|
+
Link: 'LINK',
|
|
223
|
+
Phone: 'PHONE'
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Current status of the delivery of the reward: * `SCHEDULED` - Reward is scheduled for delivery and will be delivered soon. * `FAILED` - Delivery of reward failed (e.g. email bounced). * `SUCCEEDED` - Reward was successfully delivered (email or text message delivered or reward link opened). * `PENDING` - Delivery is pending but not yet scheduled.
|
|
227
|
+
* @export
|
|
228
|
+
* @enum {string}
|
|
229
|
+
*/
|
|
230
|
+
exports.DeliveryStatus = {
|
|
231
|
+
Scheduled: 'SCHEDULED',
|
|
232
|
+
Failed: 'FAILED',
|
|
233
|
+
Succeeded: 'SUCCEEDED',
|
|
234
|
+
Pending: 'PENDING'
|
|
235
|
+
};
|
|
236
|
+
exports.FundingSourceMethodEnum = {
|
|
237
|
+
Balance: 'balance',
|
|
238
|
+
BankAccount: 'bank_account',
|
|
239
|
+
CreditCard: 'credit_card',
|
|
240
|
+
Invoice: 'invoice'
|
|
241
|
+
};
|
|
242
|
+
exports.FundingSourceTypeEnum = {
|
|
243
|
+
Commercial: 'COMMERCIAL',
|
|
244
|
+
ProForma: 'PRO_FORMA',
|
|
245
|
+
PrefundingOnly: 'PREFUNDING_ONLY'
|
|
246
|
+
};
|
|
247
|
+
exports.GetMember200ResponseMemberRoleEnum = {
|
|
248
|
+
Member: 'MEMBER',
|
|
249
|
+
Admin: 'ADMIN',
|
|
250
|
+
Deleted: 'DELETED'
|
|
251
|
+
};
|
|
252
|
+
exports.GetMember200ResponseMemberStatusEnum = {
|
|
253
|
+
Registered: 'REGISTERED',
|
|
254
|
+
Invited: 'INVITED'
|
|
255
|
+
};
|
|
256
|
+
exports.GetMember200ResponseMemberEventsInnerTypeEnum = {
|
|
257
|
+
Created: 'created',
|
|
258
|
+
LastLogin: 'last_login'
|
|
259
|
+
};
|
|
260
|
+
exports.InvoiceStatusEnum = {
|
|
261
|
+
Deleted: 'DELETED',
|
|
262
|
+
Paid: 'PAID',
|
|
263
|
+
Open: 'OPEN',
|
|
264
|
+
MarkedAsPaid: 'MARKED_AS_PAID'
|
|
265
|
+
};
|
|
266
|
+
exports.ListFundingSources200ResponseFundingSourcesInnerMethodEnum = {
|
|
267
|
+
Balance: 'balance',
|
|
268
|
+
BankAccount: 'bank_account',
|
|
269
|
+
CreditCard: 'credit_card',
|
|
270
|
+
Invoice: 'invoice'
|
|
271
|
+
};
|
|
272
|
+
exports.ListFundingSources200ResponseFundingSourcesInnerTypeEnum = {
|
|
273
|
+
Commercial: 'COMMERCIAL',
|
|
274
|
+
ProForma: 'PRO_FORMA',
|
|
275
|
+
PrefundingOnly: 'PREFUNDING_ONLY'
|
|
276
|
+
};
|
|
277
|
+
exports.ListFundingSources200ResponseFundingSourcesInnerMetaAccountTypeEnum = {
|
|
278
|
+
Checking: 'checking',
|
|
279
|
+
Savings: 'savings'
|
|
280
|
+
};
|
|
281
|
+
exports.ListFundingSources200ResponseFundingSourcesInnerMetaNetworkEnum = {
|
|
282
|
+
MasterCard: 'MasterCard',
|
|
283
|
+
Amex: 'Amex',
|
|
284
|
+
Jcb: 'JCB',
|
|
285
|
+
DinersClub: 'Diner\'s Club',
|
|
286
|
+
Visa: 'visa',
|
|
287
|
+
Discover: 'discover',
|
|
288
|
+
Laser: 'laser',
|
|
289
|
+
Elo: 'elo',
|
|
290
|
+
Maestro: 'maestro',
|
|
291
|
+
Solo: 'solo'
|
|
292
|
+
};
|
|
293
|
+
exports.ListInvoices200ResponseInvoicesInnerStatusEnum = {
|
|
294
|
+
Deleted: 'DELETED',
|
|
295
|
+
Paid: 'PAID',
|
|
296
|
+
Open: 'OPEN',
|
|
297
|
+
MarkedAsPaid: 'MARKED_AS_PAID'
|
|
298
|
+
};
|
|
299
|
+
exports.ListMembers200ResponseMembersInnerRoleEnum = {
|
|
300
|
+
Member: 'MEMBER',
|
|
301
|
+
Admin: 'ADMIN',
|
|
302
|
+
Deleted: 'DELETED'
|
|
303
|
+
};
|
|
304
|
+
exports.ListMembers200ResponseMembersInnerStatusEnum = {
|
|
305
|
+
Registered: 'REGISTERED',
|
|
306
|
+
Invited: 'INVITED'
|
|
307
|
+
};
|
|
308
|
+
exports.ListOrders200ResponseOrdersInnerStatusEnum = {
|
|
309
|
+
Canceled: 'CANCELED',
|
|
310
|
+
Cart: 'CART',
|
|
311
|
+
Executed: 'EXECUTED',
|
|
312
|
+
Failed: 'FAILED',
|
|
313
|
+
PendingApproval: 'PENDING APPROVAL'
|
|
314
|
+
};
|
|
315
|
+
exports.ListOrders200ResponseOrdersInnerPaymentChannelEnum = {
|
|
316
|
+
Ui: 'UI',
|
|
317
|
+
Api: 'API',
|
|
318
|
+
Embed: 'EMBED',
|
|
319
|
+
Decipher: 'DECIPHER',
|
|
320
|
+
Qualtrics: 'QUALTRICS',
|
|
321
|
+
Typeform: 'TYPEFORM',
|
|
322
|
+
SurveyMonkey: 'SURVEY MONKEY'
|
|
323
|
+
};
|
|
324
|
+
exports.ListOrganizations200ResponseOrganizationsInnerStatusEnum = {
|
|
325
|
+
Pending: 'PENDING',
|
|
326
|
+
Approved: 'APPROVED',
|
|
327
|
+
Rejected: 'REJECTED'
|
|
328
|
+
};
|
|
329
|
+
exports.ListProducts200ResponseProductsInnerCategoryEnum = {
|
|
330
|
+
Ach: 'ach',
|
|
331
|
+
Charity: 'charity',
|
|
332
|
+
MerchantCard: 'merchant_card',
|
|
333
|
+
Paypal: 'paypal',
|
|
334
|
+
Venmo: 'venmo',
|
|
335
|
+
VisaCard: 'visa_card'
|
|
336
|
+
};
|
|
337
|
+
exports.ListProducts200ResponseProductsInnerCurrencyCodesEnum = {
|
|
338
|
+
Usd: 'USD',
|
|
339
|
+
Cad: 'CAD',
|
|
340
|
+
Eur: 'EUR',
|
|
341
|
+
Aed: 'AED',
|
|
342
|
+
Afn: 'AFN',
|
|
343
|
+
All: 'ALL',
|
|
344
|
+
Amd: 'AMD',
|
|
345
|
+
Ars: 'ARS',
|
|
346
|
+
Aud: 'AUD',
|
|
347
|
+
Azn: 'AZN',
|
|
348
|
+
Bam: 'BAM',
|
|
349
|
+
Bdt: 'BDT',
|
|
350
|
+
Bgn: 'BGN',
|
|
351
|
+
Bhd: 'BHD',
|
|
352
|
+
Bif: 'BIF',
|
|
353
|
+
Bnd: 'BND',
|
|
354
|
+
Bob: 'BOB',
|
|
355
|
+
Brl: 'BRL',
|
|
356
|
+
Bwp: 'BWP',
|
|
357
|
+
Byr: 'BYR',
|
|
358
|
+
Bzd: 'BZD',
|
|
359
|
+
Cdf: 'CDF',
|
|
360
|
+
Chf: 'CHF',
|
|
361
|
+
Clp: 'CLP',
|
|
362
|
+
Cny: 'CNY',
|
|
363
|
+
Cop: 'COP',
|
|
364
|
+
Crc: 'CRC',
|
|
365
|
+
Cve: 'CVE',
|
|
366
|
+
Czk: 'CZK',
|
|
367
|
+
Djf: 'DJF',
|
|
368
|
+
Dkk: 'DKK',
|
|
369
|
+
Dop: 'DOP',
|
|
370
|
+
Dzd: 'DZD',
|
|
371
|
+
Eek: 'EEK',
|
|
372
|
+
Egp: 'EGP',
|
|
373
|
+
Ern: 'ERN',
|
|
374
|
+
Etb: 'ETB',
|
|
375
|
+
Gbp: 'GBP',
|
|
376
|
+
Gel: 'GEL',
|
|
377
|
+
Ghs: 'GHS',
|
|
378
|
+
Gnf: 'GNF',
|
|
379
|
+
Gtq: 'GTQ',
|
|
380
|
+
Hkd: 'HKD',
|
|
381
|
+
Hnl: 'HNL',
|
|
382
|
+
Hrk: 'HRK',
|
|
383
|
+
Huf: 'HUF',
|
|
384
|
+
Idr: 'IDR',
|
|
385
|
+
Ils: 'ILS',
|
|
386
|
+
Inr: 'INR',
|
|
387
|
+
Iqd: 'IQD',
|
|
388
|
+
Irr: 'IRR',
|
|
389
|
+
Isk: 'ISK',
|
|
390
|
+
Jmd: 'JMD',
|
|
391
|
+
Jod: 'JOD',
|
|
392
|
+
Jpy: 'JPY',
|
|
393
|
+
Kes: 'KES',
|
|
394
|
+
Khr: 'KHR',
|
|
395
|
+
Krw: 'KRW',
|
|
396
|
+
Kwd: 'KWD',
|
|
397
|
+
Kzt: 'KZT',
|
|
398
|
+
Lbp: 'LBP',
|
|
399
|
+
Lkr: 'LKR',
|
|
400
|
+
Ltl: 'LTL',
|
|
401
|
+
Lvl: 'LVL',
|
|
402
|
+
Mad: 'MAD',
|
|
403
|
+
Mdl: 'MDL',
|
|
404
|
+
Mga: 'MGA',
|
|
405
|
+
Mkd: 'MKD',
|
|
406
|
+
Mmk: 'MMK',
|
|
407
|
+
Mop: 'MOP',
|
|
408
|
+
Mur: 'MUR',
|
|
409
|
+
Mxn: 'MXN',
|
|
410
|
+
Myr: 'MYR',
|
|
411
|
+
Mzn: 'MZN',
|
|
412
|
+
Nad: 'NAD',
|
|
413
|
+
Ngn: 'NGN',
|
|
414
|
+
Nio: 'NIO',
|
|
415
|
+
Nok: 'NOK',
|
|
416
|
+
Npr: 'NPR',
|
|
417
|
+
Nzd: 'NZD',
|
|
418
|
+
Omr: 'OMR',
|
|
419
|
+
Pab: 'PAB',
|
|
420
|
+
Pen: 'PEN',
|
|
421
|
+
Php: 'PHP',
|
|
422
|
+
Pkr: 'PKR',
|
|
423
|
+
Pln: 'PLN',
|
|
424
|
+
Pyg: 'PYG',
|
|
425
|
+
Qar: 'QAR',
|
|
426
|
+
Ron: 'RON',
|
|
427
|
+
Rsd: 'RSD',
|
|
428
|
+
Rub: 'RUB',
|
|
429
|
+
Rwf: 'RWF',
|
|
430
|
+
Sar: 'SAR',
|
|
431
|
+
Sdg: 'SDG',
|
|
432
|
+
Sek: 'SEK',
|
|
433
|
+
Sgd: 'SGD',
|
|
434
|
+
Sos: 'SOS',
|
|
435
|
+
Syp: 'SYP',
|
|
436
|
+
Thb: 'THB',
|
|
437
|
+
Tnd: 'TND',
|
|
438
|
+
Top: 'TOP',
|
|
439
|
+
Try: 'TRY',
|
|
440
|
+
Ttd: 'TTD',
|
|
441
|
+
Twd: 'TWD',
|
|
442
|
+
Tzs: 'TZS',
|
|
443
|
+
Uah: 'UAH',
|
|
444
|
+
Ugx: 'UGX',
|
|
445
|
+
Uyu: 'UYU',
|
|
446
|
+
Uzs: 'UZS',
|
|
447
|
+
Vef: 'VEF',
|
|
448
|
+
Vnd: 'VND',
|
|
449
|
+
Xaf: 'XAF',
|
|
450
|
+
Xof: 'XOF',
|
|
451
|
+
Yer: 'YER',
|
|
452
|
+
Zar: 'ZAR',
|
|
453
|
+
Zmk: 'ZMK'
|
|
454
|
+
};
|
|
455
|
+
exports.ListProducts200ResponseProductsInnerImagesInnerTypeEnum = {
|
|
456
|
+
Card: 'card',
|
|
457
|
+
Logo: 'logo'
|
|
458
|
+
};
|
|
459
|
+
exports.ListRewards200ResponseRewardsInnerDeliveryMethodEnum = {
|
|
460
|
+
Email: 'EMAIL',
|
|
461
|
+
Link: 'LINK',
|
|
462
|
+
Phone: 'PHONE'
|
|
463
|
+
};
|
|
464
|
+
exports.ListRewards200ResponseRewardsInnerDeliveryStatusEnum = {
|
|
465
|
+
Scheduled: 'SCHEDULED',
|
|
466
|
+
Failed: 'FAILED',
|
|
467
|
+
Succeeded: 'SUCCEEDED',
|
|
468
|
+
Pending: 'PENDING'
|
|
469
|
+
};
|
|
470
|
+
exports.ListRewards200ResponseRewardsInnerValueCurrencyCodeEnum = {
|
|
471
|
+
Usd: 'USD',
|
|
472
|
+
Cad: 'CAD',
|
|
473
|
+
Eur: 'EUR',
|
|
474
|
+
Aed: 'AED',
|
|
475
|
+
Afn: 'AFN',
|
|
476
|
+
All: 'ALL',
|
|
477
|
+
Amd: 'AMD',
|
|
478
|
+
Ars: 'ARS',
|
|
479
|
+
Aud: 'AUD',
|
|
480
|
+
Azn: 'AZN',
|
|
481
|
+
Bam: 'BAM',
|
|
482
|
+
Bdt: 'BDT',
|
|
483
|
+
Bgn: 'BGN',
|
|
484
|
+
Bhd: 'BHD',
|
|
485
|
+
Bif: 'BIF',
|
|
486
|
+
Bnd: 'BND',
|
|
487
|
+
Bob: 'BOB',
|
|
488
|
+
Brl: 'BRL',
|
|
489
|
+
Bwp: 'BWP',
|
|
490
|
+
Byr: 'BYR',
|
|
491
|
+
Bzd: 'BZD',
|
|
492
|
+
Cdf: 'CDF',
|
|
493
|
+
Chf: 'CHF',
|
|
494
|
+
Clp: 'CLP',
|
|
495
|
+
Cny: 'CNY',
|
|
496
|
+
Cop: 'COP',
|
|
497
|
+
Crc: 'CRC',
|
|
498
|
+
Cve: 'CVE',
|
|
499
|
+
Czk: 'CZK',
|
|
500
|
+
Djf: 'DJF',
|
|
501
|
+
Dkk: 'DKK',
|
|
502
|
+
Dop: 'DOP',
|
|
503
|
+
Dzd: 'DZD',
|
|
504
|
+
Eek: 'EEK',
|
|
505
|
+
Egp: 'EGP',
|
|
506
|
+
Ern: 'ERN',
|
|
507
|
+
Etb: 'ETB',
|
|
508
|
+
Gbp: 'GBP',
|
|
509
|
+
Gel: 'GEL',
|
|
510
|
+
Ghs: 'GHS',
|
|
511
|
+
Gnf: 'GNF',
|
|
512
|
+
Gtq: 'GTQ',
|
|
513
|
+
Hkd: 'HKD',
|
|
514
|
+
Hnl: 'HNL',
|
|
515
|
+
Hrk: 'HRK',
|
|
516
|
+
Huf: 'HUF',
|
|
517
|
+
Idr: 'IDR',
|
|
518
|
+
Ils: 'ILS',
|
|
519
|
+
Inr: 'INR',
|
|
520
|
+
Iqd: 'IQD',
|
|
521
|
+
Irr: 'IRR',
|
|
522
|
+
Isk: 'ISK',
|
|
523
|
+
Jmd: 'JMD',
|
|
524
|
+
Jod: 'JOD',
|
|
525
|
+
Jpy: 'JPY',
|
|
526
|
+
Kes: 'KES',
|
|
527
|
+
Khr: 'KHR',
|
|
528
|
+
Krw: 'KRW',
|
|
529
|
+
Kwd: 'KWD',
|
|
530
|
+
Kzt: 'KZT',
|
|
531
|
+
Lbp: 'LBP',
|
|
532
|
+
Lkr: 'LKR',
|
|
533
|
+
Ltl: 'LTL',
|
|
534
|
+
Lvl: 'LVL',
|
|
535
|
+
Mad: 'MAD',
|
|
536
|
+
Mdl: 'MDL',
|
|
537
|
+
Mga: 'MGA',
|
|
538
|
+
Mkd: 'MKD',
|
|
539
|
+
Mmk: 'MMK',
|
|
540
|
+
Mop: 'MOP',
|
|
541
|
+
Mur: 'MUR',
|
|
542
|
+
Mxn: 'MXN',
|
|
543
|
+
Myr: 'MYR',
|
|
544
|
+
Mzn: 'MZN',
|
|
545
|
+
Nad: 'NAD',
|
|
546
|
+
Ngn: 'NGN',
|
|
547
|
+
Nio: 'NIO',
|
|
548
|
+
Nok: 'NOK',
|
|
549
|
+
Npr: 'NPR',
|
|
550
|
+
Nzd: 'NZD',
|
|
551
|
+
Omr: 'OMR',
|
|
552
|
+
Pab: 'PAB',
|
|
553
|
+
Pen: 'PEN',
|
|
554
|
+
Php: 'PHP',
|
|
555
|
+
Pkr: 'PKR',
|
|
556
|
+
Pln: 'PLN',
|
|
557
|
+
Pyg: 'PYG',
|
|
558
|
+
Qar: 'QAR',
|
|
559
|
+
Ron: 'RON',
|
|
560
|
+
Rsd: 'RSD',
|
|
561
|
+
Rub: 'RUB',
|
|
562
|
+
Rwf: 'RWF',
|
|
563
|
+
Sar: 'SAR',
|
|
564
|
+
Sdg: 'SDG',
|
|
565
|
+
Sek: 'SEK',
|
|
566
|
+
Sgd: 'SGD',
|
|
567
|
+
Sos: 'SOS',
|
|
568
|
+
Syp: 'SYP',
|
|
569
|
+
Thb: 'THB',
|
|
570
|
+
Tnd: 'TND',
|
|
571
|
+
Top: 'TOP',
|
|
572
|
+
Try: 'TRY',
|
|
573
|
+
Ttd: 'TTD',
|
|
574
|
+
Twd: 'TWD',
|
|
575
|
+
Tzs: 'TZS',
|
|
576
|
+
Uah: 'UAH',
|
|
577
|
+
Ugx: 'UGX',
|
|
578
|
+
Uyu: 'UYU',
|
|
579
|
+
Uzs: 'UZS',
|
|
580
|
+
Vef: 'VEF',
|
|
581
|
+
Vnd: 'VND',
|
|
582
|
+
Xaf: 'XAF',
|
|
583
|
+
Xof: 'XOF',
|
|
584
|
+
Yer: 'YER',
|
|
585
|
+
Zar: 'ZAR',
|
|
586
|
+
Zmk: 'ZMK'
|
|
587
|
+
};
|
|
588
|
+
exports.MemberRoleEnum = {
|
|
589
|
+
Member: 'MEMBER',
|
|
590
|
+
Admin: 'ADMIN',
|
|
591
|
+
Deleted: 'DELETED'
|
|
592
|
+
};
|
|
593
|
+
exports.MemberStatusEnum = {
|
|
594
|
+
Registered: 'REGISTERED',
|
|
595
|
+
Invited: 'INVITED'
|
|
596
|
+
};
|
|
597
|
+
exports.MemberBaseRoleEnum = {
|
|
598
|
+
Member: 'MEMBER',
|
|
599
|
+
Admin: 'ADMIN',
|
|
600
|
+
Deleted: 'DELETED'
|
|
601
|
+
};
|
|
602
|
+
exports.MemberBaseStatusEnum = {
|
|
603
|
+
Registered: 'REGISTERED',
|
|
604
|
+
Invited: 'INVITED'
|
|
605
|
+
};
|
|
606
|
+
exports.MemberWithEventsRoleEnum = {
|
|
607
|
+
Member: 'MEMBER',
|
|
608
|
+
Admin: 'ADMIN',
|
|
609
|
+
Deleted: 'DELETED'
|
|
610
|
+
};
|
|
611
|
+
exports.MemberWithEventsStatusEnum = {
|
|
612
|
+
Registered: 'REGISTERED',
|
|
613
|
+
Invited: 'INVITED'
|
|
614
|
+
};
|
|
615
|
+
exports.MemberWithoutEventsRoleEnum = {
|
|
616
|
+
Member: 'MEMBER',
|
|
617
|
+
Admin: 'ADMIN',
|
|
618
|
+
Deleted: 'DELETED'
|
|
619
|
+
};
|
|
620
|
+
exports.MemberWithoutEventsStatusEnum = {
|
|
621
|
+
Registered: 'REGISTERED',
|
|
622
|
+
Invited: 'INVITED'
|
|
623
|
+
};
|
|
624
|
+
exports.OrderStatusEnum = {
|
|
625
|
+
Canceled: 'CANCELED',
|
|
626
|
+
Cart: 'CART',
|
|
627
|
+
Executed: 'EXECUTED',
|
|
628
|
+
Failed: 'FAILED',
|
|
629
|
+
PendingApproval: 'PENDING APPROVAL'
|
|
630
|
+
};
|
|
631
|
+
exports.OrderBaseStatusEnum = {
|
|
632
|
+
Canceled: 'CANCELED',
|
|
633
|
+
Cart: 'CART',
|
|
634
|
+
Executed: 'EXECUTED',
|
|
635
|
+
Failed: 'FAILED',
|
|
636
|
+
PendingApproval: 'PENDING APPROVAL'
|
|
637
|
+
};
|
|
638
|
+
exports.OrderBasePaymentChannelEnum = {
|
|
639
|
+
Ui: 'UI',
|
|
640
|
+
Api: 'API',
|
|
641
|
+
Embed: 'EMBED',
|
|
642
|
+
Decipher: 'DECIPHER',
|
|
643
|
+
Qualtrics: 'QUALTRICS',
|
|
644
|
+
Typeform: 'TYPEFORM',
|
|
645
|
+
SurveyMonkey: 'SURVEY MONKEY'
|
|
646
|
+
};
|
|
647
|
+
/**
|
|
648
|
+
* Execution status of a given order <table> <thead> <tr> <th> Status </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <code> CANCELED </code> </td> <td> The order and all of its rewards were canceled. </td> </tr> <tr> <td> <code> CART </code> </td> <td> The order has been created, but hasn\'t yet been processed. </td> </tr> <tr> <td> <code> EXECUTED </code> </td> <td> The order has been executed. Payment has been handled and rewards are being delivered (if applicable). </td> </tr> <tr> <td> <code> FAILED </code> </td> <td> The order could not be processed due to an error. E.g. due to insufficient funds in the account. </td> </tr> <tr> <td> <code> PENDING APPROVAL </code> </td> <td> The order has been created but needs approval to be executed. </td> </tr> </tbody> </table>
|
|
649
|
+
* @export
|
|
650
|
+
* @enum {string}
|
|
651
|
+
*/
|
|
652
|
+
exports.OrderStatus = {
|
|
653
|
+
Canceled: 'CANCELED',
|
|
654
|
+
Cart: 'CART',
|
|
655
|
+
Executed: 'EXECUTED',
|
|
656
|
+
Failed: 'FAILED',
|
|
657
|
+
PendingApproval: 'PENDING APPROVAL'
|
|
658
|
+
};
|
|
659
|
+
exports.OrderWithLinkStatusEnum = {
|
|
660
|
+
Canceled: 'CANCELED',
|
|
661
|
+
Cart: 'CART',
|
|
662
|
+
Executed: 'EXECUTED',
|
|
663
|
+
Failed: 'FAILED',
|
|
664
|
+
PendingApproval: 'PENDING APPROVAL'
|
|
665
|
+
};
|
|
666
|
+
exports.OrderWithoutLinkStatusEnum = {
|
|
667
|
+
Canceled: 'CANCELED',
|
|
668
|
+
Cart: 'CART',
|
|
669
|
+
Executed: 'EXECUTED',
|
|
670
|
+
Failed: 'FAILED',
|
|
671
|
+
PendingApproval: 'PENDING APPROVAL'
|
|
672
|
+
};
|
|
673
|
+
exports.OrganizationStatusEnum = {
|
|
674
|
+
Pending: 'PENDING',
|
|
675
|
+
Approved: 'APPROVED',
|
|
676
|
+
Rejected: 'REJECTED'
|
|
677
|
+
};
|
|
678
|
+
exports.PaymentDetailsChannelEnum = {
|
|
679
|
+
Ui: 'UI',
|
|
680
|
+
Api: 'API',
|
|
681
|
+
Embed: 'EMBED',
|
|
682
|
+
Decipher: 'DECIPHER',
|
|
683
|
+
Qualtrics: 'QUALTRICS',
|
|
684
|
+
Typeform: 'TYPEFORM',
|
|
685
|
+
SurveyMonkey: 'SURVEY MONKEY'
|
|
686
|
+
};
|
|
687
|
+
exports.ProductCategoryEnum = {
|
|
688
|
+
Ach: 'ach',
|
|
689
|
+
Charity: 'charity',
|
|
690
|
+
MerchantCard: 'merchant_card',
|
|
691
|
+
Paypal: 'paypal',
|
|
692
|
+
Venmo: 'venmo',
|
|
693
|
+
VisaCard: 'visa_card'
|
|
694
|
+
};
|
|
695
|
+
exports.ProductCurrencyCodesEnum = {
|
|
696
|
+
Usd: 'USD',
|
|
697
|
+
Cad: 'CAD',
|
|
698
|
+
Eur: 'EUR',
|
|
699
|
+
Aed: 'AED',
|
|
700
|
+
Afn: 'AFN',
|
|
701
|
+
All: 'ALL',
|
|
702
|
+
Amd: 'AMD',
|
|
703
|
+
Ars: 'ARS',
|
|
704
|
+
Aud: 'AUD',
|
|
705
|
+
Azn: 'AZN',
|
|
706
|
+
Bam: 'BAM',
|
|
707
|
+
Bdt: 'BDT',
|
|
708
|
+
Bgn: 'BGN',
|
|
709
|
+
Bhd: 'BHD',
|
|
710
|
+
Bif: 'BIF',
|
|
711
|
+
Bnd: 'BND',
|
|
712
|
+
Bob: 'BOB',
|
|
713
|
+
Brl: 'BRL',
|
|
714
|
+
Bwp: 'BWP',
|
|
715
|
+
Byr: 'BYR',
|
|
716
|
+
Bzd: 'BZD',
|
|
717
|
+
Cdf: 'CDF',
|
|
718
|
+
Chf: 'CHF',
|
|
719
|
+
Clp: 'CLP',
|
|
720
|
+
Cny: 'CNY',
|
|
721
|
+
Cop: 'COP',
|
|
722
|
+
Crc: 'CRC',
|
|
723
|
+
Cve: 'CVE',
|
|
724
|
+
Czk: 'CZK',
|
|
725
|
+
Djf: 'DJF',
|
|
726
|
+
Dkk: 'DKK',
|
|
727
|
+
Dop: 'DOP',
|
|
728
|
+
Dzd: 'DZD',
|
|
729
|
+
Eek: 'EEK',
|
|
730
|
+
Egp: 'EGP',
|
|
731
|
+
Ern: 'ERN',
|
|
732
|
+
Etb: 'ETB',
|
|
733
|
+
Gbp: 'GBP',
|
|
734
|
+
Gel: 'GEL',
|
|
735
|
+
Ghs: 'GHS',
|
|
736
|
+
Gnf: 'GNF',
|
|
737
|
+
Gtq: 'GTQ',
|
|
738
|
+
Hkd: 'HKD',
|
|
739
|
+
Hnl: 'HNL',
|
|
740
|
+
Hrk: 'HRK',
|
|
741
|
+
Huf: 'HUF',
|
|
742
|
+
Idr: 'IDR',
|
|
743
|
+
Ils: 'ILS',
|
|
744
|
+
Inr: 'INR',
|
|
745
|
+
Iqd: 'IQD',
|
|
746
|
+
Irr: 'IRR',
|
|
747
|
+
Isk: 'ISK',
|
|
748
|
+
Jmd: 'JMD',
|
|
749
|
+
Jod: 'JOD',
|
|
750
|
+
Jpy: 'JPY',
|
|
751
|
+
Kes: 'KES',
|
|
752
|
+
Khr: 'KHR',
|
|
753
|
+
Krw: 'KRW',
|
|
754
|
+
Kwd: 'KWD',
|
|
755
|
+
Kzt: 'KZT',
|
|
756
|
+
Lbp: 'LBP',
|
|
757
|
+
Lkr: 'LKR',
|
|
758
|
+
Ltl: 'LTL',
|
|
759
|
+
Lvl: 'LVL',
|
|
760
|
+
Mad: 'MAD',
|
|
761
|
+
Mdl: 'MDL',
|
|
762
|
+
Mga: 'MGA',
|
|
763
|
+
Mkd: 'MKD',
|
|
764
|
+
Mmk: 'MMK',
|
|
765
|
+
Mop: 'MOP',
|
|
766
|
+
Mur: 'MUR',
|
|
767
|
+
Mxn: 'MXN',
|
|
768
|
+
Myr: 'MYR',
|
|
769
|
+
Mzn: 'MZN',
|
|
770
|
+
Nad: 'NAD',
|
|
771
|
+
Ngn: 'NGN',
|
|
772
|
+
Nio: 'NIO',
|
|
773
|
+
Nok: 'NOK',
|
|
774
|
+
Npr: 'NPR',
|
|
775
|
+
Nzd: 'NZD',
|
|
776
|
+
Omr: 'OMR',
|
|
777
|
+
Pab: 'PAB',
|
|
778
|
+
Pen: 'PEN',
|
|
779
|
+
Php: 'PHP',
|
|
780
|
+
Pkr: 'PKR',
|
|
781
|
+
Pln: 'PLN',
|
|
782
|
+
Pyg: 'PYG',
|
|
783
|
+
Qar: 'QAR',
|
|
784
|
+
Ron: 'RON',
|
|
785
|
+
Rsd: 'RSD',
|
|
786
|
+
Rub: 'RUB',
|
|
787
|
+
Rwf: 'RWF',
|
|
788
|
+
Sar: 'SAR',
|
|
789
|
+
Sdg: 'SDG',
|
|
790
|
+
Sek: 'SEK',
|
|
791
|
+
Sgd: 'SGD',
|
|
792
|
+
Sos: 'SOS',
|
|
793
|
+
Syp: 'SYP',
|
|
794
|
+
Thb: 'THB',
|
|
795
|
+
Tnd: 'TND',
|
|
796
|
+
Top: 'TOP',
|
|
797
|
+
Try: 'TRY',
|
|
798
|
+
Ttd: 'TTD',
|
|
799
|
+
Twd: 'TWD',
|
|
800
|
+
Tzs: 'TZS',
|
|
801
|
+
Uah: 'UAH',
|
|
802
|
+
Ugx: 'UGX',
|
|
803
|
+
Uyu: 'UYU',
|
|
804
|
+
Uzs: 'UZS',
|
|
805
|
+
Vef: 'VEF',
|
|
806
|
+
Vnd: 'VND',
|
|
807
|
+
Xaf: 'XAF',
|
|
808
|
+
Xof: 'XOF',
|
|
809
|
+
Yer: 'YER',
|
|
810
|
+
Zar: 'ZAR',
|
|
811
|
+
Zmk: 'ZMK'
|
|
812
|
+
};
|
|
813
|
+
exports.RewardValueCurrencyCodeEnum = {
|
|
814
|
+
Usd: 'USD',
|
|
815
|
+
Cad: 'CAD',
|
|
816
|
+
Eur: 'EUR',
|
|
817
|
+
Aed: 'AED',
|
|
818
|
+
Afn: 'AFN',
|
|
819
|
+
All: 'ALL',
|
|
820
|
+
Amd: 'AMD',
|
|
821
|
+
Ars: 'ARS',
|
|
822
|
+
Aud: 'AUD',
|
|
823
|
+
Azn: 'AZN',
|
|
824
|
+
Bam: 'BAM',
|
|
825
|
+
Bdt: 'BDT',
|
|
826
|
+
Bgn: 'BGN',
|
|
827
|
+
Bhd: 'BHD',
|
|
828
|
+
Bif: 'BIF',
|
|
829
|
+
Bnd: 'BND',
|
|
830
|
+
Bob: 'BOB',
|
|
831
|
+
Brl: 'BRL',
|
|
832
|
+
Bwp: 'BWP',
|
|
833
|
+
Byr: 'BYR',
|
|
834
|
+
Bzd: 'BZD',
|
|
835
|
+
Cdf: 'CDF',
|
|
836
|
+
Chf: 'CHF',
|
|
837
|
+
Clp: 'CLP',
|
|
838
|
+
Cny: 'CNY',
|
|
839
|
+
Cop: 'COP',
|
|
840
|
+
Crc: 'CRC',
|
|
841
|
+
Cve: 'CVE',
|
|
842
|
+
Czk: 'CZK',
|
|
843
|
+
Djf: 'DJF',
|
|
844
|
+
Dkk: 'DKK',
|
|
845
|
+
Dop: 'DOP',
|
|
846
|
+
Dzd: 'DZD',
|
|
847
|
+
Eek: 'EEK',
|
|
848
|
+
Egp: 'EGP',
|
|
849
|
+
Ern: 'ERN',
|
|
850
|
+
Etb: 'ETB',
|
|
851
|
+
Gbp: 'GBP',
|
|
852
|
+
Gel: 'GEL',
|
|
853
|
+
Ghs: 'GHS',
|
|
854
|
+
Gnf: 'GNF',
|
|
855
|
+
Gtq: 'GTQ',
|
|
856
|
+
Hkd: 'HKD',
|
|
857
|
+
Hnl: 'HNL',
|
|
858
|
+
Hrk: 'HRK',
|
|
859
|
+
Huf: 'HUF',
|
|
860
|
+
Idr: 'IDR',
|
|
861
|
+
Ils: 'ILS',
|
|
862
|
+
Inr: 'INR',
|
|
863
|
+
Iqd: 'IQD',
|
|
864
|
+
Irr: 'IRR',
|
|
865
|
+
Isk: 'ISK',
|
|
866
|
+
Jmd: 'JMD',
|
|
867
|
+
Jod: 'JOD',
|
|
868
|
+
Jpy: 'JPY',
|
|
869
|
+
Kes: 'KES',
|
|
870
|
+
Khr: 'KHR',
|
|
871
|
+
Krw: 'KRW',
|
|
872
|
+
Kwd: 'KWD',
|
|
873
|
+
Kzt: 'KZT',
|
|
874
|
+
Lbp: 'LBP',
|
|
875
|
+
Lkr: 'LKR',
|
|
876
|
+
Ltl: 'LTL',
|
|
877
|
+
Lvl: 'LVL',
|
|
878
|
+
Mad: 'MAD',
|
|
879
|
+
Mdl: 'MDL',
|
|
880
|
+
Mga: 'MGA',
|
|
881
|
+
Mkd: 'MKD',
|
|
882
|
+
Mmk: 'MMK',
|
|
883
|
+
Mop: 'MOP',
|
|
884
|
+
Mur: 'MUR',
|
|
885
|
+
Mxn: 'MXN',
|
|
886
|
+
Myr: 'MYR',
|
|
887
|
+
Mzn: 'MZN',
|
|
888
|
+
Nad: 'NAD',
|
|
889
|
+
Ngn: 'NGN',
|
|
890
|
+
Nio: 'NIO',
|
|
891
|
+
Nok: 'NOK',
|
|
892
|
+
Npr: 'NPR',
|
|
893
|
+
Nzd: 'NZD',
|
|
894
|
+
Omr: 'OMR',
|
|
895
|
+
Pab: 'PAB',
|
|
896
|
+
Pen: 'PEN',
|
|
897
|
+
Php: 'PHP',
|
|
898
|
+
Pkr: 'PKR',
|
|
899
|
+
Pln: 'PLN',
|
|
900
|
+
Pyg: 'PYG',
|
|
901
|
+
Qar: 'QAR',
|
|
902
|
+
Ron: 'RON',
|
|
903
|
+
Rsd: 'RSD',
|
|
904
|
+
Rub: 'RUB',
|
|
905
|
+
Rwf: 'RWF',
|
|
906
|
+
Sar: 'SAR',
|
|
907
|
+
Sdg: 'SDG',
|
|
908
|
+
Sek: 'SEK',
|
|
909
|
+
Sgd: 'SGD',
|
|
910
|
+
Sos: 'SOS',
|
|
911
|
+
Syp: 'SYP',
|
|
912
|
+
Thb: 'THB',
|
|
913
|
+
Tnd: 'TND',
|
|
914
|
+
Top: 'TOP',
|
|
915
|
+
Try: 'TRY',
|
|
916
|
+
Ttd: 'TTD',
|
|
917
|
+
Twd: 'TWD',
|
|
918
|
+
Tzs: 'TZS',
|
|
919
|
+
Uah: 'UAH',
|
|
920
|
+
Ugx: 'UGX',
|
|
921
|
+
Uyu: 'UYU',
|
|
922
|
+
Uzs: 'UZS',
|
|
923
|
+
Vef: 'VEF',
|
|
924
|
+
Vnd: 'VND',
|
|
925
|
+
Xaf: 'XAF',
|
|
926
|
+
Xof: 'XOF',
|
|
927
|
+
Yer: 'YER',
|
|
928
|
+
Zar: 'ZAR',
|
|
929
|
+
Zmk: 'ZMK'
|
|
930
|
+
};
|
|
931
|
+
exports.RewardWithLinkDeliveryMethodEnum = {
|
|
932
|
+
Email: 'EMAIL',
|
|
933
|
+
Link: 'LINK',
|
|
934
|
+
Phone: 'PHONE'
|
|
935
|
+
};
|
|
936
|
+
exports.RewardWithLinkDeliveryStatusEnum = {
|
|
937
|
+
Scheduled: 'SCHEDULED',
|
|
938
|
+
Failed: 'FAILED',
|
|
939
|
+
Succeeded: 'SUCCEEDED',
|
|
940
|
+
Pending: 'PENDING'
|
|
941
|
+
};
|
|
942
|
+
exports.RewardWithoutLinkDeliveryMethodEnum = {
|
|
943
|
+
Email: 'EMAIL',
|
|
944
|
+
Link: 'LINK',
|
|
945
|
+
Phone: 'PHONE'
|
|
946
|
+
};
|
|
947
|
+
exports.RewardWithoutLinkDeliveryStatusEnum = {
|
|
948
|
+
Scheduled: 'SCHEDULED',
|
|
949
|
+
Failed: 'FAILED',
|
|
950
|
+
Succeeded: 'SUCCEEDED',
|
|
951
|
+
Pending: 'PENDING'
|
|
952
|
+
};
|
|
953
|
+
/**
|
|
954
|
+
* BalanceTransactionsApi - axios parameter creator
|
|
955
|
+
* @export
|
|
956
|
+
*/
|
|
957
|
+
const BalanceTransactionsApiAxiosParamCreator = function (configuration) {
|
|
958
|
+
return {
|
|
959
|
+
/**
|
|
960
|
+
* Fetch a list of all balance transactions on your account.
|
|
961
|
+
* @summary List balance transactions
|
|
962
|
+
* @param {number} [offset] Offsets the returned list by the given number of transactions. The returned transactions are ordered (and offsetted) by their creation date (DESC).
|
|
963
|
+
* @param {number} [limit] Limits the number of transactions listed. The default value is 10.
|
|
964
|
+
* @param {string} [createdAtGte] Only return results where the created_at field is greater than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
|
|
965
|
+
* @param {string} [createdAtLte] Only return results where the created_at field is less than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
|
|
966
|
+
* @param {*} [options] Override http request option.
|
|
967
|
+
* @throws {RequiredError}
|
|
968
|
+
*/
|
|
969
|
+
listBalanceTransactions: (offset, limit, createdAtGte, createdAtLte, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
970
|
+
const localVarPath = `/balance_transactions`;
|
|
971
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
972
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
973
|
+
let baseOptions;
|
|
974
|
+
if (configuration) {
|
|
975
|
+
baseOptions = configuration.baseOptions;
|
|
976
|
+
}
|
|
977
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
978
|
+
const localVarHeaderParameter = {};
|
|
979
|
+
const localVarQueryParameter = {};
|
|
980
|
+
// authentication BearerApiKey required
|
|
981
|
+
// http bearer authentication required
|
|
982
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
983
|
+
if (offset !== undefined) {
|
|
984
|
+
localVarQueryParameter['offset'] = offset;
|
|
985
|
+
}
|
|
986
|
+
if (limit !== undefined) {
|
|
987
|
+
localVarQueryParameter['limit'] = limit;
|
|
988
|
+
}
|
|
989
|
+
if (createdAtGte !== undefined) {
|
|
990
|
+
localVarQueryParameter['created_at[gte]'] = createdAtGte;
|
|
991
|
+
}
|
|
992
|
+
if (createdAtLte !== undefined) {
|
|
993
|
+
localVarQueryParameter['created_at[lte]'] = createdAtLte;
|
|
994
|
+
}
|
|
995
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
996
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
997
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
998
|
+
return {
|
|
999
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
1000
|
+
options: localVarRequestOptions,
|
|
1001
|
+
};
|
|
1002
|
+
}),
|
|
1003
|
+
};
|
|
1004
|
+
};
|
|
1005
|
+
exports.BalanceTransactionsApiAxiosParamCreator = BalanceTransactionsApiAxiosParamCreator;
|
|
1006
|
+
/**
|
|
1007
|
+
* BalanceTransactionsApi - functional programming interface
|
|
1008
|
+
* @export
|
|
1009
|
+
*/
|
|
1010
|
+
const BalanceTransactionsApiFp = function (configuration) {
|
|
1011
|
+
const localVarAxiosParamCreator = (0, exports.BalanceTransactionsApiAxiosParamCreator)(configuration);
|
|
1012
|
+
return {
|
|
1013
|
+
/**
|
|
1014
|
+
* Fetch a list of all balance transactions on your account.
|
|
1015
|
+
* @summary List balance transactions
|
|
1016
|
+
* @param {number} [offset] Offsets the returned list by the given number of transactions. The returned transactions are ordered (and offsetted) by their creation date (DESC).
|
|
1017
|
+
* @param {number} [limit] Limits the number of transactions listed. The default value is 10.
|
|
1018
|
+
* @param {string} [createdAtGte] Only return results where the created_at field is greater than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
|
|
1019
|
+
* @param {string} [createdAtLte] Only return results where the created_at field is less than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
|
|
1020
|
+
* @param {*} [options] Override http request option.
|
|
1021
|
+
* @throws {RequiredError}
|
|
1022
|
+
*/
|
|
1023
|
+
listBalanceTransactions(offset, limit, createdAtGte, createdAtLte, options) {
|
|
1024
|
+
var _a, _b, _c;
|
|
1025
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1026
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listBalanceTransactions(offset, limit, createdAtGte, createdAtLte, options);
|
|
1027
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
1028
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['BalanceTransactionsApi.listBalanceTransactions']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
1029
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
1030
|
+
});
|
|
1031
|
+
},
|
|
1032
|
+
};
|
|
1033
|
+
};
|
|
1034
|
+
exports.BalanceTransactionsApiFp = BalanceTransactionsApiFp;
|
|
1035
|
+
/**
|
|
1036
|
+
* BalanceTransactionsApi - factory interface
|
|
1037
|
+
* @export
|
|
1038
|
+
*/
|
|
1039
|
+
const BalanceTransactionsApiFactory = function (configuration, basePath, axios) {
|
|
1040
|
+
const localVarFp = (0, exports.BalanceTransactionsApiFp)(configuration);
|
|
1041
|
+
return {
|
|
1042
|
+
/**
|
|
1043
|
+
* Fetch a list of all balance transactions on your account.
|
|
1044
|
+
* @summary List balance transactions
|
|
1045
|
+
* @param {number} [offset] Offsets the returned list by the given number of transactions. The returned transactions are ordered (and offsetted) by their creation date (DESC).
|
|
1046
|
+
* @param {number} [limit] Limits the number of transactions listed. The default value is 10.
|
|
1047
|
+
* @param {string} [createdAtGte] Only return results where the created_at field is greater than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
|
|
1048
|
+
* @param {string} [createdAtLte] Only return results where the created_at field is less than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
|
|
1049
|
+
* @param {*} [options] Override http request option.
|
|
1050
|
+
* @throws {RequiredError}
|
|
1051
|
+
*/
|
|
1052
|
+
listBalanceTransactions(offset, limit, createdAtGte, createdAtLte, options) {
|
|
1053
|
+
return localVarFp.listBalanceTransactions(offset, limit, createdAtGte, createdAtLte, options).then((request) => request(axios, basePath));
|
|
1054
|
+
},
|
|
1055
|
+
};
|
|
1056
|
+
};
|
|
1057
|
+
exports.BalanceTransactionsApiFactory = BalanceTransactionsApiFactory;
|
|
1058
|
+
/**
|
|
1059
|
+
* BalanceTransactionsApi - object-oriented interface
|
|
1060
|
+
* @export
|
|
1061
|
+
* @class BalanceTransactionsApi
|
|
1062
|
+
* @extends {BaseAPI}
|
|
1063
|
+
*/
|
|
1064
|
+
class BalanceTransactionsApi extends base_1.BaseAPI {
|
|
1065
|
+
/**
|
|
1066
|
+
* Fetch a list of all balance transactions on your account.
|
|
1067
|
+
* @summary List balance transactions
|
|
1068
|
+
* @param {number} [offset] Offsets the returned list by the given number of transactions. The returned transactions are ordered (and offsetted) by their creation date (DESC).
|
|
1069
|
+
* @param {number} [limit] Limits the number of transactions listed. The default value is 10.
|
|
1070
|
+
* @param {string} [createdAtGte] Only return results where the created_at field is greater than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
|
|
1071
|
+
* @param {string} [createdAtLte] Only return results where the created_at field is less than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
|
|
1072
|
+
* @param {*} [options] Override http request option.
|
|
1073
|
+
* @throws {RequiredError}
|
|
1074
|
+
* @memberof BalanceTransactionsApi
|
|
1075
|
+
*/
|
|
1076
|
+
listBalanceTransactions(offset, limit, createdAtGte, createdAtLte, options) {
|
|
1077
|
+
return (0, exports.BalanceTransactionsApiFp)(this.configuration).listBalanceTransactions(offset, limit, createdAtGte, createdAtLte, options).then((request) => request(this.axios, this.basePath));
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
exports.BalanceTransactionsApi = BalanceTransactionsApi;
|
|
1081
|
+
/**
|
|
1082
|
+
* CampaignsApi - axios parameter creator
|
|
1083
|
+
* @export
|
|
1084
|
+
*/
|
|
1085
|
+
const CampaignsApiAxiosParamCreator = function (configuration) {
|
|
1086
|
+
return {
|
|
1087
|
+
/**
|
|
1088
|
+
* Retrieve a campaign, identified by the given `id` in the URL
|
|
1089
|
+
* @summary Retrieve campaign
|
|
1090
|
+
* @param {string} id ID of the campaign that should be retrieved
|
|
1091
|
+
* @param {*} [options] Override http request option.
|
|
1092
|
+
* @throws {RequiredError}
|
|
1093
|
+
*/
|
|
1094
|
+
getCampaign: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1095
|
+
// verify required parameter 'id' is not null or undefined
|
|
1096
|
+
(0, common_1.assertParamExists)('getCampaign', 'id', id);
|
|
1097
|
+
const localVarPath = `/campaigns/{id}`
|
|
1098
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
1099
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1100
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
1101
|
+
let baseOptions;
|
|
1102
|
+
if (configuration) {
|
|
1103
|
+
baseOptions = configuration.baseOptions;
|
|
1104
|
+
}
|
|
1105
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
1106
|
+
const localVarHeaderParameter = {};
|
|
1107
|
+
const localVarQueryParameter = {};
|
|
1108
|
+
// authentication BearerApiKey required
|
|
1109
|
+
// http bearer authentication required
|
|
1110
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
1111
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
1112
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1113
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1114
|
+
return {
|
|
1115
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
1116
|
+
options: localVarRequestOptions,
|
|
1117
|
+
};
|
|
1118
|
+
}),
|
|
1119
|
+
/**
|
|
1120
|
+
* Retrieve a list of all campaigns created in your account
|
|
1121
|
+
* @summary List campaigns
|
|
1122
|
+
* @param {*} [options] Override http request option.
|
|
1123
|
+
* @throws {RequiredError}
|
|
1124
|
+
*/
|
|
1125
|
+
listCampaigns: (options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1126
|
+
const localVarPath = `/campaigns`;
|
|
1127
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1128
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
1129
|
+
let baseOptions;
|
|
1130
|
+
if (configuration) {
|
|
1131
|
+
baseOptions = configuration.baseOptions;
|
|
1132
|
+
}
|
|
1133
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
1134
|
+
const localVarHeaderParameter = {};
|
|
1135
|
+
const localVarQueryParameter = {};
|
|
1136
|
+
// authentication BearerApiKey required
|
|
1137
|
+
// http bearer authentication required
|
|
1138
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
1139
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
1140
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1141
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1142
|
+
return {
|
|
1143
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
1144
|
+
options: localVarRequestOptions,
|
|
1145
|
+
};
|
|
1146
|
+
}),
|
|
1147
|
+
};
|
|
1148
|
+
};
|
|
1149
|
+
exports.CampaignsApiAxiosParamCreator = CampaignsApiAxiosParamCreator;
|
|
1150
|
+
/**
|
|
1151
|
+
* CampaignsApi - functional programming interface
|
|
1152
|
+
* @export
|
|
1153
|
+
*/
|
|
1154
|
+
const CampaignsApiFp = function (configuration) {
|
|
1155
|
+
const localVarAxiosParamCreator = (0, exports.CampaignsApiAxiosParamCreator)(configuration);
|
|
1156
|
+
return {
|
|
1157
|
+
/**
|
|
1158
|
+
* Retrieve a campaign, identified by the given `id` in the URL
|
|
1159
|
+
* @summary Retrieve campaign
|
|
1160
|
+
* @param {string} id ID of the campaign that should be retrieved
|
|
1161
|
+
* @param {*} [options] Override http request option.
|
|
1162
|
+
* @throws {RequiredError}
|
|
1163
|
+
*/
|
|
1164
|
+
getCampaign(id, options) {
|
|
1165
|
+
var _a, _b, _c;
|
|
1166
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1167
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getCampaign(id, options);
|
|
1168
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
1169
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['CampaignsApi.getCampaign']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
1170
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
1171
|
+
});
|
|
1172
|
+
},
|
|
1173
|
+
/**
|
|
1174
|
+
* Retrieve a list of all campaigns created in your account
|
|
1175
|
+
* @summary List campaigns
|
|
1176
|
+
* @param {*} [options] Override http request option.
|
|
1177
|
+
* @throws {RequiredError}
|
|
1178
|
+
*/
|
|
1179
|
+
listCampaigns(options) {
|
|
1180
|
+
var _a, _b, _c;
|
|
1181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1182
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listCampaigns(options);
|
|
1183
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
1184
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['CampaignsApi.listCampaigns']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
1185
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
1186
|
+
});
|
|
1187
|
+
},
|
|
1188
|
+
};
|
|
1189
|
+
};
|
|
1190
|
+
exports.CampaignsApiFp = CampaignsApiFp;
|
|
1191
|
+
/**
|
|
1192
|
+
* CampaignsApi - factory interface
|
|
1193
|
+
* @export
|
|
1194
|
+
*/
|
|
1195
|
+
const CampaignsApiFactory = function (configuration, basePath, axios) {
|
|
1196
|
+
const localVarFp = (0, exports.CampaignsApiFp)(configuration);
|
|
1197
|
+
return {
|
|
1198
|
+
/**
|
|
1199
|
+
* Retrieve a campaign, identified by the given `id` in the URL
|
|
1200
|
+
* @summary Retrieve campaign
|
|
1201
|
+
* @param {string} id ID of the campaign that should be retrieved
|
|
1202
|
+
* @param {*} [options] Override http request option.
|
|
1203
|
+
* @throws {RequiredError}
|
|
1204
|
+
*/
|
|
1205
|
+
getCampaign(id, options) {
|
|
1206
|
+
return localVarFp.getCampaign(id, options).then((request) => request(axios, basePath));
|
|
1207
|
+
},
|
|
1208
|
+
/**
|
|
1209
|
+
* Retrieve a list of all campaigns created in your account
|
|
1210
|
+
* @summary List campaigns
|
|
1211
|
+
* @param {*} [options] Override http request option.
|
|
1212
|
+
* @throws {RequiredError}
|
|
1213
|
+
*/
|
|
1214
|
+
listCampaigns(options) {
|
|
1215
|
+
return localVarFp.listCampaigns(options).then((request) => request(axios, basePath));
|
|
1216
|
+
},
|
|
1217
|
+
};
|
|
1218
|
+
};
|
|
1219
|
+
exports.CampaignsApiFactory = CampaignsApiFactory;
|
|
1220
|
+
/**
|
|
1221
|
+
* CampaignsApi - object-oriented interface
|
|
1222
|
+
* @export
|
|
1223
|
+
* @class CampaignsApi
|
|
1224
|
+
* @extends {BaseAPI}
|
|
1225
|
+
*/
|
|
1226
|
+
class CampaignsApi extends base_1.BaseAPI {
|
|
1227
|
+
/**
|
|
1228
|
+
* Retrieve a campaign, identified by the given `id` in the URL
|
|
1229
|
+
* @summary Retrieve campaign
|
|
1230
|
+
* @param {string} id ID of the campaign that should be retrieved
|
|
1231
|
+
* @param {*} [options] Override http request option.
|
|
1232
|
+
* @throws {RequiredError}
|
|
1233
|
+
* @memberof CampaignsApi
|
|
1234
|
+
*/
|
|
1235
|
+
getCampaign(id, options) {
|
|
1236
|
+
return (0, exports.CampaignsApiFp)(this.configuration).getCampaign(id, options).then((request) => request(this.axios, this.basePath));
|
|
1237
|
+
}
|
|
1238
|
+
/**
|
|
1239
|
+
* Retrieve a list of all campaigns created in your account
|
|
1240
|
+
* @summary List campaigns
|
|
1241
|
+
* @param {*} [options] Override http request option.
|
|
1242
|
+
* @throws {RequiredError}
|
|
1243
|
+
* @memberof CampaignsApi
|
|
1244
|
+
*/
|
|
1245
|
+
listCampaigns(options) {
|
|
1246
|
+
return (0, exports.CampaignsApiFp)(this.configuration).listCampaigns(options).then((request) => request(this.axios, this.basePath));
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
exports.CampaignsApi = CampaignsApi;
|
|
1250
|
+
/**
|
|
1251
|
+
* FieldsApi - axios parameter creator
|
|
1252
|
+
* @export
|
|
1253
|
+
*/
|
|
1254
|
+
const FieldsApiAxiosParamCreator = function (configuration) {
|
|
1255
|
+
return {
|
|
1256
|
+
/**
|
|
1257
|
+
* For reporting and analytics purposes, custom fields can be associated with rewards generated through the API. Custom fields must be first added by members of your admin team through the Tremendous Dashboard.
|
|
1258
|
+
* @summary List fields
|
|
1259
|
+
* @param {*} [options] Override http request option.
|
|
1260
|
+
* @throws {RequiredError}
|
|
1261
|
+
*/
|
|
1262
|
+
listFields: (options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1263
|
+
const localVarPath = `/fields`;
|
|
1264
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1265
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
1266
|
+
let baseOptions;
|
|
1267
|
+
if (configuration) {
|
|
1268
|
+
baseOptions = configuration.baseOptions;
|
|
1269
|
+
}
|
|
1270
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
1271
|
+
const localVarHeaderParameter = {};
|
|
1272
|
+
const localVarQueryParameter = {};
|
|
1273
|
+
// authentication BearerApiKey required
|
|
1274
|
+
// http bearer authentication required
|
|
1275
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
1276
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
1277
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1278
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1279
|
+
return {
|
|
1280
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
1281
|
+
options: localVarRequestOptions,
|
|
1282
|
+
};
|
|
1283
|
+
}),
|
|
1284
|
+
};
|
|
1285
|
+
};
|
|
1286
|
+
exports.FieldsApiAxiosParamCreator = FieldsApiAxiosParamCreator;
|
|
1287
|
+
/**
|
|
1288
|
+
* FieldsApi - functional programming interface
|
|
1289
|
+
* @export
|
|
1290
|
+
*/
|
|
1291
|
+
const FieldsApiFp = function (configuration) {
|
|
1292
|
+
const localVarAxiosParamCreator = (0, exports.FieldsApiAxiosParamCreator)(configuration);
|
|
1293
|
+
return {
|
|
1294
|
+
/**
|
|
1295
|
+
* For reporting and analytics purposes, custom fields can be associated with rewards generated through the API. Custom fields must be first added by members of your admin team through the Tremendous Dashboard.
|
|
1296
|
+
* @summary List fields
|
|
1297
|
+
* @param {*} [options] Override http request option.
|
|
1298
|
+
* @throws {RequiredError}
|
|
1299
|
+
*/
|
|
1300
|
+
listFields(options) {
|
|
1301
|
+
var _a, _b, _c;
|
|
1302
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1303
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listFields(options);
|
|
1304
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
1305
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['FieldsApi.listFields']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
1306
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
1307
|
+
});
|
|
1308
|
+
},
|
|
1309
|
+
};
|
|
1310
|
+
};
|
|
1311
|
+
exports.FieldsApiFp = FieldsApiFp;
|
|
1312
|
+
/**
|
|
1313
|
+
* FieldsApi - factory interface
|
|
1314
|
+
* @export
|
|
1315
|
+
*/
|
|
1316
|
+
const FieldsApiFactory = function (configuration, basePath, axios) {
|
|
1317
|
+
const localVarFp = (0, exports.FieldsApiFp)(configuration);
|
|
1318
|
+
return {
|
|
1319
|
+
/**
|
|
1320
|
+
* For reporting and analytics purposes, custom fields can be associated with rewards generated through the API. Custom fields must be first added by members of your admin team through the Tremendous Dashboard.
|
|
1321
|
+
* @summary List fields
|
|
1322
|
+
* @param {*} [options] Override http request option.
|
|
1323
|
+
* @throws {RequiredError}
|
|
1324
|
+
*/
|
|
1325
|
+
listFields(options) {
|
|
1326
|
+
return localVarFp.listFields(options).then((request) => request(axios, basePath));
|
|
1327
|
+
},
|
|
1328
|
+
};
|
|
1329
|
+
};
|
|
1330
|
+
exports.FieldsApiFactory = FieldsApiFactory;
|
|
1331
|
+
/**
|
|
1332
|
+
* FieldsApi - object-oriented interface
|
|
1333
|
+
* @export
|
|
1334
|
+
* @class FieldsApi
|
|
1335
|
+
* @extends {BaseAPI}
|
|
1336
|
+
*/
|
|
1337
|
+
class FieldsApi extends base_1.BaseAPI {
|
|
1338
|
+
/**
|
|
1339
|
+
* For reporting and analytics purposes, custom fields can be associated with rewards generated through the API. Custom fields must be first added by members of your admin team through the Tremendous Dashboard.
|
|
1340
|
+
* @summary List fields
|
|
1341
|
+
* @param {*} [options] Override http request option.
|
|
1342
|
+
* @throws {RequiredError}
|
|
1343
|
+
* @memberof FieldsApi
|
|
1344
|
+
*/
|
|
1345
|
+
listFields(options) {
|
|
1346
|
+
return (0, exports.FieldsApiFp)(this.configuration).listFields(options).then((request) => request(this.axios, this.basePath));
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
exports.FieldsApi = FieldsApi;
|
|
1350
|
+
/**
|
|
1351
|
+
* FundingSourcesApi - axios parameter creator
|
|
1352
|
+
* @export
|
|
1353
|
+
*/
|
|
1354
|
+
const FundingSourcesApiAxiosParamCreator = function (configuration) {
|
|
1355
|
+
return {
|
|
1356
|
+
/**
|
|
1357
|
+
* Retrieve a funding source, identified by the given `id` in the URL
|
|
1358
|
+
* @summary Retrieve funding source
|
|
1359
|
+
* @param {string} id ID of the funding source that should be retrieved
|
|
1360
|
+
* @param {*} [options] Override http request option.
|
|
1361
|
+
* @throws {RequiredError}
|
|
1362
|
+
*/
|
|
1363
|
+
getFundingSource: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1364
|
+
// verify required parameter 'id' is not null or undefined
|
|
1365
|
+
(0, common_1.assertParamExists)('getFundingSource', 'id', id);
|
|
1366
|
+
const localVarPath = `/funding_sources/{id}`
|
|
1367
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
1368
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1369
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
1370
|
+
let baseOptions;
|
|
1371
|
+
if (configuration) {
|
|
1372
|
+
baseOptions = configuration.baseOptions;
|
|
1373
|
+
}
|
|
1374
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
1375
|
+
const localVarHeaderParameter = {};
|
|
1376
|
+
const localVarQueryParameter = {};
|
|
1377
|
+
// authentication BearerApiKey required
|
|
1378
|
+
// http bearer authentication required
|
|
1379
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
1380
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
1381
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1382
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1383
|
+
return {
|
|
1384
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
1385
|
+
options: localVarRequestOptions,
|
|
1386
|
+
};
|
|
1387
|
+
}),
|
|
1388
|
+
/**
|
|
1389
|
+
* Retrieve a list of all funding sources available for ordering through the API in your organization\'s account.
|
|
1390
|
+
* @summary List funding sources
|
|
1391
|
+
* @param {*} [options] Override http request option.
|
|
1392
|
+
* @throws {RequiredError}
|
|
1393
|
+
*/
|
|
1394
|
+
listFundingSources: (options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1395
|
+
const localVarPath = `/funding_sources`;
|
|
1396
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1397
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
1398
|
+
let baseOptions;
|
|
1399
|
+
if (configuration) {
|
|
1400
|
+
baseOptions = configuration.baseOptions;
|
|
1401
|
+
}
|
|
1402
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
1403
|
+
const localVarHeaderParameter = {};
|
|
1404
|
+
const localVarQueryParameter = {};
|
|
1405
|
+
// authentication BearerApiKey required
|
|
1406
|
+
// http bearer authentication required
|
|
1407
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
1408
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
1409
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1410
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1411
|
+
return {
|
|
1412
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
1413
|
+
options: localVarRequestOptions,
|
|
1414
|
+
};
|
|
1415
|
+
}),
|
|
1416
|
+
};
|
|
1417
|
+
};
|
|
1418
|
+
exports.FundingSourcesApiAxiosParamCreator = FundingSourcesApiAxiosParamCreator;
|
|
1419
|
+
/**
|
|
1420
|
+
* FundingSourcesApi - functional programming interface
|
|
1421
|
+
* @export
|
|
1422
|
+
*/
|
|
1423
|
+
const FundingSourcesApiFp = function (configuration) {
|
|
1424
|
+
const localVarAxiosParamCreator = (0, exports.FundingSourcesApiAxiosParamCreator)(configuration);
|
|
1425
|
+
return {
|
|
1426
|
+
/**
|
|
1427
|
+
* Retrieve a funding source, identified by the given `id` in the URL
|
|
1428
|
+
* @summary Retrieve funding source
|
|
1429
|
+
* @param {string} id ID of the funding source that should be retrieved
|
|
1430
|
+
* @param {*} [options] Override http request option.
|
|
1431
|
+
* @throws {RequiredError}
|
|
1432
|
+
*/
|
|
1433
|
+
getFundingSource(id, options) {
|
|
1434
|
+
var _a, _b, _c;
|
|
1435
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1436
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getFundingSource(id, options);
|
|
1437
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
1438
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['FundingSourcesApi.getFundingSource']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
1439
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
1440
|
+
});
|
|
1441
|
+
},
|
|
1442
|
+
/**
|
|
1443
|
+
* Retrieve a list of all funding sources available for ordering through the API in your organization\'s account.
|
|
1444
|
+
* @summary List funding sources
|
|
1445
|
+
* @param {*} [options] Override http request option.
|
|
1446
|
+
* @throws {RequiredError}
|
|
1447
|
+
*/
|
|
1448
|
+
listFundingSources(options) {
|
|
1449
|
+
var _a, _b, _c;
|
|
1450
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1451
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listFundingSources(options);
|
|
1452
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
1453
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['FundingSourcesApi.listFundingSources']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
1454
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
1455
|
+
});
|
|
1456
|
+
},
|
|
1457
|
+
};
|
|
1458
|
+
};
|
|
1459
|
+
exports.FundingSourcesApiFp = FundingSourcesApiFp;
|
|
1460
|
+
/**
|
|
1461
|
+
* FundingSourcesApi - factory interface
|
|
1462
|
+
* @export
|
|
1463
|
+
*/
|
|
1464
|
+
const FundingSourcesApiFactory = function (configuration, basePath, axios) {
|
|
1465
|
+
const localVarFp = (0, exports.FundingSourcesApiFp)(configuration);
|
|
1466
|
+
return {
|
|
1467
|
+
/**
|
|
1468
|
+
* Retrieve a funding source, identified by the given `id` in the URL
|
|
1469
|
+
* @summary Retrieve funding source
|
|
1470
|
+
* @param {string} id ID of the funding source that should be retrieved
|
|
1471
|
+
* @param {*} [options] Override http request option.
|
|
1472
|
+
* @throws {RequiredError}
|
|
1473
|
+
*/
|
|
1474
|
+
getFundingSource(id, options) {
|
|
1475
|
+
return localVarFp.getFundingSource(id, options).then((request) => request(axios, basePath));
|
|
1476
|
+
},
|
|
1477
|
+
/**
|
|
1478
|
+
* Retrieve a list of all funding sources available for ordering through the API in your organization\'s account.
|
|
1479
|
+
* @summary List funding sources
|
|
1480
|
+
* @param {*} [options] Override http request option.
|
|
1481
|
+
* @throws {RequiredError}
|
|
1482
|
+
*/
|
|
1483
|
+
listFundingSources(options) {
|
|
1484
|
+
return localVarFp.listFundingSources(options).then((request) => request(axios, basePath));
|
|
1485
|
+
},
|
|
1486
|
+
};
|
|
1487
|
+
};
|
|
1488
|
+
exports.FundingSourcesApiFactory = FundingSourcesApiFactory;
|
|
1489
|
+
/**
|
|
1490
|
+
* FundingSourcesApi - object-oriented interface
|
|
1491
|
+
* @export
|
|
1492
|
+
* @class FundingSourcesApi
|
|
1493
|
+
* @extends {BaseAPI}
|
|
1494
|
+
*/
|
|
1495
|
+
class FundingSourcesApi extends base_1.BaseAPI {
|
|
1496
|
+
/**
|
|
1497
|
+
* Retrieve a funding source, identified by the given `id` in the URL
|
|
1498
|
+
* @summary Retrieve funding source
|
|
1499
|
+
* @param {string} id ID of the funding source that should be retrieved
|
|
1500
|
+
* @param {*} [options] Override http request option.
|
|
1501
|
+
* @throws {RequiredError}
|
|
1502
|
+
* @memberof FundingSourcesApi
|
|
1503
|
+
*/
|
|
1504
|
+
getFundingSource(id, options) {
|
|
1505
|
+
return (0, exports.FundingSourcesApiFp)(this.configuration).getFundingSource(id, options).then((request) => request(this.axios, this.basePath));
|
|
1506
|
+
}
|
|
1507
|
+
/**
|
|
1508
|
+
* Retrieve a list of all funding sources available for ordering through the API in your organization\'s account.
|
|
1509
|
+
* @summary List funding sources
|
|
1510
|
+
* @param {*} [options] Override http request option.
|
|
1511
|
+
* @throws {RequiredError}
|
|
1512
|
+
* @memberof FundingSourcesApi
|
|
1513
|
+
*/
|
|
1514
|
+
listFundingSources(options) {
|
|
1515
|
+
return (0, exports.FundingSourcesApiFp)(this.configuration).listFundingSources(options).then((request) => request(this.axios, this.basePath));
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
exports.FundingSourcesApi = FundingSourcesApi;
|
|
1519
|
+
/**
|
|
1520
|
+
* InvoicesApi - axios parameter creator
|
|
1521
|
+
* @export
|
|
1522
|
+
*/
|
|
1523
|
+
const InvoicesApiAxiosParamCreator = function (configuration) {
|
|
1524
|
+
return {
|
|
1525
|
+
/**
|
|
1526
|
+
* Creating an invoice is the way for your organization to fund your account\'s balance. 1. Create an invoice 2. Pay the invoice 3. Funds get added to your account\'s balance ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">po_number</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference to the purchase order number within your organization</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">amount</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the invoice in USD</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">memo</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>A note to be included in the invoice. This is for your internal use and will not be visible to the recipient.</p> </td></tr> </tbody> </table> </div>
|
|
1527
|
+
* @summary Create invoice
|
|
1528
|
+
* @param {CreateInvoiceRequest} createInvoiceRequest Invoice details
|
|
1529
|
+
* @param {*} [options] Override http request option.
|
|
1530
|
+
* @throws {RequiredError}
|
|
1531
|
+
*/
|
|
1532
|
+
createInvoice: (createInvoiceRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1533
|
+
// verify required parameter 'createInvoiceRequest' is not null or undefined
|
|
1534
|
+
(0, common_1.assertParamExists)('createInvoice', 'createInvoiceRequest', createInvoiceRequest);
|
|
1535
|
+
const localVarPath = `/invoices`;
|
|
1536
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1537
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
1538
|
+
let baseOptions;
|
|
1539
|
+
if (configuration) {
|
|
1540
|
+
baseOptions = configuration.baseOptions;
|
|
1541
|
+
}
|
|
1542
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
1543
|
+
const localVarHeaderParameter = {};
|
|
1544
|
+
const localVarQueryParameter = {};
|
|
1545
|
+
// authentication BearerApiKey required
|
|
1546
|
+
// http bearer authentication required
|
|
1547
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
1548
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1549
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
1550
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1551
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1552
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createInvoiceRequest, localVarRequestOptions, configuration);
|
|
1553
|
+
return {
|
|
1554
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
1555
|
+
options: localVarRequestOptions,
|
|
1556
|
+
};
|
|
1557
|
+
}),
|
|
1558
|
+
/**
|
|
1559
|
+
* Removes an invoice. This has no further consequences but is a rather cosmetic operation.
|
|
1560
|
+
* @summary Delete invoice
|
|
1561
|
+
* @param {string} id ID of the invoice that should be retrieved
|
|
1562
|
+
* @param {*} [options] Override http request option.
|
|
1563
|
+
* @throws {RequiredError}
|
|
1564
|
+
*/
|
|
1565
|
+
deleteInvoices: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1566
|
+
// verify required parameter 'id' is not null or undefined
|
|
1567
|
+
(0, common_1.assertParamExists)('deleteInvoices', 'id', id);
|
|
1568
|
+
const localVarPath = `/invoices/{id}`
|
|
1569
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
1570
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1571
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
1572
|
+
let baseOptions;
|
|
1573
|
+
if (configuration) {
|
|
1574
|
+
baseOptions = configuration.baseOptions;
|
|
1575
|
+
}
|
|
1576
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
|
|
1577
|
+
const localVarHeaderParameter = {};
|
|
1578
|
+
const localVarQueryParameter = {};
|
|
1579
|
+
// authentication BearerApiKey required
|
|
1580
|
+
// http bearer authentication required
|
|
1581
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
1582
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
1583
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1584
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1585
|
+
return {
|
|
1586
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
1587
|
+
options: localVarRequestOptions,
|
|
1588
|
+
};
|
|
1589
|
+
}),
|
|
1590
|
+
/**
|
|
1591
|
+
* Generates a CSV version for an invoice listing the associated rewards and orders
|
|
1592
|
+
* @summary Retrieve invoice as CSV
|
|
1593
|
+
* @param {string} id ID of the Invoice for that the CSV should be generated
|
|
1594
|
+
* @param {*} [options] Override http request option.
|
|
1595
|
+
* @throws {RequiredError}
|
|
1596
|
+
*/
|
|
1597
|
+
downloadInvoiceCsv: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1598
|
+
// verify required parameter 'id' is not null or undefined
|
|
1599
|
+
(0, common_1.assertParamExists)('downloadInvoiceCsv', 'id', id);
|
|
1600
|
+
const localVarPath = `/invoices/{id}/csv`
|
|
1601
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
1602
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1603
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
1604
|
+
let baseOptions;
|
|
1605
|
+
if (configuration) {
|
|
1606
|
+
baseOptions = configuration.baseOptions;
|
|
1607
|
+
}
|
|
1608
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
1609
|
+
const localVarHeaderParameter = {};
|
|
1610
|
+
const localVarQueryParameter = {};
|
|
1611
|
+
// authentication BearerApiKey required
|
|
1612
|
+
// http bearer authentication required
|
|
1613
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
1614
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
1615
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1616
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1617
|
+
return {
|
|
1618
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
1619
|
+
options: localVarRequestOptions,
|
|
1620
|
+
};
|
|
1621
|
+
}),
|
|
1622
|
+
/**
|
|
1623
|
+
* Generates a PDF version for an invoice
|
|
1624
|
+
* @summary Retrieve invoice as PDF
|
|
1625
|
+
* @param {string} id ID of the Invoice for that the PDF should be generated
|
|
1626
|
+
* @param {*} [options] Override http request option.
|
|
1627
|
+
* @throws {RequiredError}
|
|
1628
|
+
*/
|
|
1629
|
+
downloadInvoicePdf: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1630
|
+
// verify required parameter 'id' is not null or undefined
|
|
1631
|
+
(0, common_1.assertParamExists)('downloadInvoicePdf', 'id', id);
|
|
1632
|
+
const localVarPath = `/invoices/{id}/pdf`
|
|
1633
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
1634
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1635
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
1636
|
+
let baseOptions;
|
|
1637
|
+
if (configuration) {
|
|
1638
|
+
baseOptions = configuration.baseOptions;
|
|
1639
|
+
}
|
|
1640
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
1641
|
+
const localVarHeaderParameter = {};
|
|
1642
|
+
const localVarQueryParameter = {};
|
|
1643
|
+
// authentication BearerApiKey required
|
|
1644
|
+
// http bearer authentication required
|
|
1645
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
1646
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
1647
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1648
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1649
|
+
return {
|
|
1650
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
1651
|
+
options: localVarRequestOptions,
|
|
1652
|
+
};
|
|
1653
|
+
}),
|
|
1654
|
+
/**
|
|
1655
|
+
* Retrieve an invoice, identified by the given `id` in the URL > 📘 Deleted Invoices > > This endpoint can be used to retrieve details on deleted invoices > that the list of invoices omits.
|
|
1656
|
+
* @summary Retrieve invoice
|
|
1657
|
+
* @param {string} id ID of the invoice that should be retrieved
|
|
1658
|
+
* @param {*} [options] Override http request option.
|
|
1659
|
+
* @throws {RequiredError}
|
|
1660
|
+
*/
|
|
1661
|
+
getInvoice: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1662
|
+
// verify required parameter 'id' is not null or undefined
|
|
1663
|
+
(0, common_1.assertParamExists)('getInvoice', 'id', id);
|
|
1664
|
+
const localVarPath = `/invoices/{id}`
|
|
1665
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
1666
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1667
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
1668
|
+
let baseOptions;
|
|
1669
|
+
if (configuration) {
|
|
1670
|
+
baseOptions = configuration.baseOptions;
|
|
1671
|
+
}
|
|
1672
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
1673
|
+
const localVarHeaderParameter = {};
|
|
1674
|
+
const localVarQueryParameter = {};
|
|
1675
|
+
// authentication BearerApiKey required
|
|
1676
|
+
// http bearer authentication required
|
|
1677
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
1678
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
1679
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1680
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1681
|
+
return {
|
|
1682
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
1683
|
+
options: localVarRequestOptions,
|
|
1684
|
+
};
|
|
1685
|
+
}),
|
|
1686
|
+
/**
|
|
1687
|
+
* Fetch a list of all invoices on your account. > 🚧 Deleted invoices are omitted > > The response does not include any previously deleted invoices.
|
|
1688
|
+
* @summary List invoices
|
|
1689
|
+
* @param {number} [offset] Offsets the returned list by the given number of invoices. The returned invoices are ordered (and offsetted) by their creation date (DESC).
|
|
1690
|
+
* @param {number} [limit] Limits the number of invoices listed. The maximum and default value is 10.
|
|
1691
|
+
* @param {*} [options] Override http request option.
|
|
1692
|
+
* @throws {RequiredError}
|
|
1693
|
+
*/
|
|
1694
|
+
listInvoices: (offset, limit, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1695
|
+
const localVarPath = `/invoices`;
|
|
1696
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1697
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
1698
|
+
let baseOptions;
|
|
1699
|
+
if (configuration) {
|
|
1700
|
+
baseOptions = configuration.baseOptions;
|
|
1701
|
+
}
|
|
1702
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
1703
|
+
const localVarHeaderParameter = {};
|
|
1704
|
+
const localVarQueryParameter = {};
|
|
1705
|
+
// authentication BearerApiKey required
|
|
1706
|
+
// http bearer authentication required
|
|
1707
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
1708
|
+
if (offset !== undefined) {
|
|
1709
|
+
localVarQueryParameter['offset'] = offset;
|
|
1710
|
+
}
|
|
1711
|
+
if (limit !== undefined) {
|
|
1712
|
+
localVarQueryParameter['limit'] = limit;
|
|
1713
|
+
}
|
|
1714
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
1715
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1716
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1717
|
+
return {
|
|
1718
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
1719
|
+
options: localVarRequestOptions,
|
|
1720
|
+
};
|
|
1721
|
+
}),
|
|
1722
|
+
};
|
|
1723
|
+
};
|
|
1724
|
+
exports.InvoicesApiAxiosParamCreator = InvoicesApiAxiosParamCreator;
|
|
1725
|
+
/**
|
|
1726
|
+
* InvoicesApi - functional programming interface
|
|
1727
|
+
* @export
|
|
1728
|
+
*/
|
|
1729
|
+
const InvoicesApiFp = function (configuration) {
|
|
1730
|
+
const localVarAxiosParamCreator = (0, exports.InvoicesApiAxiosParamCreator)(configuration);
|
|
1731
|
+
return {
|
|
1732
|
+
/**
|
|
1733
|
+
* Creating an invoice is the way for your organization to fund your account\'s balance. 1. Create an invoice 2. Pay the invoice 3. Funds get added to your account\'s balance ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">po_number</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference to the purchase order number within your organization</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">amount</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the invoice in USD</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">memo</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>A note to be included in the invoice. This is for your internal use and will not be visible to the recipient.</p> </td></tr> </tbody> </table> </div>
|
|
1734
|
+
* @summary Create invoice
|
|
1735
|
+
* @param {CreateInvoiceRequest} createInvoiceRequest Invoice details
|
|
1736
|
+
* @param {*} [options] Override http request option.
|
|
1737
|
+
* @throws {RequiredError}
|
|
1738
|
+
*/
|
|
1739
|
+
createInvoice(createInvoiceRequest, options) {
|
|
1740
|
+
var _a, _b, _c;
|
|
1741
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1742
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createInvoice(createInvoiceRequest, options);
|
|
1743
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
1744
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['InvoicesApi.createInvoice']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
1745
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
1746
|
+
});
|
|
1747
|
+
},
|
|
1748
|
+
/**
|
|
1749
|
+
* Removes an invoice. This has no further consequences but is a rather cosmetic operation.
|
|
1750
|
+
* @summary Delete invoice
|
|
1751
|
+
* @param {string} id ID of the invoice that should be retrieved
|
|
1752
|
+
* @param {*} [options] Override http request option.
|
|
1753
|
+
* @throws {RequiredError}
|
|
1754
|
+
*/
|
|
1755
|
+
deleteInvoices(id, options) {
|
|
1756
|
+
var _a, _b, _c;
|
|
1757
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1758
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteInvoices(id, options);
|
|
1759
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
1760
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['InvoicesApi.deleteInvoices']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
1761
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
1762
|
+
});
|
|
1763
|
+
},
|
|
1764
|
+
/**
|
|
1765
|
+
* Generates a CSV version for an invoice listing the associated rewards and orders
|
|
1766
|
+
* @summary Retrieve invoice as CSV
|
|
1767
|
+
* @param {string} id ID of the Invoice for that the CSV should be generated
|
|
1768
|
+
* @param {*} [options] Override http request option.
|
|
1769
|
+
* @throws {RequiredError}
|
|
1770
|
+
*/
|
|
1771
|
+
downloadInvoiceCsv(id, options) {
|
|
1772
|
+
var _a, _b, _c;
|
|
1773
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1774
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.downloadInvoiceCsv(id, options);
|
|
1775
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
1776
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['InvoicesApi.downloadInvoiceCsv']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
1777
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
1778
|
+
});
|
|
1779
|
+
},
|
|
1780
|
+
/**
|
|
1781
|
+
* Generates a PDF version for an invoice
|
|
1782
|
+
* @summary Retrieve invoice as PDF
|
|
1783
|
+
* @param {string} id ID of the Invoice for that the PDF should be generated
|
|
1784
|
+
* @param {*} [options] Override http request option.
|
|
1785
|
+
* @throws {RequiredError}
|
|
1786
|
+
*/
|
|
1787
|
+
downloadInvoicePdf(id, options) {
|
|
1788
|
+
var _a, _b, _c;
|
|
1789
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1790
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.downloadInvoicePdf(id, options);
|
|
1791
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
1792
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['InvoicesApi.downloadInvoicePdf']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
1793
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
1794
|
+
});
|
|
1795
|
+
},
|
|
1796
|
+
/**
|
|
1797
|
+
* Retrieve an invoice, identified by the given `id` in the URL > 📘 Deleted Invoices > > This endpoint can be used to retrieve details on deleted invoices > that the list of invoices omits.
|
|
1798
|
+
* @summary Retrieve invoice
|
|
1799
|
+
* @param {string} id ID of the invoice that should be retrieved
|
|
1800
|
+
* @param {*} [options] Override http request option.
|
|
1801
|
+
* @throws {RequiredError}
|
|
1802
|
+
*/
|
|
1803
|
+
getInvoice(id, options) {
|
|
1804
|
+
var _a, _b, _c;
|
|
1805
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1806
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getInvoice(id, options);
|
|
1807
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
1808
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['InvoicesApi.getInvoice']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
1809
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
1810
|
+
});
|
|
1811
|
+
},
|
|
1812
|
+
/**
|
|
1813
|
+
* Fetch a list of all invoices on your account. > 🚧 Deleted invoices are omitted > > The response does not include any previously deleted invoices.
|
|
1814
|
+
* @summary List invoices
|
|
1815
|
+
* @param {number} [offset] Offsets the returned list by the given number of invoices. The returned invoices are ordered (and offsetted) by their creation date (DESC).
|
|
1816
|
+
* @param {number} [limit] Limits the number of invoices listed. The maximum and default value is 10.
|
|
1817
|
+
* @param {*} [options] Override http request option.
|
|
1818
|
+
* @throws {RequiredError}
|
|
1819
|
+
*/
|
|
1820
|
+
listInvoices(offset, limit, options) {
|
|
1821
|
+
var _a, _b, _c;
|
|
1822
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1823
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listInvoices(offset, limit, options);
|
|
1824
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
1825
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['InvoicesApi.listInvoices']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
1826
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
1827
|
+
});
|
|
1828
|
+
},
|
|
1829
|
+
};
|
|
1830
|
+
};
|
|
1831
|
+
exports.InvoicesApiFp = InvoicesApiFp;
|
|
1832
|
+
/**
|
|
1833
|
+
* InvoicesApi - factory interface
|
|
1834
|
+
* @export
|
|
1835
|
+
*/
|
|
1836
|
+
const InvoicesApiFactory = function (configuration, basePath, axios) {
|
|
1837
|
+
const localVarFp = (0, exports.InvoicesApiFp)(configuration);
|
|
1838
|
+
return {
|
|
1839
|
+
/**
|
|
1840
|
+
* Creating an invoice is the way for your organization to fund your account\'s balance. 1. Create an invoice 2. Pay the invoice 3. Funds get added to your account\'s balance ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">po_number</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference to the purchase order number within your organization</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">amount</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the invoice in USD</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">memo</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>A note to be included in the invoice. This is for your internal use and will not be visible to the recipient.</p> </td></tr> </tbody> </table> </div>
|
|
1841
|
+
* @summary Create invoice
|
|
1842
|
+
* @param {CreateInvoiceRequest} createInvoiceRequest Invoice details
|
|
1843
|
+
* @param {*} [options] Override http request option.
|
|
1844
|
+
* @throws {RequiredError}
|
|
1845
|
+
*/
|
|
1846
|
+
createInvoice(createInvoiceRequest, options) {
|
|
1847
|
+
return localVarFp.createInvoice(createInvoiceRequest, options).then((request) => request(axios, basePath));
|
|
1848
|
+
},
|
|
1849
|
+
/**
|
|
1850
|
+
* Removes an invoice. This has no further consequences but is a rather cosmetic operation.
|
|
1851
|
+
* @summary Delete invoice
|
|
1852
|
+
* @param {string} id ID of the invoice that should be retrieved
|
|
1853
|
+
* @param {*} [options] Override http request option.
|
|
1854
|
+
* @throws {RequiredError}
|
|
1855
|
+
*/
|
|
1856
|
+
deleteInvoices(id, options) {
|
|
1857
|
+
return localVarFp.deleteInvoices(id, options).then((request) => request(axios, basePath));
|
|
1858
|
+
},
|
|
1859
|
+
/**
|
|
1860
|
+
* Generates a CSV version for an invoice listing the associated rewards and orders
|
|
1861
|
+
* @summary Retrieve invoice as CSV
|
|
1862
|
+
* @param {string} id ID of the Invoice for that the CSV should be generated
|
|
1863
|
+
* @param {*} [options] Override http request option.
|
|
1864
|
+
* @throws {RequiredError}
|
|
1865
|
+
*/
|
|
1866
|
+
downloadInvoiceCsv(id, options) {
|
|
1867
|
+
return localVarFp.downloadInvoiceCsv(id, options).then((request) => request(axios, basePath));
|
|
1868
|
+
},
|
|
1869
|
+
/**
|
|
1870
|
+
* Generates a PDF version for an invoice
|
|
1871
|
+
* @summary Retrieve invoice as PDF
|
|
1872
|
+
* @param {string} id ID of the Invoice for that the PDF should be generated
|
|
1873
|
+
* @param {*} [options] Override http request option.
|
|
1874
|
+
* @throws {RequiredError}
|
|
1875
|
+
*/
|
|
1876
|
+
downloadInvoicePdf(id, options) {
|
|
1877
|
+
return localVarFp.downloadInvoicePdf(id, options).then((request) => request(axios, basePath));
|
|
1878
|
+
},
|
|
1879
|
+
/**
|
|
1880
|
+
* Retrieve an invoice, identified by the given `id` in the URL > 📘 Deleted Invoices > > This endpoint can be used to retrieve details on deleted invoices > that the list of invoices omits.
|
|
1881
|
+
* @summary Retrieve invoice
|
|
1882
|
+
* @param {string} id ID of the invoice that should be retrieved
|
|
1883
|
+
* @param {*} [options] Override http request option.
|
|
1884
|
+
* @throws {RequiredError}
|
|
1885
|
+
*/
|
|
1886
|
+
getInvoice(id, options) {
|
|
1887
|
+
return localVarFp.getInvoice(id, options).then((request) => request(axios, basePath));
|
|
1888
|
+
},
|
|
1889
|
+
/**
|
|
1890
|
+
* Fetch a list of all invoices on your account. > 🚧 Deleted invoices are omitted > > The response does not include any previously deleted invoices.
|
|
1891
|
+
* @summary List invoices
|
|
1892
|
+
* @param {number} [offset] Offsets the returned list by the given number of invoices. The returned invoices are ordered (and offsetted) by their creation date (DESC).
|
|
1893
|
+
* @param {number} [limit] Limits the number of invoices listed. The maximum and default value is 10.
|
|
1894
|
+
* @param {*} [options] Override http request option.
|
|
1895
|
+
* @throws {RequiredError}
|
|
1896
|
+
*/
|
|
1897
|
+
listInvoices(offset, limit, options) {
|
|
1898
|
+
return localVarFp.listInvoices(offset, limit, options).then((request) => request(axios, basePath));
|
|
1899
|
+
},
|
|
1900
|
+
};
|
|
1901
|
+
};
|
|
1902
|
+
exports.InvoicesApiFactory = InvoicesApiFactory;
|
|
1903
|
+
/**
|
|
1904
|
+
* InvoicesApi - object-oriented interface
|
|
1905
|
+
* @export
|
|
1906
|
+
* @class InvoicesApi
|
|
1907
|
+
* @extends {BaseAPI}
|
|
1908
|
+
*/
|
|
1909
|
+
class InvoicesApi extends base_1.BaseAPI {
|
|
1910
|
+
/**
|
|
1911
|
+
* Creating an invoice is the way for your organization to fund your account\'s balance. 1. Create an invoice 2. Pay the invoice 3. Funds get added to your account\'s balance ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">po_number</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference to the purchase order number within your organization</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">amount</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the invoice in USD</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">memo</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>A note to be included in the invoice. This is for your internal use and will not be visible to the recipient.</p> </td></tr> </tbody> </table> </div>
|
|
1912
|
+
* @summary Create invoice
|
|
1913
|
+
* @param {CreateInvoiceRequest} createInvoiceRequest Invoice details
|
|
1914
|
+
* @param {*} [options] Override http request option.
|
|
1915
|
+
* @throws {RequiredError}
|
|
1916
|
+
* @memberof InvoicesApi
|
|
1917
|
+
*/
|
|
1918
|
+
createInvoice(createInvoiceRequest, options) {
|
|
1919
|
+
return (0, exports.InvoicesApiFp)(this.configuration).createInvoice(createInvoiceRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1920
|
+
}
|
|
1921
|
+
/**
|
|
1922
|
+
* Removes an invoice. This has no further consequences but is a rather cosmetic operation.
|
|
1923
|
+
* @summary Delete invoice
|
|
1924
|
+
* @param {string} id ID of the invoice that should be retrieved
|
|
1925
|
+
* @param {*} [options] Override http request option.
|
|
1926
|
+
* @throws {RequiredError}
|
|
1927
|
+
* @memberof InvoicesApi
|
|
1928
|
+
*/
|
|
1929
|
+
deleteInvoices(id, options) {
|
|
1930
|
+
return (0, exports.InvoicesApiFp)(this.configuration).deleteInvoices(id, options).then((request) => request(this.axios, this.basePath));
|
|
1931
|
+
}
|
|
1932
|
+
/**
|
|
1933
|
+
* Generates a CSV version for an invoice listing the associated rewards and orders
|
|
1934
|
+
* @summary Retrieve invoice as CSV
|
|
1935
|
+
* @param {string} id ID of the Invoice for that the CSV should be generated
|
|
1936
|
+
* @param {*} [options] Override http request option.
|
|
1937
|
+
* @throws {RequiredError}
|
|
1938
|
+
* @memberof InvoicesApi
|
|
1939
|
+
*/
|
|
1940
|
+
downloadInvoiceCsv(id, options) {
|
|
1941
|
+
return (0, exports.InvoicesApiFp)(this.configuration).downloadInvoiceCsv(id, options).then((request) => request(this.axios, this.basePath));
|
|
1942
|
+
}
|
|
1943
|
+
/**
|
|
1944
|
+
* Generates a PDF version for an invoice
|
|
1945
|
+
* @summary Retrieve invoice as PDF
|
|
1946
|
+
* @param {string} id ID of the Invoice for that the PDF should be generated
|
|
1947
|
+
* @param {*} [options] Override http request option.
|
|
1948
|
+
* @throws {RequiredError}
|
|
1949
|
+
* @memberof InvoicesApi
|
|
1950
|
+
*/
|
|
1951
|
+
downloadInvoicePdf(id, options) {
|
|
1952
|
+
return (0, exports.InvoicesApiFp)(this.configuration).downloadInvoicePdf(id, options).then((request) => request(this.axios, this.basePath));
|
|
1953
|
+
}
|
|
1954
|
+
/**
|
|
1955
|
+
* Retrieve an invoice, identified by the given `id` in the URL > 📘 Deleted Invoices > > This endpoint can be used to retrieve details on deleted invoices > that the list of invoices omits.
|
|
1956
|
+
* @summary Retrieve invoice
|
|
1957
|
+
* @param {string} id ID of the invoice that should be retrieved
|
|
1958
|
+
* @param {*} [options] Override http request option.
|
|
1959
|
+
* @throws {RequiredError}
|
|
1960
|
+
* @memberof InvoicesApi
|
|
1961
|
+
*/
|
|
1962
|
+
getInvoice(id, options) {
|
|
1963
|
+
return (0, exports.InvoicesApiFp)(this.configuration).getInvoice(id, options).then((request) => request(this.axios, this.basePath));
|
|
1964
|
+
}
|
|
1965
|
+
/**
|
|
1966
|
+
* Fetch a list of all invoices on your account. > 🚧 Deleted invoices are omitted > > The response does not include any previously deleted invoices.
|
|
1967
|
+
* @summary List invoices
|
|
1968
|
+
* @param {number} [offset] Offsets the returned list by the given number of invoices. The returned invoices are ordered (and offsetted) by their creation date (DESC).
|
|
1969
|
+
* @param {number} [limit] Limits the number of invoices listed. The maximum and default value is 10.
|
|
1970
|
+
* @param {*} [options] Override http request option.
|
|
1971
|
+
* @throws {RequiredError}
|
|
1972
|
+
* @memberof InvoicesApi
|
|
1973
|
+
*/
|
|
1974
|
+
listInvoices(offset, limit, options) {
|
|
1975
|
+
return (0, exports.InvoicesApiFp)(this.configuration).listInvoices(offset, limit, options).then((request) => request(this.axios, this.basePath));
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
exports.InvoicesApi = InvoicesApi;
|
|
1979
|
+
/**
|
|
1980
|
+
* MembersApi - axios parameter creator
|
|
1981
|
+
* @export
|
|
1982
|
+
*/
|
|
1983
|
+
const MembersApiAxiosParamCreator = function (configuration) {
|
|
1984
|
+
return {
|
|
1985
|
+
/**
|
|
1986
|
+
* Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have one of two roles that determine their permissions within the organization: 1. `MEMBER`: Limited permissions. Can view their own reward and order histories only. 2. `ADMIN`: Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization. To create members of a sub-organizations [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the create member request. ### Inviting new members After creating a member, an automatic invite is sent to the email address. If the user is not registered yet, that person will then need to sign up for a Tremendous account. > ❗️ Automatic invitations are not available in the sandbox > > You must manually use the returned `invite_url` field in the payload instead.
|
|
1987
|
+
* @summary Create member
|
|
1988
|
+
* @param {CreateMemberRequest} createMemberRequest Member details
|
|
1989
|
+
* @param {*} [options] Override http request option.
|
|
1990
|
+
* @throws {RequiredError}
|
|
1991
|
+
*/
|
|
1992
|
+
createMember: (createMemberRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1993
|
+
// verify required parameter 'createMemberRequest' is not null or undefined
|
|
1994
|
+
(0, common_1.assertParamExists)('createMember', 'createMemberRequest', createMemberRequest);
|
|
1995
|
+
const localVarPath = `/members`;
|
|
1996
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1997
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
1998
|
+
let baseOptions;
|
|
1999
|
+
if (configuration) {
|
|
2000
|
+
baseOptions = configuration.baseOptions;
|
|
2001
|
+
}
|
|
2002
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
2003
|
+
const localVarHeaderParameter = {};
|
|
2004
|
+
const localVarQueryParameter = {};
|
|
2005
|
+
// authentication BearerApiKey required
|
|
2006
|
+
// http bearer authentication required
|
|
2007
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
2008
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
2009
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
2010
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2011
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
2012
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createMemberRequest, localVarRequestOptions, configuration);
|
|
2013
|
+
return {
|
|
2014
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
2015
|
+
options: localVarRequestOptions,
|
|
2016
|
+
};
|
|
2017
|
+
}),
|
|
2018
|
+
/**
|
|
2019
|
+
*
|
|
2020
|
+
* @summary Retrieve member
|
|
2021
|
+
* @param {string} id ID of the member to retrieve
|
|
2022
|
+
* @param {*} [options] Override http request option.
|
|
2023
|
+
* @throws {RequiredError}
|
|
2024
|
+
*/
|
|
2025
|
+
getMember: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
2026
|
+
// verify required parameter 'id' is not null or undefined
|
|
2027
|
+
(0, common_1.assertParamExists)('getMember', 'id', id);
|
|
2028
|
+
const localVarPath = `/members/{id}`
|
|
2029
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
2030
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2031
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
2032
|
+
let baseOptions;
|
|
2033
|
+
if (configuration) {
|
|
2034
|
+
baseOptions = configuration.baseOptions;
|
|
2035
|
+
}
|
|
2036
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
2037
|
+
const localVarHeaderParameter = {};
|
|
2038
|
+
const localVarQueryParameter = {};
|
|
2039
|
+
// authentication BearerApiKey required
|
|
2040
|
+
// http bearer authentication required
|
|
2041
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
2042
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
2043
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2044
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
2045
|
+
return {
|
|
2046
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
2047
|
+
options: localVarRequestOptions,
|
|
2048
|
+
};
|
|
2049
|
+
}),
|
|
2050
|
+
/**
|
|
2051
|
+
* To list members of a sub-organization [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the list members request.
|
|
2052
|
+
* @summary List members
|
|
2053
|
+
* @param {*} [options] Override http request option.
|
|
2054
|
+
* @throws {RequiredError}
|
|
2055
|
+
*/
|
|
2056
|
+
listMembers: (options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
2057
|
+
const localVarPath = `/members`;
|
|
2058
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2059
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
2060
|
+
let baseOptions;
|
|
2061
|
+
if (configuration) {
|
|
2062
|
+
baseOptions = configuration.baseOptions;
|
|
2063
|
+
}
|
|
2064
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
2065
|
+
const localVarHeaderParameter = {};
|
|
2066
|
+
const localVarQueryParameter = {};
|
|
2067
|
+
// authentication BearerApiKey required
|
|
2068
|
+
// http bearer authentication required
|
|
2069
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
2070
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
2071
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2072
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
2073
|
+
return {
|
|
2074
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
2075
|
+
options: localVarRequestOptions,
|
|
2076
|
+
};
|
|
2077
|
+
}),
|
|
2078
|
+
};
|
|
2079
|
+
};
|
|
2080
|
+
exports.MembersApiAxiosParamCreator = MembersApiAxiosParamCreator;
|
|
2081
|
+
/**
|
|
2082
|
+
* MembersApi - functional programming interface
|
|
2083
|
+
* @export
|
|
2084
|
+
*/
|
|
2085
|
+
const MembersApiFp = function (configuration) {
|
|
2086
|
+
const localVarAxiosParamCreator = (0, exports.MembersApiAxiosParamCreator)(configuration);
|
|
2087
|
+
return {
|
|
2088
|
+
/**
|
|
2089
|
+
* Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have one of two roles that determine their permissions within the organization: 1. `MEMBER`: Limited permissions. Can view their own reward and order histories only. 2. `ADMIN`: Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization. To create members of a sub-organizations [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the create member request. ### Inviting new members After creating a member, an automatic invite is sent to the email address. If the user is not registered yet, that person will then need to sign up for a Tremendous account. > ❗️ Automatic invitations are not available in the sandbox > > You must manually use the returned `invite_url` field in the payload instead.
|
|
2090
|
+
* @summary Create member
|
|
2091
|
+
* @param {CreateMemberRequest} createMemberRequest Member details
|
|
2092
|
+
* @param {*} [options] Override http request option.
|
|
2093
|
+
* @throws {RequiredError}
|
|
2094
|
+
*/
|
|
2095
|
+
createMember(createMemberRequest, options) {
|
|
2096
|
+
var _a, _b, _c;
|
|
2097
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2098
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createMember(createMemberRequest, options);
|
|
2099
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
2100
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['MembersApi.createMember']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
2101
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
2102
|
+
});
|
|
2103
|
+
},
|
|
2104
|
+
/**
|
|
2105
|
+
*
|
|
2106
|
+
* @summary Retrieve member
|
|
2107
|
+
* @param {string} id ID of the member to retrieve
|
|
2108
|
+
* @param {*} [options] Override http request option.
|
|
2109
|
+
* @throws {RequiredError}
|
|
2110
|
+
*/
|
|
2111
|
+
getMember(id, options) {
|
|
2112
|
+
var _a, _b, _c;
|
|
2113
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2114
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getMember(id, options);
|
|
2115
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
2116
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['MembersApi.getMember']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
2117
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
2118
|
+
});
|
|
2119
|
+
},
|
|
2120
|
+
/**
|
|
2121
|
+
* To list members of a sub-organization [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the list members request.
|
|
2122
|
+
* @summary List members
|
|
2123
|
+
* @param {*} [options] Override http request option.
|
|
2124
|
+
* @throws {RequiredError}
|
|
2125
|
+
*/
|
|
2126
|
+
listMembers(options) {
|
|
2127
|
+
var _a, _b, _c;
|
|
2128
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2129
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listMembers(options);
|
|
2130
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
2131
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['MembersApi.listMembers']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
2132
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
2133
|
+
});
|
|
2134
|
+
},
|
|
2135
|
+
};
|
|
2136
|
+
};
|
|
2137
|
+
exports.MembersApiFp = MembersApiFp;
|
|
2138
|
+
/**
|
|
2139
|
+
* MembersApi - factory interface
|
|
2140
|
+
* @export
|
|
2141
|
+
*/
|
|
2142
|
+
const MembersApiFactory = function (configuration, basePath, axios) {
|
|
2143
|
+
const localVarFp = (0, exports.MembersApiFp)(configuration);
|
|
2144
|
+
return {
|
|
2145
|
+
/**
|
|
2146
|
+
* Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have one of two roles that determine their permissions within the organization: 1. `MEMBER`: Limited permissions. Can view their own reward and order histories only. 2. `ADMIN`: Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization. To create members of a sub-organizations [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the create member request. ### Inviting new members After creating a member, an automatic invite is sent to the email address. If the user is not registered yet, that person will then need to sign up for a Tremendous account. > ❗️ Automatic invitations are not available in the sandbox > > You must manually use the returned `invite_url` field in the payload instead.
|
|
2147
|
+
* @summary Create member
|
|
2148
|
+
* @param {CreateMemberRequest} createMemberRequest Member details
|
|
2149
|
+
* @param {*} [options] Override http request option.
|
|
2150
|
+
* @throws {RequiredError}
|
|
2151
|
+
*/
|
|
2152
|
+
createMember(createMemberRequest, options) {
|
|
2153
|
+
return localVarFp.createMember(createMemberRequest, options).then((request) => request(axios, basePath));
|
|
2154
|
+
},
|
|
2155
|
+
/**
|
|
2156
|
+
*
|
|
2157
|
+
* @summary Retrieve member
|
|
2158
|
+
* @param {string} id ID of the member to retrieve
|
|
2159
|
+
* @param {*} [options] Override http request option.
|
|
2160
|
+
* @throws {RequiredError}
|
|
2161
|
+
*/
|
|
2162
|
+
getMember(id, options) {
|
|
2163
|
+
return localVarFp.getMember(id, options).then((request) => request(axios, basePath));
|
|
2164
|
+
},
|
|
2165
|
+
/**
|
|
2166
|
+
* To list members of a sub-organization [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the list members request.
|
|
2167
|
+
* @summary List members
|
|
2168
|
+
* @param {*} [options] Override http request option.
|
|
2169
|
+
* @throws {RequiredError}
|
|
2170
|
+
*/
|
|
2171
|
+
listMembers(options) {
|
|
2172
|
+
return localVarFp.listMembers(options).then((request) => request(axios, basePath));
|
|
2173
|
+
},
|
|
2174
|
+
};
|
|
2175
|
+
};
|
|
2176
|
+
exports.MembersApiFactory = MembersApiFactory;
|
|
2177
|
+
/**
|
|
2178
|
+
* MembersApi - object-oriented interface
|
|
2179
|
+
* @export
|
|
2180
|
+
* @class MembersApi
|
|
2181
|
+
* @extends {BaseAPI}
|
|
2182
|
+
*/
|
|
2183
|
+
class MembersApi extends base_1.BaseAPI {
|
|
2184
|
+
/**
|
|
2185
|
+
* Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have one of two roles that determine their permissions within the organization: 1. `MEMBER`: Limited permissions. Can view their own reward and order histories only. 2. `ADMIN`: Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization. To create members of a sub-organizations [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the create member request. ### Inviting new members After creating a member, an automatic invite is sent to the email address. If the user is not registered yet, that person will then need to sign up for a Tremendous account. > ❗️ Automatic invitations are not available in the sandbox > > You must manually use the returned `invite_url` field in the payload instead.
|
|
2186
|
+
* @summary Create member
|
|
2187
|
+
* @param {CreateMemberRequest} createMemberRequest Member details
|
|
2188
|
+
* @param {*} [options] Override http request option.
|
|
2189
|
+
* @throws {RequiredError}
|
|
2190
|
+
* @memberof MembersApi
|
|
2191
|
+
*/
|
|
2192
|
+
createMember(createMemberRequest, options) {
|
|
2193
|
+
return (0, exports.MembersApiFp)(this.configuration).createMember(createMemberRequest, options).then((request) => request(this.axios, this.basePath));
|
|
2194
|
+
}
|
|
2195
|
+
/**
|
|
2196
|
+
*
|
|
2197
|
+
* @summary Retrieve member
|
|
2198
|
+
* @param {string} id ID of the member to retrieve
|
|
2199
|
+
* @param {*} [options] Override http request option.
|
|
2200
|
+
* @throws {RequiredError}
|
|
2201
|
+
* @memberof MembersApi
|
|
2202
|
+
*/
|
|
2203
|
+
getMember(id, options) {
|
|
2204
|
+
return (0, exports.MembersApiFp)(this.configuration).getMember(id, options).then((request) => request(this.axios, this.basePath));
|
|
2205
|
+
}
|
|
2206
|
+
/**
|
|
2207
|
+
* To list members of a sub-organization [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the list members request.
|
|
2208
|
+
* @summary List members
|
|
2209
|
+
* @param {*} [options] Override http request option.
|
|
2210
|
+
* @throws {RequiredError}
|
|
2211
|
+
* @memberof MembersApi
|
|
2212
|
+
*/
|
|
2213
|
+
listMembers(options) {
|
|
2214
|
+
return (0, exports.MembersApiFp)(this.configuration).listMembers(options).then((request) => request(this.axios, this.basePath));
|
|
2215
|
+
}
|
|
2216
|
+
}
|
|
2217
|
+
exports.MembersApi = MembersApi;
|
|
2218
|
+
/**
|
|
2219
|
+
* OrdersApi - axios parameter creator
|
|
2220
|
+
* @export
|
|
2221
|
+
*/
|
|
2222
|
+
const OrdersApiAxiosParamCreator = function (configuration) {
|
|
2223
|
+
return {
|
|
2224
|
+
/**
|
|
2225
|
+
* Approves an order that is pending review, identified by the given `id` in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable \'Allow approvals via API\' via the organization\'\'s \'Order Approvals\' settings from the Tremendous dashboard.
|
|
2226
|
+
* @summary Approve order
|
|
2227
|
+
* @param {string} id ID of the order that should be approved. In case the order has an `external_id` reference supplied by the customer on creation, it\'s possible to use it instead.
|
|
2228
|
+
* @param {*} [options] Override http request option.
|
|
2229
|
+
* @throws {RequiredError}
|
|
2230
|
+
*/
|
|
2231
|
+
approveOrder: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
2232
|
+
// verify required parameter 'id' is not null or undefined
|
|
2233
|
+
(0, common_1.assertParamExists)('approveOrder', 'id', id);
|
|
2234
|
+
const localVarPath = `/order_approvals/{id}/approve`
|
|
2235
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
2236
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2237
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
2238
|
+
let baseOptions;
|
|
2239
|
+
if (configuration) {
|
|
2240
|
+
baseOptions = configuration.baseOptions;
|
|
2241
|
+
}
|
|
2242
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
2243
|
+
const localVarHeaderParameter = {};
|
|
2244
|
+
const localVarQueryParameter = {};
|
|
2245
|
+
// authentication BearerApiKey required
|
|
2246
|
+
// http bearer authentication required
|
|
2247
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
2248
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
2249
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2250
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
2251
|
+
return {
|
|
2252
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
2253
|
+
options: localVarRequestOptions,
|
|
2254
|
+
};
|
|
2255
|
+
}),
|
|
2256
|
+
/**
|
|
2257
|
+
* Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style=\"display: block; margin-top: 20px;\" href=\"/docs/sending-rewards-intro\">Check it out!</a></strong> ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">external_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, <code>external_id</code> makes order idempotent. All requests that use the same <code>external_id</code> after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a <code>201</code> response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by <code>external_id</code> instead of <code>id</code> only.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">payment</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">funding_source_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use <code>balance</code> to use your Tremendous's balance.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">reward</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either <code>products</code> or <code>campaign_id</code> must be specified.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">products</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a <code>products</code> array will override the products made available by the campaign specified using the <code>campaign_id</code> property unless the <code>products</code> array is empty. It will <em>not</em> override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">denomination</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">currency_code</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Currency of the reward</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">recipient</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">email</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">phone</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">deliver_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">custom_fields</code> </div> </td><td><span class=\"property-type\">array</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Value of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">language</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\">ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a \"funding source\". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](https://tremendous.readme.io/reference/core-funding-source-index). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $5,000 in *fake money* to test the API. [Learn more about the sandbox environment](https://tremendous.readme.io/reference/sandbox). The HTTP status code `200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it\'s recipient (for delivery method `EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same external_id are idempotent. Submitting an order with an already existing `external_id`, will result in a `201` response code. In this case the response will return a representation of the already existing order in the response body.
|
|
2258
|
+
* @summary Create order
|
|
2259
|
+
* @param {CreateOrderRequest} createOrderRequest Order to create
|
|
2260
|
+
* @param {*} [options] Override http request option.
|
|
2261
|
+
* @throws {RequiredError}
|
|
2262
|
+
*/
|
|
2263
|
+
createOrder: (createOrderRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
2264
|
+
// verify required parameter 'createOrderRequest' is not null or undefined
|
|
2265
|
+
(0, common_1.assertParamExists)('createOrder', 'createOrderRequest', createOrderRequest);
|
|
2266
|
+
const localVarPath = `/orders`;
|
|
2267
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2268
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
2269
|
+
let baseOptions;
|
|
2270
|
+
if (configuration) {
|
|
2271
|
+
baseOptions = configuration.baseOptions;
|
|
2272
|
+
}
|
|
2273
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
2274
|
+
const localVarHeaderParameter = {};
|
|
2275
|
+
const localVarQueryParameter = {};
|
|
2276
|
+
// authentication BearerApiKey required
|
|
2277
|
+
// http bearer authentication required
|
|
2278
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
2279
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
2280
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
2281
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2282
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
2283
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createOrderRequest, localVarRequestOptions, configuration);
|
|
2284
|
+
return {
|
|
2285
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
2286
|
+
options: localVarRequestOptions,
|
|
2287
|
+
};
|
|
2288
|
+
}),
|
|
2289
|
+
/**
|
|
2290
|
+
* Retrieve the order, identified by the given `id` in the URL
|
|
2291
|
+
* @summary Retrieve order
|
|
2292
|
+
* @param {string} id ID of the order that should be retrieved. In case the order has an `external_id` reference supplied by the customer on creation, it\'s possible to use it instead.
|
|
2293
|
+
* @param {*} [options] Override http request option.
|
|
2294
|
+
* @throws {RequiredError}
|
|
2295
|
+
*/
|
|
2296
|
+
getOrder: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
2297
|
+
// verify required parameter 'id' is not null or undefined
|
|
2298
|
+
(0, common_1.assertParamExists)('getOrder', 'id', id);
|
|
2299
|
+
const localVarPath = `/orders/{id}`
|
|
2300
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
2301
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2302
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
2303
|
+
let baseOptions;
|
|
2304
|
+
if (configuration) {
|
|
2305
|
+
baseOptions = configuration.baseOptions;
|
|
2306
|
+
}
|
|
2307
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
2308
|
+
const localVarHeaderParameter = {};
|
|
2309
|
+
const localVarQueryParameter = {};
|
|
2310
|
+
// authentication BearerApiKey required
|
|
2311
|
+
// http bearer authentication required
|
|
2312
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
2313
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
2314
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2315
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
2316
|
+
return {
|
|
2317
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
2318
|
+
options: localVarRequestOptions,
|
|
2319
|
+
};
|
|
2320
|
+
}),
|
|
2321
|
+
/**
|
|
2322
|
+
* Retrieve a list of orders
|
|
2323
|
+
* @summary List orders
|
|
2324
|
+
* @param {number} [offset] Offsets the returned list by the given number of orders. The returned orders are ordered (and offsetted) by their creation date (DESC).
|
|
2325
|
+
* @param {string} [campaignId] Only return results with a matching campaign_id.
|
|
2326
|
+
* @param {string} [externalId] Only return results with a matching external_id.
|
|
2327
|
+
* @param {string} [createdAtGte] Only return results where the created_at field is greater than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
|
|
2328
|
+
* @param {string} [createdAtLte] Only return results where the created_at field is less than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
|
|
2329
|
+
* @param {number} [limit] Limits the number of orders listed. The maximum value is 100 and the default is 10.
|
|
2330
|
+
* @param {*} [options] Override http request option.
|
|
2331
|
+
* @throws {RequiredError}
|
|
2332
|
+
*/
|
|
2333
|
+
listOrders: (offset, campaignId, externalId, createdAtGte, createdAtLte, limit, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
2334
|
+
const localVarPath = `/orders`;
|
|
2335
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2336
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
2337
|
+
let baseOptions;
|
|
2338
|
+
if (configuration) {
|
|
2339
|
+
baseOptions = configuration.baseOptions;
|
|
2340
|
+
}
|
|
2341
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
2342
|
+
const localVarHeaderParameter = {};
|
|
2343
|
+
const localVarQueryParameter = {};
|
|
2344
|
+
// authentication BearerApiKey required
|
|
2345
|
+
// http bearer authentication required
|
|
2346
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
2347
|
+
if (offset !== undefined) {
|
|
2348
|
+
localVarQueryParameter['offset'] = offset;
|
|
2349
|
+
}
|
|
2350
|
+
if (campaignId !== undefined) {
|
|
2351
|
+
localVarQueryParameter['campaign_id'] = campaignId;
|
|
2352
|
+
}
|
|
2353
|
+
if (externalId !== undefined) {
|
|
2354
|
+
localVarQueryParameter['external_id'] = externalId;
|
|
2355
|
+
}
|
|
2356
|
+
if (createdAtGte !== undefined) {
|
|
2357
|
+
localVarQueryParameter['created_at[gte]'] = createdAtGte;
|
|
2358
|
+
}
|
|
2359
|
+
if (createdAtLte !== undefined) {
|
|
2360
|
+
localVarQueryParameter['created_at[lte]'] = createdAtLte;
|
|
2361
|
+
}
|
|
2362
|
+
if (limit !== undefined) {
|
|
2363
|
+
localVarQueryParameter['limit'] = limit;
|
|
2364
|
+
}
|
|
2365
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
2366
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2367
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
2368
|
+
return {
|
|
2369
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
2370
|
+
options: localVarRequestOptions,
|
|
2371
|
+
};
|
|
2372
|
+
}),
|
|
2373
|
+
/**
|
|
2374
|
+
* Rejects an order that is pending review, identified by the given `id` in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable \'Allow approvals via API\' via the organization\'\'s \'Order Approvals\' settings from the Tremendous dashboard.
|
|
2375
|
+
* @summary Reject order
|
|
2376
|
+
* @param {string} id ID of the order that should be rejected. In case the order has an `external_id` reference supplied by the customer on creation, it\'s possible to use it instead.
|
|
2377
|
+
* @param {*} [options] Override http request option.
|
|
2378
|
+
* @throws {RequiredError}
|
|
2379
|
+
*/
|
|
2380
|
+
rejectOrder: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
2381
|
+
// verify required parameter 'id' is not null or undefined
|
|
2382
|
+
(0, common_1.assertParamExists)('rejectOrder', 'id', id);
|
|
2383
|
+
const localVarPath = `/order_approvals/{id}/reject`
|
|
2384
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
2385
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2386
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
2387
|
+
let baseOptions;
|
|
2388
|
+
if (configuration) {
|
|
2389
|
+
baseOptions = configuration.baseOptions;
|
|
2390
|
+
}
|
|
2391
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
2392
|
+
const localVarHeaderParameter = {};
|
|
2393
|
+
const localVarQueryParameter = {};
|
|
2394
|
+
// authentication BearerApiKey required
|
|
2395
|
+
// http bearer authentication required
|
|
2396
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
2397
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
2398
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2399
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
2400
|
+
return {
|
|
2401
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
2402
|
+
options: localVarRequestOptions,
|
|
2403
|
+
};
|
|
2404
|
+
}),
|
|
2405
|
+
};
|
|
2406
|
+
};
|
|
2407
|
+
exports.OrdersApiAxiosParamCreator = OrdersApiAxiosParamCreator;
|
|
2408
|
+
/**
|
|
2409
|
+
* OrdersApi - functional programming interface
|
|
2410
|
+
* @export
|
|
2411
|
+
*/
|
|
2412
|
+
const OrdersApiFp = function (configuration) {
|
|
2413
|
+
const localVarAxiosParamCreator = (0, exports.OrdersApiAxiosParamCreator)(configuration);
|
|
2414
|
+
return {
|
|
2415
|
+
/**
|
|
2416
|
+
* Approves an order that is pending review, identified by the given `id` in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable \'Allow approvals via API\' via the organization\'\'s \'Order Approvals\' settings from the Tremendous dashboard.
|
|
2417
|
+
* @summary Approve order
|
|
2418
|
+
* @param {string} id ID of the order that should be approved. In case the order has an `external_id` reference supplied by the customer on creation, it\'s possible to use it instead.
|
|
2419
|
+
* @param {*} [options] Override http request option.
|
|
2420
|
+
* @throws {RequiredError}
|
|
2421
|
+
*/
|
|
2422
|
+
approveOrder(id, options) {
|
|
2423
|
+
var _a, _b, _c;
|
|
2424
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2425
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.approveOrder(id, options);
|
|
2426
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
2427
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['OrdersApi.approveOrder']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
2428
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
2429
|
+
});
|
|
2430
|
+
},
|
|
2431
|
+
/**
|
|
2432
|
+
* Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style=\"display: block; margin-top: 20px;\" href=\"/docs/sending-rewards-intro\">Check it out!</a></strong> ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">external_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, <code>external_id</code> makes order idempotent. All requests that use the same <code>external_id</code> after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a <code>201</code> response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by <code>external_id</code> instead of <code>id</code> only.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">payment</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">funding_source_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use <code>balance</code> to use your Tremendous's balance.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">reward</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either <code>products</code> or <code>campaign_id</code> must be specified.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">products</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a <code>products</code> array will override the products made available by the campaign specified using the <code>campaign_id</code> property unless the <code>products</code> array is empty. It will <em>not</em> override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">denomination</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">currency_code</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Currency of the reward</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">recipient</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">email</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">phone</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">deliver_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">custom_fields</code> </div> </td><td><span class=\"property-type\">array</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Value of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">language</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\">ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a \"funding source\". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](https://tremendous.readme.io/reference/core-funding-source-index). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $5,000 in *fake money* to test the API. [Learn more about the sandbox environment](https://tremendous.readme.io/reference/sandbox). The HTTP status code `200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it\'s recipient (for delivery method `EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same external_id are idempotent. Submitting an order with an already existing `external_id`, will result in a `201` response code. In this case the response will return a representation of the already existing order in the response body.
|
|
2433
|
+
* @summary Create order
|
|
2434
|
+
* @param {CreateOrderRequest} createOrderRequest Order to create
|
|
2435
|
+
* @param {*} [options] Override http request option.
|
|
2436
|
+
* @throws {RequiredError}
|
|
2437
|
+
*/
|
|
2438
|
+
createOrder(createOrderRequest, options) {
|
|
2439
|
+
var _a, _b, _c;
|
|
2440
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2441
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createOrder(createOrderRequest, options);
|
|
2442
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
2443
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['OrdersApi.createOrder']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
2444
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
2445
|
+
});
|
|
2446
|
+
},
|
|
2447
|
+
/**
|
|
2448
|
+
* Retrieve the order, identified by the given `id` in the URL
|
|
2449
|
+
* @summary Retrieve order
|
|
2450
|
+
* @param {string} id ID of the order that should be retrieved. In case the order has an `external_id` reference supplied by the customer on creation, it\'s possible to use it instead.
|
|
2451
|
+
* @param {*} [options] Override http request option.
|
|
2452
|
+
* @throws {RequiredError}
|
|
2453
|
+
*/
|
|
2454
|
+
getOrder(id, options) {
|
|
2455
|
+
var _a, _b, _c;
|
|
2456
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2457
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrder(id, options);
|
|
2458
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
2459
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['OrdersApi.getOrder']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
2460
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
2461
|
+
});
|
|
2462
|
+
},
|
|
2463
|
+
/**
|
|
2464
|
+
* Retrieve a list of orders
|
|
2465
|
+
* @summary List orders
|
|
2466
|
+
* @param {number} [offset] Offsets the returned list by the given number of orders. The returned orders are ordered (and offsetted) by their creation date (DESC).
|
|
2467
|
+
* @param {string} [campaignId] Only return results with a matching campaign_id.
|
|
2468
|
+
* @param {string} [externalId] Only return results with a matching external_id.
|
|
2469
|
+
* @param {string} [createdAtGte] Only return results where the created_at field is greater than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
|
|
2470
|
+
* @param {string} [createdAtLte] Only return results where the created_at field is less than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
|
|
2471
|
+
* @param {number} [limit] Limits the number of orders listed. The maximum value is 100 and the default is 10.
|
|
2472
|
+
* @param {*} [options] Override http request option.
|
|
2473
|
+
* @throws {RequiredError}
|
|
2474
|
+
*/
|
|
2475
|
+
listOrders(offset, campaignId, externalId, createdAtGte, createdAtLte, limit, options) {
|
|
2476
|
+
var _a, _b, _c;
|
|
2477
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2478
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listOrders(offset, campaignId, externalId, createdAtGte, createdAtLte, limit, options);
|
|
2479
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
2480
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['OrdersApi.listOrders']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
2481
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
2482
|
+
});
|
|
2483
|
+
},
|
|
2484
|
+
/**
|
|
2485
|
+
* Rejects an order that is pending review, identified by the given `id` in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable \'Allow approvals via API\' via the organization\'\'s \'Order Approvals\' settings from the Tremendous dashboard.
|
|
2486
|
+
* @summary Reject order
|
|
2487
|
+
* @param {string} id ID of the order that should be rejected. In case the order has an `external_id` reference supplied by the customer on creation, it\'s possible to use it instead.
|
|
2488
|
+
* @param {*} [options] Override http request option.
|
|
2489
|
+
* @throws {RequiredError}
|
|
2490
|
+
*/
|
|
2491
|
+
rejectOrder(id, options) {
|
|
2492
|
+
var _a, _b, _c;
|
|
2493
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2494
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.rejectOrder(id, options);
|
|
2495
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
2496
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['OrdersApi.rejectOrder']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
2497
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
2498
|
+
});
|
|
2499
|
+
},
|
|
2500
|
+
};
|
|
2501
|
+
};
|
|
2502
|
+
exports.OrdersApiFp = OrdersApiFp;
|
|
2503
|
+
/**
|
|
2504
|
+
* OrdersApi - factory interface
|
|
2505
|
+
* @export
|
|
2506
|
+
*/
|
|
2507
|
+
const OrdersApiFactory = function (configuration, basePath, axios) {
|
|
2508
|
+
const localVarFp = (0, exports.OrdersApiFp)(configuration);
|
|
2509
|
+
return {
|
|
2510
|
+
/**
|
|
2511
|
+
* Approves an order that is pending review, identified by the given `id` in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable \'Allow approvals via API\' via the organization\'\'s \'Order Approvals\' settings from the Tremendous dashboard.
|
|
2512
|
+
* @summary Approve order
|
|
2513
|
+
* @param {string} id ID of the order that should be approved. In case the order has an `external_id` reference supplied by the customer on creation, it\'s possible to use it instead.
|
|
2514
|
+
* @param {*} [options] Override http request option.
|
|
2515
|
+
* @throws {RequiredError}
|
|
2516
|
+
*/
|
|
2517
|
+
approveOrder(id, options) {
|
|
2518
|
+
return localVarFp.approveOrder(id, options).then((request) => request(axios, basePath));
|
|
2519
|
+
},
|
|
2520
|
+
/**
|
|
2521
|
+
* Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style=\"display: block; margin-top: 20px;\" href=\"/docs/sending-rewards-intro\">Check it out!</a></strong> ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">external_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, <code>external_id</code> makes order idempotent. All requests that use the same <code>external_id</code> after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a <code>201</code> response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by <code>external_id</code> instead of <code>id</code> only.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">payment</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">funding_source_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use <code>balance</code> to use your Tremendous's balance.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">reward</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either <code>products</code> or <code>campaign_id</code> must be specified.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">products</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a <code>products</code> array will override the products made available by the campaign specified using the <code>campaign_id</code> property unless the <code>products</code> array is empty. It will <em>not</em> override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">denomination</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">currency_code</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Currency of the reward</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">recipient</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">email</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">phone</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">deliver_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">custom_fields</code> </div> </td><td><span class=\"property-type\">array</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Value of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">language</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\">ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a \"funding source\". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](https://tremendous.readme.io/reference/core-funding-source-index). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $5,000 in *fake money* to test the API. [Learn more about the sandbox environment](https://tremendous.readme.io/reference/sandbox). The HTTP status code `200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it\'s recipient (for delivery method `EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same external_id are idempotent. Submitting an order with an already existing `external_id`, will result in a `201` response code. In this case the response will return a representation of the already existing order in the response body.
|
|
2522
|
+
* @summary Create order
|
|
2523
|
+
* @param {CreateOrderRequest} createOrderRequest Order to create
|
|
2524
|
+
* @param {*} [options] Override http request option.
|
|
2525
|
+
* @throws {RequiredError}
|
|
2526
|
+
*/
|
|
2527
|
+
createOrder(createOrderRequest, options) {
|
|
2528
|
+
return localVarFp.createOrder(createOrderRequest, options).then((request) => request(axios, basePath));
|
|
2529
|
+
},
|
|
2530
|
+
/**
|
|
2531
|
+
* Retrieve the order, identified by the given `id` in the URL
|
|
2532
|
+
* @summary Retrieve order
|
|
2533
|
+
* @param {string} id ID of the order that should be retrieved. In case the order has an `external_id` reference supplied by the customer on creation, it\'s possible to use it instead.
|
|
2534
|
+
* @param {*} [options] Override http request option.
|
|
2535
|
+
* @throws {RequiredError}
|
|
2536
|
+
*/
|
|
2537
|
+
getOrder(id, options) {
|
|
2538
|
+
return localVarFp.getOrder(id, options).then((request) => request(axios, basePath));
|
|
2539
|
+
},
|
|
2540
|
+
/**
|
|
2541
|
+
* Retrieve a list of orders
|
|
2542
|
+
* @summary List orders
|
|
2543
|
+
* @param {number} [offset] Offsets the returned list by the given number of orders. The returned orders are ordered (and offsetted) by their creation date (DESC).
|
|
2544
|
+
* @param {string} [campaignId] Only return results with a matching campaign_id.
|
|
2545
|
+
* @param {string} [externalId] Only return results with a matching external_id.
|
|
2546
|
+
* @param {string} [createdAtGte] Only return results where the created_at field is greater than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
|
|
2547
|
+
* @param {string} [createdAtLte] Only return results where the created_at field is less than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
|
|
2548
|
+
* @param {number} [limit] Limits the number of orders listed. The maximum value is 100 and the default is 10.
|
|
2549
|
+
* @param {*} [options] Override http request option.
|
|
2550
|
+
* @throws {RequiredError}
|
|
2551
|
+
*/
|
|
2552
|
+
listOrders(offset, campaignId, externalId, createdAtGte, createdAtLte, limit, options) {
|
|
2553
|
+
return localVarFp.listOrders(offset, campaignId, externalId, createdAtGte, createdAtLte, limit, options).then((request) => request(axios, basePath));
|
|
2554
|
+
},
|
|
2555
|
+
/**
|
|
2556
|
+
* Rejects an order that is pending review, identified by the given `id` in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable \'Allow approvals via API\' via the organization\'\'s \'Order Approvals\' settings from the Tremendous dashboard.
|
|
2557
|
+
* @summary Reject order
|
|
2558
|
+
* @param {string} id ID of the order that should be rejected. In case the order has an `external_id` reference supplied by the customer on creation, it\'s possible to use it instead.
|
|
2559
|
+
* @param {*} [options] Override http request option.
|
|
2560
|
+
* @throws {RequiredError}
|
|
2561
|
+
*/
|
|
2562
|
+
rejectOrder(id, options) {
|
|
2563
|
+
return localVarFp.rejectOrder(id, options).then((request) => request(axios, basePath));
|
|
2564
|
+
},
|
|
2565
|
+
};
|
|
2566
|
+
};
|
|
2567
|
+
exports.OrdersApiFactory = OrdersApiFactory;
|
|
2568
|
+
/**
|
|
2569
|
+
* OrdersApi - object-oriented interface
|
|
2570
|
+
* @export
|
|
2571
|
+
* @class OrdersApi
|
|
2572
|
+
* @extends {BaseAPI}
|
|
2573
|
+
*/
|
|
2574
|
+
class OrdersApi extends base_1.BaseAPI {
|
|
2575
|
+
/**
|
|
2576
|
+
* Approves an order that is pending review, identified by the given `id` in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable \'Allow approvals via API\' via the organization\'\'s \'Order Approvals\' settings from the Tremendous dashboard.
|
|
2577
|
+
* @summary Approve order
|
|
2578
|
+
* @param {string} id ID of the order that should be approved. In case the order has an `external_id` reference supplied by the customer on creation, it\'s possible to use it instead.
|
|
2579
|
+
* @param {*} [options] Override http request option.
|
|
2580
|
+
* @throws {RequiredError}
|
|
2581
|
+
* @memberof OrdersApi
|
|
2582
|
+
*/
|
|
2583
|
+
approveOrder(id, options) {
|
|
2584
|
+
return (0, exports.OrdersApiFp)(this.configuration).approveOrder(id, options).then((request) => request(this.axios, this.basePath));
|
|
2585
|
+
}
|
|
2586
|
+
/**
|
|
2587
|
+
* Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style=\"display: block; margin-top: 20px;\" href=\"/docs/sending-rewards-intro\">Check it out!</a></strong> ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">external_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, <code>external_id</code> makes order idempotent. All requests that use the same <code>external_id</code> after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a <code>201</code> response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by <code>external_id</code> instead of <code>id</code> only.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">payment</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">funding_source_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use <code>balance</code> to use your Tremendous's balance.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">reward</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either <code>products</code> or <code>campaign_id</code> must be specified.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">products</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a <code>products</code> array will override the products made available by the campaign specified using the <code>campaign_id</code> property unless the <code>products</code> array is empty. It will <em>not</em> override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">denomination</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">currency_code</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Currency of the reward</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">recipient</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">email</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">phone</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">deliver_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">custom_fields</code> </div> </td><td><span class=\"property-type\">array</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Value of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">language</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\">ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a \"funding source\". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](https://tremendous.readme.io/reference/core-funding-source-index). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $5,000 in *fake money* to test the API. [Learn more about the sandbox environment](https://tremendous.readme.io/reference/sandbox). The HTTP status code `200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it\'s recipient (for delivery method `EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same external_id are idempotent. Submitting an order with an already existing `external_id`, will result in a `201` response code. In this case the response will return a representation of the already existing order in the response body.
|
|
2588
|
+
* @summary Create order
|
|
2589
|
+
* @param {CreateOrderRequest} createOrderRequest Order to create
|
|
2590
|
+
* @param {*} [options] Override http request option.
|
|
2591
|
+
* @throws {RequiredError}
|
|
2592
|
+
* @memberof OrdersApi
|
|
2593
|
+
*/
|
|
2594
|
+
createOrder(createOrderRequest, options) {
|
|
2595
|
+
return (0, exports.OrdersApiFp)(this.configuration).createOrder(createOrderRequest, options).then((request) => request(this.axios, this.basePath));
|
|
2596
|
+
}
|
|
2597
|
+
/**
|
|
2598
|
+
* Retrieve the order, identified by the given `id` in the URL
|
|
2599
|
+
* @summary Retrieve order
|
|
2600
|
+
* @param {string} id ID of the order that should be retrieved. In case the order has an `external_id` reference supplied by the customer on creation, it\'s possible to use it instead.
|
|
2601
|
+
* @param {*} [options] Override http request option.
|
|
2602
|
+
* @throws {RequiredError}
|
|
2603
|
+
* @memberof OrdersApi
|
|
2604
|
+
*/
|
|
2605
|
+
getOrder(id, options) {
|
|
2606
|
+
return (0, exports.OrdersApiFp)(this.configuration).getOrder(id, options).then((request) => request(this.axios, this.basePath));
|
|
2607
|
+
}
|
|
2608
|
+
/**
|
|
2609
|
+
* Retrieve a list of orders
|
|
2610
|
+
* @summary List orders
|
|
2611
|
+
* @param {number} [offset] Offsets the returned list by the given number of orders. The returned orders are ordered (and offsetted) by their creation date (DESC).
|
|
2612
|
+
* @param {string} [campaignId] Only return results with a matching campaign_id.
|
|
2613
|
+
* @param {string} [externalId] Only return results with a matching external_id.
|
|
2614
|
+
* @param {string} [createdAtGte] Only return results where the created_at field is greater than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
|
|
2615
|
+
* @param {string} [createdAtLte] Only return results where the created_at field is less than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
|
|
2616
|
+
* @param {number} [limit] Limits the number of orders listed. The maximum value is 100 and the default is 10.
|
|
2617
|
+
* @param {*} [options] Override http request option.
|
|
2618
|
+
* @throws {RequiredError}
|
|
2619
|
+
* @memberof OrdersApi
|
|
2620
|
+
*/
|
|
2621
|
+
listOrders(offset, campaignId, externalId, createdAtGte, createdAtLte, limit, options) {
|
|
2622
|
+
return (0, exports.OrdersApiFp)(this.configuration).listOrders(offset, campaignId, externalId, createdAtGte, createdAtLte, limit, options).then((request) => request(this.axios, this.basePath));
|
|
2623
|
+
}
|
|
2624
|
+
/**
|
|
2625
|
+
* Rejects an order that is pending review, identified by the given `id` in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable \'Allow approvals via API\' via the organization\'\'s \'Order Approvals\' settings from the Tremendous dashboard.
|
|
2626
|
+
* @summary Reject order
|
|
2627
|
+
* @param {string} id ID of the order that should be rejected. In case the order has an `external_id` reference supplied by the customer on creation, it\'s possible to use it instead.
|
|
2628
|
+
* @param {*} [options] Override http request option.
|
|
2629
|
+
* @throws {RequiredError}
|
|
2630
|
+
* @memberof OrdersApi
|
|
2631
|
+
*/
|
|
2632
|
+
rejectOrder(id, options) {
|
|
2633
|
+
return (0, exports.OrdersApiFp)(this.configuration).rejectOrder(id, options).then((request) => request(this.axios, this.basePath));
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2636
|
+
exports.OrdersApi = OrdersApi;
|
|
2637
|
+
/**
|
|
2638
|
+
* OrganizationsApi - axios parameter creator
|
|
2639
|
+
* @export
|
|
2640
|
+
*/
|
|
2641
|
+
const OrganizationsApiAxiosParamCreator = function (configuration) {
|
|
2642
|
+
return {
|
|
2643
|
+
/**
|
|
2644
|
+
* Creates a new API key. The API key used to make the request will remain active. Created API keys are generated randomly and returned in the response. **You cannot retrieve them again.**
|
|
2645
|
+
* @summary Create API key
|
|
2646
|
+
* @param {*} [options] Override http request option.
|
|
2647
|
+
* @throws {RequiredError}
|
|
2648
|
+
*/
|
|
2649
|
+
createApiKey: (options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
2650
|
+
const localVarPath = `/organizations/create_api_key`;
|
|
2651
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2652
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
2653
|
+
let baseOptions;
|
|
2654
|
+
if (configuration) {
|
|
2655
|
+
baseOptions = configuration.baseOptions;
|
|
2656
|
+
}
|
|
2657
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
2658
|
+
const localVarHeaderParameter = {};
|
|
2659
|
+
const localVarQueryParameter = {};
|
|
2660
|
+
// authentication BearerApiKey required
|
|
2661
|
+
// http bearer authentication required
|
|
2662
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
2663
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
2664
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2665
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
2666
|
+
return {
|
|
2667
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
2668
|
+
options: localVarRequestOptions,
|
|
2669
|
+
};
|
|
2670
|
+
}),
|
|
2671
|
+
/**
|
|
2672
|
+
* Organizations are a way to separate different parts of your business within the same Tremendous account. You can assign users in your Tremendous team as members to any organization. Users can be members of multiple organizations at once. API keys belong to a single organization. The API key used in a request determines on behalf of which organization the request is carried out. **Important note:** When creating an organization, you are required to either pass `with_api_key` or `copy_settings[user]` in the request body as `true`. This ensures that your new Organization can either be accessed via the API or the Dashboard.
|
|
2673
|
+
* @summary Create organization
|
|
2674
|
+
* @param {CreateOrganizationRequest} createOrganizationRequest Organization details
|
|
2675
|
+
* @param {*} [options] Override http request option.
|
|
2676
|
+
* @throws {RequiredError}
|
|
2677
|
+
*/
|
|
2678
|
+
createOrganization: (createOrganizationRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
2679
|
+
// verify required parameter 'createOrganizationRequest' is not null or undefined
|
|
2680
|
+
(0, common_1.assertParamExists)('createOrganization', 'createOrganizationRequest', createOrganizationRequest);
|
|
2681
|
+
const localVarPath = `/organizations`;
|
|
2682
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2683
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
2684
|
+
let baseOptions;
|
|
2685
|
+
if (configuration) {
|
|
2686
|
+
baseOptions = configuration.baseOptions;
|
|
2687
|
+
}
|
|
2688
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
2689
|
+
const localVarHeaderParameter = {};
|
|
2690
|
+
const localVarQueryParameter = {};
|
|
2691
|
+
// authentication BearerApiKey required
|
|
2692
|
+
// http bearer authentication required
|
|
2693
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
2694
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
2695
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
2696
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2697
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
2698
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createOrganizationRequest, localVarRequestOptions, configuration);
|
|
2699
|
+
return {
|
|
2700
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
2701
|
+
options: localVarRequestOptions,
|
|
2702
|
+
};
|
|
2703
|
+
}),
|
|
2704
|
+
/**
|
|
2705
|
+
*
|
|
2706
|
+
* @summary Retrieve organization
|
|
2707
|
+
* @param {string} id ID of the organization to retrieve
|
|
2708
|
+
* @param {*} [options] Override http request option.
|
|
2709
|
+
* @throws {RequiredError}
|
|
2710
|
+
*/
|
|
2711
|
+
getOrganization: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
2712
|
+
// verify required parameter 'id' is not null or undefined
|
|
2713
|
+
(0, common_1.assertParamExists)('getOrganization', 'id', id);
|
|
2714
|
+
const localVarPath = `/organizations/{id}`
|
|
2715
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
2716
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2717
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
2718
|
+
let baseOptions;
|
|
2719
|
+
if (configuration) {
|
|
2720
|
+
baseOptions = configuration.baseOptions;
|
|
2721
|
+
}
|
|
2722
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
2723
|
+
const localVarHeaderParameter = {};
|
|
2724
|
+
const localVarQueryParameter = {};
|
|
2725
|
+
// authentication BearerApiKey required
|
|
2726
|
+
// http bearer authentication required
|
|
2727
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
2728
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
2729
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2730
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
2731
|
+
return {
|
|
2732
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
2733
|
+
options: localVarRequestOptions,
|
|
2734
|
+
};
|
|
2735
|
+
}),
|
|
2736
|
+
/**
|
|
2737
|
+
* The returned list only includes the organization to which the API key belongs to, that is used for the request.
|
|
2738
|
+
* @summary List organizations
|
|
2739
|
+
* @param {*} [options] Override http request option.
|
|
2740
|
+
* @throws {RequiredError}
|
|
2741
|
+
*/
|
|
2742
|
+
listOrganizations: (options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
2743
|
+
const localVarPath = `/organizations`;
|
|
2744
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2745
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
2746
|
+
let baseOptions;
|
|
2747
|
+
if (configuration) {
|
|
2748
|
+
baseOptions = configuration.baseOptions;
|
|
2749
|
+
}
|
|
2750
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
2751
|
+
const localVarHeaderParameter = {};
|
|
2752
|
+
const localVarQueryParameter = {};
|
|
2753
|
+
// authentication BearerApiKey required
|
|
2754
|
+
// http bearer authentication required
|
|
2755
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
2756
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
2757
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2758
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
2759
|
+
return {
|
|
2760
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
2761
|
+
options: localVarRequestOptions,
|
|
2762
|
+
};
|
|
2763
|
+
}),
|
|
2764
|
+
};
|
|
2765
|
+
};
|
|
2766
|
+
exports.OrganizationsApiAxiosParamCreator = OrganizationsApiAxiosParamCreator;
|
|
2767
|
+
/**
|
|
2768
|
+
* OrganizationsApi - functional programming interface
|
|
2769
|
+
* @export
|
|
2770
|
+
*/
|
|
2771
|
+
const OrganizationsApiFp = function (configuration) {
|
|
2772
|
+
const localVarAxiosParamCreator = (0, exports.OrganizationsApiAxiosParamCreator)(configuration);
|
|
2773
|
+
return {
|
|
2774
|
+
/**
|
|
2775
|
+
* Creates a new API key. The API key used to make the request will remain active. Created API keys are generated randomly and returned in the response. **You cannot retrieve them again.**
|
|
2776
|
+
* @summary Create API key
|
|
2777
|
+
* @param {*} [options] Override http request option.
|
|
2778
|
+
* @throws {RequiredError}
|
|
2779
|
+
*/
|
|
2780
|
+
createApiKey(options) {
|
|
2781
|
+
var _a, _b, _c;
|
|
2782
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2783
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createApiKey(options);
|
|
2784
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
2785
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['OrganizationsApi.createApiKey']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
2786
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
2787
|
+
});
|
|
2788
|
+
},
|
|
2789
|
+
/**
|
|
2790
|
+
* Organizations are a way to separate different parts of your business within the same Tremendous account. You can assign users in your Tremendous team as members to any organization. Users can be members of multiple organizations at once. API keys belong to a single organization. The API key used in a request determines on behalf of which organization the request is carried out. **Important note:** When creating an organization, you are required to either pass `with_api_key` or `copy_settings[user]` in the request body as `true`. This ensures that your new Organization can either be accessed via the API or the Dashboard.
|
|
2791
|
+
* @summary Create organization
|
|
2792
|
+
* @param {CreateOrganizationRequest} createOrganizationRequest Organization details
|
|
2793
|
+
* @param {*} [options] Override http request option.
|
|
2794
|
+
* @throws {RequiredError}
|
|
2795
|
+
*/
|
|
2796
|
+
createOrganization(createOrganizationRequest, options) {
|
|
2797
|
+
var _a, _b, _c;
|
|
2798
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2799
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createOrganization(createOrganizationRequest, options);
|
|
2800
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
2801
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['OrganizationsApi.createOrganization']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
2802
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
2803
|
+
});
|
|
2804
|
+
},
|
|
2805
|
+
/**
|
|
2806
|
+
*
|
|
2807
|
+
* @summary Retrieve organization
|
|
2808
|
+
* @param {string} id ID of the organization to retrieve
|
|
2809
|
+
* @param {*} [options] Override http request option.
|
|
2810
|
+
* @throws {RequiredError}
|
|
2811
|
+
*/
|
|
2812
|
+
getOrganization(id, options) {
|
|
2813
|
+
var _a, _b, _c;
|
|
2814
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2815
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrganization(id, options);
|
|
2816
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
2817
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['OrganizationsApi.getOrganization']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
2818
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
2819
|
+
});
|
|
2820
|
+
},
|
|
2821
|
+
/**
|
|
2822
|
+
* The returned list only includes the organization to which the API key belongs to, that is used for the request.
|
|
2823
|
+
* @summary List organizations
|
|
2824
|
+
* @param {*} [options] Override http request option.
|
|
2825
|
+
* @throws {RequiredError}
|
|
2826
|
+
*/
|
|
2827
|
+
listOrganizations(options) {
|
|
2828
|
+
var _a, _b, _c;
|
|
2829
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2830
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listOrganizations(options);
|
|
2831
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
2832
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['OrganizationsApi.listOrganizations']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
2833
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
2834
|
+
});
|
|
2835
|
+
},
|
|
2836
|
+
};
|
|
2837
|
+
};
|
|
2838
|
+
exports.OrganizationsApiFp = OrganizationsApiFp;
|
|
2839
|
+
/**
|
|
2840
|
+
* OrganizationsApi - factory interface
|
|
2841
|
+
* @export
|
|
2842
|
+
*/
|
|
2843
|
+
const OrganizationsApiFactory = function (configuration, basePath, axios) {
|
|
2844
|
+
const localVarFp = (0, exports.OrganizationsApiFp)(configuration);
|
|
2845
|
+
return {
|
|
2846
|
+
/**
|
|
2847
|
+
* Creates a new API key. The API key used to make the request will remain active. Created API keys are generated randomly and returned in the response. **You cannot retrieve them again.**
|
|
2848
|
+
* @summary Create API key
|
|
2849
|
+
* @param {*} [options] Override http request option.
|
|
2850
|
+
* @throws {RequiredError}
|
|
2851
|
+
*/
|
|
2852
|
+
createApiKey(options) {
|
|
2853
|
+
return localVarFp.createApiKey(options).then((request) => request(axios, basePath));
|
|
2854
|
+
},
|
|
2855
|
+
/**
|
|
2856
|
+
* Organizations are a way to separate different parts of your business within the same Tremendous account. You can assign users in your Tremendous team as members to any organization. Users can be members of multiple organizations at once. API keys belong to a single organization. The API key used in a request determines on behalf of which organization the request is carried out. **Important note:** When creating an organization, you are required to either pass `with_api_key` or `copy_settings[user]` in the request body as `true`. This ensures that your new Organization can either be accessed via the API or the Dashboard.
|
|
2857
|
+
* @summary Create organization
|
|
2858
|
+
* @param {CreateOrganizationRequest} createOrganizationRequest Organization details
|
|
2859
|
+
* @param {*} [options] Override http request option.
|
|
2860
|
+
* @throws {RequiredError}
|
|
2861
|
+
*/
|
|
2862
|
+
createOrganization(createOrganizationRequest, options) {
|
|
2863
|
+
return localVarFp.createOrganization(createOrganizationRequest, options).then((request) => request(axios, basePath));
|
|
2864
|
+
},
|
|
2865
|
+
/**
|
|
2866
|
+
*
|
|
2867
|
+
* @summary Retrieve organization
|
|
2868
|
+
* @param {string} id ID of the organization to retrieve
|
|
2869
|
+
* @param {*} [options] Override http request option.
|
|
2870
|
+
* @throws {RequiredError}
|
|
2871
|
+
*/
|
|
2872
|
+
getOrganization(id, options) {
|
|
2873
|
+
return localVarFp.getOrganization(id, options).then((request) => request(axios, basePath));
|
|
2874
|
+
},
|
|
2875
|
+
/**
|
|
2876
|
+
* The returned list only includes the organization to which the API key belongs to, that is used for the request.
|
|
2877
|
+
* @summary List organizations
|
|
2878
|
+
* @param {*} [options] Override http request option.
|
|
2879
|
+
* @throws {RequiredError}
|
|
2880
|
+
*/
|
|
2881
|
+
listOrganizations(options) {
|
|
2882
|
+
return localVarFp.listOrganizations(options).then((request) => request(axios, basePath));
|
|
2883
|
+
},
|
|
2884
|
+
};
|
|
2885
|
+
};
|
|
2886
|
+
exports.OrganizationsApiFactory = OrganizationsApiFactory;
|
|
2887
|
+
/**
|
|
2888
|
+
* OrganizationsApi - object-oriented interface
|
|
2889
|
+
* @export
|
|
2890
|
+
* @class OrganizationsApi
|
|
2891
|
+
* @extends {BaseAPI}
|
|
2892
|
+
*/
|
|
2893
|
+
class OrganizationsApi extends base_1.BaseAPI {
|
|
2894
|
+
/**
|
|
2895
|
+
* Creates a new API key. The API key used to make the request will remain active. Created API keys are generated randomly and returned in the response. **You cannot retrieve them again.**
|
|
2896
|
+
* @summary Create API key
|
|
2897
|
+
* @param {*} [options] Override http request option.
|
|
2898
|
+
* @throws {RequiredError}
|
|
2899
|
+
* @memberof OrganizationsApi
|
|
2900
|
+
*/
|
|
2901
|
+
createApiKey(options) {
|
|
2902
|
+
return (0, exports.OrganizationsApiFp)(this.configuration).createApiKey(options).then((request) => request(this.axios, this.basePath));
|
|
2903
|
+
}
|
|
2904
|
+
/**
|
|
2905
|
+
* Organizations are a way to separate different parts of your business within the same Tremendous account. You can assign users in your Tremendous team as members to any organization. Users can be members of multiple organizations at once. API keys belong to a single organization. The API key used in a request determines on behalf of which organization the request is carried out. **Important note:** When creating an organization, you are required to either pass `with_api_key` or `copy_settings[user]` in the request body as `true`. This ensures that your new Organization can either be accessed via the API or the Dashboard.
|
|
2906
|
+
* @summary Create organization
|
|
2907
|
+
* @param {CreateOrganizationRequest} createOrganizationRequest Organization details
|
|
2908
|
+
* @param {*} [options] Override http request option.
|
|
2909
|
+
* @throws {RequiredError}
|
|
2910
|
+
* @memberof OrganizationsApi
|
|
2911
|
+
*/
|
|
2912
|
+
createOrganization(createOrganizationRequest, options) {
|
|
2913
|
+
return (0, exports.OrganizationsApiFp)(this.configuration).createOrganization(createOrganizationRequest, options).then((request) => request(this.axios, this.basePath));
|
|
2914
|
+
}
|
|
2915
|
+
/**
|
|
2916
|
+
*
|
|
2917
|
+
* @summary Retrieve organization
|
|
2918
|
+
* @param {string} id ID of the organization to retrieve
|
|
2919
|
+
* @param {*} [options] Override http request option.
|
|
2920
|
+
* @throws {RequiredError}
|
|
2921
|
+
* @memberof OrganizationsApi
|
|
2922
|
+
*/
|
|
2923
|
+
getOrganization(id, options) {
|
|
2924
|
+
return (0, exports.OrganizationsApiFp)(this.configuration).getOrganization(id, options).then((request) => request(this.axios, this.basePath));
|
|
2925
|
+
}
|
|
2926
|
+
/**
|
|
2927
|
+
* The returned list only includes the organization to which the API key belongs to, that is used for the request.
|
|
2928
|
+
* @summary List organizations
|
|
2929
|
+
* @param {*} [options] Override http request option.
|
|
2930
|
+
* @throws {RequiredError}
|
|
2931
|
+
* @memberof OrganizationsApi
|
|
2932
|
+
*/
|
|
2933
|
+
listOrganizations(options) {
|
|
2934
|
+
return (0, exports.OrganizationsApiFp)(this.configuration).listOrganizations(options).then((request) => request(this.axios, this.basePath));
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
exports.OrganizationsApi = OrganizationsApi;
|
|
2938
|
+
/**
|
|
2939
|
+
* ProductsApi - axios parameter creator
|
|
2940
|
+
* @export
|
|
2941
|
+
*/
|
|
2942
|
+
const ProductsApiAxiosParamCreator = function (configuration) {
|
|
2943
|
+
return {
|
|
2944
|
+
/**
|
|
2945
|
+
* Retrieve a product, identified by the given `id` in the URL
|
|
2946
|
+
* @summary Retrieve product
|
|
2947
|
+
* @param {string} id ID of the product that should be retrieved
|
|
2948
|
+
* @param {*} [options] Override http request option.
|
|
2949
|
+
* @throws {RequiredError}
|
|
2950
|
+
*/
|
|
2951
|
+
getProduct: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
2952
|
+
// verify required parameter 'id' is not null or undefined
|
|
2953
|
+
(0, common_1.assertParamExists)('getProduct', 'id', id);
|
|
2954
|
+
const localVarPath = `/products/{id}`
|
|
2955
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
2956
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2957
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
2958
|
+
let baseOptions;
|
|
2959
|
+
if (configuration) {
|
|
2960
|
+
baseOptions = configuration.baseOptions;
|
|
2961
|
+
}
|
|
2962
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
2963
|
+
const localVarHeaderParameter = {};
|
|
2964
|
+
const localVarQueryParameter = {};
|
|
2965
|
+
// authentication BearerApiKey required
|
|
2966
|
+
// http bearer authentication required
|
|
2967
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
2968
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
2969
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2970
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
2971
|
+
return {
|
|
2972
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
2973
|
+
options: localVarRequestOptions,
|
|
2974
|
+
};
|
|
2975
|
+
}),
|
|
2976
|
+
/**
|
|
2977
|
+
* Retrieve a list of available products
|
|
2978
|
+
* @summary List products
|
|
2979
|
+
* @param {string} [country] Comma-separated list of [Alpha-2 country codes](https://www.iban.com/country-codes), used to only retrieve products available in the provided countries
|
|
2980
|
+
* @param {string} [currency] Comma-separated list of [currency codes](https://www.iban.com/currency-codes), used to only retrieve products available in the provided currencies
|
|
2981
|
+
* @param {*} [options] Override http request option.
|
|
2982
|
+
* @throws {RequiredError}
|
|
2983
|
+
*/
|
|
2984
|
+
listProducts: (country, currency, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
2985
|
+
const localVarPath = `/products`;
|
|
2986
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2987
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
2988
|
+
let baseOptions;
|
|
2989
|
+
if (configuration) {
|
|
2990
|
+
baseOptions = configuration.baseOptions;
|
|
2991
|
+
}
|
|
2992
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
2993
|
+
const localVarHeaderParameter = {};
|
|
2994
|
+
const localVarQueryParameter = {};
|
|
2995
|
+
// authentication BearerApiKey required
|
|
2996
|
+
// http bearer authentication required
|
|
2997
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
2998
|
+
if (country !== undefined) {
|
|
2999
|
+
localVarQueryParameter['country'] = country;
|
|
3000
|
+
}
|
|
3001
|
+
if (currency !== undefined) {
|
|
3002
|
+
localVarQueryParameter['currency'] = currency;
|
|
3003
|
+
}
|
|
3004
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
3005
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3006
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
3007
|
+
return {
|
|
3008
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
3009
|
+
options: localVarRequestOptions,
|
|
3010
|
+
};
|
|
3011
|
+
}),
|
|
3012
|
+
};
|
|
3013
|
+
};
|
|
3014
|
+
exports.ProductsApiAxiosParamCreator = ProductsApiAxiosParamCreator;
|
|
3015
|
+
/**
|
|
3016
|
+
* ProductsApi - functional programming interface
|
|
3017
|
+
* @export
|
|
3018
|
+
*/
|
|
3019
|
+
const ProductsApiFp = function (configuration) {
|
|
3020
|
+
const localVarAxiosParamCreator = (0, exports.ProductsApiAxiosParamCreator)(configuration);
|
|
3021
|
+
return {
|
|
3022
|
+
/**
|
|
3023
|
+
* Retrieve a product, identified by the given `id` in the URL
|
|
3024
|
+
* @summary Retrieve product
|
|
3025
|
+
* @param {string} id ID of the product that should be retrieved
|
|
3026
|
+
* @param {*} [options] Override http request option.
|
|
3027
|
+
* @throws {RequiredError}
|
|
3028
|
+
*/
|
|
3029
|
+
getProduct(id, options) {
|
|
3030
|
+
var _a, _b, _c;
|
|
3031
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3032
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getProduct(id, options);
|
|
3033
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
3034
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['ProductsApi.getProduct']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
3035
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
3036
|
+
});
|
|
3037
|
+
},
|
|
3038
|
+
/**
|
|
3039
|
+
* Retrieve a list of available products
|
|
3040
|
+
* @summary List products
|
|
3041
|
+
* @param {string} [country] Comma-separated list of [Alpha-2 country codes](https://www.iban.com/country-codes), used to only retrieve products available in the provided countries
|
|
3042
|
+
* @param {string} [currency] Comma-separated list of [currency codes](https://www.iban.com/currency-codes), used to only retrieve products available in the provided currencies
|
|
3043
|
+
* @param {*} [options] Override http request option.
|
|
3044
|
+
* @throws {RequiredError}
|
|
3045
|
+
*/
|
|
3046
|
+
listProducts(country, currency, options) {
|
|
3047
|
+
var _a, _b, _c;
|
|
3048
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3049
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listProducts(country, currency, options);
|
|
3050
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
3051
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['ProductsApi.listProducts']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
3052
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
3053
|
+
});
|
|
3054
|
+
},
|
|
3055
|
+
};
|
|
3056
|
+
};
|
|
3057
|
+
exports.ProductsApiFp = ProductsApiFp;
|
|
3058
|
+
/**
|
|
3059
|
+
* ProductsApi - factory interface
|
|
3060
|
+
* @export
|
|
3061
|
+
*/
|
|
3062
|
+
const ProductsApiFactory = function (configuration, basePath, axios) {
|
|
3063
|
+
const localVarFp = (0, exports.ProductsApiFp)(configuration);
|
|
3064
|
+
return {
|
|
3065
|
+
/**
|
|
3066
|
+
* Retrieve a product, identified by the given `id` in the URL
|
|
3067
|
+
* @summary Retrieve product
|
|
3068
|
+
* @param {string} id ID of the product that should be retrieved
|
|
3069
|
+
* @param {*} [options] Override http request option.
|
|
3070
|
+
* @throws {RequiredError}
|
|
3071
|
+
*/
|
|
3072
|
+
getProduct(id, options) {
|
|
3073
|
+
return localVarFp.getProduct(id, options).then((request) => request(axios, basePath));
|
|
3074
|
+
},
|
|
3075
|
+
/**
|
|
3076
|
+
* Retrieve a list of available products
|
|
3077
|
+
* @summary List products
|
|
3078
|
+
* @param {string} [country] Comma-separated list of [Alpha-2 country codes](https://www.iban.com/country-codes), used to only retrieve products available in the provided countries
|
|
3079
|
+
* @param {string} [currency] Comma-separated list of [currency codes](https://www.iban.com/currency-codes), used to only retrieve products available in the provided currencies
|
|
3080
|
+
* @param {*} [options] Override http request option.
|
|
3081
|
+
* @throws {RequiredError}
|
|
3082
|
+
*/
|
|
3083
|
+
listProducts(country, currency, options) {
|
|
3084
|
+
return localVarFp.listProducts(country, currency, options).then((request) => request(axios, basePath));
|
|
3085
|
+
},
|
|
3086
|
+
};
|
|
3087
|
+
};
|
|
3088
|
+
exports.ProductsApiFactory = ProductsApiFactory;
|
|
3089
|
+
/**
|
|
3090
|
+
* ProductsApi - object-oriented interface
|
|
3091
|
+
* @export
|
|
3092
|
+
* @class ProductsApi
|
|
3093
|
+
* @extends {BaseAPI}
|
|
3094
|
+
*/
|
|
3095
|
+
class ProductsApi extends base_1.BaseAPI {
|
|
3096
|
+
/**
|
|
3097
|
+
* Retrieve a product, identified by the given `id` in the URL
|
|
3098
|
+
* @summary Retrieve product
|
|
3099
|
+
* @param {string} id ID of the product that should be retrieved
|
|
3100
|
+
* @param {*} [options] Override http request option.
|
|
3101
|
+
* @throws {RequiredError}
|
|
3102
|
+
* @memberof ProductsApi
|
|
3103
|
+
*/
|
|
3104
|
+
getProduct(id, options) {
|
|
3105
|
+
return (0, exports.ProductsApiFp)(this.configuration).getProduct(id, options).then((request) => request(this.axios, this.basePath));
|
|
3106
|
+
}
|
|
3107
|
+
/**
|
|
3108
|
+
* Retrieve a list of available products
|
|
3109
|
+
* @summary List products
|
|
3110
|
+
* @param {string} [country] Comma-separated list of [Alpha-2 country codes](https://www.iban.com/country-codes), used to only retrieve products available in the provided countries
|
|
3111
|
+
* @param {string} [currency] Comma-separated list of [currency codes](https://www.iban.com/currency-codes), used to only retrieve products available in the provided currencies
|
|
3112
|
+
* @param {*} [options] Override http request option.
|
|
3113
|
+
* @throws {RequiredError}
|
|
3114
|
+
* @memberof ProductsApi
|
|
3115
|
+
*/
|
|
3116
|
+
listProducts(country, currency, options) {
|
|
3117
|
+
return (0, exports.ProductsApiFp)(this.configuration).listProducts(country, currency, options).then((request) => request(this.axios, this.basePath));
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
exports.ProductsApi = ProductsApi;
|
|
3121
|
+
/**
|
|
3122
|
+
* RewardsApi - axios parameter creator
|
|
3123
|
+
* @export
|
|
3124
|
+
*/
|
|
3125
|
+
const RewardsApiAxiosParamCreator = function (configuration) {
|
|
3126
|
+
return {
|
|
3127
|
+
/**
|
|
3128
|
+
* Generate a redemption link for the reward identified by the `id` in the URL
|
|
3129
|
+
* @summary Generate a reward URL
|
|
3130
|
+
* @param {string} id ID of the reward
|
|
3131
|
+
* @param {*} [options] Override http request option.
|
|
3132
|
+
* @throws {RequiredError}
|
|
3133
|
+
*/
|
|
3134
|
+
generateRewardLink: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
3135
|
+
// verify required parameter 'id' is not null or undefined
|
|
3136
|
+
(0, common_1.assertParamExists)('generateRewardLink', 'id', id);
|
|
3137
|
+
const localVarPath = `/rewards/{id}/generate_link`
|
|
3138
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
3139
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
3140
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
3141
|
+
let baseOptions;
|
|
3142
|
+
if (configuration) {
|
|
3143
|
+
baseOptions = configuration.baseOptions;
|
|
3144
|
+
}
|
|
3145
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
3146
|
+
const localVarHeaderParameter = {};
|
|
3147
|
+
const localVarQueryParameter = {};
|
|
3148
|
+
// authentication BearerApiKey required
|
|
3149
|
+
// http bearer authentication required
|
|
3150
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
3151
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
3152
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3153
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
3154
|
+
return {
|
|
3155
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
3156
|
+
options: localVarRequestOptions,
|
|
3157
|
+
};
|
|
3158
|
+
}),
|
|
3159
|
+
/**
|
|
3160
|
+
* Generate a temporary reward token identified by the `id` in the URL. These tokens are needed to render a reward when using [Tremendous Embed](https://github.com/tremendous-rewards/embed/blob/master/docs/documentation.md). The token is valid for 24 hours.
|
|
3161
|
+
* @summary Generate a reward token
|
|
3162
|
+
* @param {string} id ID of the reward
|
|
3163
|
+
* @param {*} [options] Override http request option.
|
|
3164
|
+
* @throws {RequiredError}
|
|
3165
|
+
*/
|
|
3166
|
+
generateRewardToken: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
3167
|
+
// verify required parameter 'id' is not null or undefined
|
|
3168
|
+
(0, common_1.assertParamExists)('generateRewardToken', 'id', id);
|
|
3169
|
+
const localVarPath = `/rewards/{id}/generate_embed_token`
|
|
3170
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
3171
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
3172
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
3173
|
+
let baseOptions;
|
|
3174
|
+
if (configuration) {
|
|
3175
|
+
baseOptions = configuration.baseOptions;
|
|
3176
|
+
}
|
|
3177
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
3178
|
+
const localVarHeaderParameter = {};
|
|
3179
|
+
const localVarQueryParameter = {};
|
|
3180
|
+
// authentication BearerApiKey required
|
|
3181
|
+
// http bearer authentication required
|
|
3182
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
3183
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
3184
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3185
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
3186
|
+
return {
|
|
3187
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
3188
|
+
options: localVarRequestOptions,
|
|
3189
|
+
};
|
|
3190
|
+
}),
|
|
3191
|
+
/**
|
|
3192
|
+
* Retrieve the reward, identified by the given `id` in the URL
|
|
3193
|
+
* @summary Retrieve single reward
|
|
3194
|
+
* @param {string} id ID of the reward that should be retrieved
|
|
3195
|
+
* @param {*} [options] Override http request option.
|
|
3196
|
+
* @throws {RequiredError}
|
|
3197
|
+
*/
|
|
3198
|
+
getReward: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
3199
|
+
// verify required parameter 'id' is not null or undefined
|
|
3200
|
+
(0, common_1.assertParamExists)('getReward', 'id', id);
|
|
3201
|
+
const localVarPath = `/rewards/{id}`
|
|
3202
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
3203
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
3204
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
3205
|
+
let baseOptions;
|
|
3206
|
+
if (configuration) {
|
|
3207
|
+
baseOptions = configuration.baseOptions;
|
|
3208
|
+
}
|
|
3209
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
3210
|
+
const localVarHeaderParameter = {};
|
|
3211
|
+
const localVarQueryParameter = {};
|
|
3212
|
+
// authentication BearerApiKey required
|
|
3213
|
+
// http bearer authentication required
|
|
3214
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
3215
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
3216
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3217
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
3218
|
+
return {
|
|
3219
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
3220
|
+
options: localVarRequestOptions,
|
|
3221
|
+
};
|
|
3222
|
+
}),
|
|
3223
|
+
/**
|
|
3224
|
+
* Retrieve a list of all created rewards
|
|
3225
|
+
* @summary List rewards
|
|
3226
|
+
* @param {number} [offset] Offsets the returned list by the given number of rewards. The returned rewards are ordered (and offsetted) by their creation date (DESC).
|
|
3227
|
+
* @param {*} [options] Override http request option.
|
|
3228
|
+
* @throws {RequiredError}
|
|
3229
|
+
*/
|
|
3230
|
+
listRewards: (offset, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
3231
|
+
const localVarPath = `/rewards`;
|
|
3232
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
3233
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
3234
|
+
let baseOptions;
|
|
3235
|
+
if (configuration) {
|
|
3236
|
+
baseOptions = configuration.baseOptions;
|
|
3237
|
+
}
|
|
3238
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
3239
|
+
const localVarHeaderParameter = {};
|
|
3240
|
+
const localVarQueryParameter = {};
|
|
3241
|
+
// authentication BearerApiKey required
|
|
3242
|
+
// http bearer authentication required
|
|
3243
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
3244
|
+
if (offset !== undefined) {
|
|
3245
|
+
localVarQueryParameter['offset'] = offset;
|
|
3246
|
+
}
|
|
3247
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
3248
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3249
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
3250
|
+
return {
|
|
3251
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
3252
|
+
options: localVarRequestOptions,
|
|
3253
|
+
};
|
|
3254
|
+
}),
|
|
3255
|
+
/**
|
|
3256
|
+
* Resends a reward, identified by the given `id` in the URL, to its recipient.
|
|
3257
|
+
* @summary Resend reward
|
|
3258
|
+
* @param {string} id ID of the reward that should be resent
|
|
3259
|
+
* @param {*} [options] Override http request option.
|
|
3260
|
+
* @throws {RequiredError}
|
|
3261
|
+
*/
|
|
3262
|
+
resendReward: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
3263
|
+
// verify required parameter 'id' is not null or undefined
|
|
3264
|
+
(0, common_1.assertParamExists)('resendReward', 'id', id);
|
|
3265
|
+
const localVarPath = `/rewards/{id}/resend`
|
|
3266
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
3267
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
3268
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
3269
|
+
let baseOptions;
|
|
3270
|
+
if (configuration) {
|
|
3271
|
+
baseOptions = configuration.baseOptions;
|
|
3272
|
+
}
|
|
3273
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
3274
|
+
const localVarHeaderParameter = {};
|
|
3275
|
+
const localVarQueryParameter = {};
|
|
3276
|
+
// authentication BearerApiKey required
|
|
3277
|
+
// http bearer authentication required
|
|
3278
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
3279
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
3280
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3281
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
3282
|
+
return {
|
|
3283
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
3284
|
+
options: localVarRequestOptions,
|
|
3285
|
+
};
|
|
3286
|
+
}),
|
|
3287
|
+
};
|
|
3288
|
+
};
|
|
3289
|
+
exports.RewardsApiAxiosParamCreator = RewardsApiAxiosParamCreator;
|
|
3290
|
+
/**
|
|
3291
|
+
* RewardsApi - functional programming interface
|
|
3292
|
+
* @export
|
|
3293
|
+
*/
|
|
3294
|
+
const RewardsApiFp = function (configuration) {
|
|
3295
|
+
const localVarAxiosParamCreator = (0, exports.RewardsApiAxiosParamCreator)(configuration);
|
|
3296
|
+
return {
|
|
3297
|
+
/**
|
|
3298
|
+
* Generate a redemption link for the reward identified by the `id` in the URL
|
|
3299
|
+
* @summary Generate a reward URL
|
|
3300
|
+
* @param {string} id ID of the reward
|
|
3301
|
+
* @param {*} [options] Override http request option.
|
|
3302
|
+
* @throws {RequiredError}
|
|
3303
|
+
*/
|
|
3304
|
+
generateRewardLink(id, options) {
|
|
3305
|
+
var _a, _b, _c;
|
|
3306
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3307
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.generateRewardLink(id, options);
|
|
3308
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
3309
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['RewardsApi.generateRewardLink']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
3310
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
3311
|
+
});
|
|
3312
|
+
},
|
|
3313
|
+
/**
|
|
3314
|
+
* Generate a temporary reward token identified by the `id` in the URL. These tokens are needed to render a reward when using [Tremendous Embed](https://github.com/tremendous-rewards/embed/blob/master/docs/documentation.md). The token is valid for 24 hours.
|
|
3315
|
+
* @summary Generate a reward token
|
|
3316
|
+
* @param {string} id ID of the reward
|
|
3317
|
+
* @param {*} [options] Override http request option.
|
|
3318
|
+
* @throws {RequiredError}
|
|
3319
|
+
*/
|
|
3320
|
+
generateRewardToken(id, options) {
|
|
3321
|
+
var _a, _b, _c;
|
|
3322
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3323
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.generateRewardToken(id, options);
|
|
3324
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
3325
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['RewardsApi.generateRewardToken']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
3326
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
3327
|
+
});
|
|
3328
|
+
},
|
|
3329
|
+
/**
|
|
3330
|
+
* Retrieve the reward, identified by the given `id` in the URL
|
|
3331
|
+
* @summary Retrieve single reward
|
|
3332
|
+
* @param {string} id ID of the reward that should be retrieved
|
|
3333
|
+
* @param {*} [options] Override http request option.
|
|
3334
|
+
* @throws {RequiredError}
|
|
3335
|
+
*/
|
|
3336
|
+
getReward(id, options) {
|
|
3337
|
+
var _a, _b, _c;
|
|
3338
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3339
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getReward(id, options);
|
|
3340
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
3341
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['RewardsApi.getReward']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
3342
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
3343
|
+
});
|
|
3344
|
+
},
|
|
3345
|
+
/**
|
|
3346
|
+
* Retrieve a list of all created rewards
|
|
3347
|
+
* @summary List rewards
|
|
3348
|
+
* @param {number} [offset] Offsets the returned list by the given number of rewards. The returned rewards are ordered (and offsetted) by their creation date (DESC).
|
|
3349
|
+
* @param {*} [options] Override http request option.
|
|
3350
|
+
* @throws {RequiredError}
|
|
3351
|
+
*/
|
|
3352
|
+
listRewards(offset, options) {
|
|
3353
|
+
var _a, _b, _c;
|
|
3354
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3355
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listRewards(offset, options);
|
|
3356
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
3357
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['RewardsApi.listRewards']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
3358
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
3359
|
+
});
|
|
3360
|
+
},
|
|
3361
|
+
/**
|
|
3362
|
+
* Resends a reward, identified by the given `id` in the URL, to its recipient.
|
|
3363
|
+
* @summary Resend reward
|
|
3364
|
+
* @param {string} id ID of the reward that should be resent
|
|
3365
|
+
* @param {*} [options] Override http request option.
|
|
3366
|
+
* @throws {RequiredError}
|
|
3367
|
+
*/
|
|
3368
|
+
resendReward(id, options) {
|
|
3369
|
+
var _a, _b, _c;
|
|
3370
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3371
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.resendReward(id, options);
|
|
3372
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
3373
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['RewardsApi.resendReward']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
3374
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
3375
|
+
});
|
|
3376
|
+
},
|
|
3377
|
+
};
|
|
3378
|
+
};
|
|
3379
|
+
exports.RewardsApiFp = RewardsApiFp;
|
|
3380
|
+
/**
|
|
3381
|
+
* RewardsApi - factory interface
|
|
3382
|
+
* @export
|
|
3383
|
+
*/
|
|
3384
|
+
const RewardsApiFactory = function (configuration, basePath, axios) {
|
|
3385
|
+
const localVarFp = (0, exports.RewardsApiFp)(configuration);
|
|
3386
|
+
return {
|
|
3387
|
+
/**
|
|
3388
|
+
* Generate a redemption link for the reward identified by the `id` in the URL
|
|
3389
|
+
* @summary Generate a reward URL
|
|
3390
|
+
* @param {string} id ID of the reward
|
|
3391
|
+
* @param {*} [options] Override http request option.
|
|
3392
|
+
* @throws {RequiredError}
|
|
3393
|
+
*/
|
|
3394
|
+
generateRewardLink(id, options) {
|
|
3395
|
+
return localVarFp.generateRewardLink(id, options).then((request) => request(axios, basePath));
|
|
3396
|
+
},
|
|
3397
|
+
/**
|
|
3398
|
+
* Generate a temporary reward token identified by the `id` in the URL. These tokens are needed to render a reward when using [Tremendous Embed](https://github.com/tremendous-rewards/embed/blob/master/docs/documentation.md). The token is valid for 24 hours.
|
|
3399
|
+
* @summary Generate a reward token
|
|
3400
|
+
* @param {string} id ID of the reward
|
|
3401
|
+
* @param {*} [options] Override http request option.
|
|
3402
|
+
* @throws {RequiredError}
|
|
3403
|
+
*/
|
|
3404
|
+
generateRewardToken(id, options) {
|
|
3405
|
+
return localVarFp.generateRewardToken(id, options).then((request) => request(axios, basePath));
|
|
3406
|
+
},
|
|
3407
|
+
/**
|
|
3408
|
+
* Retrieve the reward, identified by the given `id` in the URL
|
|
3409
|
+
* @summary Retrieve single reward
|
|
3410
|
+
* @param {string} id ID of the reward that should be retrieved
|
|
3411
|
+
* @param {*} [options] Override http request option.
|
|
3412
|
+
* @throws {RequiredError}
|
|
3413
|
+
*/
|
|
3414
|
+
getReward(id, options) {
|
|
3415
|
+
return localVarFp.getReward(id, options).then((request) => request(axios, basePath));
|
|
3416
|
+
},
|
|
3417
|
+
/**
|
|
3418
|
+
* Retrieve a list of all created rewards
|
|
3419
|
+
* @summary List rewards
|
|
3420
|
+
* @param {number} [offset] Offsets the returned list by the given number of rewards. The returned rewards are ordered (and offsetted) by their creation date (DESC).
|
|
3421
|
+
* @param {*} [options] Override http request option.
|
|
3422
|
+
* @throws {RequiredError}
|
|
3423
|
+
*/
|
|
3424
|
+
listRewards(offset, options) {
|
|
3425
|
+
return localVarFp.listRewards(offset, options).then((request) => request(axios, basePath));
|
|
3426
|
+
},
|
|
3427
|
+
/**
|
|
3428
|
+
* Resends a reward, identified by the given `id` in the URL, to its recipient.
|
|
3429
|
+
* @summary Resend reward
|
|
3430
|
+
* @param {string} id ID of the reward that should be resent
|
|
3431
|
+
* @param {*} [options] Override http request option.
|
|
3432
|
+
* @throws {RequiredError}
|
|
3433
|
+
*/
|
|
3434
|
+
resendReward(id, options) {
|
|
3435
|
+
return localVarFp.resendReward(id, options).then((request) => request(axios, basePath));
|
|
3436
|
+
},
|
|
3437
|
+
};
|
|
3438
|
+
};
|
|
3439
|
+
exports.RewardsApiFactory = RewardsApiFactory;
|
|
3440
|
+
/**
|
|
3441
|
+
* RewardsApi - object-oriented interface
|
|
3442
|
+
* @export
|
|
3443
|
+
* @class RewardsApi
|
|
3444
|
+
* @extends {BaseAPI}
|
|
3445
|
+
*/
|
|
3446
|
+
class RewardsApi extends base_1.BaseAPI {
|
|
3447
|
+
/**
|
|
3448
|
+
* Generate a redemption link for the reward identified by the `id` in the URL
|
|
3449
|
+
* @summary Generate a reward URL
|
|
3450
|
+
* @param {string} id ID of the reward
|
|
3451
|
+
* @param {*} [options] Override http request option.
|
|
3452
|
+
* @throws {RequiredError}
|
|
3453
|
+
* @memberof RewardsApi
|
|
3454
|
+
*/
|
|
3455
|
+
generateRewardLink(id, options) {
|
|
3456
|
+
return (0, exports.RewardsApiFp)(this.configuration).generateRewardLink(id, options).then((request) => request(this.axios, this.basePath));
|
|
3457
|
+
}
|
|
3458
|
+
/**
|
|
3459
|
+
* Generate a temporary reward token identified by the `id` in the URL. These tokens are needed to render a reward when using [Tremendous Embed](https://github.com/tremendous-rewards/embed/blob/master/docs/documentation.md). The token is valid for 24 hours.
|
|
3460
|
+
* @summary Generate a reward token
|
|
3461
|
+
* @param {string} id ID of the reward
|
|
3462
|
+
* @param {*} [options] Override http request option.
|
|
3463
|
+
* @throws {RequiredError}
|
|
3464
|
+
* @memberof RewardsApi
|
|
3465
|
+
*/
|
|
3466
|
+
generateRewardToken(id, options) {
|
|
3467
|
+
return (0, exports.RewardsApiFp)(this.configuration).generateRewardToken(id, options).then((request) => request(this.axios, this.basePath));
|
|
3468
|
+
}
|
|
3469
|
+
/**
|
|
3470
|
+
* Retrieve the reward, identified by the given `id` in the URL
|
|
3471
|
+
* @summary Retrieve single reward
|
|
3472
|
+
* @param {string} id ID of the reward that should be retrieved
|
|
3473
|
+
* @param {*} [options] Override http request option.
|
|
3474
|
+
* @throws {RequiredError}
|
|
3475
|
+
* @memberof RewardsApi
|
|
3476
|
+
*/
|
|
3477
|
+
getReward(id, options) {
|
|
3478
|
+
return (0, exports.RewardsApiFp)(this.configuration).getReward(id, options).then((request) => request(this.axios, this.basePath));
|
|
3479
|
+
}
|
|
3480
|
+
/**
|
|
3481
|
+
* Retrieve a list of all created rewards
|
|
3482
|
+
* @summary List rewards
|
|
3483
|
+
* @param {number} [offset] Offsets the returned list by the given number of rewards. The returned rewards are ordered (and offsetted) by their creation date (DESC).
|
|
3484
|
+
* @param {*} [options] Override http request option.
|
|
3485
|
+
* @throws {RequiredError}
|
|
3486
|
+
* @memberof RewardsApi
|
|
3487
|
+
*/
|
|
3488
|
+
listRewards(offset, options) {
|
|
3489
|
+
return (0, exports.RewardsApiFp)(this.configuration).listRewards(offset, options).then((request) => request(this.axios, this.basePath));
|
|
3490
|
+
}
|
|
3491
|
+
/**
|
|
3492
|
+
* Resends a reward, identified by the given `id` in the URL, to its recipient.
|
|
3493
|
+
* @summary Resend reward
|
|
3494
|
+
* @param {string} id ID of the reward that should be resent
|
|
3495
|
+
* @param {*} [options] Override http request option.
|
|
3496
|
+
* @throws {RequiredError}
|
|
3497
|
+
* @memberof RewardsApi
|
|
3498
|
+
*/
|
|
3499
|
+
resendReward(id, options) {
|
|
3500
|
+
return (0, exports.RewardsApiFp)(this.configuration).resendReward(id, options).then((request) => request(this.axios, this.basePath));
|
|
3501
|
+
}
|
|
3502
|
+
}
|
|
3503
|
+
exports.RewardsApi = RewardsApi;
|
|
3504
|
+
/**
|
|
3505
|
+
* WebhooksApi - axios parameter creator
|
|
3506
|
+
* @export
|
|
3507
|
+
*/
|
|
3508
|
+
const WebhooksApiAxiosParamCreator = function (configuration) {
|
|
3509
|
+
return {
|
|
3510
|
+
/**
|
|
3511
|
+
* Tremendous uses webhooks as a notification system for various events that happen in your account. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1) Every organization can define a single webhook endpoint where we send requests to, whenever an event happens. This endpoint allows you to setup that endpoint. The URL of the endpoint can be changed by making a request to this endpoint again with the new URL. ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">url</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">uri</span></td><td><p>URL the webhook will make requests to</p> </td></tr> </tbody> </table> </div>
|
|
3512
|
+
* @summary Create webhook
|
|
3513
|
+
* @param {CreateWebhookRequest} createWebhookRequest Webhook details
|
|
3514
|
+
* @param {*} [options] Override http request option.
|
|
3515
|
+
* @throws {RequiredError}
|
|
3516
|
+
*/
|
|
3517
|
+
createWebhook: (createWebhookRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
3518
|
+
// verify required parameter 'createWebhookRequest' is not null or undefined
|
|
3519
|
+
(0, common_1.assertParamExists)('createWebhook', 'createWebhookRequest', createWebhookRequest);
|
|
3520
|
+
const localVarPath = `/webhooks`;
|
|
3521
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
3522
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
3523
|
+
let baseOptions;
|
|
3524
|
+
if (configuration) {
|
|
3525
|
+
baseOptions = configuration.baseOptions;
|
|
3526
|
+
}
|
|
3527
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
3528
|
+
const localVarHeaderParameter = {};
|
|
3529
|
+
const localVarQueryParameter = {};
|
|
3530
|
+
// authentication BearerApiKey required
|
|
3531
|
+
// http bearer authentication required
|
|
3532
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
3533
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
3534
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
3535
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3536
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
3537
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createWebhookRequest, localVarRequestOptions, configuration);
|
|
3538
|
+
return {
|
|
3539
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
3540
|
+
options: localVarRequestOptions,
|
|
3541
|
+
};
|
|
3542
|
+
}),
|
|
3543
|
+
/**
|
|
3544
|
+
* > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
3545
|
+
* @summary Retrieve webhook
|
|
3546
|
+
* @param {string} id ID of the webhook to retrieve
|
|
3547
|
+
* @param {*} [options] Override http request option.
|
|
3548
|
+
* @throws {RequiredError}
|
|
3549
|
+
*/
|
|
3550
|
+
getWebhook: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
3551
|
+
// verify required parameter 'id' is not null or undefined
|
|
3552
|
+
(0, common_1.assertParamExists)('getWebhook', 'id', id);
|
|
3553
|
+
const localVarPath = `/webhooks/{id}`
|
|
3554
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
3555
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
3556
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
3557
|
+
let baseOptions;
|
|
3558
|
+
if (configuration) {
|
|
3559
|
+
baseOptions = configuration.baseOptions;
|
|
3560
|
+
}
|
|
3561
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
3562
|
+
const localVarHeaderParameter = {};
|
|
3563
|
+
const localVarQueryParameter = {};
|
|
3564
|
+
// authentication BearerApiKey required
|
|
3565
|
+
// http bearer authentication required
|
|
3566
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
3567
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
3568
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3569
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
3570
|
+
return {
|
|
3571
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
3572
|
+
options: localVarRequestOptions,
|
|
3573
|
+
};
|
|
3574
|
+
}),
|
|
3575
|
+
/**
|
|
3576
|
+
* Lists all event types that can be sent to the configured webhook endpoint. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
3577
|
+
* @summary List events
|
|
3578
|
+
* @param {string} id ID of the webhook to list the events for
|
|
3579
|
+
* @param {*} [options] Override http request option.
|
|
3580
|
+
* @throws {RequiredError}
|
|
3581
|
+
*/
|
|
3582
|
+
listWebhookEvents: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
3583
|
+
// verify required parameter 'id' is not null or undefined
|
|
3584
|
+
(0, common_1.assertParamExists)('listWebhookEvents', 'id', id);
|
|
3585
|
+
const localVarPath = `/webhooks/{id}/events`
|
|
3586
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
3587
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
3588
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
3589
|
+
let baseOptions;
|
|
3590
|
+
if (configuration) {
|
|
3591
|
+
baseOptions = configuration.baseOptions;
|
|
3592
|
+
}
|
|
3593
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
3594
|
+
const localVarHeaderParameter = {};
|
|
3595
|
+
const localVarQueryParameter = {};
|
|
3596
|
+
// authentication BearerApiKey required
|
|
3597
|
+
// http bearer authentication required
|
|
3598
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
3599
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
3600
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3601
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
3602
|
+
return {
|
|
3603
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
3604
|
+
options: localVarRequestOptions,
|
|
3605
|
+
};
|
|
3606
|
+
}),
|
|
3607
|
+
/**
|
|
3608
|
+
* Every organization can only have one webhook. This endpoint shows the details about that webhook. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
3609
|
+
* @summary List webhooks
|
|
3610
|
+
* @param {*} [options] Override http request option.
|
|
3611
|
+
* @throws {RequiredError}
|
|
3612
|
+
*/
|
|
3613
|
+
listWebhooks: (options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
3614
|
+
const localVarPath = `/webhooks`;
|
|
3615
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
3616
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
3617
|
+
let baseOptions;
|
|
3618
|
+
if (configuration) {
|
|
3619
|
+
baseOptions = configuration.baseOptions;
|
|
3620
|
+
}
|
|
3621
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
3622
|
+
const localVarHeaderParameter = {};
|
|
3623
|
+
const localVarQueryParameter = {};
|
|
3624
|
+
// authentication BearerApiKey required
|
|
3625
|
+
// http bearer authentication required
|
|
3626
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
3627
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
3628
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3629
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
3630
|
+
return {
|
|
3631
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
3632
|
+
options: localVarRequestOptions,
|
|
3633
|
+
};
|
|
3634
|
+
}),
|
|
3635
|
+
/**
|
|
3636
|
+
* Making a request to this endpoint will cause our system to trigger a webhook for the specified event. This can be very useful when testing the setup that processes webhooks on your end. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
3637
|
+
* @summary Test webhook
|
|
3638
|
+
* @param {string} id ID of the webhook to test
|
|
3639
|
+
* @param {SimulateWebhookRequest} simulateWebhookRequest Webhook details
|
|
3640
|
+
* @param {*} [options] Override http request option.
|
|
3641
|
+
* @throws {RequiredError}
|
|
3642
|
+
*/
|
|
3643
|
+
simulateWebhook: (id, simulateWebhookRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
3644
|
+
// verify required parameter 'id' is not null or undefined
|
|
3645
|
+
(0, common_1.assertParamExists)('simulateWebhook', 'id', id);
|
|
3646
|
+
// verify required parameter 'simulateWebhookRequest' is not null or undefined
|
|
3647
|
+
(0, common_1.assertParamExists)('simulateWebhook', 'simulateWebhookRequest', simulateWebhookRequest);
|
|
3648
|
+
const localVarPath = `/webhooks/{id}/simulate`
|
|
3649
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
3650
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
3651
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
3652
|
+
let baseOptions;
|
|
3653
|
+
if (configuration) {
|
|
3654
|
+
baseOptions = configuration.baseOptions;
|
|
3655
|
+
}
|
|
3656
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
3657
|
+
const localVarHeaderParameter = {};
|
|
3658
|
+
const localVarQueryParameter = {};
|
|
3659
|
+
// authentication BearerApiKey required
|
|
3660
|
+
// http bearer authentication required
|
|
3661
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
3662
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
3663
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
3664
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3665
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
3666
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(simulateWebhookRequest, localVarRequestOptions, configuration);
|
|
3667
|
+
return {
|
|
3668
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
3669
|
+
options: localVarRequestOptions,
|
|
3670
|
+
};
|
|
3671
|
+
}),
|
|
3672
|
+
};
|
|
3673
|
+
};
|
|
3674
|
+
exports.WebhooksApiAxiosParamCreator = WebhooksApiAxiosParamCreator;
|
|
3675
|
+
/**
|
|
3676
|
+
* WebhooksApi - functional programming interface
|
|
3677
|
+
* @export
|
|
3678
|
+
*/
|
|
3679
|
+
const WebhooksApiFp = function (configuration) {
|
|
3680
|
+
const localVarAxiosParamCreator = (0, exports.WebhooksApiAxiosParamCreator)(configuration);
|
|
3681
|
+
return {
|
|
3682
|
+
/**
|
|
3683
|
+
* Tremendous uses webhooks as a notification system for various events that happen in your account. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1) Every organization can define a single webhook endpoint where we send requests to, whenever an event happens. This endpoint allows you to setup that endpoint. The URL of the endpoint can be changed by making a request to this endpoint again with the new URL. ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">url</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">uri</span></td><td><p>URL the webhook will make requests to</p> </td></tr> </tbody> </table> </div>
|
|
3684
|
+
* @summary Create webhook
|
|
3685
|
+
* @param {CreateWebhookRequest} createWebhookRequest Webhook details
|
|
3686
|
+
* @param {*} [options] Override http request option.
|
|
3687
|
+
* @throws {RequiredError}
|
|
3688
|
+
*/
|
|
3689
|
+
createWebhook(createWebhookRequest, options) {
|
|
3690
|
+
var _a, _b, _c;
|
|
3691
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3692
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createWebhook(createWebhookRequest, options);
|
|
3693
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
3694
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksApi.createWebhook']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
3695
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
3696
|
+
});
|
|
3697
|
+
},
|
|
3698
|
+
/**
|
|
3699
|
+
* > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
3700
|
+
* @summary Retrieve webhook
|
|
3701
|
+
* @param {string} id ID of the webhook to retrieve
|
|
3702
|
+
* @param {*} [options] Override http request option.
|
|
3703
|
+
* @throws {RequiredError}
|
|
3704
|
+
*/
|
|
3705
|
+
getWebhook(id, options) {
|
|
3706
|
+
var _a, _b, _c;
|
|
3707
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3708
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getWebhook(id, options);
|
|
3709
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
3710
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksApi.getWebhook']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
3711
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
3712
|
+
});
|
|
3713
|
+
},
|
|
3714
|
+
/**
|
|
3715
|
+
* Lists all event types that can be sent to the configured webhook endpoint. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
3716
|
+
* @summary List events
|
|
3717
|
+
* @param {string} id ID of the webhook to list the events for
|
|
3718
|
+
* @param {*} [options] Override http request option.
|
|
3719
|
+
* @throws {RequiredError}
|
|
3720
|
+
*/
|
|
3721
|
+
listWebhookEvents(id, options) {
|
|
3722
|
+
var _a, _b, _c;
|
|
3723
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3724
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listWebhookEvents(id, options);
|
|
3725
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
3726
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksApi.listWebhookEvents']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
3727
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
3728
|
+
});
|
|
3729
|
+
},
|
|
3730
|
+
/**
|
|
3731
|
+
* Every organization can only have one webhook. This endpoint shows the details about that webhook. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
3732
|
+
* @summary List webhooks
|
|
3733
|
+
* @param {*} [options] Override http request option.
|
|
3734
|
+
* @throws {RequiredError}
|
|
3735
|
+
*/
|
|
3736
|
+
listWebhooks(options) {
|
|
3737
|
+
var _a, _b, _c;
|
|
3738
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3739
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listWebhooks(options);
|
|
3740
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
3741
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksApi.listWebhooks']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
3742
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
3743
|
+
});
|
|
3744
|
+
},
|
|
3745
|
+
/**
|
|
3746
|
+
* Making a request to this endpoint will cause our system to trigger a webhook for the specified event. This can be very useful when testing the setup that processes webhooks on your end. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
3747
|
+
* @summary Test webhook
|
|
3748
|
+
* @param {string} id ID of the webhook to test
|
|
3749
|
+
* @param {SimulateWebhookRequest} simulateWebhookRequest Webhook details
|
|
3750
|
+
* @param {*} [options] Override http request option.
|
|
3751
|
+
* @throws {RequiredError}
|
|
3752
|
+
*/
|
|
3753
|
+
simulateWebhook(id, simulateWebhookRequest, options) {
|
|
3754
|
+
var _a, _b, _c;
|
|
3755
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3756
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.simulateWebhook(id, simulateWebhookRequest, options);
|
|
3757
|
+
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
3758
|
+
const operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksApi.simulateWebhook']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
|
|
3759
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
|
3760
|
+
});
|
|
3761
|
+
},
|
|
3762
|
+
};
|
|
3763
|
+
};
|
|
3764
|
+
exports.WebhooksApiFp = WebhooksApiFp;
|
|
3765
|
+
/**
|
|
3766
|
+
* WebhooksApi - factory interface
|
|
3767
|
+
* @export
|
|
3768
|
+
*/
|
|
3769
|
+
const WebhooksApiFactory = function (configuration, basePath, axios) {
|
|
3770
|
+
const localVarFp = (0, exports.WebhooksApiFp)(configuration);
|
|
3771
|
+
return {
|
|
3772
|
+
/**
|
|
3773
|
+
* Tremendous uses webhooks as a notification system for various events that happen in your account. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1) Every organization can define a single webhook endpoint where we send requests to, whenever an event happens. This endpoint allows you to setup that endpoint. The URL of the endpoint can be changed by making a request to this endpoint again with the new URL. ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">url</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">uri</span></td><td><p>URL the webhook will make requests to</p> </td></tr> </tbody> </table> </div>
|
|
3774
|
+
* @summary Create webhook
|
|
3775
|
+
* @param {CreateWebhookRequest} createWebhookRequest Webhook details
|
|
3776
|
+
* @param {*} [options] Override http request option.
|
|
3777
|
+
* @throws {RequiredError}
|
|
3778
|
+
*/
|
|
3779
|
+
createWebhook(createWebhookRequest, options) {
|
|
3780
|
+
return localVarFp.createWebhook(createWebhookRequest, options).then((request) => request(axios, basePath));
|
|
3781
|
+
},
|
|
3782
|
+
/**
|
|
3783
|
+
* > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
3784
|
+
* @summary Retrieve webhook
|
|
3785
|
+
* @param {string} id ID of the webhook to retrieve
|
|
3786
|
+
* @param {*} [options] Override http request option.
|
|
3787
|
+
* @throws {RequiredError}
|
|
3788
|
+
*/
|
|
3789
|
+
getWebhook(id, options) {
|
|
3790
|
+
return localVarFp.getWebhook(id, options).then((request) => request(axios, basePath));
|
|
3791
|
+
},
|
|
3792
|
+
/**
|
|
3793
|
+
* Lists all event types that can be sent to the configured webhook endpoint. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
3794
|
+
* @summary List events
|
|
3795
|
+
* @param {string} id ID of the webhook to list the events for
|
|
3796
|
+
* @param {*} [options] Override http request option.
|
|
3797
|
+
* @throws {RequiredError}
|
|
3798
|
+
*/
|
|
3799
|
+
listWebhookEvents(id, options) {
|
|
3800
|
+
return localVarFp.listWebhookEvents(id, options).then((request) => request(axios, basePath));
|
|
3801
|
+
},
|
|
3802
|
+
/**
|
|
3803
|
+
* Every organization can only have one webhook. This endpoint shows the details about that webhook. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
3804
|
+
* @summary List webhooks
|
|
3805
|
+
* @param {*} [options] Override http request option.
|
|
3806
|
+
* @throws {RequiredError}
|
|
3807
|
+
*/
|
|
3808
|
+
listWebhooks(options) {
|
|
3809
|
+
return localVarFp.listWebhooks(options).then((request) => request(axios, basePath));
|
|
3810
|
+
},
|
|
3811
|
+
/**
|
|
3812
|
+
* Making a request to this endpoint will cause our system to trigger a webhook for the specified event. This can be very useful when testing the setup that processes webhooks on your end. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
3813
|
+
* @summary Test webhook
|
|
3814
|
+
* @param {string} id ID of the webhook to test
|
|
3815
|
+
* @param {SimulateWebhookRequest} simulateWebhookRequest Webhook details
|
|
3816
|
+
* @param {*} [options] Override http request option.
|
|
3817
|
+
* @throws {RequiredError}
|
|
3818
|
+
*/
|
|
3819
|
+
simulateWebhook(id, simulateWebhookRequest, options) {
|
|
3820
|
+
return localVarFp.simulateWebhook(id, simulateWebhookRequest, options).then((request) => request(axios, basePath));
|
|
3821
|
+
},
|
|
3822
|
+
};
|
|
3823
|
+
};
|
|
3824
|
+
exports.WebhooksApiFactory = WebhooksApiFactory;
|
|
3825
|
+
/**
|
|
3826
|
+
* WebhooksApi - object-oriented interface
|
|
3827
|
+
* @export
|
|
3828
|
+
* @class WebhooksApi
|
|
3829
|
+
* @extends {BaseAPI}
|
|
3830
|
+
*/
|
|
3831
|
+
class WebhooksApi extends base_1.BaseAPI {
|
|
3832
|
+
/**
|
|
3833
|
+
* Tremendous uses webhooks as a notification system for various events that happen in your account. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1) Every organization can define a single webhook endpoint where we send requests to, whenever an event happens. This endpoint allows you to setup that endpoint. The URL of the endpoint can be changed by making a request to this endpoint again with the new URL. ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">url</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">uri</span></td><td><p>URL the webhook will make requests to</p> </td></tr> </tbody> </table> </div>
|
|
3834
|
+
* @summary Create webhook
|
|
3835
|
+
* @param {CreateWebhookRequest} createWebhookRequest Webhook details
|
|
3836
|
+
* @param {*} [options] Override http request option.
|
|
3837
|
+
* @throws {RequiredError}
|
|
3838
|
+
* @memberof WebhooksApi
|
|
3839
|
+
*/
|
|
3840
|
+
createWebhook(createWebhookRequest, options) {
|
|
3841
|
+
return (0, exports.WebhooksApiFp)(this.configuration).createWebhook(createWebhookRequest, options).then((request) => request(this.axios, this.basePath));
|
|
3842
|
+
}
|
|
3843
|
+
/**
|
|
3844
|
+
* > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
3845
|
+
* @summary Retrieve webhook
|
|
3846
|
+
* @param {string} id ID of the webhook to retrieve
|
|
3847
|
+
* @param {*} [options] Override http request option.
|
|
3848
|
+
* @throws {RequiredError}
|
|
3849
|
+
* @memberof WebhooksApi
|
|
3850
|
+
*/
|
|
3851
|
+
getWebhook(id, options) {
|
|
3852
|
+
return (0, exports.WebhooksApiFp)(this.configuration).getWebhook(id, options).then((request) => request(this.axios, this.basePath));
|
|
3853
|
+
}
|
|
3854
|
+
/**
|
|
3855
|
+
* Lists all event types that can be sent to the configured webhook endpoint. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
3856
|
+
* @summary List events
|
|
3857
|
+
* @param {string} id ID of the webhook to list the events for
|
|
3858
|
+
* @param {*} [options] Override http request option.
|
|
3859
|
+
* @throws {RequiredError}
|
|
3860
|
+
* @memberof WebhooksApi
|
|
3861
|
+
*/
|
|
3862
|
+
listWebhookEvents(id, options) {
|
|
3863
|
+
return (0, exports.WebhooksApiFp)(this.configuration).listWebhookEvents(id, options).then((request) => request(this.axios, this.basePath));
|
|
3864
|
+
}
|
|
3865
|
+
/**
|
|
3866
|
+
* Every organization can only have one webhook. This endpoint shows the details about that webhook. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
3867
|
+
* @summary List webhooks
|
|
3868
|
+
* @param {*} [options] Override http request option.
|
|
3869
|
+
* @throws {RequiredError}
|
|
3870
|
+
* @memberof WebhooksApi
|
|
3871
|
+
*/
|
|
3872
|
+
listWebhooks(options) {
|
|
3873
|
+
return (0, exports.WebhooksApiFp)(this.configuration).listWebhooks(options).then((request) => request(this.axios, this.basePath));
|
|
3874
|
+
}
|
|
3875
|
+
/**
|
|
3876
|
+
* Making a request to this endpoint will cause our system to trigger a webhook for the specified event. This can be very useful when testing the setup that processes webhooks on your end. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
3877
|
+
* @summary Test webhook
|
|
3878
|
+
* @param {string} id ID of the webhook to test
|
|
3879
|
+
* @param {SimulateWebhookRequest} simulateWebhookRequest Webhook details
|
|
3880
|
+
* @param {*} [options] Override http request option.
|
|
3881
|
+
* @throws {RequiredError}
|
|
3882
|
+
* @memberof WebhooksApi
|
|
3883
|
+
*/
|
|
3884
|
+
simulateWebhook(id, simulateWebhookRequest, options) {
|
|
3885
|
+
return (0, exports.WebhooksApiFp)(this.configuration).simulateWebhook(id, simulateWebhookRequest, options).then((request) => request(this.axios, this.basePath));
|
|
3886
|
+
}
|
|
3887
|
+
}
|
|
3888
|
+
exports.WebhooksApi = WebhooksApi;
|