-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathSplitCreate.ts
More file actions
104 lines (95 loc) · 2.81 KB
/
SplitCreate.ts
File metadata and controls
104 lines (95 loc) · 2.81 KB
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
/* tslint:disable */
/* eslint-disable */
/**
* Paystack
* The OpenAPI specification of the Paystack API that merchants and developers can harness to build financial solutions in Africa.
*
* The version of the Paystack Node library: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import {
SplitSubaccounts,
SplitSubaccountsFromJSON,
SplitSubaccountsFromJSONTyped,
SplitSubaccountsToJSON,
} from './';
/**
*
* @export
* @interface SplitCreate
*/
export interface SplitCreate {
/**
* Name of the transaction split
* @type {string}
* @memberof SplitCreate
*/
name: string;
/**
* The type of transaction split you want to create.
* @type {string}
* @memberof SplitCreate
*/
type: string;
/**
* A list of object containing subaccount code and number of shares
* @type {Array<SplitSubaccounts>}
* @memberof SplitCreate
*/
subaccounts: Array<SplitSubaccounts>;
/**
* The transaction currency
* @type {string}
* @memberof SplitCreate
*/
currency: string;
/**
* This allows you specify how the transaction charge should be processed
* @type {string}
* @memberof SplitCreate
*/
bearerType?: string;
/**
* This is the subaccount code of the customer or partner that would bear the transaction charge if you specified subaccount as the bearer type
* @type {string}
* @memberof SplitCreate
*/
bearerSubaccount?: string;
}
export function SplitCreateFromJSON(json: any): SplitCreate {
return SplitCreateFromJSONTyped(json, false);
}
export function SplitCreateFromJSONTyped(json: any, ignoreDiscriminator: boolean): SplitCreate {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'name': json['name'],
'type': json['type'],
'subaccounts': ((json['subaccounts'] as Array<any>).map(SplitSubaccountsFromJSON)),
'currency': json['currency'],
'bearerType': !exists(json, 'bearer_type') ? undefined : json['bearer_type'],
'bearerSubaccount': !exists(json, 'bearer_subaccount') ? undefined : json['bearer_subaccount'],
};
}
export function SplitCreateToJSON(value?: SplitCreate | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'type': value.type,
'subaccounts': ((value.subaccounts as Array<any>).map(SplitSubaccountsToJSON)),
'currency': value.currency,
'bearer_type': value.bearerType,
'bearer_subaccount': value.bearerSubaccount,
};
}