aboutsummaryrefslogtreecommitdiff
path: root/src/api/apis/wallet-api.ts
blob: 37a8cee51206bd018363b1b3578b77311618c6f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
/* tslint:disable */
/* eslint-disable */
/**
 * General Research Full Service Brokerage API
 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
 *
 * OpenAPI spec version: 1.1.0
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */

import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
import { CashoutMethodForeignValueResponse } from '../models';
import { CashoutMethodResponse } from '../models';
import { CashoutMethodsResponse } from '../models';
import { CashoutRequestResponse } from '../models';
import { CreateCashoutRequest } from '../models';
import { HTTPValidationError } from '../models';
import { StatusResponse } from '../models';
import { UserTransactionHistoryResponse } from '../models';
import { UserWalletBalanceResponse } from '../models';
/**
 * WalletApi - axios parameter creator
 * @export
 */
export const WalletApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * A user can only have 1 unique Cashout Method of any type at a time (eg. they can't create multiple paypal payout methods). Cashout Methods cannot be edited, they can only be created or deleted. Creating different Cashout Methods will require type-dependent request data attributes in order to be successfully created.  Currently only creating paypal or Cash in Mail cashout methods are supported
         * @summary Create Cashout Method
         * @param {any} body 
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createCashoutMethodProductIdCashoutMethodsPost: async (body: any, productId: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'body' is not null or undefined
            if (body === null || body === undefined) {
                throw new RequiredError('body','Required parameter body was null or undefined when calling createCashoutMethodProductIdCashoutMethodsPost.');
            }
            // verify required parameter 'productId' is not null or undefined
            if (productId === null || productId === undefined) {
                throw new RequiredError('productId','Required parameter productId was null or undefined when calling createCashoutMethodProductIdCashoutMethodsPost.');
            }
            const localVarPath = `/{product_id}/cashout_methods/`
                .replace(`{${"product_id"}}`, encodeURIComponent(String(productId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, 'https://example.com');
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            localVarHeaderParameter['Content-Type'] = 'application/json';

            const query = new URLSearchParams(localVarUrlObj.search);
            for (const key in localVarQueryParameter) {
                query.set(key, localVarQueryParameter[key]);
            }
            for (const key in options.params) {
                query.set(key, options.params[key]);
            }
            localVarUrlObj.search = (new URLSearchParams(query)).toString();
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data =  needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");

            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };
        },
        /**
         * Delete a cashout method
         * @summary Delete Cashout Method
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {any} cashoutMethodId The ID of the cashout method to delete
         * @param {any} bpuid A unique identifier for each user, which is set by the Supplier. Must be consistent across respondent entrances and unique to the platform. It should not contain any sensitive information like email or names, and should avoid using any incrementing values.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteCashoutMethodProductIdCashoutMethodsCashoutMethodIdDelete: async (productId: any, cashoutMethodId: any, bpuid: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'productId' is not null or undefined
            if (productId === null || productId === undefined) {
                throw new RequiredError('productId','Required parameter productId was null or undefined when calling deleteCashoutMethodProductIdCashoutMethodsCashoutMethodIdDelete.');
            }
            // verify required parameter 'cashoutMethodId' is not null or undefined
            if (cashoutMethodId === null || cashoutMethodId === undefined) {
                throw new RequiredError('cashoutMethodId','Required parameter cashoutMethodId was null or undefined when calling deleteCashoutMethodProductIdCashoutMethodsCashoutMethodIdDelete.');
            }
            // verify required parameter 'bpuid' is not null or undefined
            if (bpuid === null || bpuid === undefined) {
                throw new RequiredError('bpuid','Required parameter bpuid was null or undefined when calling deleteCashoutMethodProductIdCashoutMethodsCashoutMethodIdDelete.');
            }
            const localVarPath = `/{product_id}/cashout_methods/{cashout_method_id}/`
                .replace(`{${"product_id"}}`, encodeURIComponent(String(productId)))
                .replace(`{${"cashout_method_id"}}`, encodeURIComponent(String(cashoutMethodId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, 'https://example.com');
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions :AxiosRequestConfig = { method: 'DELETE', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            if (bpuid !== undefined) {
                localVarQueryParameter['bpuid'] = bpuid;
            }

            const query = new URLSearchParams(localVarUrlObj.search);
            for (const key in localVarQueryParameter) {
                query.set(key, localVarQueryParameter[key]);
            }
            for (const key in options.params) {
                query.set(key, options.params[key]);
            }
            localVarUrlObj.search = (new URLSearchParams(query)).toString();
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };
        },
        /**
         * Retrieve the details for a specific Cashout event
         * @summary Get Cashout Detail
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {any} cashoutId The cashout event ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getCashoutDetailProductIdCashoutCashoutIdGet: async (productId: any, cashoutId: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'productId' is not null or undefined
            if (productId === null || productId === undefined) {
                throw new RequiredError('productId','Required parameter productId was null or undefined when calling getCashoutDetailProductIdCashoutCashoutIdGet.');
            }
            // verify required parameter 'cashoutId' is not null or undefined
            if (cashoutId === null || cashoutId === undefined) {
                throw new RequiredError('cashoutId','Required parameter cashoutId was null or undefined when calling getCashoutDetailProductIdCashoutCashoutIdGet.');
            }
            const localVarPath = `/{product_id}/cashout/{cashout_id}/`
                .replace(`{${"product_id"}}`, encodeURIComponent(String(productId)))
                .replace(`{${"cashout_id"}}`, encodeURIComponent(String(cashoutId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, 'https://example.com');
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            const query = new URLSearchParams(localVarUrlObj.search);
            for (const key in localVarQueryParameter) {
                query.set(key, localVarQueryParameter[key]);
            }
            for (const key in options.params) {
                query.set(key, options.params[key]);
            }
            localVarUrlObj.search = (new URLSearchParams(query)).toString();
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };
        },
        /**
         * Retrieve the current available mechanisms that a user can use to retrieve funds.
         * @summary Get Cashout Methods
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {any} bpuid A unique identifier for each user, which is set by the Supplier. Must be consistent across respondent entrances and unique to the platform. It should not contain any sensitive information like email or names, and should avoid using any incrementing values.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getCashoutMethodsProductIdCashoutMethodsGet: async (productId: any, bpuid: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'productId' is not null or undefined
            if (productId === null || productId === undefined) {
                throw new RequiredError('productId','Required parameter productId was null or undefined when calling getCashoutMethodsProductIdCashoutMethodsGet.');
            }
            // verify required parameter 'bpuid' is not null or undefined
            if (bpuid === null || bpuid === undefined) {
                throw new RequiredError('bpuid','Required parameter bpuid was null or undefined when calling getCashoutMethodsProductIdCashoutMethodsGet.');
            }
            const localVarPath = `/{product_id}/cashout_methods/`
                .replace(`{${"product_id"}}`, encodeURIComponent(String(productId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, 'https://example.com');
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            if (bpuid !== undefined) {
                localVarQueryParameter['bpuid'] = bpuid;
            }

            const query = new URLSearchParams(localVarUrlObj.search);
            for (const key in localVarQueryParameter) {
                query.set(key, localVarQueryParameter[key]);
            }
            for (const key in options.params) {
                query.set(key, options.params[key]);
            }
            localVarUrlObj.search = (new URLSearchParams(query)).toString();
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };
        },
        /**
         * Use this function to get the \"value\" (in local currency, e.g. CAD, BTC) for this   cashout_method, for amount (in USD cents).
         * @summary Get Expected Redemption Value
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {any} cashoutMethodId The ID of the cashout method
         * @param {any} amount (USD cents) The amount to convert
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getExpectedRedemptionValueProductIdCashoutMethodCashoutMethodIdValueGet: async (productId: any, cashoutMethodId: any, amount: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'productId' is not null or undefined
            if (productId === null || productId === undefined) {
                throw new RequiredError('productId','Required parameter productId was null or undefined when calling getExpectedRedemptionValueProductIdCashoutMethodCashoutMethodIdValueGet.');
            }
            // verify required parameter 'cashoutMethodId' is not null or undefined
            if (cashoutMethodId === null || cashoutMethodId === undefined) {
                throw new RequiredError('cashoutMethodId','Required parameter cashoutMethodId was null or undefined when calling getExpectedRedemptionValueProductIdCashoutMethodCashoutMethodIdValueGet.');
            }
            // verify required parameter 'amount' is not null or undefined
            if (amount === null || amount === undefined) {
                throw new RequiredError('amount','Required parameter amount was null or undefined when calling getExpectedRedemptionValueProductIdCashoutMethodCashoutMethodIdValueGet.');
            }
            const localVarPath = `/{product_id}/cashout_method/{cashout_method_id}/value/`
                .replace(`{${"product_id"}}`, encodeURIComponent(String(productId)))
                .replace(`{${"cashout_method_id"}}`, encodeURIComponent(String(cashoutMethodId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, 'https://example.com');
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            if (amount !== undefined) {
                localVarQueryParameter['amount'] = amount;
            }

            const query = new URLSearchParams(localVarUrlObj.search);
            for (const key in localVarQueryParameter) {
                query.set(key, localVarQueryParameter[key]);
            }
            for (const key in options.params) {
                query.set(key, options.params[key]);
            }
            localVarUrlObj.search = (new URLSearchParams(query)).toString();
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };
        },
        /**
         * Return array of user events that altered their wallet balance
         * @summary Get User Transaction History
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {any} bpuid A unique identifier for each user, which is set by the Supplier. Must be consistent across respondent entrances and unique to the platform. It should not contain any sensitive information like email or names, and should avoid using any incrementing values.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getUserTransactionHistoryProductIdTransactionHistoryGet: async (productId: any, bpuid: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'productId' is not null or undefined
            if (productId === null || productId === undefined) {
                throw new RequiredError('productId','Required parameter productId was null or undefined when calling getUserTransactionHistoryProductIdTransactionHistoryGet.');
            }
            // verify required parameter 'bpuid' is not null or undefined
            if (bpuid === null || bpuid === undefined) {
                throw new RequiredError('bpuid','Required parameter bpuid was null or undefined when calling getUserTransactionHistoryProductIdTransactionHistoryGet.');
            }
            const localVarPath = `/{product_id}/transaction_history/`
                .replace(`{${"product_id"}}`, encodeURIComponent(String(productId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, 'https://example.com');
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            if (bpuid !== undefined) {
                localVarQueryParameter['bpuid'] = bpuid;
            }

            const query = new URLSearchParams(localVarUrlObj.search);
            for (const key in localVarQueryParameter) {
                query.set(key, localVarQueryParameter[key]);
            }
            for (const key in options.params) {
                query.set(key, options.params[key]);
            }
            localVarUrlObj.search = (new URLSearchParams(query)).toString();
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };
        },
        /**
         * Retrieve the current balance of a respondent's wallet balance for display
         * @summary Get User Wallet Balance
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {any} bpuid A unique identifier for each user, which is set by the Supplier. Must be consistent across respondent entrances and unique to the platform. It should not contain any sensitive information like email or names, and should avoid using any incrementing values.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getUserWalletBalanceProductIdWalletGet: async (productId: any, bpuid: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'productId' is not null or undefined
            if (productId === null || productId === undefined) {
                throw new RequiredError('productId','Required parameter productId was null or undefined when calling getUserWalletBalanceProductIdWalletGet.');
            }
            // verify required parameter 'bpuid' is not null or undefined
            if (bpuid === null || bpuid === undefined) {
                throw new RequiredError('bpuid','Required parameter bpuid was null or undefined when calling getUserWalletBalanceProductIdWalletGet.');
            }
            const localVarPath = `/{product_id}/wallet/`
                .replace(`{${"product_id"}}`, encodeURIComponent(String(productId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, 'https://example.com');
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            if (bpuid !== undefined) {
                localVarQueryParameter['bpuid'] = bpuid;
            }

            const query = new URLSearchParams(localVarUrlObj.search);
            for (const key in localVarQueryParameter) {
                query.set(key, localVarQueryParameter[key]);
            }
            for (const key in options.params) {
                query.set(key, options.params[key]);
            }
            localVarUrlObj.search = (new URLSearchParams(query)).toString();
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };
        },
        /**
         * Request a cashout taken from a user's available wallet balance, to be paid via a particular cashout method.
         * @summary Submit User Cashout
         * @param {CreateCashoutRequest} body 
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        submitUserCashoutProductIdCashoutPost: async (body: CreateCashoutRequest, productId: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'body' is not null or undefined
            if (body === null || body === undefined) {
                throw new RequiredError('body','Required parameter body was null or undefined when calling submitUserCashoutProductIdCashoutPost.');
            }
            // verify required parameter 'productId' is not null or undefined
            if (productId === null || productId === undefined) {
                throw new RequiredError('productId','Required parameter productId was null or undefined when calling submitUserCashoutProductIdCashoutPost.');
            }
            const localVarPath = `/{product_id}/cashout/`
                .replace(`{${"product_id"}}`, encodeURIComponent(String(productId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, 'https://example.com');
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            localVarHeaderParameter['Content-Type'] = 'application/json';

            const query = new URLSearchParams(localVarUrlObj.search);
            for (const key in localVarQueryParameter) {
                query.set(key, localVarQueryParameter[key]);
            }
            for (const key in options.params) {
                query.set(key, options.params[key]);
            }
            localVarUrlObj.search = (new URLSearchParams(query)).toString();
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data =  needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");

            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * WalletApi - functional programming interface
 * @export
 */
export const WalletApiFp = function(configuration?: Configuration) {
    return {
        /**
         * A user can only have 1 unique Cashout Method of any type at a time (eg. they can't create multiple paypal payout methods). Cashout Methods cannot be edited, they can only be created or deleted. Creating different Cashout Methods will require type-dependent request data attributes in order to be successfully created.  Currently only creating paypal or Cash in Mail cashout methods are supported
         * @summary Create Cashout Method
         * @param {any} body 
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createCashoutMethodProductIdCashoutMethodsPost(body: any, productId: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<CashoutMethodResponse>>> {
            const localVarAxiosArgs = await WalletApiAxiosParamCreator(configuration).createCashoutMethodProductIdCashoutMethodsPost(body, productId, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         * Delete a cashout method
         * @summary Delete Cashout Method
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {any} cashoutMethodId The ID of the cashout method to delete
         * @param {any} bpuid A unique identifier for each user, which is set by the Supplier. Must be consistent across respondent entrances and unique to the platform. It should not contain any sensitive information like email or names, and should avoid using any incrementing values.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteCashoutMethodProductIdCashoutMethodsCashoutMethodIdDelete(productId: any, cashoutMethodId: any, bpuid: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<StatusResponse>>> {
            const localVarAxiosArgs = await WalletApiAxiosParamCreator(configuration).deleteCashoutMethodProductIdCashoutMethodsCashoutMethodIdDelete(productId, cashoutMethodId, bpuid, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         * Retrieve the details for a specific Cashout event
         * @summary Get Cashout Detail
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {any} cashoutId The cashout event ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getCashoutDetailProductIdCashoutCashoutIdGet(productId: any, cashoutId: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<CashoutRequestResponse>>> {
            const localVarAxiosArgs = await WalletApiAxiosParamCreator(configuration).getCashoutDetailProductIdCashoutCashoutIdGet(productId, cashoutId, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         * Retrieve the current available mechanisms that a user can use to retrieve funds.
         * @summary Get Cashout Methods
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {any} bpuid A unique identifier for each user, which is set by the Supplier. Must be consistent across respondent entrances and unique to the platform. It should not contain any sensitive information like email or names, and should avoid using any incrementing values.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getCashoutMethodsProductIdCashoutMethodsGet(productId: any, bpuid: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<CashoutMethodsResponse>>> {
            const localVarAxiosArgs = await WalletApiAxiosParamCreator(configuration).getCashoutMethodsProductIdCashoutMethodsGet(productId, bpuid, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         * Use this function to get the \"value\" (in local currency, e.g. CAD, BTC) for this   cashout_method, for amount (in USD cents).
         * @summary Get Expected Redemption Value
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {any} cashoutMethodId The ID of the cashout method
         * @param {any} amount (USD cents) The amount to convert
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getExpectedRedemptionValueProductIdCashoutMethodCashoutMethodIdValueGet(productId: any, cashoutMethodId: any, amount: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<CashoutMethodForeignValueResponse>>> {
            const localVarAxiosArgs = await WalletApiAxiosParamCreator(configuration).getExpectedRedemptionValueProductIdCashoutMethodCashoutMethodIdValueGet(productId, cashoutMethodId, amount, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         * Return array of user events that altered their wallet balance
         * @summary Get User Transaction History
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {any} bpuid A unique identifier for each user, which is set by the Supplier. Must be consistent across respondent entrances and unique to the platform. It should not contain any sensitive information like email or names, and should avoid using any incrementing values.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getUserTransactionHistoryProductIdTransactionHistoryGet(productId: any, bpuid: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<UserTransactionHistoryResponse>>> {
            const localVarAxiosArgs = await WalletApiAxiosParamCreator(configuration).getUserTransactionHistoryProductIdTransactionHistoryGet(productId, bpuid, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         * Retrieve the current balance of a respondent's wallet balance for display
         * @summary Get User Wallet Balance
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {any} bpuid A unique identifier for each user, which is set by the Supplier. Must be consistent across respondent entrances and unique to the platform. It should not contain any sensitive information like email or names, and should avoid using any incrementing values.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getUserWalletBalanceProductIdWalletGet(productId: any, bpuid: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<UserWalletBalanceResponse>>> {
            const localVarAxiosArgs = await WalletApiAxiosParamCreator(configuration).getUserWalletBalanceProductIdWalletGet(productId, bpuid, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         * Request a cashout taken from a user's available wallet balance, to be paid via a particular cashout method.
         * @summary Submit User Cashout
         * @param {CreateCashoutRequest} body 
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async submitUserCashoutProductIdCashoutPost(body: CreateCashoutRequest, productId: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<CashoutRequestResponse>>> {
            const localVarAxiosArgs = await WalletApiAxiosParamCreator(configuration).submitUserCashoutProductIdCashoutPost(body, productId, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
    }
};

/**
 * WalletApi - factory interface
 * @export
 */
export const WalletApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    return {
        /**
         * A user can only have 1 unique Cashout Method of any type at a time (eg. they can't create multiple paypal payout methods). Cashout Methods cannot be edited, they can only be created or deleted. Creating different Cashout Methods will require type-dependent request data attributes in order to be successfully created.  Currently only creating paypal or Cash in Mail cashout methods are supported
         * @summary Create Cashout Method
         * @param {any} body 
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createCashoutMethodProductIdCashoutMethodsPost(body: any, productId: any, options?: AxiosRequestConfig): Promise<AxiosResponse<CashoutMethodResponse>> {
            return WalletApiFp(configuration).createCashoutMethodProductIdCashoutMethodsPost(body, productId, options).then((request) => request(axios, basePath));
        },
        /**
         * Delete a cashout method
         * @summary Delete Cashout Method
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {any} cashoutMethodId The ID of the cashout method to delete
         * @param {any} bpuid A unique identifier for each user, which is set by the Supplier. Must be consistent across respondent entrances and unique to the platform. It should not contain any sensitive information like email or names, and should avoid using any incrementing values.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteCashoutMethodProductIdCashoutMethodsCashoutMethodIdDelete(productId: any, cashoutMethodId: any, bpuid: any, options?: AxiosRequestConfig): Promise<AxiosResponse<StatusResponse>> {
            return WalletApiFp(configuration).deleteCashoutMethodProductIdCashoutMethodsCashoutMethodIdDelete(productId, cashoutMethodId, bpuid, options).then((request) => request(axios, basePath));
        },
        /**
         * Retrieve the details for a specific Cashout event
         * @summary Get Cashout Detail
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {any} cashoutId The cashout event ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getCashoutDetailProductIdCashoutCashoutIdGet(productId: any, cashoutId: any, options?: AxiosRequestConfig): Promise<AxiosResponse<CashoutRequestResponse>> {
            return WalletApiFp(configuration).getCashoutDetailProductIdCashoutCashoutIdGet(productId, cashoutId, options).then((request) => request(axios, basePath));
        },
        /**
         * Retrieve the current available mechanisms that a user can use to retrieve funds.
         * @summary Get Cashout Methods
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {any} bpuid A unique identifier for each user, which is set by the Supplier. Must be consistent across respondent entrances and unique to the platform. It should not contain any sensitive information like email or names, and should avoid using any incrementing values.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getCashoutMethodsProductIdCashoutMethodsGet(productId: any, bpuid: any, options?: AxiosRequestConfig): Promise<AxiosResponse<CashoutMethodsResponse>> {
            return WalletApiFp(configuration).getCashoutMethodsProductIdCashoutMethodsGet(productId, bpuid, options).then((request) => request(axios, basePath));
        },
        /**
         * Use this function to get the \"value\" (in local currency, e.g. CAD, BTC) for this   cashout_method, for amount (in USD cents).
         * @summary Get Expected Redemption Value
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {any} cashoutMethodId The ID of the cashout method
         * @param {any} amount (USD cents) The amount to convert
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getExpectedRedemptionValueProductIdCashoutMethodCashoutMethodIdValueGet(productId: any, cashoutMethodId: any, amount: any, options?: AxiosRequestConfig): Promise<AxiosResponse<CashoutMethodForeignValueResponse>> {
            return WalletApiFp(configuration).getExpectedRedemptionValueProductIdCashoutMethodCashoutMethodIdValueGet(productId, cashoutMethodId, amount, options).then((request) => request(axios, basePath));
        },
        /**
         * Return array of user events that altered their wallet balance
         * @summary Get User Transaction History
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {any} bpuid A unique identifier for each user, which is set by the Supplier. Must be consistent across respondent entrances and unique to the platform. It should not contain any sensitive information like email or names, and should avoid using any incrementing values.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getUserTransactionHistoryProductIdTransactionHistoryGet(productId: any, bpuid: any, options?: AxiosRequestConfig): Promise<AxiosResponse<UserTransactionHistoryResponse>> {
            return WalletApiFp(configuration).getUserTransactionHistoryProductIdTransactionHistoryGet(productId, bpuid, options).then((request) => request(axios, basePath));
        },
        /**
         * Retrieve the current balance of a respondent's wallet balance for display
         * @summary Get User Wallet Balance
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {any} bpuid A unique identifier for each user, which is set by the Supplier. Must be consistent across respondent entrances and unique to the platform. It should not contain any sensitive information like email or names, and should avoid using any incrementing values.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getUserWalletBalanceProductIdWalletGet(productId: any, bpuid: any, options?: AxiosRequestConfig): Promise<AxiosResponse<UserWalletBalanceResponse>> {
            return WalletApiFp(configuration).getUserWalletBalanceProductIdWalletGet(productId, bpuid, options).then((request) => request(axios, basePath));
        },
        /**
         * Request a cashout taken from a user's available wallet balance, to be paid via a particular cashout method.
         * @summary Submit User Cashout
         * @param {CreateCashoutRequest} body 
         * @param {any} productId The Brokerage Product ID provided by GRL.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async submitUserCashoutProductIdCashoutPost(body: CreateCashoutRequest, productId: any, options?: AxiosRequestConfig): Promise<AxiosResponse<CashoutRequestResponse>> {
            return WalletApiFp(configuration).submitUserCashoutProductIdCashoutPost(body, productId, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * WalletApi - object-oriented interface
 * @export
 * @class WalletApi
 * @extends {BaseAPI}
 */
export class WalletApi extends BaseAPI {
    /**
     * A user can only have 1 unique Cashout Method of any type at a time (eg. they can't create multiple paypal payout methods). Cashout Methods cannot be edited, they can only be created or deleted. Creating different Cashout Methods will require type-dependent request data attributes in order to be successfully created.  Currently only creating paypal or Cash in Mail cashout methods are supported
     * @summary Create Cashout Method
     * @param {any} body 
     * @param {any} productId The Brokerage Product ID provided by GRL.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WalletApi
     */
    public async createCashoutMethodProductIdCashoutMethodsPost(body: any, productId: any, options?: AxiosRequestConfig) : Promise<AxiosResponse<CashoutMethodResponse>> {
        return WalletApiFp(this.configuration).createCashoutMethodProductIdCashoutMethodsPost(body, productId, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Delete a cashout method
     * @summary Delete Cashout Method
     * @param {any} productId The Brokerage Product ID provided by GRL.
     * @param {any} cashoutMethodId The ID of the cashout method to delete
     * @param {any} bpuid A unique identifier for each user, which is set by the Supplier. Must be consistent across respondent entrances and unique to the platform. It should not contain any sensitive information like email or names, and should avoid using any incrementing values.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WalletApi
     */
    public async deleteCashoutMethodProductIdCashoutMethodsCashoutMethodIdDelete(productId: any, cashoutMethodId: any, bpuid: any, options?: AxiosRequestConfig) : Promise<AxiosResponse<StatusResponse>> {
        return WalletApiFp(this.configuration).deleteCashoutMethodProductIdCashoutMethodsCashoutMethodIdDelete(productId, cashoutMethodId, bpuid, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Retrieve the details for a specific Cashout event
     * @summary Get Cashout Detail
     * @param {any} productId The Brokerage Product ID provided by GRL.
     * @param {any} cashoutId The cashout event ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WalletApi
     */
    public async getCashoutDetailProductIdCashoutCashoutIdGet(productId: any, cashoutId: any, options?: AxiosRequestConfig) : Promise<AxiosResponse<CashoutRequestResponse>> {
        return WalletApiFp(this.configuration).getCashoutDetailProductIdCashoutCashoutIdGet(productId, cashoutId, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Retrieve the current available mechanisms that a user can use to retrieve funds.
     * @summary Get Cashout Methods
     * @param {any} productId The Brokerage Product ID provided by GRL.
     * @param {any} bpuid A unique identifier for each user, which is set by the Supplier. Must be consistent across respondent entrances and unique to the platform. It should not contain any sensitive information like email or names, and should avoid using any incrementing values.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WalletApi
     */
    public async getCashoutMethodsProductIdCashoutMethodsGet(productId: any, bpuid: any, options?: AxiosRequestConfig) : Promise<AxiosResponse<CashoutMethodsResponse>> {
        return WalletApiFp(this.configuration).getCashoutMethodsProductIdCashoutMethodsGet(productId, bpuid, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Use this function to get the \"value\" (in local currency, e.g. CAD, BTC) for this   cashout_method, for amount (in USD cents).
     * @summary Get Expected Redemption Value
     * @param {any} productId The Brokerage Product ID provided by GRL.
     * @param {any} cashoutMethodId The ID of the cashout method
     * @param {any} amount (USD cents) The amount to convert
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WalletApi
     */
    public async getExpectedRedemptionValueProductIdCashoutMethodCashoutMethodIdValueGet(productId: any, cashoutMethodId: any, amount: any, options?: AxiosRequestConfig) : Promise<AxiosResponse<CashoutMethodForeignValueResponse>> {
        return WalletApiFp(this.configuration).getExpectedRedemptionValueProductIdCashoutMethodCashoutMethodIdValueGet(productId, cashoutMethodId, amount, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Return array of user events that altered their wallet balance
     * @summary Get User Transaction History
     * @param {any} productId The Brokerage Product ID provided by GRL.
     * @param {any} bpuid A unique identifier for each user, which is set by the Supplier. Must be consistent across respondent entrances and unique to the platform. It should not contain any sensitive information like email or names, and should avoid using any incrementing values.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WalletApi
     */
    public async getUserTransactionHistoryProductIdTransactionHistoryGet(productId: any, bpuid: any, options?: AxiosRequestConfig) : Promise<AxiosResponse<UserTransactionHistoryResponse>> {
        return WalletApiFp(this.configuration).getUserTransactionHistoryProductIdTransactionHistoryGet(productId, bpuid, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Retrieve the current balance of a respondent's wallet balance for display
     * @summary Get User Wallet Balance
     * @param {any} productId The Brokerage Product ID provided by GRL.
     * @param {any} bpuid A unique identifier for each user, which is set by the Supplier. Must be consistent across respondent entrances and unique to the platform. It should not contain any sensitive information like email or names, and should avoid using any incrementing values.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WalletApi
     */
    public async getUserWalletBalanceProductIdWalletGet(productId: any, bpuid: any, options?: AxiosRequestConfig) : Promise<AxiosResponse<UserWalletBalanceResponse>> {
        return WalletApiFp(this.configuration).getUserWalletBalanceProductIdWalletGet(productId, bpuid, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Request a cashout taken from a user's available wallet balance, to be paid via a particular cashout method.
     * @summary Submit User Cashout
     * @param {CreateCashoutRequest} body 
     * @param {any} productId The Brokerage Product ID provided by GRL.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WalletApi
     */
    public async submitUserCashoutProductIdCashoutPost(body: CreateCashoutRequest, productId: any, options?: AxiosRequestConfig) : Promise<AxiosResponse<CashoutRequestResponse>> {
        return WalletApiFp(this.configuration).submitUserCashoutProductIdCashoutPost(body, productId, options).then((request) => request(this.axios, this.basePath));
    }
}