Skip to content

Commit 47f7b83

Browse files
AdyenAutomationBotAdyenAutomationBotDjoykeAbyah
authored
Code generation: update services and models (#1458)
* [reformat][adyen-sdk-automation] automated change * style(fmt): code formatted * Update transferRoute.ts remove import statement --------- Co-authored-by: AdyenAutomationBot <Adyen Automation [email protected]> Co-authored-by: Djoyke Reijans <[email protected]>
1 parent 607b773 commit 47f7b83

File tree

10 files changed

+454
-9
lines changed

10 files changed

+454
-9
lines changed

src/typings/checkout/additionalDataAirline.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ export class AdditionalDataAirline {
9898
*/
9999
'airline_passenger_last_name'?: string;
100100
/**
101-
* The passenger\'s telephone number, including country code. This is an alphanumeric field that can include the \'+\' and \'-\' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters
101+
* The passenger\'s phone number, including country code. This is an alphanumeric field that can include the \'+\' and \'-\' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters
102102
*/
103-
'airline_passenger_telephone_number'?: string;
103+
'airline_passenger_phone_number'?: string;
104104
/**
105105
* The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters
106106
*/
@@ -240,8 +240,8 @@ export class AdditionalDataAirline {
240240
"type": "string"
241241
},
242242
{
243-
"name": "airline_passenger_telephone_number",
244-
"baseName": "airline.passenger.telephone_number",
243+
"name": "airline_passenger_phone_number",
244+
"baseName": "airline.passenger.phone_number",
245245
"type": "string"
246246
},
247247
{

src/typings/legalEntityManagement/legalEntityAssociation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class LegalEntityAssociation {
3838
*/
3939
'settlorExemptionReason'?: Array<string>;
4040
/**
41-
* Defines the relationship of the legal entity to the current legal entity. Possible value for individuals: **legalRepresentative**. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **director**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. Possible value for trusts: **trust**. Possible values for trust members: **definedBeneficiary**, **protector**, **secondaryTrustee**, **settlor**, **uboThroughControl**, or **uboThroughOwnership**. Possible value for unincorporated partnership: **unincorporatedPartnership**. Possible values for unincorporated partnership members: **secondaryPartner**, **uboThroughControl**, **uboThroughOwnership**
41+
* Defines the relationship of the legal entity to the current legal entity. Possible value for individuals: **legalRepresentative**. Possible values for organizations: **director**, **signatory**, **trustOwnership**, **uboThroughOwnership**, **uboThroughControl**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. Possible value for trusts: **trust**. Possible values for trust members: **definedBeneficiary**, **protector**, **secondaryTrustee**, **settlor**, **uboThroughControl**, or **uboThroughOwnership**. Possible value for unincorporated partnership: **unincorporatedPartnership**. Possible values for unincorporated partnership members: **secondaryPartner**, **uboThroughControl**, **uboThroughOwnership**
4242
*/
4343
'type': LegalEntityAssociation.TypeEnum;
4444

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* The version of the OpenAPI document: v1
3+
*
4+
*
5+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
6+
* https://openapi-generator.tech
7+
* Do not edit this class manually.
8+
*/
9+
10+
11+
export class Amount {
12+
/**
13+
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes).
14+
*/
15+
'currency': string;
16+
/**
17+
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
18+
*/
19+
'value': number;
20+
21+
static discriminator: string | undefined = undefined;
22+
23+
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
24+
{
25+
"name": "currency",
26+
"baseName": "currency",
27+
"type": "string"
28+
},
29+
{
30+
"name": "value",
31+
"baseName": "value",
32+
"type": "number"
33+
} ];
34+
35+
static getAttributeTypeMap() {
36+
return Amount.attributeTypeMap;
37+
}
38+
}
39+
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
/*
2+
* The version of the OpenAPI document: v1
3+
*
4+
*
5+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
6+
* https://openapi-generator.tech
7+
* Do not edit this class manually.
8+
*/
9+
10+
11+
export * from './amount';
12+
export * from './negativeBalanceCompensationWarningNotificationData';
13+
export * from './negativeBalanceCompensationWarningNotificationRequest';
14+
export * from './resource';
15+
export * from './resourceReference';
16+
17+
18+
import { Amount } from './amount';
19+
import { NegativeBalanceCompensationWarningNotificationData } from './negativeBalanceCompensationWarningNotificationData';
20+
import { NegativeBalanceCompensationWarningNotificationRequest } from './negativeBalanceCompensationWarningNotificationRequest';
21+
import { Resource } from './resource';
22+
import { ResourceReference } from './resourceReference';
23+
24+
/* tslint:disable:no-unused-variable */
25+
let primitives = [
26+
"string",
27+
"boolean",
28+
"double",
29+
"integer",
30+
"long",
31+
"float",
32+
"number",
33+
"any"
34+
];
35+
36+
let enumsMap: {[index: string]: any} = {
37+
"NegativeBalanceCompensationWarningNotificationRequest.TypeEnum": NegativeBalanceCompensationWarningNotificationRequest.TypeEnum,
38+
}
39+
40+
let typeMap: {[index: string]: any} = {
41+
"Amount": Amount,
42+
"NegativeBalanceCompensationWarningNotificationData": NegativeBalanceCompensationWarningNotificationData,
43+
"NegativeBalanceCompensationWarningNotificationRequest": NegativeBalanceCompensationWarningNotificationRequest,
44+
"Resource": Resource,
45+
"ResourceReference": ResourceReference,
46+
}
47+
48+
export class ObjectSerializer {
49+
public static findCorrectType(data: any, expectedType: string) {
50+
if (data == undefined) {
51+
return expectedType;
52+
} else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
53+
return expectedType;
54+
} else if (expectedType === "Date") {
55+
return expectedType;
56+
} else {
57+
if (enumsMap[expectedType]) {
58+
return expectedType;
59+
}
60+
61+
if (!typeMap[expectedType]) {
62+
return expectedType; // w/e we don't know the type
63+
}
64+
65+
// Check the discriminator
66+
let discriminatorProperty = typeMap[expectedType].discriminator;
67+
if (discriminatorProperty == null) {
68+
return expectedType; // the type does not have a discriminator. use it.
69+
} else {
70+
if (data[discriminatorProperty]) {
71+
var discriminatorType = data[discriminatorProperty];
72+
if(typeMap[discriminatorType]){
73+
return discriminatorType; // use the type given in the discriminator
74+
} else {
75+
return expectedType; // discriminator did not map to a type
76+
}
77+
} else {
78+
return expectedType; // discriminator was not present (or an empty string)
79+
}
80+
}
81+
}
82+
}
83+
84+
public static serialize(data: any, type: string) {
85+
if (data == undefined) {
86+
return data;
87+
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
88+
return data;
89+
} else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
90+
let subType: string = type.replace("Array<", ""); // Array<Type> => Type>
91+
subType = subType.substring(0, subType.length - 1); // Type> => Type
92+
let transformedData: any[] = [];
93+
for (let index = 0; index < data.length; index++) {
94+
let datum = data[index];
95+
transformedData.push(ObjectSerializer.serialize(datum, subType));
96+
}
97+
return transformedData;
98+
} else if (type === "Date") {
99+
return data.toISOString();
100+
} else if (type === "SaleToAcquirerData") {
101+
const dataString = JSON.stringify(data);
102+
return Buffer.from(dataString).toString("base64");
103+
} else {
104+
if (enumsMap[type]) {
105+
return data;
106+
}
107+
if (!typeMap[type]) { // in case we dont know the type
108+
return data;
109+
}
110+
111+
// Get the actual type of this object
112+
type = this.findCorrectType(data, type);
113+
114+
// get the map for the correct type.
115+
let attributeTypes = typeMap[type].getAttributeTypeMap();
116+
let instance: {[index: string]: any} = {};
117+
for (let index = 0; index < attributeTypes.length; index++) {
118+
let attributeType = attributeTypes[index];
119+
instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
120+
}
121+
return instance;
122+
}
123+
}
124+
125+
public static deserialize(data: any, type: string) {
126+
// polymorphism may change the actual type.
127+
type = ObjectSerializer.findCorrectType(data, type);
128+
if (data == undefined) {
129+
return data;
130+
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
131+
return data;
132+
} else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
133+
let subType: string = type.replace("Array<", ""); // Array<Type> => Type>
134+
subType = subType.substring(0, subType.length - 1); // Type> => Type
135+
let transformedData: any[] = [];
136+
for (let index = 0; index < data.length; index++) {
137+
let datum = data[index];
138+
transformedData.push(ObjectSerializer.deserialize(datum, subType));
139+
}
140+
return transformedData;
141+
} else if (type === "Date") {
142+
return new Date(data);
143+
} else {
144+
if (enumsMap[type]) {// is Enum
145+
return data;
146+
}
147+
148+
if (!typeMap[type]) { // dont know the type
149+
return data;
150+
}
151+
let instance = new typeMap[type]();
152+
let attributeTypes = typeMap[type].getAttributeTypeMap();
153+
for (let index = 0; index < attributeTypes.length; index++) {
154+
let attributeType = attributeTypes[index];
155+
instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type);
156+
}
157+
return instance;
158+
}
159+
}
160+
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
* The version of the OpenAPI document: v1
3+
*
4+
*
5+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
6+
* https://openapi-generator.tech
7+
* Do not edit this class manually.
8+
*/
9+
10+
import { Amount } from './amount';
11+
import { ResourceReference } from './resourceReference';
12+
13+
export class NegativeBalanceCompensationWarningNotificationData {
14+
'accountHolder'?: ResourceReference | null;
15+
'amount'?: Amount | null;
16+
/**
17+
* The unique identifier of the balance platform.
18+
*/
19+
'balancePlatform'?: string;
20+
/**
21+
* The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.
22+
*/
23+
'creationDate'?: Date;
24+
/**
25+
* The ID of the resource.
26+
*/
27+
'id'?: string;
28+
/**
29+
* The balance account ID of the account that will be used to compensate the balance account whose balance is negative.
30+
*/
31+
'liableBalanceAccountId'?: string;
32+
/**
33+
* The date the balance for the account became negative.
34+
*/
35+
'negativeBalanceSince'?: Date;
36+
/**
37+
* The date when a compensation transfer to the account is scheduled to happen.
38+
*/
39+
'scheduledCompensationAt'?: Date;
40+
41+
static discriminator: string | undefined = undefined;
42+
43+
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
44+
{
45+
"name": "accountHolder",
46+
"baseName": "accountHolder",
47+
"type": "ResourceReference | null"
48+
},
49+
{
50+
"name": "amount",
51+
"baseName": "amount",
52+
"type": "Amount | null"
53+
},
54+
{
55+
"name": "balancePlatform",
56+
"baseName": "balancePlatform",
57+
"type": "string"
58+
},
59+
{
60+
"name": "creationDate",
61+
"baseName": "creationDate",
62+
"type": "Date"
63+
},
64+
{
65+
"name": "id",
66+
"baseName": "id",
67+
"type": "string"
68+
},
69+
{
70+
"name": "liableBalanceAccountId",
71+
"baseName": "liableBalanceAccountId",
72+
"type": "string"
73+
},
74+
{
75+
"name": "negativeBalanceSince",
76+
"baseName": "negativeBalanceSince",
77+
"type": "Date"
78+
},
79+
{
80+
"name": "scheduledCompensationAt",
81+
"baseName": "scheduledCompensationAt",
82+
"type": "Date"
83+
} ];
84+
85+
static getAttributeTypeMap() {
86+
return NegativeBalanceCompensationWarningNotificationData.attributeTypeMap;
87+
}
88+
}
89+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* The version of the OpenAPI document: v1
3+
*
4+
*
5+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
6+
* https://openapi-generator.tech
7+
* Do not edit this class manually.
8+
*/
9+
10+
import { NegativeBalanceCompensationWarningNotificationData } from './negativeBalanceCompensationWarningNotificationData';
11+
12+
export class NegativeBalanceCompensationWarningNotificationRequest {
13+
'data': NegativeBalanceCompensationWarningNotificationData;
14+
/**
15+
* The environment from which the webhook originated. Possible values: **test**, **live**.
16+
*/
17+
'environment': string;
18+
/**
19+
* When the event was queued.
20+
*/
21+
'timestamp'?: Date;
22+
/**
23+
* Type of webhook.
24+
*/
25+
'type': NegativeBalanceCompensationWarningNotificationRequest.TypeEnum;
26+
27+
static discriminator: string | undefined = undefined;
28+
29+
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
30+
{
31+
"name": "data",
32+
"baseName": "data",
33+
"type": "NegativeBalanceCompensationWarningNotificationData"
34+
},
35+
{
36+
"name": "environment",
37+
"baseName": "environment",
38+
"type": "string"
39+
},
40+
{
41+
"name": "timestamp",
42+
"baseName": "timestamp",
43+
"type": "Date"
44+
},
45+
{
46+
"name": "type",
47+
"baseName": "type",
48+
"type": "NegativeBalanceCompensationWarningNotificationRequest.TypeEnum"
49+
} ];
50+
51+
static getAttributeTypeMap() {
52+
return NegativeBalanceCompensationWarningNotificationRequest.attributeTypeMap;
53+
}
54+
}
55+
56+
export namespace NegativeBalanceCompensationWarningNotificationRequest {
57+
export enum TypeEnum {
58+
BalancePlatformNegativeBalanceCompensationWarningScheduled = 'balancePlatform.negativeBalanceCompensationWarning.scheduled'
59+
}
60+
}

0 commit comments

Comments
 (0)