@@ -30,14 +30,17 @@ A bank feed is a connection between a source bank account in your application an
3030
3131<!-- Start Table of Contents [toc] -->
3232## Table of Contents
33+ <!-- $toc-max-depth=2 -->
34+ * [ Endpoints] ( #endpoints )
35+ * [ SDK Installation] ( #sdk-installation )
36+ * [ Example Usage] ( #example-usage )
37+ * [ SDK Example Usage] ( #sdk-example-usage )
38+ * [ Available Resources and Operations] ( #available-resources-and-operations )
39+ * [ Retries] ( #retries )
40+ * [ Error Handling] ( #error-handling )
41+ * [ Server Selection] ( #server-selection )
42+ * [ Authentication] ( #authentication )
3343
34- * [ SDK Installation] ( #sdk-installation )
35- * [ SDK Example Usage] ( #sdk-example-usage )
36- * [ Available Resources and Operations] ( #available-resources-and-operations )
37- * [ Retries] ( #retries )
38- * [ Error Handling] ( #error-handling )
39- * [ Server Selection] ( #server-selection )
40- * [ Authentication] ( #authentication )
4144<!-- End Table of Contents [toc] -->
4245
4346<!-- Start SDK Installation [installation] -->
@@ -51,15 +54,15 @@ The samples below show how a published SDK artifact is used:
5154
5255Gradle:
5356``` groovy
54- implementation 'io.codat:bank-feeds:2 .0.0'
57+ implementation 'io.codat:bank-feeds:3 .0.0'
5558```
5659
5760Maven:
5861``` xml
5962<dependency >
6063 <groupId >io.codat</groupId >
6164 <artifactId >bank-feeds</artifactId >
62- <version >2 .0.0</version >
65+ <version >3 .0.0</version >
6366</dependency >
6467```
6568
@@ -88,31 +91,56 @@ gradlew.bat publishToMavenLocal -Pskip.signing
8891package hello.world ;
8992
9093import io.codat.bank_feeds.CodatBankFeeds ;
91- import io.codat.bank_feeds.models.components.CompanyRequestBody ;
92- import io.codat.bank_feeds.models.errors.ErrorMessage ;
93- import io.codat.bank_feeds.models.operations.CreateCompanyResponse ;
94+ import io.codat.bank_feeds.models.components.CompanyReference ;
95+ import io.codat.bank_feeds.models.components.CompanyReferenceLinks ;
96+ import io.codat.bank_feeds.models.components.SourceAccount ;
97+ import io.codat.bank_feeds.models.components.SourceAccountWebhook ;
98+ import io.codat.bank_feeds.models.components.SourceAccountWebhookPayload ;
99+ import io.codat.bank_feeds.models.components.SourceAccountWebhookPayloadSourceAccount ;
100+ import io.codat.bank_feeds.models.components.Status ;
101+ import io.codat.bank_feeds.models.webhooks.BankFeedsSourceAccountConnectedResponse ;
94102import java.lang.Exception ;
103+ import java.math.BigDecimal ;
95104
96105public class Application {
97106
98- public static void main (String [] args ) throws ErrorMessage , Exception {
107+ public static void main (String [] args ) throws Exception {
99108
100109 CodatBankFeeds sdk = CodatBankFeeds . builder()
101- .authHeader(" Basic BASE_64_ENCODED(API_KEY)" )
102110 .build();
103111
104- CompanyRequestBody req = CompanyRequestBody . builder()
105- .name(" Bank of Dave" )
106- .description(" Requested early access to the new financing scheme." )
112+ SourceAccountWebhook req = SourceAccountWebhook . builder()
113+ .eventType(" bankFeeds.sourceAccount.connected" )
114+ .generatedDate(" 2022-10-23T00:00:00Z" )
115+ .id(" ba29118f-5406-4e59-b05c-ba307ca38d01" )
116+ .payload(SourceAccountWebhookPayload . builder()
117+ .connectionId(" 2e9d2c44-f675-40ba-8049-353bfcb5e171" )
118+ .referenceCompany(CompanyReference . builder()
119+ .description(" Requested early access to the new financing scheme." )
120+ .id(" 0498e921-9b53-4396-a412-4f2f5983b0a2" )
121+ .links(CompanyReferenceLinks . builder()
122+ .portal(" https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary" )
123+ .build())
124+ .name(" Toft stores" )
125+ .build())
126+ .sourceAccount(SourceAccountWebhookPayloadSourceAccount . of(SourceAccount . builder()
127+ .id(" acc-002" )
128+ .accountName(" account-081" )
129+ .accountNumber(" 12345678" )
130+ .balance(new BigDecimal (" 99.99" ))
131+ .currency(" GBP" )
132+ .modifiedDate(" 2023-01-09T14:14:14.105Z" )
133+ .sortCode(" 040004" )
134+ .status(Status . PENDING )
135+ .build()))
136+ .build())
107137 .build();
108138
109- CreateCompanyResponse res = sdk. companies() . create ()
139+ BankFeedsSourceAccountConnectedResponse res = sdk. bankFeedsSourceAccountConnected ()
110140 .request(req)
111141 .call();
112142
113- if (res. company(). isPresent()) {
114- // handle response
115- }
143+ // handle response
116144 }
117145}
118146```
@@ -213,7 +241,7 @@ public class Application {
213241 .build();
214242
215243 CompanyRequestBody req = CompanyRequestBody . builder()
216- .name(" Bank of Dave " )
244+ .name(" Technicalium " )
217245 .description(" Requested early access to the new financing scheme." )
218246 .build();
219247
@@ -270,7 +298,7 @@ public class Application {
270298 .build();
271299
272300 CompanyRequestBody req = CompanyRequestBody . builder()
273- .name(" Bank of Dave " )
301+ .name(" Technicalium " )
274302 .description(" Requested early access to the new financing scheme." )
275303 .build();
276304
@@ -318,7 +346,7 @@ public class Application {
318346 .build();
319347
320348 CompanyRequestBody req = CompanyRequestBody . builder()
321- .name(" Bank of Dave " )
349+ .name(" Technicalium " )
322350 .description(" Requested early access to the new financing scheme." )
323351 .build();
324352
@@ -359,7 +387,7 @@ public class Application {
359387 .build();
360388
361389 CompanyRequestBody req = CompanyRequestBody . builder()
362- .name(" Bank of Dave " )
390+ .name(" Technicalium " )
363391 .description(" Requested early access to the new financing scheme." )
364392 .build();
365393
@@ -405,7 +433,7 @@ public class Application {
405433 .build();
406434
407435 CompanyRequestBody req = CompanyRequestBody . builder()
408- .name(" Bank of Dave " )
436+ .name(" Technicalium " )
409437 .description(" Requested early access to the new financing scheme." )
410438 .build();
411439
0 commit comments