Skip to content

Commit 46db084

Browse files
AdyenAutomationBotjillingkAlexandrosMor
authored
Update services + models (#1246)
* [create-pull-request] automated change * fix ut * fix fix ut * fix fix fix ut * fix coveralls --------- Co-authored-by: jilling <jilling.kingma@adyen.com> Co-authored-by: jillingk <93914435+jillingk@users.noreply.github.com> Co-authored-by: Alexandros Moraitis <amoraitis@outlook.com>
1 parent b9336e0 commit 46db084

File tree

10 files changed

+165
-64
lines changed

10 files changed

+165
-64
lines changed

src/__tests__/checkout.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -543,11 +543,11 @@ describe("Checkout", (): void => {
543543

544544
test("Should delete stored paymentMethod", async (): Promise<void> => {
545545
scope.delete("/storedPaymentMethods/12321")
546-
.reply(200, {
547-
"id": "123"
548-
});
546+
.reply(200);
547+
548+
await expect(
549+
checkoutService.RecurringApi.deleteTokenForStoredPaymentDetails("12321"),
550+
).resolves.not.toThrowError();
549551

550-
const deletePaymentMethodResponse = await checkoutService.RecurringApi.deleteTokenForStoredPaymentDetails("12321");
551-
expect(deletePaymentMethodResponse.id).toEqual("123");
552552
});
553553
});

src/services/balancePlatform/balanceAccountsApi.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { BalanceAccount } from "../../typings/balancePlatform/models";
1414
import { BalanceAccountInfo } from "../../typings/balancePlatform/models";
1515
import { BalanceAccountUpdateRequest } from "../../typings/balancePlatform/models";
1616
import { BalanceSweepConfigurationsResponse } from "../../typings/balancePlatform/models";
17+
import { CreateSweepConfigurationV2 } from "../../typings/balancePlatform/models";
1718
import { PaginatedPaymentInstrumentsResponse } from "../../typings/balancePlatform/models";
1819
import { SweepConfigurationV2 } from "../../typings/balancePlatform/models";
1920
import { UpdateSweepConfigurationV2 } from "../../typings/balancePlatform/models";
@@ -190,16 +191,16 @@ export class BalanceAccountsApi extends Service {
190191
/**
191192
* @summary Create a sweep
192193
* @param balanceAccountId {@link string } The unique identifier of the balance account.
193-
* @param sweepConfigurationV2 {@link SweepConfigurationV2 }
194+
* @param createSweepConfigurationV2 {@link CreateSweepConfigurationV2 }
194195
* @param requestOptions {@link IRequest.Options}
195196
* @return {@link SweepConfigurationV2 }
196197
*/
197-
public async createSweep(balanceAccountId: string, sweepConfigurationV2: SweepConfigurationV2, requestOptions?: IRequest.Options): Promise<SweepConfigurationV2> {
198+
public async createSweep(balanceAccountId: string, createSweepConfigurationV2: CreateSweepConfigurationV2, requestOptions?: IRequest.Options): Promise<SweepConfigurationV2> {
198199
const endpoint = `${this.baseUrl}/balanceAccounts/{balanceAccountId}/sweeps`
199200
.replace("{" + "balanceAccountId" + "}", encodeURIComponent(String(balanceAccountId)));
200201
const resource = new Resource(this, endpoint);
201-
const request: SweepConfigurationV2 = ObjectSerializer.serialize(sweepConfigurationV2, "SweepConfigurationV2");
202-
const response = await getJsonResponse<SweepConfigurationV2, SweepConfigurationV2>(
202+
const request: CreateSweepConfigurationV2 = ObjectSerializer.serialize(createSweepConfigurationV2, "CreateSweepConfigurationV2");
203+
const response = await getJsonResponse<CreateSweepConfigurationV2, SweepConfigurationV2>(
203204
resource,
204205
request,
205206
{ ...requestOptions, method: "POST" }

src/services/balancePlatform/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { PaymentInstrumentGroupsApi } from "./paymentInstrumentGroupsApi";
1717
import { PaymentInstrumentsApi } from "./paymentInstrumentsApi";
1818
import { PlatformApi } from "./platformApi";
1919
import { TransactionRulesApi } from "./transactionRulesApi";
20+
import { TransferRoutesApi } from "./transferRoutesApi";
2021

2122
import Service from "../../service";
2223
import Client from "../../client";
@@ -66,4 +67,8 @@ export default class BalancePlatformAPI extends Service {
6667
public get TransactionRulesApi() {
6768
return new TransactionRulesApi(this.client);
6869
}
70+
71+
public get TransferRoutesApi() {
72+
return new TransferRoutesApi(this.client);
73+
}
6974
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* The version of the OpenAPI document: v2
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 getJsonResponse from "../../helpers/getJsonResponse";
11+
import Service from "../../service";
12+
import Client from "../../client";
13+
import { TransferRouteRequest } from "../../typings/balancePlatform/models";
14+
import { TransferRouteResponse } from "../../typings/balancePlatform/models";
15+
import { IRequest } from "../../typings/requestOptions";
16+
import Resource from "../resource";
17+
import { ObjectSerializer } from "../../typings/balancePlatform/models";
18+
19+
export class TransferRoutesApi extends Service {
20+
21+
private readonly API_BASEPATH: string = "https://balanceplatform-api-test.adyen.com/bcl/v2";
22+
private baseUrl: string;
23+
24+
public constructor(client: Client){
25+
super(client);
26+
this.baseUrl = this.createBaseUrl(this.API_BASEPATH);
27+
}
28+
29+
/**
30+
* @summary Calculate transfer routes
31+
* @param transferRouteRequest {@link TransferRouteRequest }
32+
* @param requestOptions {@link IRequest.Options}
33+
* @return {@link TransferRouteResponse }
34+
*/
35+
public async calculateTransferRoutes(transferRouteRequest: TransferRouteRequest, requestOptions?: IRequest.Options): Promise<TransferRouteResponse> {
36+
const endpoint = `${this.baseUrl}/transferRoutes/calculate`;
37+
const resource = new Resource(this, endpoint);
38+
const request: TransferRouteRequest = ObjectSerializer.serialize(transferRouteRequest, "TransferRouteRequest");
39+
const response = await getJsonResponse<TransferRouteRequest, TransferRouteResponse>(
40+
resource,
41+
request,
42+
{ ...requestOptions, method: "POST" }
43+
);
44+
return ObjectSerializer.deserialize(response, "TransferRouteResponse");
45+
}
46+
}

src/services/checkout/recurringApi.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import getJsonResponse from "../../helpers/getJsonResponse";
1111
import Service from "../../service";
1212
import Client from "../../client";
1313
import { ListStoredPaymentMethodsResponse } from "../../typings/checkout/models";
14-
import { StoredPaymentMethodResource } from "../../typings/checkout/models";
1514
import { IRequest } from "../../typings/requestOptions";
1615
import Resource from "../resource";
1716
import { ObjectSerializer } from "../../typings/checkout/models";
@@ -32,18 +31,16 @@ export class RecurringApi extends Service {
3231
* @param shopperReference {@link string } Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. &gt; Your reference must not include personally identifiable information (PII), for example name or email address.
3332
* @param merchantAccount {@link string } Your merchant account.
3433
* @param requestOptions {@link IRequest.Options}
35-
* @return {@link StoredPaymentMethodResource }
3634
*/
37-
public async deleteTokenForStoredPaymentDetails(storedPaymentMethodId: string, requestOptions?: IRequest.Options): Promise<StoredPaymentMethodResource> {
35+
public async deleteTokenForStoredPaymentDetails(storedPaymentMethodId: string, requestOptions?: IRequest.Options): Promise<void> {
3836
const endpoint = `${this.baseUrl}/storedPaymentMethods/{storedPaymentMethodId}`
3937
.replace("{" + "storedPaymentMethodId" + "}", encodeURIComponent(String(storedPaymentMethodId)));
4038
const resource = new Resource(this, endpoint);
41-
const response = await getJsonResponse<string, StoredPaymentMethodResource>(
39+
await getJsonResponse<string, void>(
4240
resource,
4341
"",
4442
{ ...requestOptions, method: "DELETE" }
4543
);
46-
return ObjectSerializer.deserialize(response, "StoredPaymentMethodResource");
4744
}
4845

4946
/**

src/services/legalEntityManagement/pCIQuestionnairesApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class PCIQuestionnairesApi extends Service {
7070

7171
/**
7272
* @summary Generate PCI questionnaire
73-
* @param id {@link string } The legal entity ID of the individual who will sign the PCI questionnaire.
73+
* @param id {@link string } The unique identifier of the legal entity to get PCI questionnaire information.
7474
* @param generatePciDescriptionRequest {@link GeneratePciDescriptionRequest }
7575
* @param requestOptions {@link IRequest.Options}
7676
* @return {@link GeneratePciDescriptionResponse }

src/services/legalEntityManagement/termsOfServiceApi.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class TermsOfServiceApi extends Service {
3232

3333
/**
3434
* @summary Get Terms of Service information for a legal entity
35-
* @param id {@link string } The unique identifier of the legal entity.
35+
* @param id {@link string } The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner.
3636
* @param requestOptions {@link IRequest.Options}
3737
* @return {@link GetTermsOfServiceAcceptanceInfosResponse }
3838
*/
@@ -50,7 +50,7 @@ export class TermsOfServiceApi extends Service {
5050

5151
/**
5252
* @summary Get Terms of Service status
53-
* @param id {@link string } The unique identifier of the legal entity.
53+
* @param id {@link string } The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner.
5454
* @param requestOptions {@link IRequest.Options}
5555
* @return {@link CalculateTermsOfServiceStatusResponse }
5656
*/
@@ -68,7 +68,7 @@ export class TermsOfServiceApi extends Service {
6868

6969
/**
7070
* @summary Accept Terms of Service
71-
* @param id {@link string } The unique identifier of the legal entity.
71+
* @param id {@link string } The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner.
7272
* @param termsofservicedocumentid {@link string } The unique identifier of the Terms of Service document.
7373
* @param acceptTermsOfServiceRequest {@link AcceptTermsOfServiceRequest }
7474
* @param requestOptions {@link IRequest.Options}
@@ -90,7 +90,7 @@ export class TermsOfServiceApi extends Service {
9090

9191
/**
9292
* @summary Get Terms of Service document
93-
* @param id {@link string } The unique identifier of the legal entity.
93+
* @param id {@link string } The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner.
9494
* @param getTermsOfServiceDocumentRequest {@link GetTermsOfServiceDocumentRequest }
9595
* @param requestOptions {@link IRequest.Options}
9696
* @return {@link GetTermsOfServiceDocumentResponse }
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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 getJsonResponse from "../../helpers/getJsonResponse";
11+
import Service from "../../service";
12+
import Client from "../../client";
13+
import { AndroidApp } from "../../typings/management/models";
14+
import { AndroidAppsResponse } from "../../typings/management/models";
15+
import { AndroidCertificatesResponse } from "../../typings/management/models";
16+
import { IRequest } from "../../typings/requestOptions";
17+
import Resource from "../resource";
18+
import { ObjectSerializer } from "../../typings/management/models";
19+
20+
export class AndroidFilesCompanyLevelApi extends Service {
21+
22+
private readonly API_BASEPATH: string = "https://management-test.adyen.com/v1";
23+
private baseUrl: string;
24+
25+
public constructor(client: Client){
26+
super(client);
27+
this.baseUrl = this.createBaseUrl(this.API_BASEPATH);
28+
}
29+
30+
/**
31+
* @summary Get a list of Android apps
32+
* @param companyId {@link string } The unique identifier of the company account.
33+
* @param pageNumber {@link number } The number of the page to fetch.
34+
* @param pageSize {@link number } The number of items to have on a page, maximum 100. The default is 20 items on a page.
35+
* @param packageName {@link string } The package name that uniquely identifies the Android app.
36+
* @param versionCode {@link number } The version number of the app.
37+
* @param requestOptions {@link IRequest.Options}
38+
* @return {@link AndroidAppsResponse }
39+
*/
40+
public async listAndroidApps(companyId: string, requestOptions?: IRequest.Options): Promise<AndroidAppsResponse> {
41+
const endpoint = `${this.baseUrl}/companies/{companyId}/androidApps`
42+
.replace("{" + "companyId" + "}", encodeURIComponent(String(companyId)));
43+
const resource = new Resource(this, endpoint);
44+
const response = await getJsonResponse<string, AndroidAppsResponse>(
45+
resource,
46+
"",
47+
{ ...requestOptions, method: "GET" }
48+
);
49+
return ObjectSerializer.deserialize(response, "AndroidAppsResponse");
50+
}
51+
52+
/**
53+
* @summary Get Android app
54+
* @param companyId {@link string } The unique identifier of the company account.
55+
* @param id {@link string } The unique identifier of the app.
56+
* @param requestOptions {@link IRequest.Options}
57+
* @return {@link AndroidApp }
58+
*/
59+
public async getAndroidApp(companyId: string, id: string, requestOptions?: IRequest.Options): Promise<AndroidApp> {
60+
const endpoint = `${this.baseUrl}/companies/{companyId}/androidApps/{id}`
61+
.replace("{" + "companyId" + "}", encodeURIComponent(String(companyId)))
62+
.replace("{" + "id" + "}", encodeURIComponent(String(id)));
63+
const resource = new Resource(this, endpoint);
64+
const response = await getJsonResponse<string, AndroidApp>(
65+
resource,
66+
"",
67+
{ ...requestOptions, method: "GET" }
68+
);
69+
return ObjectSerializer.deserialize(response, "AndroidApp");
70+
}
71+
72+
/**
73+
* @summary Get a list of Android certificates
74+
* @param companyId {@link string } The unique identifier of the company account.
75+
* @param pageNumber {@link number } The number of the page to fetch.
76+
* @param pageSize {@link number } The number of items to have on a page, maximum 100. The default is 20 items on a page.
77+
* @param certificateName {@link string } The name of the certificate.
78+
* @param requestOptions {@link IRequest.Options}
79+
* @return {@link AndroidCertificatesResponse }
80+
*/
81+
public async listAndroidCertificates(companyId: string, requestOptions?: IRequest.Options): Promise<AndroidCertificatesResponse> {
82+
const endpoint = `${this.baseUrl}/companies/{companyId}/androidCertificates`
83+
.replace("{" + "companyId" + "}", encodeURIComponent(String(companyId)));
84+
const resource = new Resource(this, endpoint);
85+
const response = await getJsonResponse<string, AndroidCertificatesResponse>(
86+
resource,
87+
"",
88+
{ ...requestOptions, method: "GET" }
89+
);
90+
return ObjectSerializer.deserialize(response, "AndroidCertificatesResponse");
91+
}
92+
}

src/services/management/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { AccountMerchantLevelApi } from "./accountMerchantLevelApi";
1616
import { AccountStoreLevelApi } from "./accountStoreLevelApi";
1717
import { AllowedOriginsCompanyLevelApi } from "./allowedOriginsCompanyLevelApi";
1818
import { AllowedOriginsMerchantLevelApi } from "./allowedOriginsMerchantLevelApi";
19+
import { AndroidFilesCompanyLevelApi } from "./androidFilesCompanyLevelApi";
1920
import { ClientKeyCompanyLevelApi } from "./clientKeyCompanyLevelApi";
2021
import { ClientKeyMerchantLevelApi } from "./clientKeyMerchantLevelApi";
2122
import { MyAPICredentialApi } from "./myAPICredentialApi";
@@ -81,6 +82,10 @@ export default class ManagementAPI extends Service {
8182
return new AllowedOriginsMerchantLevelApi(this.client);
8283
}
8384

85+
public get AndroidFilesCompanyLevelApi() {
86+
return new AndroidFilesCompanyLevelApi(this.client);
87+
}
88+
8489
public get ClientKeyCompanyLevelApi() {
8590
return new ClientKeyCompanyLevelApi(this.client);
8691
}

src/services/management/terminalActionsCompanyLevelApi.ts

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
import getJsonResponse from "../../helpers/getJsonResponse";
1111
import Service from "../../service";
1212
import Client from "../../client";
13-
import { AndroidAppsResponse } from "../../typings/management/models";
14-
import { AndroidCertificatesResponse } from "../../typings/management/models";
1513
import { ExternalTerminalAction } from "../../typings/management/models";
1614
import { ListExternalTerminalActionsResponse } from "../../typings/management/models";
1715
import { IRequest } from "../../typings/requestOptions";
@@ -28,49 +26,6 @@ export class TerminalActionsCompanyLevelApi extends Service {
2826
this.baseUrl = this.createBaseUrl(this.API_BASEPATH);
2927
}
3028

31-
/**
32-
* @summary Get a list of Android apps
33-
* @param companyId {@link string } The unique identifier of the company account.
34-
* @param pageNumber {@link number } The number of the page to fetch.
35-
* @param pageSize {@link number } The number of items to have on a page, maximum 100. The default is 20 items on a page.
36-
* @param packageName {@link string } The package name that uniquely identifies the Android app.
37-
* @param versionCode {@link number } The version number of the app.
38-
* @param requestOptions {@link IRequest.Options}
39-
* @return {@link AndroidAppsResponse }
40-
*/
41-
public async listAndroidApps(companyId: string, requestOptions?: IRequest.Options): Promise<AndroidAppsResponse> {
42-
const endpoint = `${this.baseUrl}/companies/{companyId}/androidApps`
43-
.replace("{" + "companyId" + "}", encodeURIComponent(String(companyId)));
44-
const resource = new Resource(this, endpoint);
45-
const response = await getJsonResponse<string, AndroidAppsResponse>(
46-
resource,
47-
"",
48-
{ ...requestOptions, method: "GET" }
49-
);
50-
return ObjectSerializer.deserialize(response, "AndroidAppsResponse");
51-
}
52-
53-
/**
54-
* @summary Get a list of Android certificates
55-
* @param companyId {@link string } The unique identifier of the company account.
56-
* @param pageNumber {@link number } The number of the page to fetch.
57-
* @param pageSize {@link number } The number of items to have on a page, maximum 100. The default is 20 items on a page.
58-
* @param certificateName {@link string } The name of the certificate.
59-
* @param requestOptions {@link IRequest.Options}
60-
* @return {@link AndroidCertificatesResponse }
61-
*/
62-
public async listAndroidCertificates(companyId: string, requestOptions?: IRequest.Options): Promise<AndroidCertificatesResponse> {
63-
const endpoint = `${this.baseUrl}/companies/{companyId}/androidCertificates`
64-
.replace("{" + "companyId" + "}", encodeURIComponent(String(companyId)));
65-
const resource = new Resource(this, endpoint);
66-
const response = await getJsonResponse<string, AndroidCertificatesResponse>(
67-
resource,
68-
"",
69-
{ ...requestOptions, method: "GET" }
70-
);
71-
return ObjectSerializer.deserialize(response, "AndroidCertificatesResponse");
72-
}
73-
7429
/**
7530
* @summary Get a list of terminal actions
7631
* @param companyId {@link string } The unique identifier of the company account.

0 commit comments

Comments
 (0)