Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code generation: update services and models #1458

Merged
merged 3 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/typings/checkout/additionalDataAirline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ export class AdditionalDataAirline {
*/
'airline_passenger_last_name'?: string;
/**
* 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
* 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
*/
'airline_passenger_telephone_number'?: string;
'airline_passenger_phone_number'?: string;
/**
* The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters
*/
Expand Down Expand Up @@ -240,8 +240,8 @@ export class AdditionalDataAirline {
"type": "string"
},
{
"name": "airline_passenger_telephone_number",
"baseName": "airline.passenger.telephone_number",
"name": "airline_passenger_phone_number",
"baseName": "airline.passenger.phone_number",
"type": "string"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class LegalEntityAssociation {
*/
'settlorExemptionReason'?: Array<string>;
/**
* 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**
* 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**
*/
'type': LegalEntityAssociation.TypeEnum;

Expand Down
39 changes: 39 additions & 0 deletions src/typings/negativeBalanceWarningWebhooks/amount.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/


export class Amount {
/**
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes).
*/
'currency': string;
/**
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
*/
'value': number;

static discriminator: string | undefined = undefined;

static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "currency",
"baseName": "currency",
"type": "string"
},
{
"name": "value",
"baseName": "value",
"type": "number"
} ];

static getAttributeTypeMap() {
return Amount.attributeTypeMap;
}
}

160 changes: 160 additions & 0 deletions src/typings/negativeBalanceWarningWebhooks/models.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
/*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/


export * from './amount';
export * from './negativeBalanceCompensationWarningNotificationData';
export * from './negativeBalanceCompensationWarningNotificationRequest';
export * from './resource';
export * from './resourceReference';


import { Amount } from './amount';
import { NegativeBalanceCompensationWarningNotificationData } from './negativeBalanceCompensationWarningNotificationData';
import { NegativeBalanceCompensationWarningNotificationRequest } from './negativeBalanceCompensationWarningNotificationRequest';
import { Resource } from './resource';
import { ResourceReference } from './resourceReference';

/* tslint:disable:no-unused-variable */
let primitives = [
"string",
"boolean",
"double",
"integer",
"long",
"float",
"number",
"any"
];

let enumsMap: {[index: string]: any} = {
"NegativeBalanceCompensationWarningNotificationRequest.TypeEnum": NegativeBalanceCompensationWarningNotificationRequest.TypeEnum,
}

let typeMap: {[index: string]: any} = {
"Amount": Amount,
"NegativeBalanceCompensationWarningNotificationData": NegativeBalanceCompensationWarningNotificationData,
"NegativeBalanceCompensationWarningNotificationRequest": NegativeBalanceCompensationWarningNotificationRequest,
"Resource": Resource,
"ResourceReference": ResourceReference,
}

export class ObjectSerializer {
public static findCorrectType(data: any, expectedType: string) {
if (data == undefined) {
return expectedType;
} else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
return expectedType;
} else if (expectedType === "Date") {
return expectedType;
} else {
if (enumsMap[expectedType]) {
return expectedType;
}

if (!typeMap[expectedType]) {
return expectedType; // w/e we don't know the type
}

// Check the discriminator
let discriminatorProperty = typeMap[expectedType].discriminator;
if (discriminatorProperty == null) {
return expectedType; // the type does not have a discriminator. use it.
} else {
if (data[discriminatorProperty]) {
var discriminatorType = data[discriminatorProperty];
if(typeMap[discriminatorType]){
return discriminatorType; // use the type given in the discriminator
} else {
return expectedType; // discriminator did not map to a type
}
} else {
return expectedType; // discriminator was not present (or an empty string)
}
}
}
}

public static serialize(data: any, type: string) {
if (data == undefined) {
return data;
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
return data;
} else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
let subType: string = type.replace("Array<", ""); // Array<Type> => Type>
subType = subType.substring(0, subType.length - 1); // Type> => Type
let transformedData: any[] = [];
for (let index = 0; index < data.length; index++) {
let datum = data[index];
transformedData.push(ObjectSerializer.serialize(datum, subType));
}
return transformedData;
} else if (type === "Date") {
return data.toISOString();
} else if (type === "SaleToAcquirerData") {
const dataString = JSON.stringify(data);
return Buffer.from(dataString).toString("base64");
} else {
if (enumsMap[type]) {
return data;
}
if (!typeMap[type]) { // in case we dont know the type
return data;
}

// Get the actual type of this object
type = this.findCorrectType(data, type);

// get the map for the correct type.
let attributeTypes = typeMap[type].getAttributeTypeMap();
let instance: {[index: string]: any} = {};
for (let index = 0; index < attributeTypes.length; index++) {
let attributeType = attributeTypes[index];
instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
}
return instance;
}
}

