Skip to content

Commit 0f71e6f

Browse files
authored
Merge pull request #555 from codatio/speakeasy-sdk-regen-1703085282
chore: 🐝 Update SDK - Generate Platform library
2 parents 46923dd + 9439e66 commit 0f71e6f

File tree

346 files changed

+3613
-1235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

346 files changed

+3613
-1235
lines changed

platform/.gitattributes

100755100644
File mode changed.

platform/README.md

Lines changed: 244 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,54 @@
44
Manage the building blocks of Codat, including companies, connections, and more.
55
<!-- End Codat Library Description -->
66

7-
<!-- Start SDK Installation -->
7+
<!-- Start SDK Installation [installation] -->
88
## SDK Installation
99

1010
```bash
1111
pip install codat-platform
1212
```
13-
<!-- End SDK Installation -->
13+
<!-- End SDK Installation [installation] -->
1414

1515
## Example Usage
16-
<!-- Start SDK Example Usage -->
16+
<!-- Start SDK Example Usage [usage] -->
17+
## SDK Example Usage
18+
19+
### Example
20+
1721
```python
1822
import codatplatform
1923
from codatplatform.models import shared
2024

2125
s = codatplatform.CodatPlatform(
2226
security=shared.Security(
23-
auth_header="",
27+
auth_header="<YOUR_API_KEY_HERE>",
2428
),
2529
)
2630

27-
req = shared.CompanyRequestBody(
28-
description='Requested early access to the new financing scheme.',
29-
name='Bank of Dave',
31+
req = shared.CreateAPIKey(
32+
name='azure-invoice-finance-processor',
3033
)
3134

32-
res = s.companies.create(req)
35+
res = s.settings.create_api_key(req)
3336

34-
if res.company is not None:
37+
if res.api_key_details is not None:
3538
# handle response
3639
pass
3740
```
38-
<!-- End SDK Example Usage -->
41+
<!-- End SDK Example Usage [usage] -->
3942

40-
<!-- Start SDK Available Operations -->
43+
<!-- Start Available Resources and Operations [operations] -->
4144
## Available Resources and Operations
4245

