Skip to content

Commit 4ab783f

Browse files
feat(api): api update
1 parent 094a1c0 commit 4ab783f

13 files changed

Lines changed: 82 additions & 3 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: 1775
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f759309b015ca845e3ba5577121deedfa5cce762cb1df35e6bf2d846f485cf59.yml
3-
openapi_spec_hash: 5fcc8f88643596819d2afd717be92c53
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-59241dbd4fa8b7b8cca89221a611c2b835cdb65ffb8e0c6f2626581cdafb5280.yml
3+
openapi_spec_hash: e1b565911799ceedcc1aec7b0d3ced13
44
config_hash: 4a37da9893560914a7ac1a75cc01202a

src/cloudflare/resources/images/v1/v1.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
import typing_extensions
6-
from typing import Any, Type, Mapping, cast
6+
from typing import Any, Type, Mapping, Optional, cast
77

88
import httpx
99

@@ -101,6 +101,7 @@ def create(
101101
*,
102102
account_id: str,
103103
id: str | NotGiven = NOT_GIVEN,
104+
creator: str | NotGiven = NOT_GIVEN,
104105
file: FileTypes | NotGiven = NOT_GIVEN,
105106
metadata: object | NotGiven = NOT_GIVEN,
106107
require_signed_urls: bool | NotGiven = NOT_GIVEN,
@@ -122,6 +123,8 @@ def create(
122123
123124
id: An optional custom unique identifier for your image.
124125
126+
creator: Can set the creator field with an internal user ID.
127+
125128
file: An image binary data. Only needed when type is uploading a file.
126129
127130
metadata: User modifiable key-value store. Can use used for keeping references to another
@@ -145,6 +148,7 @@ def create(
145148
body = deepcopy_minimal(
146149
{
147150
"id": id,
151+
"creator": creator,
148152
"file": file,
149153
"metadata": metadata,
150154
"require_signed_urls": require_signed_urls,
@@ -175,6 +179,7 @@ def list(
175179
self,
176180
*,
177181
account_id: str,
182+
creator: Optional[str] | NotGiven = NOT_GIVEN,
178183
page: float | NotGiven = NOT_GIVEN,
179184
per_page: float | NotGiven = NOT_GIVEN,
180185
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -192,6 +197,9 @@ def list(
192197
Args:
193198
account_id: Account identifier tag.
194199
200+
creator: Internal user ID set within the creator field. Setting to empty string "" will
201+
return images where creator field is not set
202+
195203
page: Page number of paginated results.
196204
197205
per_page: Number of items per page.
@@ -216,6 +224,7 @@ def list(
216224
timeout=timeout,
217225
query=maybe_transform(
218226
{
227+
"creator": creator,
219228
"page": page,
220229
"per_page": per_page,
221230
},
@@ -281,6 +290,7 @@ def edit(
281290
image_id: str,
282291
*,
283292
account_id: str,
293+
creator: str | NotGiven = NOT_GIVEN,
284294
metadata: object | NotGiven = NOT_GIVEN,
285295
require_signed_urls: bool | NotGiven = NOT_GIVEN,
286296
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -300,6 +310,8 @@ def edit(
300310
301311
image_id: Image unique identifier.
302312
313+
creator: Can set the creator field with an internal user ID.
314+
303315
metadata: User modifiable key-value store. Can be used for keeping references to another
304316
system of record for managing images. No change if not specified.
305317
@@ -323,6 +335,7 @@ def edit(
323335
f"/accounts/{account_id}/images/v1/{image_id}",
324336
body=maybe_transform(
325337
{
338+
"creator": creator,
326339
"metadata": metadata,
327340
"require_signed_urls": require_signed_urls,
328341
},
@@ -424,6 +437,7 @@ async def create(
424437
*,
425438
account_id: str,
426439
id: str | NotGiven = NOT_GIVEN,
440+
creator: str | NotGiven = NOT_GIVEN,
427441
file: FileTypes | NotGiven = NOT_GIVEN,
428442
metadata: object | NotGiven = NOT_GIVEN,
429443
require_signed_urls: bool | NotGiven = NOT_GIVEN,
@@ -445,6 +459,8 @@ async def create(
445459
446460
id: An optional custom unique identifier for your image.
447461
462+
creator: Can set the creator field with an internal user ID.
463+
448464
file: An image binary data. Only needed when type is uploading a file.
449465
450466
metadata: User modifiable key-value store. Can use used for keeping references to another
@@ -468,6 +484,7 @@ async def create(
468484
body = deepcopy_minimal(
469485
{
470486
"id": id,
487+
"creator": creator,
471488
"file": file,
472489
"metadata": metadata,
473490
"require_signed_urls": require_signed_urls,
@@ -498,6 +515,7 @@ def list(
498515
self,
499516
*,
500517
account_id: str,
518+
creator: Optional[str] | NotGiven = NOT_GIVEN,
501519
page: float | NotGiven = NOT_GIVEN,
502520
per_page: float | NotGiven = NOT_GIVEN,
503521
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -515,6 +533,9 @@ def list(
515533
Args:
516534
account_id: Account identifier tag.
517535
536+
creator: Internal user ID set within the creator field. Setting to empty string "" will
537+
return images where creator field is not set
538+
518539
page: Page number of paginated results.
519540
520541
per_page: Number of items per page.
@@ -539,6 +560,7 @@ def list(
539560
timeout=timeout,
540561
query=maybe_transform(
541562
{
563+
"creator": creator,
542564
"page": page,
543565
"per_page": per_page,
544566
},
@@ -604,6 +626,7 @@ async def edit(
604626
image_id: str,
605627
*,
606628
account_id: str,
629+
creator: str | NotGiven = NOT_GIVEN,
607630
metadata: object | NotGiven = NOT_GIVEN,
608631
require_signed_urls: bool | NotGiven = NOT_GIVEN,
609632
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -623,6 +646,8 @@ async def edit(
623646
624647
image_id: Image unique identifier.
625648
649+
creator: Can set the creator field with an internal user ID.
650+
626651
metadata: User modifiable key-value store. Can be used for keeping references to another
627652
system of record for managing images. No change if not specified.
628653
@@ -646,6 +671,7 @@ async def edit(
646671
f"/accounts/{account_id}/images/v1/{image_id}",
647672
body=await async_maybe_transform(
648673
{
674+
"creator": creator,
649675
"metadata": metadata,
650676
"require_signed_urls": require_signed_urls,
651677
},

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def create(
5050
*,
5151
account_id: str,
5252
id: str | NotGiven = NOT_GIVEN,
53+
creator: str | NotGiven = NOT_GIVEN,
5354
expiry: Union[str, datetime] | NotGiven = NOT_GIVEN,
5455
metadata: object | NotGiven = NOT_GIVEN,
5556
require_signed_urls: bool | NotGiven = NOT_GIVEN,
@@ -77,6 +78,8 @@ def create(
7778
and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a
7879
UUID.
7980
81+
creator: Can set the creator field with an internal user ID.
82+
8083
expiry: The date after which the upload will not be accepted. Minimum: Now + 2 minutes.
8184
Maximum: Now + 6 hours.
8285
@@ -104,6 +107,7 @@ def create(
104107
body=maybe_transform(
105108
{
106109
"id": id,
110+
"creator": creator,
107111
"expiry": expiry,
108112
"metadata": metadata,
109113
"require_signed_urls": require_signed_urls,
@@ -146,6 +150,7 @@ async def create(
146150
*,
147151
account_id: str,
148152
id: str | NotGiven = NOT_GIVEN,
153+
creator: str | NotGiven = NOT_GIVEN,
149154
expiry: Union[str, datetime] | NotGiven = NOT_GIVEN,
150155
metadata: object | NotGiven = NOT_GIVEN,
151156
require_signed_urls: bool | NotGiven = NOT_GIVEN,
@@ -173,6 +178,8 @@ async def create(
173178
and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a
174179
UUID.
175180
181+
creator: Can set the creator field with an internal user ID.
182+
176183
expiry: The date after which the upload will not be accepted. Minimum: Now + 2 minutes.
177184
Maximum: Now + 6 hours.
178185
@@ -200,6 +207,7 @@ async def create(
200207
body=await async_maybe_transform(
201208
{
202209
"id": id,
210+
"creator": creator,
203211
"expiry": expiry,
204212
"metadata": metadata,
205213
"require_signed_urls": require_signed_urls,

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def list(
6262
*,
6363
account_id: str,
6464
continuation_token: Optional[str] | NotGiven = NOT_GIVEN,
65+
creator: Optional[str] | NotGiven = NOT_GIVEN,
6566
per_page: float | NotGiven = NOT_GIVEN,
6667
sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
6768
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -82,6 +83,9 @@ def list(
8283
8384
continuation_token: Continuation token for a next page. List images V2 returns continuation_token
8485
86+
creator: Internal user ID set within the creator field. Setting to empty string "" will
87+
return images where creator field is not set
88+
8589
per_page: Number of items per page.
8690
8791
sort_order: Sorting order by upload time.
@@ -106,6 +110,7 @@ def list(
106110
query=maybe_transform(
107111
{
108112
"continuation_token": continuation_token,
113+
"creator": creator,
109114
"per_page": per_page,
110115
"sort_order": sort_order,
111116
},
@@ -146,6 +151,7 @@ async def list(
146151
*,
147152
account_id: str,
148153
continuation_token: Optional[str] | NotGiven = NOT_GIVEN,
154+
creator: Optional[str] | NotGiven = NOT_GIVEN,
149155
per_page: float | NotGiven = NOT_GIVEN,
150156
sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
151157
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -166,6 +172,9 @@ async def list(
166172
167173
continuation_token: Continuation token for a next page. List images V2 returns continuation_token
168174
175+
creator: Internal user ID set within the creator field. Setting to empty string "" will
176+
return images where creator field is not set
177+
169178
per_page: Number of items per page.
170179
171180
sort_order: Sorting order by upload time.
@@ -190,6 +199,7 @@ async def list(
190199
query=await async_maybe_transform(
191200
{
192201
"continuation_token": continuation_token,
202+
"creator": creator,
193203
"per_page": per_page,
194204
"sort_order": sort_order,
195205
},

src/cloudflare/types/images/image.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ class Image(BaseModel):
1414
id: Optional[str] = None
1515
"""Image unique identifier."""
1616

17+
creator: Optional[str] = None
18+
"""Can set the creator field with an internal user ID."""
19+
1720
filename: Optional[str] = None
1821
"""Image file name."""
1922

src/cloudflare/types/images/v1_create_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ class V1CreateParams(TypedDict, total=False):
1717
id: str
1818
"""An optional custom unique identifier for your image."""
1919

20+
creator: str
21+
"""Can set the creator field with an internal user ID."""
22+
2023
file: FileTypes
2124
"""An image binary data. Only needed when type is uploading a file."""
2225

src/cloudflare/types/images/v1_edit_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ class V1EditParams(TypedDict, total=False):
1313
account_id: Required[str]
1414
"""Account identifier tag."""
1515

16+
creator: str
17+
"""Can set the creator field with an internal user ID."""
18+
1619
metadata: object
1720
"""User modifiable key-value store.
1821

src/cloudflare/types/images/v1_list_params.py

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

33
from __future__ import annotations
44

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

78
__all__ = ["V1ListParams"]
@@ -11,6 +12,12 @@ class V1ListParams(TypedDict, total=False):
1112
account_id: Required[str]
1213
"""Account identifier tag."""
1314

15+
creator: Optional[str]
16+
"""Internal user ID set within the creator field.
17+
18+
Setting to empty string "" will return images where creator field is not set
19+
"""
20+
1421
page: float
1522
"""Page number of paginated results."""
1623

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class DirectUploadCreateParams(TypedDict, total=False):
2222
Cannot start nor end with a / (forward slash). Cannot be a UUID.
2323
"""
2424

25+
creator: str
26+
"""Can set the creator field with an internal user ID."""
27+
2528
expiry: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
2629
"""The date after which the upload will not be accepted.
2730

src/cloudflare/types/images/v2_list_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ class V2ListParams(TypedDict, total=False):
1515
continuation_token: Optional[str]
1616
"""Continuation token for a next page. List images V2 returns continuation_token"""
1717

18+
creator: Optional[str]
19+
"""Internal user ID set within the creator field.
20+
21+
Setting to empty string "" will return images where creator field is not set
22+
"""
23+
1824
per_page: float
1925
"""Number of items per page."""
2026

0 commit comments

Comments
 (0)