|
1 | | -<!-- Start SDK Example Usage [usage] --> |
2 | | -```python |
3 | | -# Synchronous Example |
4 | | -from codat_bankfeeds import CodatBankFeeds |
5 | | -from codat_bankfeeds.models import shared |
6 | | - |
7 | | - |
8 | | -with CodatBankFeeds( |
9 | | - security=shared.Security( |
10 | | - auth_header="Basic BASE_64_ENCODED(API_KEY)", |
11 | | - ), |
12 | | -) as codat_bank_feeds: |
13 | | - |
14 | | - res = codat_bank_feeds.companies.create(request={ |
15 | | - "name": "Technicalium", |
16 | | - }) |
17 | | - |
18 | | - # Handle response |
19 | | - print(res) |
20 | | -``` |
21 | | - |
22 | | -</br> |
23 | | - |
24 | | -The same SDK client can also be used to make asynchronous requests by importing asyncio. |
25 | | - |
26 | | -```python |
27 | | -# Asynchronous Example |
28 | | -import asyncio |
29 | | -from codat_bankfeeds import CodatBankFeeds |
30 | | -from codat_bankfeeds.models import shared |
31 | | - |
32 | | -async def main(): |
33 | | - |
34 | | - async with CodatBankFeeds( |
35 | | - security=shared.Security( |
36 | | - auth_header="Basic BASE_64_ENCODED(API_KEY)", |
37 | | - ), |
38 | | - ) as codat_bank_feeds: |
39 | | - |
40 | | - res = await codat_bank_feeds.companies.create_async(request={ |
41 | | - "name": "Technicalium", |
42 | | - }) |
43 | | - |
44 | | - # Handle response |
45 | | - print(res) |
46 | | - |
47 | | -asyncio.run(main()) |
48 | | -``` |
| 1 | +<!-- Start SDK Example Usage [usage] --> |
| 2 | +```python |
| 3 | +# Synchronous Example |
| 4 | +from codat_bankfeeds import CodatBankFeeds |
| 5 | +from codat_bankfeeds.models import shared |
| 6 | + |
| 7 | + |
| 8 | +with CodatBankFeeds( |
| 9 | + security=shared.Security( |
| 10 | + auth_header="Basic BASE_64_ENCODED(API_KEY)", |
| 11 | + ), |
| 12 | +) as codat_bank_feeds: |
| 13 | + |
| 14 | + res = codat_bank_feeds.companies.create(request={ |
| 15 | + "description": "Requested early access to the new financing scheme.", |
| 16 | + "name": "Bank of Dave", |
| 17 | + }) |
| 18 | + |
| 19 | + # Handle response |
| 20 | + print(res) |
| 21 | +``` |
| 22 | + |
| 23 | +</br> |
| 24 | + |
| 25 | +The same SDK client can also be used to make asynchronous requests by importing asyncio. |
| 26 | + |
| 27 | +```python |
| 28 | +# Asynchronous Example |
| 29 | +import asyncio |
| 30 | +from codat_bankfeeds import CodatBankFeeds |
| 31 | +from codat_bankfeeds.models import shared |
| 32 | + |
| 33 | +async def main(): |
| 34 | + |
| 35 | + async with CodatBankFeeds( |
| 36 | + security=shared.Security( |
| 37 | + auth_header="Basic BASE_64_ENCODED(API_KEY)", |
| 38 | + ), |
| 39 | + ) as codat_bank_feeds: |
| 40 | + |
| 41 | + res = await codat_bank_feeds.companies.create_async(request={ |
| 42 | + "description": "Requested early access to the new financing scheme.", |
| 43 | + "name": "Bank of Dave", |
| 44 | + }) |
| 45 | + |
| 46 | + # Handle response |
| 47 | + print(res) |
| 48 | + |
| 49 | +asyncio.run(main()) |
| 50 | +``` |
49 | 51 | <!-- End SDK Example Usage [usage] --> |
0 commit comments