46+
### [settings](docs/sdks/settings/README.md)
47+
48+
* [create_api_key](docs/sdks/settings/README.md#create_api_key) - Create API key
49+
* [delete_api_key](docs/sdks/settings/README.md#delete_api_key) - Delete API key
50+
* [get_profile](docs/sdks/settings/README.md#get_profile) - Get profile
51+
* [get_sync_settings](docs/sdks/settings/README.md#get_sync_settings) - Get sync settings
52+
* [list_api_keys](docs/sdks/settings/README.md#list_api_keys) - List API keys
53+
* [update_profile](docs/sdks/settings/README.md#update_profile) - Update profile
54+
* [update_sync_settings](docs/sdks/settings/README.md#update_sync_settings) - Update all sync settings
4355

4456
### [companies](docs/sdks/companies/README.md)
4557

@@ -58,11 +70,12 @@ if res.company is not None:
5870
* [unlink](docs/sdks/connections/README.md#unlink) - Unlink connection
5971
* [update_authorization](docs/sdks/connections/README.md#update_authorization) - Update authorization
6072

61-
### [integrations](docs/sdks/integrations/README.md)
73+
### [custom_data_type](docs/sdks/customdatatype/README.md)
6274

63-
* [get](docs/sdks/integrations/README.md#get) - Get integration
64-
* [get_branding](docs/sdks/integrations/README.md#get_branding) - Get branding
65-
* [list](docs/sdks/integrations/README.md#list) - List integrations
75+
* [configure](docs/sdks/customdatatype/README.md#configure) - Configure custom data type
76+
* [get_configuration](docs/sdks/customdatatype/README.md#get_configuration) - Get custom data configuration
77+
* [list](docs/sdks/customdatatype/README.md#list) - List custom data type records
78+
* [refresh](docs/sdks/customdatatype/README.md#refresh) - Refresh custom data type
6679

6780
### [push_data](docs/sdks/pushdata/README.md)
6881

@@ -78,15 +91,18 @@ if res.company is not None:
7891
* [get_pull_operation](docs/sdks/refreshdata/README.md#get_pull_operation) - Get pull operation
7992
* [list_pull_operations](docs/sdks/refreshdata/README.md#list_pull_operations) - List pull operations
8093

81-
### [settings](docs/sdks/settings/README.md)
94+
### [groups](docs/sdks/groups/README.md)
8295

83-
* [create_api_key](docs/sdks/settings/README.md#create_api_key) - Create API key
84-
* [delete_api_key](docs/sdks/settings/README.md#delete_api_key) - Delete API key
85-
* [~~get_profile~~](docs/sdks/settings/README.md#get_profile) - Get profile :warning: **Deprecated**
86-
* [get_sync_settings](docs/sdks/settings/README.md#get_sync_settings) - Get sync settings
87-
* [list_api_keys](docs/sdks/settings/README.md#list_api_keys) - List API keys
88-
* [update_profile](docs/sdks/settings/README.md#update_profile) - Update profile
89-
* [update_sync_settings](docs/sdks/settings/README.md#update_sync_settings) - Update all sync settings
96+
* [add_company](docs/sdks/groups/README.md#add_company) - Add company
97+
* [create](docs/sdks/groups/README.md#create) - Create group
98+
* [list](docs/sdks/groups/README.md#list) - List groups
99+
* [remove_company](docs/sdks/groups/README.md#remove_company) - Remove company
100+
101+
### [integrations](docs/sdks/integrations/README.md)
102+
103+
* [get](docs/sdks/integrations/README.md#get) - Get integration
104+
* [get_branding](docs/sdks/integrations/README.md#get_branding) - Get branding
105+
* [list](docs/sdks/integrations/README.md#list) - List integrations
90106

91107
### [supplemental_data](docs/sdks/supplementaldata/README.md)
92108

@@ -98,15 +114,217 @@ if res.company is not None:
98114
* [create](docs/sdks/webhooks/README.md#create) - Create webhook
99115
* [get](docs/sdks/webhooks/README.md#get) - Get webhook
100116
* [list](docs/sdks/webhooks/README.md#list) - List webhooks
101-
<!-- End SDK Available Operations -->
117+
<!-- End Available Resources and Operations [operations] -->
118+
119+
120+
121+
<!-- Start Retries [retries] -->
122+
## Retries
123+
124+
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
125+
126+
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
127+
```python
128+
import codatplatform
129+
from codatplatform.models import shared
130+
from codatplatform.utils import BackoffStrategy, RetryConfig
131+
132+
s = codatplatform.CodatPlatform(
133+
security=shared.Security(
134+
auth_header="<YOUR_API_KEY_HERE>",
135+
),
136+
)
137+
138+
req = shared.CreateAPIKey(
139+
name='azure-invoice-finance-processor',
140+
)
141+
142+
res = s.settings.create_api_key(req,
143+
RetryConfig('backoff', BackoffStrategy(1, 50, 1.1, 100), False))
144+
145+
if res.api_key_details is not None:
146+
# handle response
147+
pass
148+
```
149+
150+
If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
151+
```python
152+
import codatplatform
153+
from codatplatform.models import shared
154+
from codatplatform.utils import BackoffStrategy, RetryConfig
155+
156+
s = codatplatform.CodatPlatform(
157+
retry_config=RetryConfig('backoff', BackoffStrategy(1, 50, 1.1, 100), False)
158+
security=shared.Security(
159+
auth_header="<YOUR_API_KEY_HERE>",
160+
),
161+
)
162+
163+
req = shared.CreateAPIKey(
164+
name='azure-invoice-finance-processor',
165+
)
166+
167+
res = s.settings.create_api_key(req)
168+
169+
if res.api_key_details is not None:
170+
# handle response
171+
pass
172+
```
173+
<!-- End Retries [retries] -->
174+
175+
<!-- Start Error Handling [errors] -->
176+
## Error Handling
177+
178+
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.
179+
180+
| Error Object | Status Code | Content Type |
181+
| ------------------------------- | ------------------------------- | ------------------------------- |
182+
| errors.ErrorMessage | 400,401,402,403,409,429,500,503 | application/json |
183+
| errors.SDKError | 4x-5xx | */* |
184+
185+
### Example
186+
187+
```python
188+
import codatplatform
189+
from codatplatform.models import shared
102190

191+
s = codatplatform.CodatPlatform(
192+
security=shared.Security(
193+
auth_header="<YOUR_API_KEY_HERE>",
194+
),
195+
)
196+
197+
req = shared.CreateAPIKey(
198+
name='azure-invoice-finance-processor',
199+
)
200+
201+
res = None
202+
try:
203+
res = s.settings.create_api_key(req)
204+
except errors.ErrorMessage as e:
205+
print(e) # handle exception
206+
raise(e)
207+
except errors.SDKError as e:
208+
print(e) # handle exception
209+
raise(e)
210+
211+
if res.api_key_details is not None:
212+
# handle response
213+
pass
214+
```
215+
<!-- End Error Handling [errors] -->
216+
217+
<!-- Start Server Selection [server] -->
218+
## Server Selection
219+
220+
### Select Server by Index
221+
222+
You can override the default server globally by passing a server index to the `server_idx: int` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
223+
224+
| # | Server | Variables |
225+
| - | ------ | --------- |
226+
| 0 | `https://api.codat.io` | None |
227+
228+
#### Example
229+
230+
```python
231+
import codatplatform
232+
from codatplatform.models import shared
233+
234+
s = codatplatform.CodatPlatform(
235+
server_idx=0,
236+
security=shared.Security(
237+
auth_header="<YOUR_API_KEY_HERE>",
238+
),
239+
)
240+
241+
req = shared.CreateAPIKey(
242+
name='azure-invoice-finance-processor',
243+
)
244+
245+
res = s.settings.create_api_key(req)
103246

247+
if res.api_key_details is not None:
248+
# handle response
249+
pass
250+
```
104251

105-
<!-- Start Dev Containers -->
106252

253+
### Override Server URL Per-Client
107254

255+
The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
256+
```python
257+
import codatplatform
258+
from codatplatform.models import shared
108259

109-
<!-- End Dev Containers -->
260+
s = codatplatform.CodatPlatform(
261+
server_url="https://api.codat.io",
262+
security=shared.Security(
263+
auth_header="<YOUR_API_KEY_HERE>",
264+
),
265+
)
266+
267+
req = shared.CreateAPIKey(
268+
name='azure-invoice-finance-processor',
269+
)
270+
271+
res = s.settings.create_api_key(req)
272+
273+
if res.api_key_details is not None:
274+
# handle response
275+
pass
276+
```
277+
<!-- End Server Selection [server] -->
278+
279+
<!-- Start Custom HTTP Client [http-client] -->
280+
## Custom HTTP Client
281+
282+
The Python SDK makes API calls using the (requests)[https://pypi.org/project/requests/] HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `requests.Session` object.
283+
284+
For example, you could specify a header for every request that this sdk makes as follows:
285+
```python
286+
import codatplatform
287+
import requests
288+
289+
http_client = requests.Session()
290+
http_client.headers.update({'x-custom-header': 'someValue'})
291+
s = codatplatform.CodatPlatform(client: http_client)
292+
```
293+
<!-- End Custom HTTP Client [http-client] -->
294+
295+
<!-- Start Authentication [security] -->
296+
## Authentication
297+
298+
### Per-Client Security Schemes
299+
300+
This SDK supports the following security scheme globally:
301+
302+
| Name | Type | Scheme |
303+
| ------------- | ------------- | ------------- |
304+
| `auth_header` | apiKey | API key |
305+
306+
You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. For example:
307+
```python
308+
import codatplatform
309+
from codatplatform.models import shared
310+
311+
s = codatplatform.CodatPlatform(
312+
security=shared.Security(
313+
auth_header="<YOUR_API_KEY_HERE>",
314+
),
315+
)
316+
317+
req = shared.CreateAPIKey(
318+
name='azure-invoice-finance-processor',
319+
)
320+
321+
res = s.settings.create_api_key(req)
322+
323+
if res.api_key_details is not None:
324+
# handle response
325+
pass
326+
```
327+
<!-- End Authentication [security] -->
110328

111329
<!-- Placeholder for Future Speakeasy SDK Sections -->
112330

platform/RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,14 @@ Based on:
3838
### Generated
3939
- [python v2.0.0] platform
4040
### Releases
41-
- [PyPI v2.0.0] https://pypi.org/project/codat-platform/2.0.0 - platform
41+
- [PyPI v2.0.0] https://pypi.org/project/codat-platform/2.0.0 - platform
42+
43+
## 2023-12-20 15:14:38
44+
### Changes
45+
Based on:
46+
- OpenAPI Doc 3.0.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Platform.yaml
47+
- Speakeasy CLI 1.128.0 (2.221.0) https://github.com/speakeasy-api/speakeasy
48+
### Generated
49+
- [python v3.0.0] platform
50+
### Releases
51+
- [PyPI v3.0.0] https://pypi.org/project/codat-platform/3.0.0 - platform

platform/USAGE.md

100755100644
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
1-
<!-- Start SDK Example Usage -->
2-
3-
1+
<!-- Start SDK Example Usage [usage] -->
42
```python
53
import codatplatform
64
from codatplatform.models import shared
75

86
s = codatplatform.CodatPlatform(
97
security=shared.Security(
10-
auth_header="",
8+
auth_header="<YOUR_API_KEY_HERE>",
119
),
1210
)
1311

14-
req = shared.CompanyRequestBody(
15-
description='Requested early access to the new financing scheme.',
16-
name='Bank of Dave',
12+
req = shared.CreateAPIKey(
13+
name='azure-invoice-finance-processor',
1714
)
1815

19-
res = s.companies.create(req)
16+
res = s.settings.create_api_key(req)
2017

21-
if res.company is not None:
18+
if res.api_key_details is not None:
2219
# handle response
2320
pass
2421
```
25-
<!-- End SDK Example Usage -->
22+
<!-- End SDK Example Usage [usage] -->

platform/docs/models/shared/errormessage.md renamed to platform/docs/models/errors/errormessage.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# ErrorMessage
22

3+
Bad Request
4+
35

46
## Fields
57

0 commit comments

Comments
 (0)