Skip to content

Commit 33b5aba

Browse files
feat(api): api update
1 parent c5b4600 commit 33b5aba

52 files changed

Lines changed: 628 additions & 1480 deletions

Some content is hidden

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

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 1783
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml
3-
openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81
1+
configured_endpoints: 1781
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2c42cf957e3b5a69a156a53aff688afcbefc8b3d47d588ece03224d14a520b99.yml
3+
openapi_spec_hash: 3489d7f7afa926c1b377c245812fd27d
44
config_hash: a433f3793b734bc6fcc9d9e0c27ff8c2

api.md

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,17 +1594,17 @@ Methods:
15941594
Types:
15951595

15961596
```python
1597-
from cloudflare.types.filters import FirewallFilter
1597+
from cloudflare.types.filters import FirewallFilter, FilterDeleteResponse, FilterBulkDeleteResponse
15981598
```
15991599

16001600
Methods:
16011601

16021602
- <code title="post /zones/{zone_id}/filters">client.filters.<a href="./src/cloudflare/resources/filters.py">create</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/filters/filter_create_params.py">params</a>) -> <a href="./src/cloudflare/types/filters/firewall_filter.py">SyncSinglePage[FirewallFilter]</a></code>
16031603
- <code title="put /zones/{zone_id}/filters/{filter_id}">client.filters.<a href="./src/cloudflare/resources/filters.py">update</a>(filter_id, \*, zone_id, \*\*<a href="src/cloudflare/types/filters/filter_update_params.py">params</a>) -> <a href="./src/cloudflare/types/filters/firewall_filter.py">FirewallFilter</a></code>
16041604
- <code title="get /zones/{zone_id}/filters">client.filters.<a href="./src/cloudflare/resources/filters.py">list</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/filters/filter_list_params.py">params</a>) -> <a href="./src/cloudflare/types/filters/firewall_filter.py">SyncV4PagePaginationArray[FirewallFilter]</a></code>
1605-
- <code title="delete /zones/{zone_id}/filters/{filter_id}">client.filters.<a href="./src/cloudflare/resources/filters.py">delete</a>(filter_id, \*, zone_id) -> <a href="./src/cloudflare/types/filters/firewall_filter.py">FirewallFilter</a></code>
1606-
- <code title="delete /zones/{zone_id}/filters">client.filters.<a href="./src/cloudflare/resources/filters.py">bulk_delete</a>(\*, zone_id) -> <a href="./src/cloudflare/types/filters/firewall_filter.py">SyncSinglePage[FirewallFilter]</a></code>
1607-
- <code title="put /zones/{zone_id}/filters">client.filters.<a href="./src/cloudflare/resources/filters.py">bulk_update</a>(\*, zone_id) -> <a href="./src/cloudflare/types/filters/firewall_filter.py">SyncSinglePage[FirewallFilter]</a></code>
1605+
- <code title="delete /zones/{zone_id}/filters/{filter_id}">client.filters.<a href="./src/cloudflare/resources/filters.py">delete</a>(filter_id, \*, zone_id) -> <a href="./src/cloudflare/types/filters/filter_delete_response.py">FilterDeleteResponse</a></code>
1606+
- <code title="delete /zones/{zone_id}/filters">client.filters.<a href="./src/cloudflare/resources/filters.py">bulk_delete</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/filters/filter_bulk_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/filters/filter_bulk_delete_response.py">Optional[FilterBulkDeleteResponse]</a></code>
1607+
- <code title="put /zones/{zone_id}/filters">client.filters.<a href="./src/cloudflare/resources/filters.py">bulk_update</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/filters/filter_bulk_update_params.py">params</a>) -> <a href="./src/cloudflare/types/filters/firewall_filter.py">SyncSinglePage[FirewallFilter]</a></code>
16081608
- <code title="get /zones/{zone_id}/filters/{filter_id}">client.filters.<a href="./src/cloudflare/resources/filters.py">get</a>(filter_id, \*, zone_id) -> <a href="./src/cloudflare/types/filters/firewall_filter.py">FirewallFilter</a></code>
16091609

