Skip to content

Commit f285333

Browse files
AdyenAutomationBotjeandersonbc
authored andcommitted
[capital] Automated update from Adyen/adyen-openapi@0a007ce
1 parent 5b767e3 commit f285333

53 files changed

Lines changed: 3357 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
import getJsonResponse from "../../helpers/getJsonResponse";
12+
import Service from "../../service";
13+
import Client from "../../client";
14+
import { IRequest } from "../../typings/requestOptions";
15+
import Resource from "../resource";
16+
17+
import { ObjectSerializer } from "../../typings/capital/objectSerializer";
18+
import { GrantAccount } from "../../typings/capital/models";
19+
20+
/**
21+
* API handler for GrantAccountsApi
22+
*/
23+
export class GrantAccountsApi extends Service {
24+
25+
private readonly API_BASEPATH: string = "https://balanceplatform-api-test.adyen.com/capital/v1";
26+
private baseUrl: string;
27+
28+
public constructor(client: Client){
29+
super(client);
30+
this.baseUrl = this.createBaseUrl(this.API_BASEPATH);
31+
}
32+
33+
/**
34+
* @summary Get the information of your grant account
35+
* @param id {@link string } The unique identifier of the grant account.
36+
* @param requestOptions {@link IRequest.Options }
37+
* @return {@link GrantAccount }
38+
*/
39+
public async getGrantAccountInformation(id: string, requestOptions?: IRequest.Options): Promise<GrantAccount> {
40+
const endpoint = `${this.baseUrl}/grantAccounts/{id}`
41+
.replace("{" + "id" + "}", encodeURIComponent(String(id)));
42+
const resource = new Resource(this, endpoint);
43+
44+
const response = await getJsonResponse<string, GrantAccount>(
45+
resource,
46+
"",
47+
{ ...requestOptions, method: "GET" }
48+
);
49+
50+
return ObjectSerializer.deserialize(response, "GrantAccount");
51+
}
52+
53+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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+
import getJsonResponse from "../../helpers/getJsonResponse";
12+
import Service from "../../service";
13+
import Client from "../../client";
14+
import { IRequest } from "../../typings/requestOptions";
15+
import Resource from "../resource";
16+
17+
import { ObjectSerializer } from "../../typings/capital/objectSerializer";
18+
import { GrantOffer } from "../../typings/capital/models";
19+
import { GrantOffers } from "../../typings/capital/models";
20+
21+
/**
22+
* API handler for GrantOffersApi
23+
*/
24+
export class GrantOffersApi extends Service {
25+
26+
private readonly API_BASEPATH: string = "https://balanceplatform-api-test.adyen.com/capital/v1";
27+
private baseUrl: string;
28+
29+
public constructor(client: Client){
30+
super(client);
31+
this.baseUrl = this.createBaseUrl(this.API_BASEPATH);
32+
}
33+
34+
/**
35+
* @summary Get all available grant offers
36+
* @param requestOptions {@link IRequest.Options }
37+
* @param accountHolderId {@link string } The unique identifier of the account holder for which you want to get the available grant offers.
38+
* @return {@link GrantOffers }
39+
*/
40+
public async getAllGrantOffers(accountHolderId?: string, requestOptions?: IRequest.Options): Promise<GrantOffers> {
41+
const endpoint = `${this.baseUrl}/grantOffers`;
42+
const resource = new Resource(this, endpoint);
43+
44+
const hasDefinedQueryParams = accountHolderId;
45+
if(hasDefinedQueryParams) {
46+
if(!requestOptions) requestOptions = {};
47+
if(!requestOptions.params) requestOptions.params = {};
48+
if(accountHolderId) requestOptions.params["accountHolderId"] = accountHolderId;
49+
}
50+
const response = await getJsonResponse<string, GrantOffers>(
51+
resource,
52+
"",
53+
{ ...requestOptions, method: "GET" }
54+
);
55+
56+
return ObjectSerializer.deserialize(response, "GrantOffers");
57+
}
58+
59+
/**
60+
* @summary Get the details of a grant offer
61+
* @param id {@link string } The unique identifier of the grant offer.
62+
* @param requestOptions {@link IRequest.Options }
63+
* @return {@link GrantOffer }
64+
*/
65+
public async getGrantOffer(id: string, requestOptions?: IRequest.Options): Promise<GrantOffer> {
66+
const endpoint = `${this.baseUrl}/grantOffers/{id}`
67+
.replace("{" + "id" + "}", encodeURIComponent(String(id)));
68+
const resource = new Resource(this, endpoint);
69+
70+
const response = await getJsonResponse<string, GrantOffer>(
71+
resource,
72+
"",
73+
{ ...requestOptions, method: "GET" }
74+
);
75+
76+
return ObjectSerializer.deserialize(response, "GrantOffer");
77+
}
78+
79+
}

src/services/capital/grantsApi.ts

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
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+
import getJsonResponse from "../../helpers/getJsonResponse";
12+
import Service from "../../service";
13+
import Client from "../../client";
14+
import { IRequest } from "../../typings/requestOptions";
15+
import Resource from "../resource";
16+
17+
import { ObjectSerializer } from "../../typings/capital/objectSerializer";
18+
import { Disbursement } from "../../typings/capital/models";
19+
import { DisbursementInfoUpdate } from "../../typings/capital/models";
20+
import { Disbursements } from "../../typings/capital/models";
21+
import { Grant } from "../../typings/capital/models";
22+
import { GrantInfo } from "../../typings/capital/models";
23+
import { Grants } from "../../typings/capital/models";
24+
25+
/**
26+
* API handler for GrantsApi
27+
*/
28+
export class GrantsApi extends Service {
29+
30+
private readonly API_BASEPATH: string = "https://balanceplatform-api-test.adyen.com/capital/v1";
31+
private baseUrl: string;
32+
33+
public constructor(client: Client){
34+
super(client);
35+
this.baseUrl = this.createBaseUrl(this.API_BASEPATH);
36+
}
37+
38+
/**
39+
* @summary Get all the disbursements of a grant
40+
* @param grantId {@link string } The unique identifier of the grant reference.
41+
* @param requestOptions {@link IRequest.Options }
42+
* @return {@link Disbursements }
43+
*/
44+
public async getAllGrantDisbursements(grantId: string, requestOptions?: IRequest.Options): Promise<Disbursements> {
45+
const endpoint = `${this.baseUrl}/grants/{grantId}/disbursements`
46+
.replace("{" + "grantId" + "}", encodeURIComponent(String(grantId)));
47+
const resource = new Resource(this, endpoint);
48+
49+
const response = await getJsonResponse<string, Disbursements>(
50+
resource,
51+
"",
52+
{ ...requestOptions, method: "GET" }
53+
);
54+
55+
return ObjectSerializer.deserialize(response, "Disbursements");
56+
}
57+
58+
/**
59+
* @summary Get all the grants of an account holder
60+
* @param requestOptions {@link IRequest.Options }
61+
* @param counterpartyAccountHolderId {@link string } (Required) The unique identifier of the account holder that received the grants.
62+
* @return {@link Grants }
63+
*/
64+
public async getAllGrants(counterpartyAccountHolderId: string, requestOptions?: IRequest.Options): Promise<Grants> {
65+
const endpoint = `${this.baseUrl}/grants`;
66+
const resource = new Resource(this, endpoint);
67+
68+
const hasDefinedQueryParams = counterpartyAccountHolderId;
69+
if(hasDefinedQueryParams) {
70+
if(!requestOptions) requestOptions = {};
71+
if(!requestOptions.params) requestOptions.params = {};
72+
if(counterpartyAccountHolderId) requestOptions.params["counterpartyAccountHolderId"] = counterpartyAccountHolderId;
73+
}
74+
const response = await getJsonResponse<string, Grants>(
75+
resource,
76+
"",
77+
{ ...requestOptions, method: "GET" }
78+
);
79+
80+
return ObjectSerializer.deserialize(response, "Grants");
81+
}
82+
83+
/**
84+
* @summary Get the details of a grant
85+
* @param grantId {@link string } The unique identifier of the grant reference.
86+
* @param requestOptions {@link IRequest.Options }
87+
* @return {@link Grant }
88+
*/
89+
public async getGrant(grantId: string, requestOptions?: IRequest.Options): Promise<Grant> {
90+
const endpoint = `${this.baseUrl}/grants/{grantId}`
91+
.replace("{" + "grantId" + "}", encodeURIComponent(String(grantId)));
92+
const resource = new Resource(this, endpoint);
93+
94+
const response = await getJsonResponse<string, Grant>(
95+
resource,
96+
"",
97+
{ ...requestOptions, method: "GET" }
98+
);
99+
100+
return ObjectSerializer.deserialize(response, "Grant");
101+
}
102+
103+
/**
104+
* @summary Get disbursement details
105+
* @param grantId {@link string } The unique identifier of the grant reference.
106+
* @param disbursementId {@link string } The unique identifier of the disbursement.
107+
* @param requestOptions {@link IRequest.Options }
108+
* @return {@link Disbursement }
109+
*/
110+
public async getGrantDisbursement(grantId: string, disbursementId: string, requestOptions?: IRequest.Options): Promise<Disbursement> {
111+
const endpoint = `${this.baseUrl}/grants/{grantId}/disbursements/{disbursementId}`
112+
.replace("{" + "grantId" + "}", encodeURIComponent(String(grantId)))
113+
.replace("{" + "disbursementId" + "}", encodeURIComponent(String(disbursementId)));
114+
const resource = new Resource(this, endpoint);
115+
116+
const response = await getJsonResponse<string, Disbursement>(
117+
resource,
118+
"",
119+
{ ...requestOptions, method: "GET" }
120+
);
121+
122+
return ObjectSerializer.deserialize(response, "Disbursement");
123+
}
124+
125+
/**
126+
* @summary Make a request for a grant
127+
* @param grantInfo {@link GrantInfo }
128+
* @param requestOptions {@link IRequest.Options }
129+
* @return {@link Grant }
130+
*/
131+
public async requestGrant(grantInfo: GrantInfo, requestOptions?: IRequest.Options): Promise<Grant> {
132+
const endpoint = `${this.baseUrl}/grants`;
133+
const resource = new Resource(this, endpoint);
134+
135+
const request: GrantInfo = ObjectSerializer.serialize(grantInfo, "GrantInfo");
136+
const response = await getJsonResponse<GrantInfo, Grant>(
137+
resource,
138+
request,
139+
{ ...requestOptions, method: "POST" }
140+
);
141+
142+
return ObjectSerializer.deserialize(response, "Grant");
143+
}
144+
145+
/**
146+
* @summary Update the repayment configuration of a disbursement
147+
* @param grantId {@link string } The unique identifier of the grant reference.
148+
* @param disbursementId {@link string } The unique identifier of the disbursement.
149+
* @param disbursementInfoUpdate {@link DisbursementInfoUpdate }
150+
* @param requestOptions {@link IRequest.Options }
151+
* @return {@link Disbursement }
152+
*/
153+
public async updateGrantDisbursement(grantId: string, disbursementId: string, disbursementInfoUpdate: DisbursementInfoUpdate, requestOptions?: IRequest.Options): Promise<Disbursement> {
154+
const endpoint = `${this.baseUrl}/grants/{grantId}/disbursements/{disbursementId}`
155+
.replace("{" + "grantId" + "}", encodeURIComponent(String(grantId)))
156+
.replace("{" + "disbursementId" + "}", encodeURIComponent(String(disbursementId)));
157+
const resource = new Resource(this, endpoint);
158+
159+
const request: DisbursementInfoUpdate = ObjectSerializer.serialize(disbursementInfoUpdate, "DisbursementInfoUpdate");
160+
const response = await getJsonResponse<DisbursementInfoUpdate, Disbursement>(
161+
resource,
162+
request,
163+
{ ...requestOptions, method: "PATCH" }
164+
);
165+
166+
return ObjectSerializer.deserialize(response, "Disbursement");
167+
}
168+
169+
}

src/services/capital/index.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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 { GrantAccountsApi } from "./grantAccountsApi";
11+
import { GrantOffersApi } from "./grantOffersApi";
12+
import { GrantsApi } from "./grantsApi";
13+
14+
import Service from "../../service";
15+
import Client from "../../client";
16+
17+
export default class CapitalAPI extends Service {
18+
19+
public constructor(client: Client) {
20+
super(client);
21+
}
22+
23+
public get GrantAccountsApi() {
24+
return new GrantAccountsApi(this.client);
25+
}
26+
27+
public get GrantOffersApi() {
28+
return new GrantOffersApi(this.client);
29+
}
30+
31+
public get GrantsApi() {
32+
return new GrantsApi(this.client);
33+
}
34+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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 { BankAccountIdentification } from "./bankAccountIdentification";
11+
12+
13+
export class AULocalAccountIdentification extends BankAccountIdentification {
14+
/**
15+
* The bank account number, without separators or whitespace.
16+
*/
17+
"accountNumber": string;
18+
/**
19+
* The 6-digit [Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or whitespace.
20+
*/
21+
"bsbCode": string;
22+
/**
23+
* **auLocal**
24+
*/
25+
"type": string;
26+
27+
static override readonly discriminator: string | undefined = undefined;
28+
29+
static override readonly mapping: {[index: string]: string} | undefined = undefined;
30+
31+
static override readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
32+
{
33+
"name": "accountNumber",
34+
"baseName": "accountNumber",
35+
"type": "string",
36+
"format": ""
37+
},
38+
{
39+
"name": "bsbCode",
40+
"baseName": "bsbCode",
41+
"type": "string",
42+
"format": ""
43+
},
44+
{
45+
"name": "type",
46+
"baseName": "type",
47+
"type": "string",
48+
"format": ""
49+
} ];
50+
51+
static override getAttributeTypeMap() {
52+
return super.getAttributeTypeMap().concat(AULocalAccountIdentification.attributeTypeMap);
53+
}
54+
55+
public constructor() {
56+
super();
57+
}
58+
}
59+

0 commit comments

Comments
 (0)