Skip to content

Commit 8462991

Browse files
chore(api): update composite API spec
1 parent a1a9301 commit 8462991

5 files changed

Lines changed: 42 additions & 13 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1993
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f2b3fee10da6901a7c2661c7aa56c50b60a47da670e6718e386c488daa62f896.yml
3-
openapi_spec_hash: f1de1119a8858c62bb0f73782b9dac2b
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7d5ce1b0197a398949b694a47e688826674fc215246c7684ee791ffe1fd4aa35.yml
3+
openapi_spec_hash: 5ecfbaf6fa43f11a35da78c5d718b909
44
config_hash: 7f59e93c4d7dab420f060baaaadcd059

src/cloudflare/resources/workflows/instances/instances.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def create(
8080
*,
8181
account_id: str,
8282
instance_id: str | Omit = omit,
83-
instance_retention: object | Omit = omit,
83+
instance_retention: instance_create_params.InstanceRetention | Omit = omit,
8484
params: object | Omit = omit,
8585
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
8686
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -316,7 +316,7 @@ async def create(
316316
*,
317317
account_id: str,
318318
instance_id: str | Omit = omit,
319-
instance_retention: object | Omit = omit,
319+
instance_retention: instance_create_params.InstanceRetention | Omit = omit,
320320
params: object | Omit = omit,
321321
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
322322
# The extra values given here take precedence over values defined on the client or passed to this method.

src/cloudflare/types/workflows/instance_bulk_params.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
from __future__ import annotations
44

5-
from typing import Iterable
5+
from typing import Union, Iterable
66
from typing_extensions import Required, TypedDict
77

8-
__all__ = ["InstanceBulkParams", "Body"]
8+
__all__ = ["InstanceBulkParams", "Body", "BodyInstanceRetention"]
99

1010

1111
class InstanceBulkParams(TypedDict, total=False):
@@ -14,9 +14,17 @@ class InstanceBulkParams(TypedDict, total=False):
1414
body: Iterable[Body]
1515

1616

17+
class BodyInstanceRetention(TypedDict, total=False):
18+
error_retention: Union[int, str]
19+
"""Duration in milliseconds or as a string like '5 minutes'"""
20+
21+
success_retention: Union[int, str]
22+
"""Duration in milliseconds or as a string like '5 minutes'"""
23+
24+
1725
class Body(TypedDict, total=False):
1826
instance_id: str
1927

20-
instance_retention: object
28+
instance_retention: BodyInstanceRetention
2129

2230
params: object

src/cloudflare/types/workflows/instance_create_params.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,25 @@
22

33
from __future__ import annotations
44

5+
from typing import Union
56
from typing_extensions import Required, TypedDict
67

7-
__all__ = ["InstanceCreateParams"]
8+
__all__ = ["InstanceCreateParams", "InstanceRetention"]
89

910

1011
class InstanceCreateParams(TypedDict, total=False):
1112
account_id: Required[str]
1213

1314
instance_id: str
1415

15-
instance_retention: object
16+
instance_retention: InstanceRetention
1617

1718
params: object
19+
20+
21+
class InstanceRetention(TypedDict, total=False):
22+
error_retention: Union[int, str]
23+
"""Duration in milliseconds or as a string like '5 minutes'"""
24+
25+
success_retention: Union[int, str]
26+
"""Duration in milliseconds or as a string like '5 minutes'"""

tests/api_resources/workflows/test_instances.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
3838
workflow_name="x",
3939
account_id="account_id",
4040
instance_id="instance_id",
41-
instance_retention={},
41+
instance_retention={
42+
"error_retention": 0,
43+
"success_retention": 0,
44+
},
4245
params={},
4346
)
4447
assert_matches_type(InstanceCreateResponse, instance, path=["response"])
@@ -162,7 +165,10 @@ def test_method_bulk_with_all_params(self, client: Cloudflare) -> None:
162165
body=[
163166
{
164167
"instance_id": "instance_id",
165-
"instance_retention": {},
168+
"instance_retention": {
169+
"error_retention": 0,
170+
"success_retention": 0,
171+
},
166172
"params": {},
167173
}
168174
],
@@ -289,7 +295,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
289295
workflow_name="x",
290296
account_id="account_id",
291297
instance_id="instance_id",
292-
instance_retention={},
298+
instance_retention={
299+
"error_retention": 0,
300+
"success_retention": 0,
301+
},
293302
params={},
294303
)
295304
assert_matches_type(InstanceCreateResponse, instance, path=["response"])
@@ -413,7 +422,10 @@ async def test_method_bulk_with_all_params(self, async_client: AsyncCloudflare)
413422
body=[
414423
{
415424
"instance_id": "instance_id",
416-
"instance_retention": {},
425+
"instance_retention": {
426+
"error_retention": 0,
427+
"success_retention": 0,
428+
},
417429
"params": {},
418430
}
419431
],

0 commit comments

Comments
 (0)