@@ -30,15 +30,19 @@ 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+ * [ Bank Feeds] ( #bank-feeds )
35+ * [ Endpoints] ( #endpoints )
36+ * [ SDK Installation] ( #sdk-installation )
37+ * [ Example Usage] ( #example-usage )
38+ * [ SDK Example Usage] ( #sdk-example-usage )
39+ * [ Available Resources and Operations] ( #available-resources-and-operations )
40+ * [ Retries] ( #retries )
41+ * [ Error Handling] ( #error-handling )
42+ * [ Server Selection] ( #server-selection )
43+ * [ Custom HTTP Client] ( #custom-http-client )
44+ * [ Authentication] ( #authentication )
3345
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- * [ Custom HTTP Client] ( #custom-http-client )
41- * [ Authentication] ( #authentication )
4246<!-- End Table of Contents [toc] -->
4347
4448<!-- Start SDK Installation [installation] -->
@@ -61,27 +65,49 @@ package main
6165
6266import (
6367 " context"
64- bankfeeds " github.com/codatio/client-sdk-go/bank-feeds/v7"
65- " github.com/codatio/client-sdk-go/bank-feeds/v7/pkg/models/shared"
68+ bankfeeds " github.com/codatio/client-sdk-go/bank-feeds/v8"
69+ " github.com/codatio/client-sdk-go/bank-feeds/v8/pkg/models/shared"
70+ " github.com/codatio/client-sdk-go/bank-feeds/v8/pkg/types"
6671 " log"
6772)
6873
6974func main () {
70- s := bankfeeds.New (
71- bankfeeds.WithSecurity (shared.Security {
72- AuthHeader: " Basic BASE_64_ENCODED(API_KEY)" ,
73- }),
74- )
75-
7675 ctx := context.Background ()
77- res , err := s.Companies .Create (ctx, &shared.CompanyRequestBody {
78- Description: bankfeeds.String (" Requested early access to the new financing scheme." ),
79- Name: " Technicalium" ,
76+
77+ s := bankfeeds.New ()
78+
79+ res , err := s.BankFeedsSourceAccountConnected (ctx, &shared.SourceAccountWebhook {
80+ EventType: bankfeeds.String (" bankFeeds.sourceAccount.connected" ),
81+ GeneratedDate: bankfeeds.String (" 2022-10-23T00:00:00Z" ),
82+ ID: bankfeeds.String (" ba29118f-5406-4e59-b05c-ba307ca38d01" ),
83+ Payload: &shared.SourceAccountWebhookPayload {
84+ ConnectionID: bankfeeds.String (" 2e9d2c44-f675-40ba-8049-353bfcb5e171" ),
85+ ReferenceCompany: &shared.CompanyReference {
86+ Description: bankfeeds.String (" Requested early access to the new financing scheme." ),
87+ ID: bankfeeds.String (" 0498e921-9b53-4396-a412-4f2f5983b0a2" ),
88+ Links: &shared.CompanyReferenceLinks {
89+ Portal: bankfeeds.String (" https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary" ),
90+ },
91+ Name: bankfeeds.String (" Toft stores" ),
92+ },
93+ SourceAccount: bankfeeds.Pointer (shared.CreateSourceAccountWebhookPayloadSourceAccountSourceAccount (
94+ shared.SourceAccount {
95+ AccountName: bankfeeds.String (" account-081" ),
96+ AccountNumber: bankfeeds.String (" 12345678" ),
97+ Balance: types.MustNewDecimalFromString (" 99.99" ),
98+ Currency: bankfeeds.String (" GBP" ),
99+ ID: " acc-002" ,
100+ ModifiedDate: bankfeeds.String (" 2023-01-09T14:14:14.105Z" ),
101+ SortCode: bankfeeds.String (" 040004" ),
102+ Status: shared.StatusPending .ToPointer (),
103+ },
104+ )),
105+ },
80106 })
81107 if err != nil {
82108 log.Fatal (err)
83109 }
84- if res. Company != nil {
110+ if res != nil {
85111 // handle response
86112 }
87113}
@@ -174,21 +200,22 @@ package main
174200
175201import (
176202 " context"
177- bankfeeds " github.com/codatio/client-sdk-go/bank-feeds/v7 "
178- " github.com/codatio/client-sdk-go/bank-feeds/v7 /pkg/models/shared"
179- " github.com/codatio/client-sdk-go/bank-feeds/v7 /pkg/retry"
203+ bankfeeds " github.com/codatio/client-sdk-go/bank-feeds/v8 "
204+ " github.com/codatio/client-sdk-go/bank-feeds/v8 /pkg/models/shared"
205+ " github.com/codatio/client-sdk-go/bank-feeds/v8 /pkg/retry"
180206 " log"
181207 " pkg/models/operations"
182208)
183209
184210func main () {
211+ ctx := context.Background ()
212+
185213 s := bankfeeds.New (
186214 bankfeeds.WithSecurity (shared.Security {
187215 AuthHeader: " Basic BASE_64_ENCODED(API_KEY)" ,
188216 }),
189217 )
190218
191- ctx := context.Background ()
192219 res , err := s.Companies .Create (ctx, &shared.CompanyRequestBody {
193220 Description: bankfeeds.String (" Requested early access to the new financing scheme." ),
194221 Name: " Technicalium" ,
@@ -219,13 +246,15 @@ package main
219246
220247import (
221248 " context"
222- bankfeeds " github.com/codatio/client-sdk-go/bank-feeds/v7 "
223- " github.com/codatio/client-sdk-go/bank-feeds/v7 /pkg/models/shared"
224- " github.com/codatio/client-sdk-go/bank-feeds/v7 /pkg/retry"
249+ bankfeeds " github.com/codatio/client-sdk-go/bank-feeds/v8 "
250+ " github.com/codatio/client-sdk-go/bank-feeds/v8 /pkg/models/shared"
251+ " github.com/codatio/client-sdk-go/bank-feeds/v8 /pkg/retry"
225252 " log"
226253)
227254
228255func main () {
256+ ctx := context.Background ()
257+
229258 s := bankfeeds.New (
230259 bankfeeds.WithRetryConfig (
231260 retry.Config {
@@ -243,7 +272,6 @@ func main() {
243272 }),
244273 )
245274
246- ctx := context.Background ()
247275 res , err := s.Companies .Create (ctx, &shared.CompanyRequestBody {
248276 Description: bankfeeds.String (" Requested early access to the new financing scheme." ),
249277 Name: " Technicalium" ,
@@ -283,20 +311,21 @@ package main
283311import (
284312 " context"
285313 " errors"
286- bankfeeds " github.com/codatio/client-sdk-go/bank-feeds/v7 "
287- " github.com/codatio/client-sdk-go/bank-feeds/v7 /pkg/models/sdkerrors"
288- " github.com/codatio/client-sdk-go/bank-feeds/v7 /pkg/models/shared"
314+ bankfeeds " github.com/codatio/client-sdk-go/bank-feeds/v8 "
315+ " github.com/codatio/client-sdk-go/bank-feeds/v8 /pkg/models/sdkerrors"
316+ " github.com/codatio/client-sdk-go/bank-feeds/v8 /pkg/models/shared"
289317 " log"
290318)
291319
292320func main () {
321+ ctx := context.Background ()
322+
293323 s := bankfeeds.New (
294324 bankfeeds.WithSecurity (shared.Security {
295325 AuthHeader: " Basic BASE_64_ENCODED(API_KEY)" ,
296326 }),
297327 )
298328
299- ctx := context.Background ()
300329 res , err := s.Companies .Create (ctx, &shared.CompanyRequestBody {
301330 Description: bankfeeds.String (" Requested early access to the new financing scheme." ),
302331 Name: " Technicalium" ,
@@ -333,20 +362,21 @@ package main
333362
334363import (
335364 " context"
336- bankfeeds " github.com/codatio/client-sdk-go/bank-feeds/v7 "
337- " github.com/codatio/client-sdk-go/bank-feeds/v7 /pkg/models/shared"
365+ bankfeeds " github.com/codatio/client-sdk-go/bank-feeds/v8 "
366+ " github.com/codatio/client-sdk-go/bank-feeds/v8 /pkg/models/shared"
338367 " log"
339368)
340369
341370func main () {
371+ ctx := context.Background ()
372+
342373 s := bankfeeds.New (
343374 bankfeeds.WithServerURL (" https://api.codat.io" ),
344375 bankfeeds.WithSecurity (shared.Security {
345376 AuthHeader: " Basic BASE_64_ENCODED(API_KEY)" ,
346377 }),
347378 )
348379
349- ctx := context.Background ()
350380 res , err := s.Companies .Create (ctx, &shared.CompanyRequestBody {
351381 Description: bankfeeds.String (" Requested early access to the new financing scheme." ),
352382 Name: " Technicalium" ,
@@ -412,19 +442,20 @@ package main
412442
413443import (
414444 " context"
415- bankfeeds " github.com/codatio/client-sdk-go/bank-feeds/v7 "
416- " github.com/codatio/client-sdk-go/bank-feeds/v7 /pkg/models/shared"
445+ bankfeeds " github.com/codatio/client-sdk-go/bank-feeds/v8 "
446+ " github.com/codatio/client-sdk-go/bank-feeds/v8 /pkg/models/shared"
417447 " log"
418448)
419449
420450func main () {
451+ ctx := context.Background ()
452+
421453 s := bankfeeds.New (
422454 bankfeeds.WithSecurity (shared.Security {
423455 AuthHeader: " Basic BASE_64_ENCODED(API_KEY)" ,
424456 }),
425457 )
426458
427- ctx := context.Background ()
428459 res , err := s.Companies .Create (ctx, &shared.CompanyRequestBody {
429460 Description: bankfeeds.String (" Requested early access to the new financing scheme." ),
430461 Name: " Technicalium" ,
0 commit comments