public static deserialize(data: any, type: string) {
// polymorphism may change the actual type.
type = ObjectSerializer.findCorrectType(data, type);
if (data == undefined) {
return data;
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
return data;
} else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
let subType: string = type.replace("Array<", ""); // Array<Type> => Type>
subType = subType.substring(0, subType.length - 1); // Type> => Type
let transformedData: any[] = [];
for (let index = 0; index < data.length; index++) {
let datum = data[index];
transformedData.push(ObjectSerializer.deserialize(datum, subType));
}
return transformedData;
} else if (type === "Date") {
return new Date(data);
} else {
if (enumsMap[type]) {// is Enum
return data;
}

if (!typeMap[type]) { // dont know the type
return data;
}
let instance = new typeMap[type]();
let attributeTypes = typeMap[type].getAttributeTypeMap();
for (let index = 0; index < attributeTypes.length; index++) {
let attributeType = attributeTypes[index];
instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type);
}
return instance;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/

import { Amount } from './amount';
import { ResourceReference } from './resourceReference';

export class NegativeBalanceCompensationWarningNotificationData {
'accountHolder'?: ResourceReference | null;
'amount'?: Amount | null;
/**
* The unique identifier of the balance platform.
*/
'balancePlatform'?: string;
/**
* The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.
*/
'creationDate'?: Date;
/**
* The ID of the resource.
*/
'id'?: string;
/**
* The balance account ID of the account that will be used to compensate the balance account whose balance is negative.
*/
'liableBalanceAccountId'?: string;
/**
* The date the balance for the account became negative.
*/
'negativeBalanceSince'?: Date;
/**
* The date when a compensation transfer to the account is scheduled to happen.
*/
'scheduledCompensationAt'?: Date;

static discriminator: string | undefined = undefined;

static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "accountHolder",
"baseName": "accountHolder",
"type": "ResourceReference | null"
},
{
"name": "amount",
"baseName": "amount",
"type": "Amount | null"
},
{
"name": "balancePlatform",
"baseName": "balancePlatform",
"type": "string"
},
{
"name": "creationDate",
"baseName": "creationDate",
"type": "Date"
},
{
"name": "id",
"baseName": "id",
"type": "string"
},
{
"name": "liableBalanceAccountId",
"baseName": "liableBalanceAccountId",
"type": "string"
},
{
"name": "negativeBalanceSince",
"baseName": "negativeBalanceSince",
"type": "Date"
},
{
"name": "scheduledCompensationAt",
"baseName": "scheduledCompensationAt",
"type": "Date"
} ];

static getAttributeTypeMap() {
return NegativeBalanceCompensationWarningNotificationData.attributeTypeMap;
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/

import { NegativeBalanceCompensationWarningNotificationData } from './negativeBalanceCompensationWarningNotificationData';

export class NegativeBalanceCompensationWarningNotificationRequest {
'data': NegativeBalanceCompensationWarningNotificationData;
/**
* The environment from which the webhook originated. Possible values: **test**, **live**.
*/
'environment': string;
/**
* When the event was queued.
*/
'timestamp'?: Date;
/**
* Type of webhook.
*/
'type': NegativeBalanceCompensationWarningNotificationRequest.TypeEnum;

static discriminator: string | undefined = undefined;

static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "data",
"baseName": "data",
"type": "NegativeBalanceCompensationWarningNotificationData"
},
{
"name": "environment",
"baseName": "environment",
"type": "string"
},
{
"name": "timestamp",
"baseName": "timestamp",
"type": "Date"
},
{
"name": "type",
"baseName": "type",
"type": "NegativeBalanceCompensationWarningNotificationRequest.TypeEnum"
} ];

static getAttributeTypeMap() {
return NegativeBalanceCompensationWarningNotificationRequest.attributeTypeMap;
}
}

export namespace NegativeBalanceCompensationWarningNotificationRequest {
export enum TypeEnum {
BalancePlatformNegativeBalanceCompensationWarningScheduled = 'balancePlatform.negativeBalanceCompensationWarning.scheduled'
}
}
Loading
Loading