Skip to content

Commit 8dbb050

Browse files
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.500.0 (#636)
Co-authored-by: speakeasybot <bot@speakeasyapi.dev>
1 parent 73b8540 commit 8dbb050

File tree

36 files changed

+1570
-765
lines changed

36 files changed

+1570
-765
lines changed

.speakeasy/workflow.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
speakeasyVersion: 1.477.0
1+
speakeasyVersion: 1.500.0
22
sources:
33
accounting-source:
44
sourceNamespace: accounting-source
@@ -68,11 +68,11 @@ sources:
6868
- 3.0.0
6969
sync-for-commerce-source:
7070
sourceNamespace: sync-for-commerce-source
71-
sourceRevisionDigest: sha256:df4334894c5b162a67c75770369c6fd6c0cf7b4ce5374c2f9654c2fc6da9fcb5
72-
sourceBlobDigest: sha256:1d1592cd53dae647bff1e58e43cb64f19f9da714cfc6f6198c43659b89b05369
71+
sourceRevisionDigest: sha256:119a243cc27781b143b0d8ea42a041cfc1bbf16bf6c45001a12d700a6e1cb40f
72+
sourceBlobDigest: sha256:61c9eb51c53318764e70fbc30d9960e3f776aa6f9de0b1612e41694baf3fbb7f
7373
tags:
7474
- latest
75-
- speakeasy-sdk-regen-1733826200
75+
- speakeasy-sdk-regen-1740153196
7676
- "1.1"
7777
sync-for-expenses-source:
7878
sourceNamespace: sync-for-expenses-source
@@ -152,10 +152,10 @@ targets:
152152
sync-for-commerce-library:
153153
source: sync-for-commerce-source
154154
sourceNamespace: sync-for-commerce-source
155-
sourceRevisionDigest: sha256:df4334894c5b162a67c75770369c6fd6c0cf7b4ce5374c2f9654c2fc6da9fcb5
156-
sourceBlobDigest: sha256:1d1592cd53dae647bff1e58e43cb64f19f9da714cfc6f6198c43659b89b05369
155+
sourceRevisionDigest: sha256:119a243cc27781b143b0d8ea42a041cfc1bbf16bf6c45001a12d700a6e1cb40f
156+
sourceBlobDigest: sha256:61c9eb51c53318764e70fbc30d9960e3f776aa6f9de0b1612e41694baf3fbb7f
157157
codeSamplesNamespace: sync-for-commerce-source-python-code-samples
158-
codeSamplesRevisionDigest: sha256:f936f9db889b789f7d3b90695f9b203b63e08f2f32dc96d753e5bd322d6af49a
158+
codeSamplesRevisionDigest: sha256:8cc7bb729390dbebc17e46381ce1c574cb34eae2d3d02a4fc1a6c6c0a7f312bc
159159
sync-for-expenses-library:
160160
source: sync-for-expenses-source
161161
sourceNamespace: sync-for-expenses-source

sync-for-commerce/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.speakeasy/reports
12
.venv/
23
pyrightconfig.json
34
README-PYPI.md

sync-for-commerce/.speakeasy/gen.lock

Lines changed: 78 additions & 35 deletions
Large diffs are not rendered by default.

sync-for-commerce/.speakeasy/gen.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ generation:
44
usageSnippets:
55
optionalPropertyRendering: withExample
66
fixes:
7-
nameResolutionDec2023: false
7+
nameResolutionFeb2025: false
88
parameterOrderingFeb2024: false
99
requestResponseComponentNamesFeb2024: false
10+
securityFeb2025: false
1011
auth:
1112
oAuth2ClientCredentialsEnabled: false
1213
oAuth2PasswordEnabled: false
1314
telemetryEnabled: true
1415
python:
15-
version: 6.0.1
16+
version: 6.1.0
1617
additionalDependencies:
1718
dev: {}
1819
main: {}
@@ -22,6 +23,7 @@ python:
2223
clientServerStatusCodesAsErrors: true
2324
defaultErrorName: SDKError
2425
description: Push merchants' data from your ecommerce or point-of-sale (POS) platform into your merchants' accounting software.
26+
enableCustomCodeRegions: false
2527
enumFormat: enum
2628
fixFlags:
2729
responseRequiredSep2024: false
@@ -41,5 +43,6 @@ python:
4143
methodArguments: infer-optional-args
4244
outputModelSuffix: output
4345
packageName: codat-sync-for-commerce
46+
pytestTimeout: 0
4447
responseFormat: flat
4548
templateVersion: v2

sync-for-commerce/README.md

Lines changed: 124 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Sync for Commerce: The API for Sync for Commerce.
1111

1212
Sync for Commerce automatically replicates and reconciles sales data from a merchant’s source PoS, Payments, and eCommerce systems into their accounting software. This eliminates manual processing by merchants and transforms their ability to run and grow their business.
1313

14-
[Explore product](https://docs.codat.io/commerce/overview) | [See our OpenAPI spec](https://github.com/codatio/oas)
14+
[Explore solution](https://docs.codat.io/commerce/overview) | [See our OpenAPI spec](https://github.com/codatio/oas)
1515

1616
Not seeing the endpoints you're expecting? We've [reorganized our products](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Sync for Commerce](https://docs.codat.io/sync-for-commerce-v1-api#/).
1717

@@ -45,6 +45,7 @@ Not seeing the endpoints you're expecting? We've [reorganized our products](http
4545
* [Server Selection](#server-selection)
4646
* [Custom HTTP Client](#custom-http-client)
4747
* [Authentication](#authentication)
48+
* [Resource Management](#resource-management)
4849
* [Debugging](#debugging)
4950
* [Support](#support)
5051

@@ -53,6 +54,11 @@ Not seeing the endpoints you're expecting? We've [reorganized our products](http
5354
<!-- Start SDK Installation [installation] -->
5455
## SDK Installation
5556

57+
> [!NOTE]
58+
> **Python version upgrade policy**
59+
>
60+
> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.
61+
5662
The SDK can be installed with either *pip* or *poetry* package managers.
5763

5864
### PIP
@@ -70,6 +76,37 @@ pip install codat-sync-for-commerce
7076
```bash
7177
poetry add codat-sync-for-commerce
7278
```
79+
80+
### Shell and script usage with `uv`
81+
82+
You can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so:
83+
84+
```shell
85+
uvx --from codat-sync-for-commerce python
86+
```
87+
88+
It's also possible to write a standalone Python script without needing to set up a whole project like so:
89+
90+
```python
91+
#!/usr/bin/env -S uv run --script
92+
# /// script
93+
# requires-python = ">=3.9"
94+
# dependencies = [
95+
# "codat-sync-for-commerce",
96+
# ]
97+
# ///
98+
99+
from codat_sync_for_commerce import CodatSyncCommerce
100+
101+
sdk = CodatSyncCommerce(
102+
# SDK arguments
103+
)
104+
105+
# Rest of script here...
106+
```
107+
108+
Once that is saved to a file, you can run it with `uv run script.py` where
109+
`script.py` can be replaced with the actual file name.
73110
<!-- End SDK Installation [installation] -->
74111

75112
## Example Usage
@@ -94,6 +131,7 @@ from codat_sync_for_commerce import CodatSyncCommerce
94131
from codat_sync_for_commerce.models import shared
95132

96133
with CodatSyncCommerce() as codat_sync_commerce:
134+
97135
codat_sync_commerce.connection_deleted(request={
98136
"event_type": "connection.created",
99137
"generated_date": "2022-10-23T00:00:00Z",
@@ -109,6 +147,16 @@ with CodatSyncCommerce() as codat_sync_commerce:
109147
"source_id": "35b92968-9851-4095-ad60-395c95cbcba4",
110148
"source_type": shared.SourceType.ACCOUNTING,
111149
"status": shared.DataConnectionStatus.LINKED,
150+
"data_connection_errors": [
151+
{
152+
"errored_on_utc": "2022-10-23T00:00:00Z",
153+
"resolved_on_utc": "2022-10-23T00:00:00Z",
154+
},
155+
{
156+
"errored_on_utc": "2022-10-23T00:00:00Z",
157+
"resolved_on_utc": "2022-10-23T00:00:00Z",
158+
},
159+
],
112160
"last_sync": "2022-10-23T00:00:00Z",
113161
},
114162
"reference_company": {
@@ -133,6 +181,7 @@ from codat_sync_for_commerce.models import shared
133181

134182
async def main():
135183
async with CodatSyncCommerce() as codat_sync_commerce:
184+
136185
await codat_sync_commerce.connection_deleted_async(request={
137186
"event_type": "connection.created",
138187
"generated_date": "2022-10-23T00:00:00Z",
@@ -148,6 +197,16 @@ async def main():
148197
"source_id": "35b92968-9851-4095-ad60-395c95cbcba4",
149198
"source_type": shared.SourceType.ACCOUNTING,
150199
"status": shared.DataConnectionStatus.LINKED,
200+
"data_connection_errors": [
201+
{
202+
"errored_on_utc": "2022-10-23T00:00:00Z",
203+
"resolved_on_utc": "2022-10-23T00:00:00Z",
204+
},
205+
{
206+
"errored_on_utc": "2022-10-23T00:00:00Z",
207+
"resolved_on_utc": "2022-10-23T00:00:00Z",
208+
},
209+
],
151210
"last_sync": "2022-10-23T00:00:00Z",
152211
},
153212
"reference_company": {
@@ -229,14 +288,16 @@ with CodatSyncCommerce(
229288
auth_header="Basic BASE_64_ENCODED(API_KEY)",
230289
),
231290
) as codat_sync_commerce:
291+
232292
res = codat_sync_commerce.sync_flow_settings.get_config_text_sync_flow(request={
233293
"locale": shared.Locale.EN_US,
234294
},
235295
RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))
236296

237-
if res is not None:
238-
# handle response
239-
pass
297+
assert res is not None
298+
299+
# Handle response
300+
print(res)
240301

241302
```
242303

@@ -252,13 +313,15 @@ with CodatSyncCommerce(
252313
auth_header="Basic BASE_64_ENCODED(API_KEY)",
253314
),
254315
) as codat_sync_commerce:
316+
255317
res = codat_sync_commerce.sync_flow_settings.get_config_text_sync_flow(request={
256318
"locale": shared.Locale.EN_US,
257319
})
258320

259-
if res is not None:
260-
# handle response
261-
pass
321+
assert res is not None
322+
323+
# Handle response
324+
print(res)
262325

263326
```
264327
<!-- End Retries [retries] -->
@@ -279,10 +342,11 @@ By default, an API error will raise a errors.SDKError exception, which has the f
279342

280343
When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `get_config_text_sync_flow_async` method may raise the following exceptions:
281344

282-
| Error Type | Status Code | Content Type |
283-
| ------------------- | ---------------------------- | ---------------- |
284-
| errors.ErrorMessage | 401, 402, 403, 429, 500, 503 | application/json |
285-
| errors.SDKError | 4XX, 5XX | \*/\* |
345+
| Error Type | Status Code | Content Type |
346+
| ------------------- | ------------------ | ---------------- |
347+
| errors.ErrorMessage | 401, 402, 403, 429 | application/json |
348+
| errors.ErrorMessage | 500, 503 | application/json |
349+
| errors.SDKError | 4XX, 5XX | \*/\* |
286350

287351
### Example
288352

@@ -297,14 +361,19 @@ with CodatSyncCommerce(
297361
) as codat_sync_commerce:
298362
res = None
299363
try:
364+
300365
res = codat_sync_commerce.sync_flow_settings.get_config_text_sync_flow(request={
301366
"locale": shared.Locale.EN_US,
302367
})
303368

304-
if res is not None:
305-
# handle response
306-
pass
369+
assert res is not None
370+
371+
# Handle response
372+
print(res)
307373

374+
except errors.ErrorMessage as e:
375+
# handle e.data: errors.ErrorMessageData
376+
raise(e)
308377
except errors.ErrorMessage as e:
309378
# handle e.data: errors.ErrorMessageData
310379
raise(e)
@@ -319,7 +388,7 @@ with CodatSyncCommerce(
319388

320389
### Override Server URL Per-Client
321390

322-
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:
391+
The default server can be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
323392
```python
324393
from codat_sync_for_commerce import CodatSyncCommerce
325394
from codat_sync_for_commerce.models import shared
@@ -330,13 +399,15 @@ with CodatSyncCommerce(
330399
auth_header="Basic BASE_64_ENCODED(API_KEY)",
331400
),
332401
) as codat_sync_commerce:
402+
333403
res = codat_sync_commerce.sync_flow_settings.get_config_text_sync_flow(request={
334404
"locale": shared.Locale.EN_US,
335405
})
336406

337-
if res is not None:
338-
# handle response
339-
pass
407+
assert res is not None
408+
409+
# Handle response
410+
print(res)
340411

341412
```
342413
<!-- End Server Selection [server] -->
@@ -443,17 +514,49 @@ with CodatSyncCommerce(
443514
auth_header="Basic BASE_64_ENCODED(API_KEY)",
444515
),
445516
) as codat_sync_commerce:
517+
446518
res = codat_sync_commerce.sync_flow_settings.get_config_text_sync_flow(request={
447519
"locale": shared.Locale.EN_US,
448520
})
449521

450-
if res is not None:
451-
# handle response
452-
pass
522+
assert res is not None
523+
524+
# Handle response
525+
print(res)
453526

454527
```
455528
<!-- End Authentication [security] -->
456529

530+
<!-- Start Resource Management [resource-management] -->
531+
## Resource Management
532+
533+
The `CodatSyncCommerce` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application.
534+
535+
[context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers
536+
537+
```python
538+
from codat_sync_for_commerce import CodatSyncCommerce
539+
from codat_sync_for_commerce.models import shared
540+
def main():
541+
with CodatSyncCommerce(
542+
security=shared.Security(
543+
auth_header="Basic BASE_64_ENCODED(API_KEY)",
544+
),
545+
) as codat_sync_commerce:
546+
# Rest of application here...
547+
548+
549+
# Or when using async:
550+
async def amain():
551+
async with CodatSyncCommerce(
552+
security=shared.Security(
553+
auth_header="Basic BASE_64_ENCODED(API_KEY)",
554+
),
555+
) as codat_sync_commerce:
556+
# Rest of application here...
557+
```
558+
<!-- End Resource Management [resource-management] -->
559+
457560
<!-- Start Debugging [debug] -->
458561
## Debugging
459562

sync-for-commerce/RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,4 +598,14 @@ Based on:
598598
### Generated
599599
- [python v6.0.1] sync-for-commerce
600600
### Releases
601-
- [PyPI v6.0.1] https://pypi.org/project/codat-sync-for-commerce/6.0.1 - sync-for-commerce
601+
- [PyPI v6.0.1] https://pypi.org/project/codat-sync-for-commerce/6.0.1 - sync-for-commerce
602+
603+
## 2025-02-21 15:52:55
604+
### Changes
605+
Based on:
606+
- OpenAPI Doc
607+
- Speakeasy CLI 1.500.0 (2.521.0) https://github.com/speakeasy-api/speakeasy
608+
### Generated
609+
- [python v6.1.0] sync-for-commerce
610+
### Releases
611+
- [PyPI v6.1.0] https://pypi.org/project/codat-sync-for-commerce/6.1.0 - sync-for-commerce

0 commit comments

Comments
 (0)