@@ -30,18 +30,23 @@ A bank feed is a connection between a source bank account in your application an
30
30
31
31
<!-- Start Table of Contents [toc] -->
32
32
## 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
+ * [ IDE Support] ( #ide-support )
39
+ * [ SDK Example Usage] ( #sdk-example-usage )
40
+ * [ Available Resources and Operations] ( #available-resources-and-operations )
41
+ * [ File uploads] ( #file-uploads )
42
+ * [ Retries] ( #retries )
43
+ * [ Error Handling] ( #error-handling )
44
+ * [ Server Selection] ( #server-selection )
45
+ * [ Custom HTTP Client] ( #custom-http-client )
46
+ * [ Authentication] ( #authentication )
47
+ * [ Debugging] ( #debugging )
48
+ * [ Support] ( #support )
33
49
34
- * [ SDK Installation] ( #sdk-installation )
35
- * [ IDE Support] ( #ide-support )
36
- * [ SDK Example Usage] ( #sdk-example-usage )
37
- * [ Available Resources and Operations] ( #available-resources-and-operations )
38
- * [ File uploads] ( #file-uploads )
39
- * [ Retries] ( #retries )
40
- * [ Error Handling] ( #error-handling )
41
- * [ Server Selection] ( #server-selection )
42
- * [ Custom HTTP Client] ( #custom-http-client )
43
- * [ Authentication] ( #authentication )
44
- * [ Debugging] ( #debugging )
45
50
<!-- End Table of Contents [toc] -->
46
51
47
52
<!-- Start SDK Installation [installation] -->
@@ -86,20 +91,37 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
86
91
# Synchronous Example
87
92
from codat_bankfeeds import CodatBankFeeds
88
93
from codat_bankfeeds.models import shared
89
-
90
- with CodatBankFeeds(
91
- security = shared.Security(
92
- auth_header = " Basic BASE_64_ENCODED(API_KEY)" ,
93
- ),
94
- ) as s:
95
- res = s.companies.create(request = {
96
- " name" : " Technicalium" ,
97
- " description" : " Requested early access to the new financing scheme." ,
94
+ from decimal import Decimal
95
+
96
+ with CodatBankFeeds() as codat_bank_feeds:
97
+ codat_bank_feeds.bank_feeds_source_account_connected(request = {
98
+ " event_type" : " bankFeeds.sourceAccount.connected" ,
99
+ " generated_date" : " 2022-10-23T00:00:00Z" ,
100
+ " id" : " ba29118f-5406-4e59-b05c-ba307ca38d01" ,
101
+ " payload" : {
102
+ " connection_id" : " 2e9d2c44-f675-40ba-8049-353bfcb5e171" ,
103
+ " reference_company" : {
104
+ " description" : " Requested early access to the new financing scheme." ,
105
+ " id" : " 0498e921-9b53-4396-a412-4f2f5983b0a2" ,
106
+ " links" : {
107
+ " portal" : " https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary" ,
108
+ },
109
+ " name" : " Toft stores" ,
110
+ },
111
+ " source_account" : {
112
+ " id" : " acc-002" ,
113
+ " account_name" : " account-081" ,
114
+ " account_number" : " 12345678" ,
115
+ " balance" : Decimal(" 99.99" ),
116
+ " currency" : " GBP" ,
117
+ " modified_date" : " 2023-01-09T14:14:14.105Z" ,
118
+ " sort_code" : " 040004" ,
119
+ " status" : shared.Status.PENDING ,
120
+ },
121
+ },
98
122
})
99
123
100
- if res is not None :
101
- # handle response
102
- pass
124
+ # Use the SDK ...
103
125
```
104
126
105
127
</br >
@@ -110,21 +132,38 @@ The same SDK client can also be used to make asychronous requests by importing a
110
132
import asyncio
111
133
from codat_bankfeeds import CodatBankFeeds
112
134
from codat_bankfeeds.models import shared
135
+ from decimal import Decimal
113
136
114
137
async def main ():
115
- async with CodatBankFeeds(
116
- security = shared.Security(
117
- auth_header = " Basic BASE_64_ENCODED(API_KEY)" ,
118
- ),
119
- ) as s:
120
- res = await s.companies.create_async(request = {
121
- " name" : " Technicalium" ,
122
- " description" : " Requested early access to the new financing scheme." ,
138
+ async with CodatBankFeeds() as codat_bank_feeds:
139
+ await codat_bank_feeds.bank_feeds_source_account_connected_async(request = {
140
+ " event_type" : " bankFeeds.sourceAccount.connected" ,
141
+ " generated_date" : " 2022-10-23T00:00:00Z" ,
142
+ " id" : " ba29118f-5406-4e59-b05c-ba307ca38d01" ,
143
+ " payload" : {
144
+ " connection_id" : " 2e9d2c44-f675-40ba-8049-353bfcb5e171" ,
145
+ " reference_company" : {
146
+ " description" : " Requested early access to the new financing scheme." ,
147
+ " id" : " 0498e921-9b53-4396-a412-4f2f5983b0a2" ,
148
+ " links" : {
149
+ " portal" : " https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary" ,
150
+ },
151
+ " name" : " Toft stores" ,
152
+ },
153
+ " source_account" : {
154
+ " id" : " acc-002" ,
155
+ " account_name" : " account-081" ,
156
+ " account_number" : " 12345678" ,
157
+ " balance" : Decimal(" 99.99" ),
158
+ " currency" : " GBP" ,
159
+ " modified_date" : " 2023-01-09T14:14:14.105Z" ,
160
+ " sort_code" : " 040004" ,
161
+ " status" : shared.Status.PENDING ,
162
+ },
163
+ },
123
164
})
124
165
125
- if res is not None :
126
- # handle response
127
- pass
166
+ # Use the SDK ...
128
167
129
168
asyncio.run(main())
130
169
```
@@ -220,8 +259,8 @@ with CodatBankFeeds(
220
259
security = shared.Security(
221
260
auth_header = " Basic BASE_64_ENCODED(API_KEY)" ,
222
261
),
223
- ) as s :
224
- res = s .source_accounts.generate_credentials(request = {
262
+ ) as codat_bank_feeds :
263
+ res = codat_bank_feeds .source_accounts.generate_credentials(request = {
225
264
" request_body" : open (" example.file" , " rb" ),
226
265
" company_id" : " 8a210b68-6988-11ed-a1eb-0242ac120002" ,
227
266
" connection_id" : " 2e9d2c44-f675-40ba-8049-353bfcb5e171" ,
@@ -243,14 +282,14 @@ To change the default retry strategy for a single API call, simply provide a `Re
243
282
``` python
244
283
from codat_bankfeeds import CodatBankFeeds
245
284
from codat_bankfeeds.models import shared
246
- from codatbankfeeds .utils import BackoffStrategy, RetryConfig
285
+ from codat_bankfeeds .utils import BackoffStrategy, RetryConfig
247
286
248
287
with CodatBankFeeds(
249
288
security = shared.Security(
250
289
auth_header = " Basic BASE_64_ENCODED(API_KEY)" ,
251
290
),
252
- ) as s :
253
- res = s .companies.create(request = {
291
+ ) as codat_bank_feeds :
292
+ res = codat_bank_feeds .companies.create(request = {
254
293
" name" : " Technicalium" ,
255
294
" description" : " Requested early access to the new financing scheme." ,
256
295
},
@@ -266,15 +305,15 @@ If you'd like to override the default retry strategy for all operations that sup
266
305
``` python
267
306
from codat_bankfeeds import CodatBankFeeds
268
307
from codat_bankfeeds.models import shared
269
- from codatbankfeeds .utils import BackoffStrategy, RetryConfig
308
+ from codat_bankfeeds .utils import BackoffStrategy, RetryConfig
270
309
271
310
with CodatBankFeeds(
272
311
retry_config = RetryConfig(" backoff" , BackoffStrategy(1 , 50 , 1.1 , 100 ), False ),
273
312
security = shared.Security(
274
313
auth_header = " Basic BASE_64_ENCODED(API_KEY)" ,
275
314
),
276
- ) as s :
277
- res = s .companies.create(request = {
315
+ ) as codat_bank_feeds :
316
+ res = codat_bank_feeds .companies.create(request = {
278
317
" name" : " Technicalium" ,
279
318
" description" : " Requested early access to the new financing scheme." ,
280
319
})
@@ -319,10 +358,10 @@ with CodatBankFeeds(
319
358
security = shared.Security(
320
359
auth_header = " Basic BASE_64_ENCODED(API_KEY)" ,
321
360
),
322
- ) as s :
361
+ ) as codat_bank_feeds :
323
362
res = None
324
363
try :
325
- res = s .companies.create(request = {
364
+ res = codat_bank_feeds .companies.create(request = {
326
365
" name" : " Technicalium" ,
327
366
" description" : " Requested early access to the new financing scheme." ,
328
367
})
@@ -357,8 +396,8 @@ with CodatBankFeeds(
357
396
security = shared.Security(
358
397
auth_header = " Basic BASE_64_ENCODED(API_KEY)" ,
359
398
),
360
- ) as s :
361
- res = s .companies.create(request = {
399
+ ) as codat_bank_feeds :
400
+ res = codat_bank_feeds .companies.create(request = {
362
401
" name" : " Technicalium" ,
363
402
" description" : " Requested early access to the new financing scheme." ,
364
403
})
@@ -475,8 +514,8 @@ with CodatBankFeeds(
475
514
security = shared.Security(
476
515
auth_header = " Basic BASE_64_ENCODED(API_KEY)" ,
477
516
),
478
- ) as s :
479
- res = s .companies.create(request = {
517
+ ) as codat_bank_feeds :
518
+ res = codat_bank_feeds .companies.create(request = {
480
519
" name" : " Technicalium" ,
481
520
" description" : " Requested early access to the new financing scheme." ,
482
521
})
0 commit comments