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

Fix automation/modes tests #1231

Merged
merged 3 commits into from
Aug 17, 2023
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
2 changes: 1 addition & 1 deletion src/__tests__/balancePlatform.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ describe("Balance Platform", (): void => {
"status": balancePlatform.SweepConfigurationV2.StatusEnum.Inactive,
"currency": "EUR",
"schedule": {
"type": balancePlatform.CronSweepSchedule.TypeEnum.Cron
"type": balancePlatform.SweepSchedule.TypeEnum.Cron
}
};

Expand Down
9 changes: 5 additions & 4 deletions src/services/balancePlatform/accountHoldersApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Service from "../../service";
import Client from "../../client";
import { AccountHolder } from "../../typings/balancePlatform/models";
import { AccountHolderInfo } from "../../typings/balancePlatform/models";
import { AccountHolderUpdateRequest } from "../../typings/balancePlatform/models";
import { PaginatedBalanceAccountsResponse } from "../../typings/balancePlatform/models";
import { IRequest } from "../../typings/requestOptions";
import Resource from "../resource";
Expand Down Expand Up @@ -68,16 +69,16 @@ export class AccountHoldersApi extends Service {
/**
* @summary Update an account holder
* @param id {@link string } The unique identifier of the account holder.
* @param accountHolder {@link AccountHolder }
* @param accountHolderUpdateRequest {@link AccountHolderUpdateRequest }
* @param requestOptions {@link IRequest.Options}
* @return {@link AccountHolder }
*/
public async updateAccountHolder(id: string, accountHolder: AccountHolder, requestOptions?: IRequest.Options): Promise<AccountHolder> {
public async updateAccountHolder(id: string, accountHolderUpdateRequest: AccountHolderUpdateRequest, requestOptions?: IRequest.Options): Promise<AccountHolder> {
const endpoint = `${this.baseUrl}/accountHolders/{id}`
.replace("{" + "id" + "}", encodeURIComponent(String(id)));
const resource = new Resource(this, endpoint);
const request: AccountHolder = ObjectSerializer.serialize(accountHolder, "AccountHolder");
const response = await getJsonResponse<AccountHolder, AccountHolder>(
const request: AccountHolderUpdateRequest = ObjectSerializer.serialize(accountHolderUpdateRequest, "AccountHolderUpdateRequest");
const response = await getJsonResponse<AccountHolderUpdateRequest, AccountHolder>(
resource,
request,
{ ...requestOptions, method: "PATCH" }
Expand Down
9 changes: 5 additions & 4 deletions src/services/balancePlatform/balanceAccountsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { BalanceAccountUpdateRequest } from "../../typings/balancePlatform/model
import { BalanceSweepConfigurationsResponse } from "../../typings/balancePlatform/models";
import { PaginatedPaymentInstrumentsResponse } from "../../typings/balancePlatform/models";
import { SweepConfigurationV2 } from "../../typings/balancePlatform/models";
import { UpdateSweepConfigurationV2 } from "../../typings/balancePlatform/models";
import { IRequest } from "../../typings/requestOptions";
import Resource from "../resource";
import { ObjectSerializer } from "../../typings/balancePlatform/models";
Expand Down Expand Up @@ -130,17 +131,17 @@ export class BalanceAccountsApi extends Service {
* @summary Update a sweep
* @param balanceAccountId {@link string } The unique identifier of the balance account.
* @param sweepId {@link string } The unique identifier of the sweep.
* @param sweepConfigurationV2 {@link SweepConfigurationV2 }
* @param updateSweepConfigurationV2 {@link UpdateSweepConfigurationV2 }
* @param requestOptions {@link IRequest.Options}
* @return {@link SweepConfigurationV2 }
*/
public async updateSweep(balanceAccountId: string, sweepId: string, sweepConfigurationV2: SweepConfigurationV2, requestOptions?: IRequest.Options): Promise<SweepConfigurationV2> {
public async updateSweep(balanceAccountId: string, sweepId: string, updateSweepConfigurationV2: UpdateSweepConfigurationV2, requestOptions?: IRequest.Options): Promise<SweepConfigurationV2> {
const endpoint = `${this.baseUrl}/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}`
.replace("{" + "balanceAccountId" + "}", encodeURIComponent(String(balanceAccountId)))
.replace("{" + "sweepId" + "}", encodeURIComponent(String(sweepId)));
const resource = new Resource(this, endpoint);
const request: SweepConfigurationV2 = ObjectSerializer.serialize(sweepConfigurationV2, "SweepConfigurationV2");
const response = await getJsonResponse<SweepConfigurationV2, SweepConfigurationV2>(
const request: UpdateSweepConfigurationV2 = ObjectSerializer.serialize(updateSweepConfigurationV2, "UpdateSweepConfigurationV2");
const response = await getJsonResponse<UpdateSweepConfigurationV2, SweepConfigurationV2>(
resource,
request,
{ ...requestOptions, method: "PATCH" }
Expand Down
3 changes: 1 addition & 2 deletions src/services/balancePlatform/bankAccountValidationApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ export class BankAccountValidationApi extends Service {
* @summary Validate a bank account
* @param bankAccountIdentificationValidationRequest {@link BankAccountIdentificationValidationRequest }
* @param requestOptions {@link IRequest.Options}
* @return {@link void }
*/
public async validateBankAccountIdentification(bankAccountIdentificationValidationRequest: BankAccountIdentificationValidationRequest, requestOptions?: IRequest.Options): Promise<void> {
const endpoint = `${this.baseUrl}/validateBankAccountIdentification`;
const resource = new Resource(this, endpoint);
const request: BankAccountIdentificationValidationRequest = ObjectSerializer.serialize(bankAccountIdentificationValidationRequest, "BankAccountIdentificationValidationRequest");
await getJsonResponse<BankAccountIdentificationValidationRequest, object>(
await getJsonResponse<BankAccountIdentificationValidationRequest, void>(
resource,
request,
{ ...requestOptions, method: "POST" }
Expand Down
5 changes: 5 additions & 0 deletions src/services/balancePlatform/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { BalanceAccountsApi } from "./balanceAccountsApi";
import { BankAccountValidationApi } from "./bankAccountValidationApi";
import { GrantAccountsApi } from "./grantAccountsApi";
import { GrantOffersApi } from "./grantOffersApi";
import { NetworkTokensApi } from "./networkTokensApi";
import { PaymentInstrumentGroupsApi } from "./paymentInstrumentGroupsApi";
import { PaymentInstrumentsApi } from "./paymentInstrumentsApi";
import { PlatformApi } from "./platformApi";
Expand Down Expand Up @@ -46,6 +47,10 @@ export default class BalancePlatformAPI extends Service {
return new GrantOffersApi(this.client);
}

public get NetworkTokensApi() {
return new NetworkTokensApi(this.client);
}

public get PaymentInstrumentGroupsApi() {
return new PaymentInstrumentGroupsApi(this.client);
}
Expand Down
64 changes: 64 additions & 0 deletions src/services/balancePlatform/networkTokensApi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* The version of the OpenAPI document: v2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/

import getJsonResponse from "../../helpers/getJsonResponse";
import Service from "../../service";
import Client from "../../client";
import { GetNetworkTokenResponse } from "../../typings/balancePlatform/models";
import { UpdateNetworkTokenRequest } from "../../typings/balancePlatform/models";
import { IRequest } from "../../typings/requestOptions";
import Resource from "../resource";
import { ObjectSerializer } from "../../typings/balancePlatform/models";

export class NetworkTokensApi extends Service {

private readonly API_BASEPATH: string = "https://balanceplatform-api-test.adyen.com/bcl/v2";
private baseUrl: string;

public constructor(client: Client){
super(client);
this.baseUrl = this.createBaseUrl(this.API_BASEPATH);
}

/**
* @summary Get a network token
* @param networkTokenId {@link string } The unique identifier of the network token.
* @param requestOptions {@link IRequest.Options}
* @return {@link GetNetworkTokenResponse }
*/
public async getNetworkToken(networkTokenId: string, requestOptions?: IRequest.Options): Promise<GetNetworkTokenResponse> {
const endpoint = `${this.baseUrl}/networkTokens/{networkTokenId}`
.replace("{" + "networkTokenId" + "}", encodeURIComponent(String(networkTokenId)));
const resource = new Resource(this, endpoint);
const response = await getJsonResponse<string, GetNetworkTokenResponse>(
resource,
"",
{ ...requestOptions, method: "GET" }
);
return ObjectSerializer.deserialize(response, "GetNetworkTokenResponse");
}

/**
* @summary Update a network token
* @param networkTokenId {@link string } The unique identifier of the network token.
* @param updateNetworkTokenRequest {@link UpdateNetworkTokenRequest }
* @param requestOptions {@link IRequest.Options}
*/
public async updateNetworkToken(networkTokenId: string, updateNetworkTokenRequest: UpdateNetworkTokenRequest, requestOptions?: IRequest.Options): Promise<void> {
const endpoint = `${this.baseUrl}/networkTokens/{networkTokenId}`
.replace("{" + "networkTokenId" + "}", encodeURIComponent(String(networkTokenId)));
const resource = new Resource(this, endpoint);
const request: UpdateNetworkTokenRequest = ObjectSerializer.serialize(updateNetworkTokenRequest, "UpdateNetworkTokenRequest");
await getJsonResponse<UpdateNetworkTokenRequest, void>(
resource,
request,
{ ...requestOptions, method: "PATCH" }
);
}
}
19 changes: 19 additions & 0 deletions src/services/balancePlatform/paymentInstrumentsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import getJsonResponse from "../../helpers/getJsonResponse";
import Service from "../../service";
import Client from "../../client";
import { ListNetworkTokensResponse } from "../../typings/balancePlatform/models";
import { PaymentInstrument } from "../../typings/balancePlatform/models";
import { PaymentInstrumentInfo } from "../../typings/balancePlatform/models";
import { PaymentInstrumentRevealInfo } from "../../typings/balancePlatform/models";
Expand Down Expand Up @@ -48,6 +49,24 @@ export class PaymentInstrumentsApi extends Service {
return ObjectSerializer.deserialize(response, "PaymentInstrument");
}

/**
* @summary List network tokens
* @param id {@link string } The unique identifier of the payment instrument.
* @param requestOptions {@link IRequest.Options}
* @return {@link ListNetworkTokensResponse }
*/
public async listNetworkTokens(id: string, requestOptions?: IRequest.Options): Promise<ListNetworkTokensResponse> {
const endpoint = `${this.baseUrl}/paymentInstruments/{id}/networkTokens`
.replace("{" + "id" + "}", encodeURIComponent(String(id)));
const resource = new Resource(this, endpoint);
const response = await getJsonResponse<string, ListNetworkTokensResponse>(
resource,
"",
{ ...requestOptions, method: "GET" }
);
return ObjectSerializer.deserialize(response, "ListNetworkTokensResponse");
}

/**
* @summary Get the PAN of a payment instrument
* @param id {@link string } The unique identifier of the payment instrument.
Expand Down
11 changes: 10 additions & 1 deletion src/typings/balancePlatform/accountHolder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ export class AccountHolder {
*/
'legalEntityId': string;
/**
* A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.
* A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.
*/
'metadata'?: { [key: string]: string; };
/**
* The unique identifier of the migrated account holder in the classic integration.
*/
'migratedAccountHolderCode'?: string;
/**
* The ID of the account holder\'s primary balance account. By default, this is set to the first balance account that you create for the account holder. To assign a different balance account, send a PATCH request.
*/
'primaryBalanceAccount'?: string;
Expand Down Expand Up @@ -96,6 +100,11 @@ export class AccountHolder {
"baseName": "metadata",
"type": "{ [key: string]: string; }"
},
{
"name": "migratedAccountHolderCode",
"baseName": "migratedAccountHolderCode",
"type": "string"
},
{
"name": "primaryBalanceAccount",
"baseName": "primaryBalanceAccount",
Expand Down
11 changes: 10 additions & 1 deletion src/typings/balancePlatform/accountHolderInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ export class AccountHolderInfo {
*/
'legalEntityId': string;
/**
* A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.
* A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.
*/
'metadata'?: { [key: string]: string; };
/**
* The unique identifier of the migrated account holder in the classic integration.
*/
'migratedAccountHolderCode'?: string;
/**
* Your reference for the account holder, maximum 150 characters.
*/
'reference'?: string;
Expand Down Expand Up @@ -74,6 +78,11 @@ export class AccountHolderInfo {
"baseName": "metadata",
"type": "{ [key: string]: string; }"
},
{
"name": "migratedAccountHolderCode",
"baseName": "migratedAccountHolderCode",
"type": "string"
},
{
"name": "reference",
"baseName": "reference",
Expand Down
128 changes: 128 additions & 0 deletions src/typings/balancePlatform/accountHolderUpdateRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/*
* The version of the OpenAPI document: v2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/

import { AccountHolderCapability } from './accountHolderCapability';
import { ContactDetails } from './contactDetails';
import { VerificationDeadline } from './verificationDeadline';

export class AccountHolderUpdateRequest {
/**
* The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms.
*/
'balancePlatform'?: string;
/**
* Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability.
*/
'capabilities'?: { [key: string]: AccountHolderCapability; };
'contactDetails'?: ContactDetails;
/**
* Your description for the account holder, maximum 300 characters.
*/
'description'?: string;
/**
* A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.
*/
'metadata'?: { [key: string]: string; };
/**
* The unique identifier of the migrated account holder in the classic integration.
*/
'migratedAccountHolderCode'?: string;
/**
* The ID of the account holder\'s primary balance account. By default, this is set to the first balance account that you create for the account holder. To assign a different balance account, send a PATCH request.
*/
'primaryBalanceAccount'?: string;
/**
* Your reference for the account holder, maximum 150 characters.
*/
'reference'?: string;
/**
* The status of the account holder. Possible values: * **active**: The account holder is active. This is the default status when creating an account holder. * **inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **closed**: The account holder is permanently deactivated by you. This action cannot be undone.
*/
'status'?: AccountHolderUpdateRequest.StatusEnum;
/**
* The time zone of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
*/
'timeZone'?: string;
/**
* List of verification deadlines and the capabilities that will be disallowed if verification errors are not resolved.
*/
'verificationDeadlines'?: Array<VerificationDeadline>;

static discriminator: string | undefined = undefined;

static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "balancePlatform",
"baseName": "balancePlatform",
"type": "string"
},
{
"name": "capabilities",
"baseName": "capabilities",
"type": "{ [key: string]: AccountHolderCapability; }"
},
{
"name": "contactDetails",
"baseName": "contactDetails",
"type": "ContactDetails"
},
{
"name": "description",
"baseName": "description",
"type": "string"
},
{
"name": "metadata",
"baseName": "metadata",
"type": "{ [key: string]: string; }"
},
{
"name": "migratedAccountHolderCode",
"baseName": "migratedAccountHolderCode",
"type": "string"
},
{
"name": "primaryBalanceAccount",
"baseName": "primaryBalanceAccount",
"type": "string"
},
{
"name": "reference",
"baseName": "reference",
"type": "string"
},
{
"name": "status",
"baseName": "status",
"type": "AccountHolderUpdateRequest.StatusEnum"
},
{
"name": "timeZone",
"baseName": "timeZone",
"type": "string"
},
{
"name": "verificationDeadlines",
"baseName": "verificationDeadlines",
"type": "Array<VerificationDeadline>"
} ];

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

export namespace AccountHolderUpdateRequest {
export enum StatusEnum {
Active = 'active',
Closed = 'closed',
Inactive = 'inactive',
Suspended = 'suspended'
}
}
Loading