Skip to content

Commit 58cb5af

Browse files
authored
Merge pull request #40 from apideck-libraries/speakeasy-sdk-regen-1746796133
chore: 🐝 Update SDK - Generate 0.14.1
2 parents c224546 + e48e467 commit 58cb5af

File tree

10 files changed

+71
-39
lines changed

10 files changed

+71
-39
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
**/__pycache__/
12
**/.speakeasy/temp/
23
**/.speakeasy/logs/
34
.speakeasy/temp/

.speakeasy/gen.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: fca0ac3a-5f4e-452c-bbc7-2311afa8da40
33
management:
4-
docChecksum: 14ed38db9a4af4d6b2892aea130bf389
4+
docChecksum: ef5888e0e7ebc9d485e3cff4f84a7ef6
55
docVersion: 10.16.5
6-
speakeasyVersion: 1.542.3
7-
generationVersion: 2.597.9
8-
releaseVersion: 0.14.0
9-
configChecksum: fe802b0121d229e0c0d3d87493c8ba09
6+
speakeasyVersion: 1.543.1
7+
generationVersion: 2.598.21
8+
releaseVersion: 0.14.1
9+
configChecksum: 21970d7463647e253f74bbf29670cafe
1010
repoURL: https://github.com/apideck-libraries/sdk-python.git
1111
installationURL: https://github.com/apideck-libraries/sdk-python.git
1212
published: true

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ generation:
1919
oAuth2ClientCredentialsEnabled: true
2020
oAuth2PasswordEnabled: true
2121
python:
22-
version: 0.14.0
22+
version: 0.14.1
2323
additionalDependencies:
2424
dev: {}
2525
main: {}

.speakeasy/workflow.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
speakeasyVersion: 1.542.3
1+
speakeasyVersion: 1.543.1
22
sources:
33
Apideck:
44
sourceNamespace: apideck
5-
sourceRevisionDigest: sha256:9cded97eba03a67677e9230e91aa7619ec3d30a2ff72add7cc4e53770019ccc7
6-
sourceBlobDigest: sha256:90c0e0a31fb0536da50e41f7eb85bf940cc21649ab85bc20a64177151493e444
5+
sourceRevisionDigest: sha256:f468ad536e8a33e68600665c8afdb009888f37079ec6d206ac07d0b4028cc1a1
6+
sourceBlobDigest: sha256:8755fe54b3c4fecba092fd2799273e8a9d876cd2104ad3dfb92a467d242410f4
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1746174542
9+
- speakeasy-sdk-regen-1746796133
1010
- 10.16.5
1111
targets:
1212
apideck:
1313
source: Apideck
1414
sourceNamespace: apideck
15-
sourceRevisionDigest: sha256:9cded97eba03a67677e9230e91aa7619ec3d30a2ff72add7cc4e53770019ccc7
16-
sourceBlobDigest: sha256:90c0e0a31fb0536da50e41f7eb85bf940cc21649ab85bc20a64177151493e444
15+
sourceRevisionDigest: sha256:f468ad536e8a33e68600665c8afdb009888f37079ec6d206ac07d0b4028cc1a1
16+
sourceBlobDigest: sha256:8755fe54b3c4fecba092fd2799273e8a9d876cd2104ad3dfb92a467d242410f4
1717
codeSamplesNamespace: apideck-python-code-samples
18-
codeSamplesRevisionDigest: sha256:8db1184213a80cc43443417a09ddd29bc7c40c96a57c3787aa6873bf8d86511f
18+
codeSamplesRevisionDigest: sha256:a5d04ddc583eaac5633dd8125002894c4f1e57eb9b717ebd26f6ecfeb715581a
1919
workflow:
2020
workflowVersion: 1.0.0
2121
speakeasyVersion: latest

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,4 +218,14 @@ Based on:
218218
### Generated
219219
- [python v0.14.0] .
220220
### Releases
221-
- [PyPI v0.14.0] https://pypi.org/project/apideck-unify/0.14.0 - .
221+
- [PyPI v0.14.0] https://pypi.org/project/apideck-unify/0.14.0 - .
222+
223+
## 2025-05-09 13:08:35
224+
### Changes
225+
Based on:
226+
- OpenAPI Doc
227+
- Speakeasy CLI 1.543.1 (2.598.21) https://github.com/speakeasy-api/speakeasy
228+
### Generated
229+
- [python v0.14.1] .
230+
### Releases
231+
- [PyPI v0.14.1] https://pypi.org/project/apideck-unify/0.14.1 - .

docs/models/ecommerceorderlineitem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ A single line item of an ecommerce order, representing a product or variant with
2222
| `refunded_amount` | *OptionalNullable[str]* | :heavy_minus_sign: | The amount of the line item that has been refunded. | 0 |
2323
| `refunded_quantity` | *OptionalNullable[str]* | :heavy_minus_sign: | The quantity of the line item that has been refunded. | 0 |
2424
| `sub_total` | *OptionalNullable[str]* | :heavy_minus_sign: | The sub total for the product(s) or variant associated with the line item, excluding taxes and discounts. | 43.18 |
25-
| `total_amount` | *Nullable[str]* | :heavy_check_mark: | The total amount for the product(s) or variant associated with the line item, including taxes and discounts. | 43.18 |
25+
| `total_amount` | *OptionalNullable[str]* | :heavy_minus_sign: | The total amount for the product(s) or variant associated with the line item, including taxes and discounts. | 43.18 |
2626
| `discounts` | List[[models.EcommerceDiscount](../models/ecommercediscount.md)] | :heavy_minus_sign: | N/A | |

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "apideck-unify"
3-
version = "0.14.0"
3+
version = "0.14.1"
44
description = "Python Client SDK Generated by Speakeasy."
55
authors = [{ name = "Speakeasy" },]
66
readme = "README-PYPI.md"

