Skip to content

Commit 4c6cda0

Browse files
feat(api): api update
1 parent 0114564 commit 4c6cda0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+466
-427
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1752
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-29174d64a61919dbdebbd0c8d4ab3cb5eec6f9aacff888bdd0469ba2b8d08019.yml
3-
openapi_spec_hash: b5909bd6882171a6ff0158b9f68b47cc
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0d0950b4d6565ebd937ab7f58c20ec77ed448ada47e892675290ed602d1f1e5d.yml
3+
openapi_spec_hash: 3471c05655ab2e06b07d7bab145428fa
44
config_hash: cce40d4d65a4d67d5df957a75a15b567

api.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2570,15 +2570,9 @@ Methods:
25702570

25712571
### Metadata
25722572

2573-
Types:
2574-
2575-
```python
2576-
from cloudflare.types.kv.namespaces import MetadataGetResponse
2577-
```
2578-
25792573
Methods:
25802574

2581-
- <code title="get /accounts/{account_id}/storage/kv/namespaces/{namespace_id}/metadata/{key_name}">client.kv.namespaces.metadata.<a href="./src/cloudflare/resources/kv/namespaces/metadata.py">get</a>(key_name, \*, account_id, namespace_id) -> <a href="./src/cloudflare/types/kv/namespaces/metadata_get_response.py">Optional[MetadataGetResponse]</a></code>
2575+
- <code title="get /accounts/{account_id}/storage/kv/namespaces/{namespace_id}/metadata/{key_name}">client.kv.namespaces.metadata.<a href="./src/cloudflare/resources/kv/namespaces/metadata.py">get</a>(key_name, \*, account_id, namespace_id) -> object</code>
25822576

25832577
### Values
25842578

