|
1 | | -<!-- Start SDK Example Usage [usage] --> |
2 | | -```python |
3 | | -# Synchronous Example |
4 | | -from codat_lending import CodatLending |
5 | | -from codat_lending.models import shared |
6 | | - |
7 | | - |
8 | | -with CodatLending( |
9 | | - security=shared.Security( |
10 | | - auth_header="Basic BASE_64_ENCODED(API_KEY)", |
11 | | - ), |
12 | | -) as cl_client: |
13 | | - |
14 | | - res = cl_client.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_lending import CodatLending |
30 | | -from codat_lending.models import shared |
31 | | - |
32 | | -async def main(): |
33 | | - |
34 | | - async with CodatLending( |
35 | | - security=shared.Security( |
36 | | - auth_header="Basic BASE_64_ENCODED(API_KEY)", |
37 | | - ), |
38 | | - ) as cl_client: |
39 | | - |
40 | | - res = await cl_client.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_lending import CodatLending |
| 5 | +from codat_lending.models import shared |
| 6 | + |
| 7 | + |
| 8 | +with CodatLending( |
| 9 | + security=shared.Security( |
| 10 | + auth_header="Basic BASE_64_ENCODED(API_KEY)", |
| 11 | + ), |
| 12 | +) as cl_client: |
| 13 | + |
| 14 | + res = cl_client.accounting_bank_data.list_transactions(request={ |
| 15 | + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", |
| 16 | + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", |
| 17 | + "account_id": "13d946f0-c5d5-42bc-b092-97ece17923ab", |
| 18 | + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", |
| 19 | + "order_by": "-modifiedDate", |
| 20 | + }) |
| 21 | + |
| 22 | + # Handle response |
| 23 | + print(res) |
| 24 | +``` |
| 25 | + |
| 26 | +</br> |
| 27 | + |
| 28 | +The same SDK client can also be used to make asynchronous requests by importing asyncio. |
| 29 | + |
| 30 | +```python |
| 31 | +# Asynchronous Example |
| 32 | +import asyncio |
| 33 | +from codat_lending import CodatLending |
| 34 | +from codat_lending.models import shared |
| 35 | + |
| 36 | +async def main(): |
| 37 | + |
| 38 | + async with CodatLending( |
| 39 | + security=shared.Security( |
| 40 | + auth_header="Basic BASE_64_ENCODED(API_KEY)", |
| 41 | + ), |
| 42 | + ) as cl_client: |
| 43 | + |
| 44 | + res = await cl_client.accounting_bank_data.list_transactions_async(request={ |
| 45 | + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", |
| 46 | + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", |
| 47 | + "account_id": "13d946f0-c5d5-42bc-b092-97ece17923ab", |
| 48 | + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", |
| 49 | + "order_by": "-modifiedDate", |
| 50 | + }) |
| 51 | + |
| 52 | + # Handle response |
| 53 | + print(res) |
| 54 | + |
| 55 | +asyncio.run(main()) |
| 56 | +``` |
49 | 57 | <!-- End SDK Example Usage [usage] --> |
0 commit comments