16101610
# Firewall
@@ -7241,32 +7241,6 @@ Methods:
72417241
- <code title="get /radar/ai/inference/timeseries_groups/model">client.radar.ai.inference.timeseries_groups.summary.<a href="./src/cloudflare/resources/radar/ai/inference/timeseries_groups/summary.py">model</a>(\*\*<a href="src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_params.py">params</a>) -> <a href="./src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_response.py">SummaryModelResponse</a></code>
72427242
- <code title="get /radar/ai/inference/timeseries_groups/task">client.radar.ai.inference.timeseries_groups.summary.<a href="./src/cloudflare/resources/radar/ai/inference/timeseries_groups/summary.py">task</a>(\*\*<a href="src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_params.py">params</a>) -> <a href="./src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_response.py">SummaryTaskResponse</a></code>
72437243

7244-
### Bots
7245-
7246-
#### Summary
7247-
7248-
Types:
7249-
7250-
```python
7251-
from cloudflare.types.radar.ai.bots import SummaryUserAgentResponse
7252-
```
7253-
7254-
Methods:
7255-
7256-
- <code title="get /radar/ai/bots/summary/user_agent">client.radar.ai.bots.summary.<a href="./src/cloudflare/resources/radar/ai/bots/summary.py">user_agent</a>(\*\*<a href="src/cloudflare/types/radar/ai/bots/summary_user_agent_params.py">params</a>) -> <a href="./src/cloudflare/types/radar/ai/bots/summary_user_agent_response.py">SummaryUserAgentResponse</a></code>
7257-
7258-
### TimeseriesGroups
7259-
7260-
Types:
7261-
7262-
```python
7263-
from cloudflare.types.radar.ai import TimeseriesGroupUserAgentResponse
7264-
```
7265-
7266-
Methods:
7267-
7268-
- <code title="get /radar/ai/bots/timeseries_groups/user_agent">client.radar.ai.timeseries_groups.<a href="./src/cloudflare/resources/radar/ai/timeseries_groups.py">user_agent</a>(\*\*<a href="src/cloudflare/types/radar/ai/timeseries_group_user_agent_params.py">params</a>) -> <a href="./src/cloudflare/types/radar/ai/timeseries_group_user_agent_response.py">TimeseriesGroupUserAgentResponse</a></code>
7269-
72707244
## Annotations
72717245

72727246
Types:

src/cloudflare/resources/ai/ai.py

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,45 @@ def run(
875875
"""
876876
...
877877

878+
@overload
879+
def run(
880+
self,
881+
model_name: str,
882+
*,
883+
account_id: str,
884+
image: str | NotGiven = NOT_GIVEN,
885+
text: List[str] | NotGiven = NOT_GIVEN,
886+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
887+
# The extra values given here take precedence over values defined on the client or passed to this method.
888+
extra_headers: Headers | None = None,
889+
extra_query: Query | None = None,
890+
extra_body: Body | None = None,
891+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
892+
) -> Optional[AIRunResponse]:
893+
"""
894+
This endpoint provides users with the capability to run specific AI models
895+
on-demand.
896+
897+
By submitting the required input data, users can receive real-time predictions
898+
or results generated by the chosen AI model. The endpoint supports various AI
899+
model types, ensuring flexibility and adaptability for diverse use cases.
900+
901+
Model specific inputs available in
902+
[Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/).
903+
904+
Args:
905+
image: Image in base64 encoded format.
906+
907+
extra_headers: Send extra headers
908+
909+
extra_query: Add additional query parameters to the request
910+
911+
extra_body: Add additional JSON properties to the request
912+
913+
timeout: Override the client-level default timeout for this request, in seconds
914+
"""
915+
...
916+
878917
@required_args(
879918
["account_id", "text"],
880919
["account_id", "prompt"],
@@ -892,7 +931,7 @@ def run(
892931
model_name: str,
893932
*,
894933
account_id: str,
895-
text: str | Union[str, List[str]] | NotGiven = NOT_GIVEN,
934+
text: str | Union[str, List[str]] | List[str] | NotGiven = NOT_GIVEN,
896935
prompt: str | NotGiven = NOT_GIVEN,
897936
guidance: float | NotGiven = NOT_GIVEN,
898937
height: int | NotGiven = NOT_GIVEN,
@@ -1810,6 +1849,45 @@ async def run(
18101849
"""
18111850
...
18121851

1852+
@overload
1853+
async def run(
1854+
self,
1855+
model_name: str,
1856+
*,
1857+
account_id: str,
1858+
image: str | NotGiven = NOT_GIVEN,
1859+
text: List[str] | NotGiven = NOT_GIVEN,
1860+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1861+
# The extra values given here take precedence over values defined on the client or passed to this method.
1862+
extra_headers: Headers | None = None,
1863+
extra_query: Query | None = None,
1864+
extra_body: Body | None = None,
1865+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1866+
) -> Optional[AIRunResponse]:
1867+
"""
1868+
This endpoint provides users with the capability to run specific AI models
1869+
on-demand.
1870+
1871+
By submitting the required input data, users can receive real-time predictions
1872+
or results generated by the chosen AI model. The endpoint supports various AI
1873+
model types, ensuring flexibility and adaptability for diverse use cases.
1874+
1875+
Model specific inputs available in
1876+
[Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/).
1877+
1878+
Args:
1879+
image: Image in base64 encoded format.
1880+
1881+
extra_headers: Send extra headers
1882+
1883+
extra_query: Add additional query parameters to the request
1884+
1885+
extra_body: Add additional JSON properties to the request
1886+
1887+
timeout: Override the client-level default timeout for this request, in seconds
1888+
"""
1889+
...
1890+
18131891
@required_args(
18141892
["account_id", "text"],
18151893
["account_id", "prompt"],
@@ -1827,7 +1905,7 @@ async def run(
18271905
model_name: str,
18281906
*,
18291907
account_id: str,
1830-
text: str | Union[str, List[str]] | NotGiven = NOT_GIVEN,
1908+
text: str | Union[str, List[str]] | List[str] | NotGiven = NOT_GIVEN,
18311909
prompt: str | NotGiven = NOT_GIVEN,
18321910
guidance: float | NotGiven = NOT_GIVEN,
18331911
height: int | NotGiven = NOT_GIVEN,

src/cloudflare/resources/browser_rendering/json.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def create(
8080
authenticate: json_create_params.Authenticate | NotGiven = NOT_GIVEN,
8181
best_attempt: bool | NotGiven = NOT_GIVEN,
8282
cookies: Iterable[json_create_params.Cookie] | NotGiven = NOT_GIVEN,
83+
custom_ai: Iterable[json_create_params.CustomAI] | NotGiven = NOT_GIVEN,
8384
emulate_media_type: str | NotGiven = NOT_GIVEN,
8485
goto_options: json_create_params.GotoOptions | NotGiven = NOT_GIVEN,
8586
html: str | NotGiven = NOT_GIVEN,
@@ -153,6 +154,10 @@ def create(
153154
154155
cookies: Check [options](https://pptr.dev/api/puppeteer.page.setcookie).
155156
157+
custom_ai: Optional list of custom AI models to use for the request. The models will be
158+
tried in the order provided, and in case a model returns an error, the next one
159+
will be used as fallback.
160+
156161
goto_options: Check [options](https://pptr.dev/api/puppeteer.gotooptions).
157162
158163
html: Set the content of the page, eg: `<h1>Hello World!!</h1>`. Either `html` or
@@ -195,6 +200,7 @@ def create(
195200
"authenticate": authenticate,
196201
"best_attempt": best_attempt,
197202
"cookies": cookies,
203+
"custom_ai": custom_ai,
198204
"emulate_media_type": emulate_media_type,
199205
"goto_options": goto_options,
200206
"html": html,
@@ -279,6 +285,7 @@ async def create(
279285
authenticate: json_create_params.Authenticate | NotGiven = NOT_GIVEN,
280286
best_attempt: bool | NotGiven = NOT_GIVEN,
281287
cookies: Iterable[json_create_params.Cookie] | NotGiven = NOT_GIVEN,
288+
custom_ai: Iterable[json_create_params.CustomAI] | NotGiven = NOT_GIVEN,
282289
emulate_media_type: str | NotGiven = NOT_GIVEN,
283290
goto_options: json_create_params.GotoOptions | NotGiven = NOT_GIVEN,
284291
html: str | NotGiven = NOT_GIVEN,
@@ -352,6 +359,10 @@ async def create(
352359
353360
cookies: Check [options](https://pptr.dev/api/puppeteer.page.setcookie).
354361
362+
custom_ai: Optional list of custom AI models to use for the request. The models will be
363+
tried in the order provided, and in case a model returns an error, the next one
364+
will be used as fallback.
365+
355366
goto_options: Check [options](https://pptr.dev/api/puppeteer.gotooptions).
356367
357368
html: Set the content of the page, eg: `<h1>Hello World!!</h1>`. Either `html` or
@@ -394,6 +405,7 @@ async def create(
394405
"authenticate": authenticate,
395406
"best_attempt": best_attempt,
396407
"cookies": cookies,
408+
"custom_ai": custom_ai,
397409
"emulate_media_type": emulate_media_type,
398410
"goto_options": goto_options,
399411
"html": html,

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

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

33
from __future__ import annotations
44

5-
from typing import List, Union, Iterable
5+
from typing import List, Union, Iterable, Optional
66
from datetime import datetime
77
from typing_extensions import Literal
88

@@ -198,7 +198,7 @@ def create(
198198
raw: threat_event_create_params.Raw,
199199
tlp: str,
200200
body_account_id: float | NotGiven = NOT_GIVEN,
201-
attacker: str | NotGiven = NOT_GIVEN,
201+
attacker: Optional[str] | NotGiven = NOT_GIVEN,
202202
attacker_country: str | NotGiven = NOT_GIVEN,
203203
dataset_id: str | NotGiven = NOT_GIVEN,
204204
indicator: str | NotGiven = NOT_GIVEN,
@@ -416,7 +416,7 @@ def edit(
416416
event_id: str,
417417
*,
418418
account_id: str,
419-
attacker: str | NotGiven = NOT_GIVEN,
419+
attacker: Optional[str] | NotGiven = NOT_GIVEN,
420420
attacker_country: str | NotGiven = NOT_GIVEN,
421421
category: str | NotGiven = NOT_GIVEN,
422422
date: Union[str, datetime] | NotGiven = NOT_GIVEN,
@@ -596,7 +596,7 @@ async def create(
596596
raw: threat_event_create_params.Raw,
597597
tlp: str,
598598
body_account_id: float | NotGiven = NOT_GIVEN,
599-
attacker: str | NotGiven = NOT_GIVEN,
599+
attacker: Optional[str] | NotGiven = NOT_GIVEN,
600600
attacker_country: str | NotGiven = NOT_GIVEN,
601601
dataset_id: str | NotGiven = NOT_GIVEN,
602602
indicator: str | NotGiven = NOT_GIVEN,
@@ -814,7 +814,7 @@ async def edit(
814814
event_id: str,
815815
*,
816816
account_id: str,
817-
attacker: str | NotGiven = NOT_GIVEN,
817+
attacker: Optional[str] | NotGiven = NOT_GIVEN,
818818
attacker_country: str | NotGiven = NOT_GIVEN,
819819
category: str | NotGiven = NOT_GIVEN,
820820
date: Union[str, datetime] | NotGiven = NOT_GIVEN,

0 commit comments

Comments
 (0)