From 82ae8f20def4bfd176b547f0c7cbcefff75b650c Mon Sep 17 00:00:00 2001 From: Beppe Catanese Date: Wed, 18 Jun 2025 09:34:45 +0200 Subject: [PATCH 1/4] Signature with required parameters first --- templates-v7/typescript/api/api.mustache | 2 +- templates-v7/typescript/api_summary.mustache | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/templates-v7/typescript/api/api.mustache b/templates-v7/typescript/api/api.mustache index 786d58951..395b417a5 100644 --- a/templates-v7/typescript/api/api.mustache +++ b/templates-v7/typescript/api/api.mustache @@ -36,7 +36,7 @@ export class {{classname}} extends Service { {{#operation}} {{>api_summary}} - public async {{#vendorExtensions.x-methodName}}{{.}}{{/vendorExtensions.x-methodName}}{{^vendorExtensions.x-methodName}}{{nickname}}{{/vendorExtensions.x-methodName}}({{#pathParams}}{{paramName}}: {{{dataType}}}, {{/pathParams}}{{#bodyParams}}{{paramName}}: {{{dataType}}}, {{/bodyParams}}{{#queryParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/queryParams}}requestOptions?: IRequest.Options): Promise<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}}> { + public async {{#vendorExtensions.x-methodName}}{{.}}{{/vendorExtensions.x-methodName}}{{^vendorExtensions.x-methodName}}{{nickname}}{{/vendorExtensions.x-methodName}}({{#pathParams}}{{paramName}}: {{{dataType}}}, {{/pathParams}}{{#bodyParams}}{{paramName}}: {{{dataType}}}, {{/bodyParams}}{{#queryParams}}{{#required}}{{paramName}}: {{{dataType}}}, {{/required}}{{/queryParams}}{{#queryParams}}{{^required}}{{paramName}}?: {{{dataType}}}, {{/required}}{{/queryParams}}requestOptions?: IRequest.Options): Promise<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}}> { const endpoint = `${this.baseUrl}{{{path}}}`{{#pathParams}} .replace("{" + "{{baseName}}" + "}", encodeURIComponent(String({{paramName}}))){{/pathParams}}; const resource = new Resource(this, endpoint); diff --git a/templates-v7/typescript/api_summary.mustache b/templates-v7/typescript/api_summary.mustache index e24b10651..8ea86df74 100644 --- a/templates-v7/typescript/api_summary.mustache +++ b/templates-v7/typescript/api_summary.mustache @@ -8,10 +8,9 @@ {{#bodyParams}} * @param {{paramName}} {@link {{dataType}} } {{description}} {{/bodyParams}} - * @param requestOptions {@link IRequest.Options } -{{#queryParams}} - * @param {{paramName}} {@link {{dataType}} } {{description}} -{{/queryParams}} + * @param requestOptions {@link IRequest.Options }{{#queryParams}}{{#required}} + * @param {{paramName}} {@link {{dataType}} } (Required) {{description}}{{/required}}{{/queryParams}}{{#queryParams}}{{^required}} + * @param {{paramName}} {@link {{dataType}} } {{description}}{{/required}}{{/queryParams}} {{#hasProduces}} * @return {@link {{returnType}} } {{/hasProduces}} From e02795a0f5f707832a85a27bec84a1d8627963fb Mon Sep 17 00:00:00 2001 From: Beppe Catanese Date: Wed, 18 Jun 2025 09:35:04 +0200 Subject: [PATCH 2/4] Code format --- src/services/transfers/capitalApi.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/services/transfers/capitalApi.ts b/src/services/transfers/capitalApi.ts index d4b7a5ec7..580f959cf 100644 --- a/src/services/transfers/capitalApi.ts +++ b/src/services/transfers/capitalApi.ts @@ -35,7 +35,7 @@ export class CapitalApi extends Service { /** * @summary Get a capital account * @param requestOptions {@link IRequest.Options } - * @param counterpartyAccountHolderId {@link string } The counterparty account holder id. + * @param counterpartyAccountHolderId {@link string } The counterparty account holder id. * @return {@link CapitalGrants } * * @deprecated since Transfers API v4 @@ -57,7 +57,7 @@ export class CapitalApi extends Service { { ...requestOptions, method: "GET" } ); - return ObjectSerializer.deserialize(response, "CapitalGrants", ""); + return ObjectSerializer.deserialize(response, "CapitalGrants"); } /** @@ -80,7 +80,7 @@ export class CapitalApi extends Service { { ...requestOptions, method: "GET" } ); - return ObjectSerializer.deserialize(response, "CapitalGrant", ""); + return ObjectSerializer.deserialize(response, "CapitalGrant"); } /** @@ -96,14 +96,14 @@ export class CapitalApi extends Service { const endpoint = `${this.baseUrl}/grants`; const resource = new Resource(this, endpoint); - const request: CapitalGrantInfo = ObjectSerializer.serialize(capitalGrantInfo, "CapitalGrantInfo", ""); + const request: CapitalGrantInfo = ObjectSerializer.serialize(capitalGrantInfo, "CapitalGrantInfo"); const response = await getJsonResponse( resource, request, { ...requestOptions, method: "POST" } ); - return ObjectSerializer.deserialize(response, "CapitalGrant", ""); + return ObjectSerializer.deserialize(response, "CapitalGrant"); } } From c75293394325c72daf033157ea2531672fddfa1a Mon Sep 17 00:00:00 2001 From: Beppe Catanese Date: Wed, 18 Jun 2025 09:35:40 +0200 Subject: [PATCH 3/4] Generate signature with required params first --- src/__tests__/transfers.spec.ts | 46 +++++++++++++++++++++-- src/services/transfers/transactionsApi.ts | 22 +++++------ src/services/transfers/transfersApi.ts | 38 +++++++++---------- 3 files changed, 73 insertions(+), 33 deletions(-) diff --git a/src/__tests__/transfers.spec.ts b/src/__tests__/transfers.spec.ts index d2fcb7514..764793bac 100644 --- a/src/__tests__/transfers.spec.ts +++ b/src/__tests__/transfers.spec.ts @@ -47,6 +47,45 @@ describe("Transfers", (): void => { expect(response.id).toEqual("1W1UG35U8A9J5ZLG"); }); + test("should get transfer", async (): Promise => { + scope.get("/transfers/123") + .reply(200, transfersSuccess); + const response: transfers.TransferData = await transfersAPI.TransfersApi.getTransfer("123",); + expect(response.id).toEqual("1W1UG35U8A9J5ZLG"); + }); + + test("should list transfers", async (): Promise => { + const createdSince = new Date(Date.UTC(2023, 11, 12, 0, 0, 0)); // 12-12-2023 December is month 11 + const createdUntil = new Date(Date.UTC(2023, 11, 13, 0, 0, 0)); // 13-12-2023 December is month 11 + + scope + .get("/transfers") + .query({ + balancePlatform: "platform", + createdSince: createdSince.toISOString(), + createdUntil: createdUntil.toISOString(), + }) + .reply(200, listTransactionsSuccess); + + const response: transfers.FindTransfersResponse = await transfersAPI.TransfersApi.getAllTransfers( + createdSince, + createdUntil, + "platform", + undefined, + undefined, + undefined, + undefined + ); + + expect(response.data?.length).toEqual(3); + if (response.data && response.data.length > 0) { + expect(response.data[0].id).toEqual("1VVF0D5U66PIUIVP"); + } else { + fail(); + } + }); + + test("should get transaction", async (): Promise => { scope.get("/transactions/123") .reply(200, getTransactionSuccess); @@ -68,13 +107,13 @@ describe("Transfers", (): void => { .reply(200, listTransactionsSuccess); const response: transfers.TransactionSearchResponse = await transfersAPI.TransactionsApi.getAllTransactions( + createdSince, + createdUntil, "platform", undefined, undefined, undefined, - undefined, - createdSince, - createdUntil + undefined ); expect(response.data?.length).toEqual(3); @@ -84,4 +123,5 @@ describe("Transfers", (): void => { fail(); } }); + }); \ No newline at end of file diff --git a/src/services/transfers/transactionsApi.ts b/src/services/transfers/transactionsApi.ts index 2f83e9931..95ebc7d68 100644 --- a/src/services/transfers/transactionsApi.ts +++ b/src/services/transfers/transactionsApi.ts @@ -34,17 +34,17 @@ export class TransactionsApi extends Service { /** * @summary Get all transactions * @param requestOptions {@link IRequest.Options } - * @param balancePlatform {@link string } The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id). Required if you don\'t provide a `balanceAccountId` or `accountHolderId`. - * @param paymentInstrumentId {@link string } The unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/paymentInstruments/_id_). To use this parameter, you must also provide a `balanceAccountId`, `accountHolderId`, or `balancePlatform`. The `paymentInstrumentId` must be related to the `balanceAccountId` or `accountHolderId` that you provide. - * @param accountHolderId {@link string } The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/accountHolders/{id}__queryParam_id). Required if you don\'t provide a `balanceAccountId` or `balancePlatform`. If you provide a `balanceAccountId`, the `accountHolderId` must be related to the `balanceAccountId`. - * @param balanceAccountId {@link string } The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__queryParam_id). Required if you don\'t provide an `accountHolderId` or `balancePlatform`. If you provide an `accountHolderId`, the `balanceAccountId` must be related to the `accountHolderId`. - * @param cursor {@link string } The `cursor` returned in the links of the previous response. - * @param createdSince {@link Date } Only include transactions that have been created on or after this point in time. The value must be in ISO 8601 format. For example, **2021-05-30T15:07:40Z**. - * @param createdUntil {@link Date } Only include transactions that have been created on or before this point in time. The value must be in ISO 8601 format. For example, **2021-05-30T15:07:40Z**. - * @param limit {@link number } The number of items returned per page, maximum of 100 items. By default, the response returns 10 items per page. + * @param createdSince {@link Date } (Required) Only include transactions that have been created on or after this point in time. The value must be in ISO 8601 format. For example, **2021-05-30T15:07:40Z**. + * @param createdUntil {@link Date } (Required) Only include transactions that have been created on or before this point in time. The value must be in ISO 8601 format. For example, **2021-05-30T15:07:40Z**. + * @param balancePlatform {@link string } The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id). Required if you don\'t provide a `balanceAccountId` or `accountHolderId`. + * @param paymentInstrumentId {@link string } The unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/paymentInstruments/_id_). To use this parameter, you must also provide a `balanceAccountId`, `accountHolderId`, or `balancePlatform`. The `paymentInstrumentId` must be related to the `balanceAccountId` or `accountHolderId` that you provide. + * @param accountHolderId {@link string } The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/accountHolders/{id}__queryParam_id). Required if you don\'t provide a `balanceAccountId` or `balancePlatform`. If you provide a `balanceAccountId`, the `accountHolderId` must be related to the `balanceAccountId`. + * @param balanceAccountId {@link string } The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__queryParam_id). Required if you don\'t provide an `accountHolderId` or `balancePlatform`. If you provide an `accountHolderId`, the `balanceAccountId` must be related to the `accountHolderId`. + * @param cursor {@link string } The `cursor` returned in the links of the previous response. + * @param limit {@link number } The number of items returned per page, maximum of 100 items. By default, the response returns 10 items per page. * @return {@link TransactionSearchResponse } */ - public async getAllTransactions(balancePlatform?: string, paymentInstrumentId?: string, accountHolderId?: string, balanceAccountId?: string, cursor?: string, createdSince?: Date, createdUntil?: Date, limit?: number, requestOptions?: IRequest.Options): Promise { + public async getAllTransactions(createdSince: Date, createdUntil: Date, balancePlatform?: string, paymentInstrumentId?: string, accountHolderId?: string, balanceAccountId?: string, cursor?: string, limit?: number, requestOptions?: IRequest.Options): Promise { const endpoint = `${this.baseUrl}/transactions`; const resource = new Resource(this, endpoint); @@ -67,7 +67,7 @@ export class TransactionsApi extends Service { { ...requestOptions, method: "GET" } ); - return ObjectSerializer.deserialize(response, "TransactionSearchResponse", ""); + return ObjectSerializer.deserialize(response, "TransactionSearchResponse"); } /** @@ -87,7 +87,7 @@ export class TransactionsApi extends Service { { ...requestOptions, method: "GET" } ); - return ObjectSerializer.deserialize(response, "Transaction", ""); + return ObjectSerializer.deserialize(response, "Transaction"); } } diff --git a/src/services/transfers/transfersApi.ts b/src/services/transfers/transfersApi.ts index 74022ed5d..8da5ccbdb 100644 --- a/src/services/transfers/transfersApi.ts +++ b/src/services/transfers/transfersApi.ts @@ -47,7 +47,7 @@ export class TransfersApi extends Service { const endpoint = `${this.baseUrl}/transfers/approve`; const resource = new Resource(this, endpoint); - const request: ApproveTransfersRequest = ObjectSerializer.serialize(approveTransfersRequest, "ApproveTransfersRequest", ""); + const request: ApproveTransfersRequest = ObjectSerializer.serialize(approveTransfersRequest, "ApproveTransfersRequest"); await getJsonResponse( resource, request, @@ -65,7 +65,7 @@ export class TransfersApi extends Service { const endpoint = `${this.baseUrl}/transfers/cancel`; const resource = new Resource(this, endpoint); - const request: CancelTransfersRequest = ObjectSerializer.serialize(cancelTransfersRequest, "CancelTransfersRequest", ""); + const request: CancelTransfersRequest = ObjectSerializer.serialize(cancelTransfersRequest, "CancelTransfersRequest"); await getJsonResponse( resource, request, @@ -76,19 +76,19 @@ export class TransfersApi extends Service { /** * @summary Get all transfers * @param requestOptions {@link IRequest.Options } - * @param balancePlatform {@link string } The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id). Required if you don\'t provide a `balanceAccountId` or `accountHolderId`. - * @param accountHolderId {@link string } The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/accountHolders/{id}__queryParam_id). Required if you don\'t provide a `balanceAccountId` or `balancePlatform`. If you provide a `balanceAccountId`, the `accountHolderId` must be related to the `balanceAccountId`. - * @param balanceAccountId {@link string } The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__queryParam_id). Required if you don\'t provide an `accountHolderId` or `balancePlatform`. If you provide an `accountHolderId`, the `balanceAccountId` must be related to the `accountHolderId`. - * @param paymentInstrumentId {@link string } The unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/paymentInstruments/_id_). To use this parameter, you must also provide a `balanceAccountId`, `accountHolderId`, or `balancePlatform`. The `paymentInstrumentId` must be related to the `balanceAccountId` or `accountHolderId` that you provide. - * @param reference {@link string } The reference you provided in the POST [/transfers](https://docs.adyen.com/api-explorer/transfers/latest/post/transfers) request - * @param category {@link 'bank' | 'card' | 'grants' | 'internal' | 'issuedCard' | 'migration' | 'platformPayment' | 'topUp' | 'upgrade' } The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: Transfer initiated by a Adyen-issued card. - **platformPayment**: Fund movements related to payments that are acquired for your users. - * @param createdSince {@link Date } Only include transfers that have been created on or after this point in time. The value must be in ISO 8601 format and not earlier than 6 months before the `createdUntil` date. For example, **2021-05-30T15:07:40Z**. - * @param createdUntil {@link Date } Only include transfers that have been created on or before this point in time. The value must be in ISO 8601 format and not later than 6 months after the `createdSince` date. For example, **2021-05-30T15:07:40Z**. - * @param cursor {@link string } The `cursor` returned in the links of the previous response. - * @param limit {@link number } The number of items returned per page, maximum of 100 items. By default, the response returns 10 items per page. + * @param createdSince {@link Date } (Required) Only include transfers that have been created on or after this point in time. The value must be in ISO 8601 format and not earlier than 6 months before the `createdUntil` date. For example, **2021-05-30T15:07:40Z**. + * @param createdUntil {@link Date } (Required) Only include transfers that have been created on or before this point in time. The value must be in ISO 8601 format and not later than 6 months after the `createdSince` date. For example, **2021-05-30T15:07:40Z**. + * @param balancePlatform {@link string } The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id). Required if you don\'t provide a `balanceAccountId` or `accountHolderId`. + * @param accountHolderId {@link string } The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/accountHolders/{id}__queryParam_id). Required if you don\'t provide a `balanceAccountId` or `balancePlatform`. If you provide a `balanceAccountId`, the `accountHolderId` must be related to the `balanceAccountId`. + * @param balanceAccountId {@link string } The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__queryParam_id). Required if you don\'t provide an `accountHolderId` or `balancePlatform`. If you provide an `accountHolderId`, the `balanceAccountId` must be related to the `accountHolderId`. + * @param paymentInstrumentId {@link string } The unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/paymentInstruments/_id_). To use this parameter, you must also provide a `balanceAccountId`, `accountHolderId`, or `balancePlatform`. The `paymentInstrumentId` must be related to the `balanceAccountId` or `accountHolderId` that you provide. + * @param reference {@link string } The reference you provided in the POST [/transfers](https://docs.adyen.com/api-explorer/transfers/latest/post/transfers) request + * @param category {@link 'bank' | 'card' | 'grants' | 'interest' | 'internal' | 'issuedCard' | 'migration' | 'platformPayment' | 'topUp' | 'upgrade' } The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: Transfer initiated by a Adyen-issued card. - **platformPayment**: Fund movements related to payments that are acquired for your users. + * @param cursor {@link string } The `cursor` returned in the links of the previous response. + * @param limit {@link number } The number of items returned per page, maximum of 100 items. By default, the response returns 10 items per page. * @return {@link FindTransfersResponse } */ - public async getAllTransfers(balancePlatform?: string, accountHolderId?: string, balanceAccountId?: string, paymentInstrumentId?: string, reference?: string, category?: "bank" | "card" | "grants" | "internal" | "issuedCard" | "migration" | "platformPayment" | "topUp" | "upgrade", createdSince?: Date, createdUntil?: Date, cursor?: string, limit?: number, requestOptions?: IRequest.Options): Promise { + public async getAllTransfers(createdSince: Date, createdUntil: Date, balancePlatform?: string, accountHolderId?: string, balanceAccountId?: string, paymentInstrumentId?: string, reference?: string, category?: "bank" | "card" | "grants" | "interest" | "internal" | "issuedCard" | "migration" | "platformPayment" | "topUp" | "upgrade", cursor?: string, limit?: number, requestOptions?: IRequest.Options): Promise { const endpoint = `${this.baseUrl}/transfers`; const resource = new Resource(this, endpoint); @@ -113,7 +113,7 @@ export class TransfersApi extends Service { { ...requestOptions, method: "GET" } ); - return ObjectSerializer.deserialize(response, "FindTransfersResponse", ""); + return ObjectSerializer.deserialize(response, "FindTransfersResponse"); } /** @@ -133,7 +133,7 @@ export class TransfersApi extends Service { { ...requestOptions, method: "GET" } ); - return ObjectSerializer.deserialize(response, "TransferData", ""); + return ObjectSerializer.deserialize(response, "TransferData"); } /** @@ -148,14 +148,14 @@ export class TransfersApi extends Service { .replace("{" + "transferId" + "}", encodeURIComponent(String(transferId))); const resource = new Resource(this, endpoint); - const request: ReturnTransferRequest = ObjectSerializer.serialize(returnTransferRequest, "ReturnTransferRequest", ""); + const request: ReturnTransferRequest = ObjectSerializer.serialize(returnTransferRequest, "ReturnTransferRequest"); const response = await getJsonResponse( resource, request, { ...requestOptions, method: "POST" } ); - return ObjectSerializer.deserialize(response, "ReturnTransferResponse", ""); + return ObjectSerializer.deserialize(response, "ReturnTransferResponse"); } /** @@ -168,14 +168,14 @@ export class TransfersApi extends Service { const endpoint = `${this.baseUrl}/transfers`; const resource = new Resource(this, endpoint); - const request: TransferInfo = ObjectSerializer.serialize(transferInfo, "TransferInfo", ""); + const request: TransferInfo = ObjectSerializer.serialize(transferInfo, "TransferInfo"); const response = await getJsonResponse( resource, request, { ...requestOptions, method: "POST" } ); - return ObjectSerializer.deserialize(response, "Transfer", ""); + return ObjectSerializer.deserialize(response, "Transfer"); } } From 86f27cf04c8adb18d60f9b95762e80b37cece224 Mon Sep 17 00:00:00 2001 From: Beppe Catanese Date: Wed, 18 Jun 2025 09:36:15 +0200 Subject: [PATCH 4/4] Add executionDate and format code --- src/typings/transfers/executionDate.ts | 46 +++++++++++++++++++++++ src/typings/transfers/models.ts | 1 + src/typings/transfers/objectSerializer.ts | 10 +++-- src/typings/transfers/transfer.ts | 8 ++++ src/typings/transfers/transferData.ts | 8 ++++ src/typings/transfers/transferInfo.ts | 8 ++++ 6 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 src/typings/transfers/executionDate.ts diff --git a/src/typings/transfers/executionDate.ts b/src/typings/transfers/executionDate.ts new file mode 100644 index 000000000..791f7677f --- /dev/null +++ b/src/typings/transfers/executionDate.ts @@ -0,0 +1,46 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 ExecutionDate { + /** + * The date when the transfer will be processed. This date must be: * Within 30 days of the current date. * In the [ISO 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html) **YYYY-MM-DD**. For example: 2025-01-31 + */ + "date"?: string; + /** + * The timezone that applies to the execution date. Use a timezone identifier from the [tz database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). Example: **America/Los_Angeles**. Default value: **Europe/Amsterdam**. + */ + "timezone"?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "date", + "baseName": "date", + "type": "string", + "format": "date" + }, + { + "name": "timezone", + "baseName": "timezone", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ExecutionDate.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/transfers/models.ts b/src/typings/transfers/models.ts index b9d26b20e..c2d12db6e 100644 --- a/src/typings/transfers/models.ts +++ b/src/typings/transfers/models.ts @@ -26,6 +26,7 @@ export * from "./counterpartyV3" export * from "./dKLocalAccountIdentification" export * from "./directDebitInformation" export * from "./estimationTrackingData" +export * from "./executionDate" export * from "./externalReason" export * from "./fee" export * from "./findTransfersResponse" diff --git a/src/typings/transfers/objectSerializer.ts b/src/typings/transfers/objectSerializer.ts index 12fc0260d..82f690341 100644 --- a/src/typings/transfers/objectSerializer.ts +++ b/src/typings/transfers/objectSerializer.ts @@ -28,6 +28,7 @@ import { CounterpartyV3 } from "./counterpartyV3"; import { DKLocalAccountIdentification } from "./dKLocalAccountIdentification"; import { DirectDebitInformation } from "./directDebitInformation"; import { EstimationTrackingData } from "./estimationTrackingData"; +import { ExecutionDate } from "./executionDate"; import { ExternalReason } from "./externalReason"; import { Fee } from "./fee"; import { FindTransfersResponse } from "./findTransfersResponse"; @@ -210,6 +211,7 @@ let typeMap: {[index: string]: any} = { "DKLocalAccountIdentification": DKLocalAccountIdentification, "DirectDebitInformation": DirectDebitInformation, "EstimationTrackingData": EstimationTrackingData, + "ExecutionDate": ExecutionDate, "ExternalReason": ExternalReason, "Fee": Fee, "FindTransfersResponse": FindTransfersResponse, @@ -380,10 +382,10 @@ export class ObjectSerializer { * * @param data - The value to serialize. * @param type - The expected type name as a string. - * @param format - Format hint (e.g. "date" or "date-time"). + * @param format - Format hint (e.g. "date" or "date-time"). Default is an empty string. * @returns A JSON-compatible representation of `data`. */ - public static serialize(data: any, type: string, format: string): any { + public static serialize(data: any, type: string, format: string = ""): any { if (data == undefined) { return data; } else if (primitives.indexOf(type.toLowerCase()) !== -1) { @@ -460,10 +462,10 @@ export class ObjectSerializer { * * @param data - The raw input to deserialize. * @param type - The expected type name as a string. - * @param format - Format hint (e.g. "date" or "date-time"). + * @param format - Format hint (e.g. "date" or "date-time"). Default is an empty string. * @returns A deserialized instance or value of `data`. */ - public static deserialize(data: any, type: string, format: string): any { + public static deserialize(data: any, type: string, format: string = ""): any { // polymorphism may change the actual type. type = ObjectSerializer.findCorrectType(data, type); if (data == undefined) { diff --git a/src/typings/transfers/transfer.ts b/src/typings/transfers/transfer.ts index 86ec85cfb..bb578f325 100644 --- a/src/typings/transfers/transfer.ts +++ b/src/typings/transfers/transfer.ts @@ -10,6 +10,7 @@ import { Amount } from "./amount"; import { CounterpartyV3 } from "./counterpartyV3"; import { DirectDebitInformation } from "./directDebitInformation"; +import { ExecutionDate } from "./executionDate"; import { PaymentInstrument } from "./paymentInstrument"; import { ResourceReference } from "./resourceReference"; import { TransferCategoryData } from "./transferCategoryData"; @@ -39,6 +40,7 @@ export class Transfer { * The direction of the transfer. Possible values: **incoming**, **outgoing**. */ "direction"?: Transfer.DirectionEnum; + "executionDate"?: ExecutionDate; /** * The ID of the resource. */ @@ -131,6 +133,12 @@ export class Transfer { "type": "Transfer.DirectionEnum", "format": "" }, + { + "name": "executionDate", + "baseName": "executionDate", + "type": "ExecutionDate", + "format": "" + }, { "name": "id", "baseName": "id", diff --git a/src/typings/transfers/transferData.ts b/src/typings/transfers/transferData.ts index 5fec762c7..7f3902ae9 100644 --- a/src/typings/transfers/transferData.ts +++ b/src/typings/transfers/transferData.ts @@ -10,6 +10,7 @@ import { Amount } from "./amount"; import { BalanceMutation } from "./balanceMutation"; import { DirectDebitInformation } from "./directDebitInformation"; +import { ExecutionDate } from "./executionDate"; import { ExternalReason } from "./externalReason"; import { PaymentInstrument } from "./paymentInstrument"; import { ResourceReference } from "./resourceReference"; @@ -60,6 +61,7 @@ export class TransferData { * The list of events leading up to the current status of the transfer. */ "events"?: Array; + "executionDate"?: ExecutionDate; "externalReason"?: ExternalReason; /** * The ID of the resource. @@ -183,6 +185,12 @@ export class TransferData { "type": "Array", "format": "" }, + { + "name": "executionDate", + "baseName": "executionDate", + "type": "ExecutionDate", + "format": "" + }, { "name": "externalReason", "baseName": "externalReason", diff --git a/src/typings/transfers/transferInfo.ts b/src/typings/transfers/transferInfo.ts index fd3b2bb8d..59998b845 100644 --- a/src/typings/transfers/transferInfo.ts +++ b/src/typings/transfers/transferInfo.ts @@ -9,6 +9,7 @@ import { Amount } from "./amount"; import { CounterpartyInfoV3 } from "./counterpartyInfoV3"; +import { ExecutionDate } from "./executionDate"; import { TransferRequestReview } from "./transferRequestReview"; import { UltimatePartyIdentification } from "./ultimatePartyIdentification"; @@ -28,6 +29,7 @@ export class TransferInfo { * Your description for the transfer. It is used by most banks as the transfer description. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. Supported characters: **[a-z] [A-Z] [0-9] / - ?** **: ( ) . , \' + Space** Supported characters for **regular** and **fast** transfers to a US counterparty: **[a-z] [A-Z] [0-9] & $ % # @** **~ = + - _ \' \" ! ?** */ "description"?: string; + "executionDate"?: ExecutionDate; /** * The unique identifier of the source [payment instrument](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/paymentInstruments#responses-200-id). If you want to make a transfer using a **virtual** **bankAccount**, you must specify the payment instrument ID of the **virtual** **bankAccount**. If you only specify a balance account ID, Adyen uses the default **physical** **bankAccount** payment instrument assigned to the balance account. */ @@ -90,6 +92,12 @@ export class TransferInfo { "type": "string", "format": "" }, + { + "name": "executionDate", + "baseName": "executionDate", + "type": "ExecutionDate", + "format": "" + }, { "name": "paymentInstrumentId", "baseName": "paymentInstrumentId",