src/apideck_unify/_version.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import importlib.metadata
44

55
__title__: str = "apideck-unify"
6-
__version__: str = "0.14.0"
6+
__version__: str = "0.14.1"
77
__openapi_doc_version__: str = "10.16.5"
8-
__gen_version__: str = "2.597.9"
9-
__user_agent__: str = "speakeasy-sdk/python 0.14.0 2.597.9 10.16.5 apideck-unify"
8+
__gen_version__: str = "2.598.21"
9+
__user_agent__: str = "speakeasy-sdk/python 0.14.1 2.598.21 10.16.5 apideck-unify"
1010

1111
try:
1212
if __package__ is not None:

src/apideck_unify/httpclient.py

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
# pyright: reportReturnType = false
44
import asyncio
5-
from concurrent.futures import ThreadPoolExecutor
65
from typing_extensions import Protocol, runtime_checkable
76
import httpx
87
from typing import Any, Optional, Union
@@ -116,21 +115,42 @@ def close_clients(
116115
pass
117116

118117
if async_client is not None and not async_client_supplied:
119-
is_async = False
118+
# First, try the simplest approach - use asyncio.run()
119+
# This works when we're not in an async context
120120
try:
121-
asyncio.get_running_loop()
122-
is_async = True
123-
except RuntimeError:
124-
pass
125-
126-
try:
127-
# If this function is called in an async loop then start another
128-
# loop in a separate thread to close the async http client.
129-
if is_async:
130-
with ThreadPoolExecutor(max_workers=1) as executor:
131-
future = executor.submit(asyncio.run, async_client.aclose())
132-
future.result()
121+
asyncio.run(async_client.aclose())
122+
except RuntimeError as e:
123+
# If we get "RuntimeError: This event loop is already running",
124+
# it means we're in an async context
125+
if "already running" in str(e):
126+
try:
127+
# We're in an async context, so get the running loop
128+
loop = asyncio.get_running_loop()
129+
# Create a task but don't wait for it
130+
loop.create_task(async_client.aclose())
131+
except Exception:
132+
# If we can't get the loop or create a task, just ignore
133+
# The GC will eventually clean up the resources
134+
pass
135+
# If we get "RuntimeError: There is no current event loop in thread",
136+
# we're not in an async context, but asyncio.run() failed for some reason
137+
# In this case, we can try to create a new event loop explicitly
138+
elif "no current event loop" in str(e):
139+
try:
140+
# Create a new event loop and run the coroutine
141+
loop = asyncio.new_event_loop()
142+
asyncio.set_event_loop(loop)
143+
try:
144+
loop.run_until_complete(async_client.aclose())
145+
finally:
146+
loop.close()
147+
asyncio.set_event_loop(None)
148+
except Exception:
149+
# If this also fails, just ignore
150+
pass
151+
# For any other RuntimeError, just ignore
133152
else:
134-
asyncio.run(async_client.aclose())
153+
pass
135154
except Exception:
155+
# For any other exception, just ignore
136156
pass

src/apideck_unify/models/ecommerceorderlineitem.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ class EcommerceOrderLineItemTypedDict(TypedDict):
7171
r"""The name of the product or variant associated with the line item."""
7272
quantity: Nullable[str]
7373
r"""The quantity of the product or variant associated with the line item."""
74-
total_amount: Nullable[str]
75-
r"""The total amount for the product(s) or variant associated with the line item, including taxes and discounts."""
7674
id: NotRequired[Nullable[str]]
7775
r"""A unique identifier for an object."""
7876
product_id: NotRequired[Nullable[str]]
@@ -98,6 +96,8 @@ class EcommerceOrderLineItemTypedDict(TypedDict):
9896
r"""The quantity of the line item that has been refunded."""
9997
sub_total: NotRequired[Nullable[str]]
10098
r"""The sub total for the product(s) or variant associated with the line item, excluding taxes and discounts."""
99+
total_amount: NotRequired[Nullable[str]]
100+
r"""The total amount for the product(s) or variant associated with the line item, including taxes and discounts."""
101101
discounts: NotRequired[List[EcommerceDiscountTypedDict]]
102102

103103

@@ -110,9 +110,6 @@ class EcommerceOrderLineItem(BaseModel):
110110
quantity: Nullable[str]
111111
r"""The quantity of the product or variant associated with the line item."""
112112

113-
total_amount: Nullable[str]
114-
r"""The total amount for the product(s) or variant associated with the line item, including taxes and discounts."""
115-
116113
id: OptionalNullable[str] = UNSET
117114
r"""A unique identifier for an object."""
118115

@@ -151,6 +148,9 @@ class EcommerceOrderLineItem(BaseModel):
151148
sub_total: OptionalNullable[str] = UNSET
152149
r"""The sub total for the product(s) or variant associated with the line item, excluding taxes and discounts."""
153150

151+
total_amount: OptionalNullable[str] = UNSET
152+
r"""The total amount for the product(s) or variant associated with the line item, including taxes and discounts."""
153+
154154
discounts: Optional[List[EcommerceDiscount]] = None
155155

156156
@model_serializer(mode="wrap")
@@ -169,6 +169,7 @@ def serialize_model(self, handler):
169169
"refunded_amount",
170170
"refunded_quantity",
171171
"sub_total",
172+
"total_amount",
172173
"discounts",
173174
]
174175
nullable_fields = [

0 commit comments

Comments
 (0)