Skip to content

Commit df9cab4

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#313)
1 parent b0fa819 commit df9cab4

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

src/cloudflare/resources/images/v2/direct_uploads.py

+12
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def create(
4242
self,
4343
*,
4444
account_id: str,
45+
id: str | NotGiven = NOT_GIVEN,
4546
expiry: Union[str, datetime] | NotGiven = NOT_GIVEN,
4647
metadata: object | NotGiven = NOT_GIVEN,
4748
require_signed_urls: bool | NotGiven = NOT_GIVEN,
@@ -65,6 +66,10 @@ def create(
6566
Args:
6667
account_id: Account identifier tag.
6768
69+
id: Optional Image Custom ID. Up to 1024 chars. Can include any number of subpaths,
70+
and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a
71+
UUID.
72+
6873
expiry: The date after which the upload will not be accepted. Minimum: Now + 2 minutes.
6974
Maximum: Now + 6 hours.
7075
@@ -87,6 +92,7 @@ def create(
8792
f"/accounts/{account_id}/images/v2/direct_upload",
8893
body=maybe_transform(
8994
{
95+
"id": id,
9096
"expiry": expiry,
9197
"metadata": metadata,
9298
"require_signed_urls": require_signed_urls,
@@ -117,6 +123,7 @@ async def create(
117123
self,
118124
*,
119125
account_id: str,
126+
id: str | NotGiven = NOT_GIVEN,
120127
expiry: Union[str, datetime] | NotGiven = NOT_GIVEN,
121128
metadata: object | NotGiven = NOT_GIVEN,
122129
require_signed_urls: bool | NotGiven = NOT_GIVEN,
@@ -140,6 +147,10 @@ async def create(
140147
Args:
141148
account_id: Account identifier tag.
142149
150+
id: Optional Image Custom ID. Up to 1024 chars. Can include any number of subpaths,
151+
and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a
152+
UUID.
153+
143154
expiry: The date after which the upload will not be accepted. Minimum: Now + 2 minutes.
144155
Maximum: Now + 6 hours.
145156
@@ -162,6 +173,7 @@ async def create(
162173
f"/accounts/{account_id}/images/v2/direct_upload",
163174
body=await async_maybe_transform(
164175
{
176+
"id": id,
165177
"expiry": expiry,
166178
"metadata": metadata,
167179
"require_signed_urls": require_signed_urls,

src/cloudflare/types/images/v2/direct_upload_create_params.py

+7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ class DirectUploadCreateParams(TypedDict, total=False):
1515
account_id: Required[str]
1616
"""Account identifier tag."""
1717

18+
id: str
19+
"""Optional Image Custom ID.
20+
21+
Up to 1024 chars. Can include any number of subpaths, and utf8 characters.
22+
Cannot start nor end with a / (forward slash). Cannot be a UUID.
23+
"""
24+
1825
expiry: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
1926
"""The date after which the upload will not be accepted.
2027

tests/api_resources/images/v2/test_direct_uploads.py

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def test_method_create(self, client: Cloudflare) -> None:
3131
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
3232
direct_upload = client.images.v2.direct_uploads.create(
3333
account_id="023e105f4ecef8ad9ca31a8372d0c353",
34+
id="this/is/my-customid",
3435
expiry=parse_datetime("2021-01-02T02:20:00Z"),
3536
metadata={},
3637
require_signed_urls=True,
@@ -88,6 +89,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
8889
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
8990
direct_upload = await async_client.images.v2.direct_uploads.create(
9091
account_id="023e105f4ecef8ad9ca31a8372d0c353",
92+
id="this/is/my-customid",
9193
expiry=parse_datetime("2021-01-02T02:20:00Z"),
9294
metadata={},
9395
require_signed_urls=True,

0 commit comments

Comments
 (0)