src/cloudflare/resources/cloudforce_one/threat_events/threat_events.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,15 @@ def create(
203203
self,
204204
*,
205205
path_account_id: str,
206-
attacker: str,
207-
attacker_country: str,
208206
category: str,
209207
date: Union[str, datetime],
210208
event: str,
211209
indicator_type: str,
212210
raw: threat_event_create_params.Raw,
213211
tlp: str,
214212
body_account_id: float | NotGiven = NOT_GIVEN,
213+
attacker: str | NotGiven = NOT_GIVEN,
214+
attacker_country: str | NotGiven = NOT_GIVEN,
215215
dataset_id: str | NotGiven = NOT_GIVEN,
216216
indicator: str | NotGiven = NOT_GIVEN,
217217
tags: List[str] | NotGiven = NOT_GIVEN,
@@ -247,15 +247,15 @@ def create(
247247
f"/accounts/{path_account_id}/cloudforce-one/events/create",
248248
body=maybe_transform(
249249
{
250-
"attacker": attacker,
251-
"attacker_country": attacker_country,
252250
"category": category,
253251
"date": date,
254252
"event": event,
255253
"indicator_type": indicator_type,
256254
"raw": raw,
257255
"tlp": tlp,
258256
"body_account_id": body_account_id,
257+
"attacker": attacker,
258+
"attacker_country": attacker_country,
259259
"dataset_id": dataset_id,
260260
"indicator": indicator,
261261
"tags": tags,
@@ -600,15 +600,15 @@ async def create(
600600
self,
601601
*,
602602
path_account_id: str,
603-
attacker: str,
604-
attacker_country: str,
605603
category: str,
606604
date: Union[str, datetime],
607605
event: str,
608606
indicator_type: str,
609607
raw: threat_event_create_params.Raw,
610608
tlp: str,
611609
body_account_id: float | NotGiven = NOT_GIVEN,
610+
attacker: str | NotGiven = NOT_GIVEN,
611+
attacker_country: str | NotGiven = NOT_GIVEN,
612612
dataset_id: str | NotGiven = NOT_GIVEN,
613613
indicator: str | NotGiven = NOT_GIVEN,
614614
tags: List[str] | NotGiven = NOT_GIVEN,
@@ -644,15 +644,15 @@ async def create(
644644
f"/accounts/{path_account_id}/cloudforce-one/events/create",
645645
body=await async_maybe_transform(
646646
{
647-
"attacker": attacker,
648-
"attacker_country": attacker_country,
649647
"category": category,
650648
"date": date,
651649
"event": event,
652650
"indicator_type": indicator_type,
653651
"raw": raw,
654652
"tlp": tlp,
655653
"body_account_id": body_account_id,
654+
"attacker": attacker,
655+
"attacker_country": attacker_country,
656656
"dataset_id": dataset_id,
657657
"indicator": indicator,
658658
"tags": tags,

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def create(
100100
self,
101101
*,
102102
account_id: str,
103+
id: object | NotGiven = NOT_GIVEN,
103104
file: object | NotGiven = NOT_GIVEN,
104105
metadata: object | NotGiven = NOT_GIVEN,
105106
require_signed_urls: bool | NotGiven = NOT_GIVEN,
@@ -119,6 +120,8 @@ def create(
119120
Args:
120121
account_id: Account identifier tag.
121122
123+
id: An optional custom unique identifier for your image.
124+
122125
file: An image binary data. Only needed when type is uploading a file.
123126
124127
metadata: User modifiable key-value store. Can use used for keeping references to another
@@ -147,6 +150,7 @@ def create(
147150
f"/accounts/{account_id}/images/v1",
148151
body=maybe_transform(
149152
{
153+
"id": id,
150154
"file": file,
151155
"metadata": metadata,
152156
"require_signed_urls": require_signed_urls,
@@ -417,6 +421,7 @@ async def create(
417421
self,
418422
*,
419423
account_id: str,
424+
id: object | NotGiven = NOT_GIVEN,
420425
file: object | NotGiven = NOT_GIVEN,
421426
metadata: object | NotGiven = NOT_GIVEN,
422427
require_signed_urls: bool | NotGiven = NOT_GIVEN,
@@ -436,6 +441,8 @@ async def create(
436441
Args:
437442
account_id: Account identifier tag.
438443
444+
id: An optional custom unique identifier for your image.
445+
439446
file: An image binary data. Only needed when type is uploading a file.
440447
441448
metadata: User modifiable key-value store. Can use used for keeping references to another
@@ -464,6 +471,7 @@ async def create(
464471
f"/accounts/{account_id}/images/v1",
465472
body=await async_maybe_transform(
466473
{
474+
"id": id,
467475
"file": file,
468476
"metadata": metadata,
469477
"require_signed_urls": require_signed_urls,

src/cloudflare/resources/kv/namespaces/keys.py

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def list(
6969
Lists a namespace's keys.
7070
7171
Args:
72-
account_id: Identifier
72+
account_id: Identifier.
7373
7474
namespace_id: Namespace identifier tag.
7575
@@ -78,11 +78,11 @@ def list(
7878
parameter. A valid value for the cursor can be obtained from the `cursors`
7979
object in the `result_info` structure.
8080
81-
limit: The number of keys to return. The cursor attribute may be used to iterate over
82-
the next batch of keys if there are more than the limit.
81+
limit: Limits the number of keys returned in the response. The cursor attribute may be
82+
used to iterate over the next batch of keys if there are more than the limit.
8383
84-
prefix: A string prefix used to filter down which keys will be returned. Exact matches
85-
and any key names that begin with the prefix will be returned.
84+
prefix: Filters returned keys by a name prefix. Exact matches and any key names that
85+
begin with the prefix will be returned.
8686
8787
extra_headers: Send extra headers
8888
@@ -136,7 +136,7 @@ def bulk_delete(
136136
10,000 keys to be removed.
137137
138138
Args:
139-
account_id: Identifier
139+
account_id: Identifier.
140140
141141
namespace_id: Namespace identifier tag.
142142
@@ -181,23 +181,22 @@ def bulk_get(
181181
extra_body: Body | None = None,
182182
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
183183
) -> Optional[KeyBulkGetResponse]:
184-
"""Get multiple KV pairs from the namespace.
184+
"""Retrieve up to 100 KV pairs from the namespace.
185185
186-
Body should contain keys to retrieve
187-
at most 100. Keys must contain text-based values. If value is json, it can be
188-
requested to return in JSON, instead of string. Metadata can be return if
189-
withMetadata is true.
186+
Keys must contain text-based
187+
values. JSON values can optionally be parsed instead of being returned as a
188+
string value. Metadata can be included if `withMetadata` is true.
190189
191190
Args:
192-
account_id: Identifier
191+
account_id: Identifier.
193192
194193
namespace_id: Namespace identifier tag.
195194
196-
keys: Array of keys to retrieve (maximum 100)
195+
keys: Array of keys to retrieve (maximum of 100).
197196
198-
type: Whether to parse JSON values in the response
197+
type: Whether to parse JSON values in the response.
199198
200-
with_metadata: Whether to include metadata in the response
199+
with_metadata: Whether to include metadata in the response.
201200
202201
extra_headers: Send extra headers
203202
@@ -260,7 +259,7 @@ def bulk_update(
260259
size must be 100 megabytes or less.
261260
262261
Args:
263-
account_id: Identifier
262+
account_id: Identifier.
264263
265264
namespace_id: Namespace identifier tag.
266265
@@ -329,7 +328,7 @@ def list(
329328
Lists a namespace's keys.
330329
331330
Args:
332-
account_id: Identifier
331+
account_id: Identifier.
333332
334333
namespace_id: Namespace identifier tag.
335334
@@ -338,11 +337,11 @@ def list(
338337
parameter. A valid value for the cursor can be obtained from the `cursors`
339338
object in the `result_info` structure.
340339
341-
limit: The number of keys to return. The cursor attribute may be used to iterate over
342-
the next batch of keys if there are more than the limit.
340+
limit: Limits the number of keys returned in the response. The cursor attribute may be
341+
used to iterate over the next batch of keys if there are more than the limit.
343342
344-
prefix: A string prefix used to filter down which keys will be returned. Exact matches
345-
and any key names that begin with the prefix will be returned.
343+
prefix: Filters returned keys by a name prefix. Exact matches and any key names that
344+
begin with the prefix will be returned.
346345
347346
extra_headers: Send extra headers
348347
@@ -396,7 +395,7 @@ async def bulk_delete(
396395
10,000 keys to be removed.
397396
398397
Args:
399-
account_id: Identifier
398+
account_id: Identifier.
400399
401400
namespace_id: Namespace identifier tag.
402401
@@ -441,23 +440,22 @@ async def bulk_get(
441440
extra_body: Body | None = None,
442441
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
443442
) -> Optional[KeyBulkGetResponse]:
444-
"""Get multiple KV pairs from the namespace.
443+
"""Retrieve up to 100 KV pairs from the namespace.
445444
446-
Body should contain keys to retrieve
447-
at most 100. Keys must contain text-based values. If value is json, it can be
448-
requested to return in JSON, instead of string. Metadata can be return if
449-
withMetadata is true.
445+
Keys must contain text-based
446+
values. JSON values can optionally be parsed instead of being returned as a
447+
string value. Metadata can be included if `withMetadata` is true.
450448
451449
Args:
452-
account_id: Identifier
450+
account_id: Identifier.
453451
454452
namespace_id: Namespace identifier tag.
455453
456-
keys: Array of keys to retrieve (maximum 100)
454+
keys: Array of keys to retrieve (maximum of 100).
457455
458-
type: Whether to parse JSON values in the response
456+
type: Whether to parse JSON values in the response.
459457
460-
with_metadata: Whether to include metadata in the response
458+
with_metadata: Whether to include metadata in the response.
461459
462460
extra_headers: Send extra headers
463461
@@ -520,7 +518,7 @@ async def bulk_update(
520518
size must be 100 megabytes or less.
521519
522520
Args:
523-
account_id: Identifier
521+
account_id: Identifier.
524522
525523
namespace_id: Namespace identifier tag.
526524

src/cloudflare/resources/kv/namespaces/metadata.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
)
1818
from ...._wrappers import ResultWrapper
1919
from ...._base_client import make_request_options
20-
from ....types.kv.namespaces.metadata_get_response import MetadataGetResponse
2120

2221
__all__ = ["MetadataResource", "AsyncMetadataResource"]
2322

@@ -54,15 +53,15 @@ def get(
5453
extra_query: Query | None = None,
5554
extra_body: Body | None = None,
5655
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
57-
) -> Optional[MetadataGetResponse]:
56+
) -> object:
5857
"""Returns the metadata associated with the given key in the given namespace.
5958
6059
Use
6160
URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key
6261
name.
6362
6463
Args:
65-
account_id: Identifier
64+
account_id: Identifier.
6665
6766
namespace_id: Namespace identifier tag.
6867
@@ -90,9 +89,9 @@ def get(
9089
extra_query=extra_query,
9190
extra_body=extra_body,
9291
timeout=timeout,
93-
post_parser=ResultWrapper[Optional[MetadataGetResponse]]._unwrapper,
92+
post_parser=ResultWrapper[Optional[object]]._unwrapper,
9493
),
95-
cast_to=cast(Type[Optional[MetadataGetResponse]], ResultWrapper[MetadataGetResponse]),
94+
cast_to=cast(Type[object], ResultWrapper[object]),
9695
)
9796

9897

@@ -128,15 +127,15 @@ async def get(
128127
extra_query: Query | None = None,
129128
extra_body: Body | None = None,
130129
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
131-
) -> Optional[MetadataGetResponse]:
130+
) -> object:
132131
"""Returns the metadata associated with the given key in the given namespace.
133132
134133
Use
135134
URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key
136135
name.
137136
138137
Args:
139-
account_id: Identifier
138+
account_id: Identifier.
140139
141140
namespace_id: Namespace identifier tag.
142141
@@ -164,9 +163,9 @@ async def get(
164163
extra_query=extra_query,
165164
extra_body=extra_body,
166165
timeout=timeout,
167-
post_parser=ResultWrapper[Optional[MetadataGetResponse]]._unwrapper,
166+
post_parser=ResultWrapper[Optional[object]]._unwrapper,
168167
),
169-
cast_to=cast(Type[Optional[MetadataGetResponse]], ResultWrapper[MetadataGetResponse]),
168+
cast_to=cast(Type[object], ResultWrapper[object]),
170169
)
171170

172171

0 commit comments

Comments
 (0)