Skip to content

Commit eb08f59

Browse files
feat(infrastructure_targets): swap DELETE handler to new endpoint
1 parent 748c4e8 commit eb08f59

File tree

14 files changed

+409
-68
lines changed

14 files changed

+409
-68
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 1741
1+
configured_endpoints: 1742
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1f49df4d8a7f775cdca0044a946f1d28f8d276e82e443b856a430ddaad809d20.yml
33
openapi_spec_hash: 6b84a57ef92b8257081b32a496821094
4-
config_hash: f6c4a93139a93cfd16a678e54b5fb249
4+
config_hash: 85703bb37ad4f7b8bfeea6f128f351a0

api.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5687,7 +5687,7 @@ Methods:
56875687
- <code title="put /accounts/{account_id}/infrastructure/targets/{target_id}">client.zero_trust.access.infrastructure.targets.<a href="./src/cloudflare/resources/zero_trust/access/infrastructure/targets.py">update</a>(target_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/access/infrastructure/target_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/access/infrastructure/target_update_response.py">Optional[TargetUpdateResponse]</a></code>
56885688
- <code title="get /accounts/{account_id}/infrastructure/targets">client.zero_trust.access.infrastructure.targets.<a href="./src/cloudflare/resources/zero_trust/access/infrastructure/targets.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/access/infrastructure/target_list_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/access/infrastructure/target_list_response.py">SyncV4PagePaginationArray[TargetListResponse]</a></code>
56895689
- <code title="delete /accounts/{account_id}/infrastructure/targets/{target_id}">client.zero_trust.access.infrastructure.targets.<a href="./src/cloudflare/resources/zero_trust/access/infrastructure/targets.py">delete</a>(target_id, \*, account_id) -> None</code>
5690-
- <code title="post /accounts/{account_id}/infrastructure/targets/batch_delete">client.zero_trust.access.infrastructure.targets.<a href="./src/cloudflare/resources/zero_trust/access/infrastructure/targets.py">bulk_delete</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/access/infrastructure/target_bulk_delete_params.py">params</a>) -> None</code>
5690+
- <code title="delete /accounts/{account_id}/infrastructure/targets/batch">client.zero_trust.access.infrastructure.targets.<a href="./src/cloudflare/resources/zero_trust/access/infrastructure/targets.py">bulk_delete</a>(\*, account_id) -> None</code>
56915691
- <code title="put /accounts/{account_id}/infrastructure/targets/batch">client.zero_trust.access.infrastructure.targets.<a href="./src/cloudflare/resources/zero_trust/access/infrastructure/targets.py">bulk_update</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/access/infrastructure/target_bulk_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/access/infrastructure/target_bulk_update_response.py">SyncSinglePage[TargetBulkUpdateResponse]</a></code>
56925692
- <code title="get /accounts/{account_id}/infrastructure/targets/{target_id}">client.zero_trust.access.infrastructure.targets.<a href="./src/cloudflare/resources/zero_trust/access/infrastructure/targets.py">get</a>(target_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/access/infrastructure/target_get_response.py">Optional[TargetGetResponse]</a></code>
56935693

@@ -9043,11 +9043,23 @@ from cloudflare.types.cloudforce_one.threat_events import (
90439043

90449044
Methods:
90459045

9046-
- <code title="post /accounts/{account_id}/cloudforce-one/events/dataset/create">client.cloudforce_one.threat_events.datasets.<a href="./src/cloudflare/resources/cloudforce_one/threat_events/datasets.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/cloudforce_one/threat_events/dataset_create_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/threat_events/dataset_create_response.py">DatasetCreateResponse</a></code>
9047-
- <code title="get /accounts/{account_id}/cloudforce-one/events/dataset">client.cloudforce_one.threat_events.datasets.<a href="./src/cloudflare/resources/cloudforce_one/threat_events/datasets.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/cloudforce_one/threat_events/dataset_list_response.py">DatasetListResponse</a></code>
9048-
- <code title="patch /accounts/{account_id}/cloudforce-one/events/dataset/{dataset_id}">client.cloudforce_one.threat_events.datasets.<a href="./src/cloudflare/resources/cloudforce_one/threat_events/datasets.py">edit</a>(dataset_id, \*, account_id, \*\*<a href="src/cloudflare/types/cloudforce_one/threat_events/dataset_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/threat_events/dataset_edit_response.py">DatasetEditResponse</a></code>
9049-
- <code title="get /accounts/{account_id}/cloudforce-one/events/dataset/{dataset_id}">client.cloudforce_one.threat_events.datasets.<a href="./src/cloudflare/resources/cloudforce_one/threat_events/datasets.py">get</a>(dataset_id, \*, account_id) -> <a href="./src/cloudflare/types/cloudforce_one/threat_events/dataset_get_response.py">DatasetGetResponse</a></code>
9050-
- <code title="get /accounts/{account_id}/cloudforce-one/events/raw/{dataset_id}/{event_id}">client.cloudforce_one.threat_events.datasets.<a href="./src/cloudflare/resources/cloudforce_one/threat_events/datasets.py">raw</a>(event_id, \*, account_id, dataset_id) -> <a href="./src/cloudflare/types/cloudforce_one/threat_events/dataset_raw_response.py">DatasetRawResponse</a></code>
9046+
- <code title="post /accounts/{account_id}/cloudforce-one/events/dataset/create">client.cloudforce_one.threat_events.datasets.<a href="./src/cloudflare/resources/cloudforce_one/threat_events/datasets/datasets.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/cloudforce_one/threat_events/dataset_create_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/threat_events/dataset_create_response.py">DatasetCreateResponse</a></code>
9047+
- <code title="get /accounts/{account_id}/cloudforce-one/events/dataset">client.cloudforce_one.threat_events.datasets.<a href="./src/cloudflare/resources/cloudforce_one/threat_events/datasets/datasets.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/cloudforce_one/threat_events/dataset_list_response.py">DatasetListResponse</a></code>
9048+
- <code title="patch /accounts/{account_id}/cloudforce-one/events/dataset/{dataset_id}">client.cloudforce_one.threat_events.datasets.<a href="./src/cloudflare/resources/cloudforce_one/threat_events/datasets/datasets.py">edit</a>(dataset_id, \*, account_id, \*\*<a href="src/cloudflare/types/cloudforce_one/threat_events/dataset_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/threat_events/dataset_edit_response.py">DatasetEditResponse</a></code>
9049+
- <code title="get /accounts/{account_id}/cloudforce-one/events/dataset/{dataset_id}">client.cloudforce_one.threat_events.datasets.<a href="./src/cloudflare/resources/cloudforce_one/threat_events/datasets/datasets.py">get</a>(dataset_id, \*, account_id) -> <a href="./src/cloudflare/types/cloudforce_one/threat_events/dataset_get_response.py">DatasetGetResponse</a></code>
9050+
- <code title="get /accounts/{account_id}/cloudforce-one/events/raw/{dataset_id}/{event_id}">client.cloudforce_one.threat_events.datasets.<a href="./src/cloudflare/resources/cloudforce_one/threat_events/datasets/datasets.py">raw</a>(event_id, \*, account_id, dataset_id) -> <a href="./src/cloudflare/types/cloudforce_one/threat_events/dataset_raw_response.py">DatasetRawResponse</a></code>
9051+
9052+
#### Health
9053+
9054+
Types:
9055+
9056+
```python
9057+
from cloudflare.types.cloudforce_one.threat_events.datasets import HealthGetResponse
9058+
```
9059+
9060+
Methods:
9061+
9062+
- <code title="get /accounts/{account_id}/cloudforce-one/events/dataset/{dataset_id}/health">client.cloudforce_one.threat_events.datasets.health.<a href="./src/cloudflare/resources/cloudforce_one/threat_events/datasets/health.py">get</a>(dataset_id, \*, account_id) -> <a href="./src/cloudflare/types/cloudforce_one/threat_events/datasets/health_get_response.py">HealthGetResponse</a></code>
90519063

90529064
### IndicatorTypes
90539065

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .health import (
4+
HealthResource,
5+
AsyncHealthResource,
6+
HealthResourceWithRawResponse,
7+
AsyncHealthResourceWithRawResponse,
8+
HealthResourceWithStreamingResponse,
9+
AsyncHealthResourceWithStreamingResponse,
10+
)
11+
from .datasets import (
12+
DatasetsResource,
13+
AsyncDatasetsResource,
14+
DatasetsResourceWithRawResponse,
15+
AsyncDatasetsResourceWithRawResponse,
16+
DatasetsResourceWithStreamingResponse,
17+
AsyncDatasetsResourceWithStreamingResponse,
18+
)
19+
20+
__all__ = [
21+
"HealthResource",
22+
"AsyncHealthResource",
23+
"HealthResourceWithRawResponse",
24+
"AsyncHealthResourceWithRawResponse",
25+
"HealthResourceWithStreamingResponse",
26+
"AsyncHealthResourceWithStreamingResponse",
27+
"DatasetsResource",
28+
"AsyncDatasetsResource",
29+
"DatasetsResourceWithRawResponse",
30+
"AsyncDatasetsResourceWithRawResponse",
31+
"DatasetsResourceWithStreamingResponse",
32+
"AsyncDatasetsResourceWithStreamingResponse",
33+
]

src/cloudflare/resources/cloudforce_one/threat_events/datasets.py renamed to src/cloudflare/resources/cloudforce_one/threat_events/datasets/datasets.py

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,40 @@
44

55
import httpx
66

7-
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
8-
from ...._utils import maybe_transform, async_maybe_transform
9-
from ...._compat import cached_property
10-
from ...._resource import SyncAPIResource, AsyncAPIResource
11-
from ...._response import (
7+
from .health import (
8+
HealthResource,
9+
AsyncHealthResource,
10+
HealthResourceWithRawResponse,
11+
AsyncHealthResourceWithRawResponse,
12+
HealthResourceWithStreamingResponse,
13+
AsyncHealthResourceWithStreamingResponse,
14+
)
15+
from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven
16+
from ....._utils import maybe_transform, async_maybe_transform
17+
from ....._compat import cached_property
18+
from ....._resource import SyncAPIResource, AsyncAPIResource
19+
from ....._response import (
1220
to_raw_response_wrapper,
1321
to_streamed_response_wrapper,
1422
async_to_raw_response_wrapper,
1523
async_to_streamed_response_wrapper,
1624
)
17-
from ...._base_client import make_request_options
18-
from ....types.cloudforce_one.threat_events import dataset_edit_params, dataset_create_params
19-
from ....types.cloudforce_one.threat_events.dataset_get_response import DatasetGetResponse
20-
from ....types.cloudforce_one.threat_events.dataset_raw_response import DatasetRawResponse
21-
from ....types.cloudforce_one.threat_events.dataset_edit_response import DatasetEditResponse
22-
from ....types.cloudforce_one.threat_events.dataset_list_response import DatasetListResponse
23-
from ....types.cloudforce_one.threat_events.dataset_create_response import DatasetCreateResponse
25+
from ....._base_client import make_request_options
26+
from .....types.cloudforce_one.threat_events import dataset_edit_params, dataset_create_params
27+
from .....types.cloudforce_one.threat_events.dataset_get_response import DatasetGetResponse
28+
from .....types.cloudforce_one.threat_events.dataset_raw_response import DatasetRawResponse
29+
from .....types.cloudforce_one.threat_events.dataset_edit_response import DatasetEditResponse
30+
from .....types.cloudforce_one.threat_events.dataset_list_response import DatasetListResponse
31+
from .....types.cloudforce_one.threat_events.dataset_create_response import DatasetCreateResponse
2432

2533
__all__ = ["DatasetsResource", "AsyncDatasetsResource"]
2634

2735

2836
class DatasetsResource(SyncAPIResource):
37+
@cached_property
38+
def health(self) -> HealthResource:
39+
return HealthResource(self._client)
40+
2941
@cached_property
3042
def with_raw_response(self) -> DatasetsResourceWithRawResponse:
3143
"""
@@ -260,6 +272,10 @@ def raw(
260272

261273

262274
class AsyncDatasetsResource(AsyncAPIResource):
275+
@cached_property
276+
def health(self) -> AsyncHealthResource:
277+
return AsyncHealthResource(self._client)
278+
263279
@cached_property
264280
def with_raw_response(self) -> AsyncDatasetsResourceWithRawResponse:
265281
"""
@@ -513,6 +529,10 @@ def __init__(self, datasets: DatasetsResource) -> None:
513529
datasets.raw,
514530
)
515531

532+
@cached_property
533+
def health(self) -> HealthResourceWithRawResponse:
534+
return HealthResourceWithRawResponse(self._datasets.health)
535+
516536

517537
class AsyncDatasetsResourceWithRawResponse:
518538
def __init__(self, datasets: AsyncDatasetsResource) -> None:
@@ -534,6 +554,10 @@ def __init__(self, datasets: AsyncDatasetsResource) -> None:
534554
datasets.raw,
535555
)
536556

557+
@cached_property
558+
def health(self) -> AsyncHealthResourceWithRawResponse:
559+
return AsyncHealthResourceWithRawResponse(self._datasets.health)
560+
537561

538562
class DatasetsResourceWithStreamingResponse:
539563
def __init__(self, datasets: DatasetsResource) -> None:
@@ -555,6 +579,10 @@ def __init__(self, datasets: DatasetsResource) -> None:
555579
datasets.raw,
556580
)
557581

582+
@cached_property
583+
def health(self) -> HealthResourceWithStreamingResponse:
584+
return HealthResourceWithStreamingResponse(self._datasets.health)
585+
558586

559587
class AsyncDatasetsResourceWithStreamingResponse:
560588
def __init__(self, datasets: AsyncDatasetsResource) -> None:
@@ -575,3 +603,7 @@ def __init__(self, datasets: AsyncDatasetsResource) -> None:
575603
self.raw = async_to_streamed_response_wrapper(
576604
datasets.raw,
577605
)
606+
607+
@cached_property
608+
def health(self) -> AsyncHealthResourceWithStreamingResponse:
609+
return AsyncHealthResourceWithStreamingResponse(self._datasets.health)
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
import httpx
6+
7+
from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven
8+
from ....._compat import cached_property
9+
from ....._resource import SyncAPIResource, AsyncAPIResource
10+
from ....._response import (
11+
to_raw_response_wrapper,
12+
to_streamed_response_wrapper,
13+
async_to_raw_response_wrapper,
14+
async_to_streamed_response_wrapper,
15+
)
16+
from ....._base_client import make_request_options
17+
from .....types.cloudforce_one.threat_events.datasets.health_get_response import HealthGetResponse
18+
19+
__all__ = ["HealthResource", "AsyncHealthResource"]
20+
21+
22+
class HealthResource(SyncAPIResource):
23+
@cached_property
24+
def with_raw_response(self) -> HealthResourceWithRawResponse:
25+
"""
26+
This property can be used as a prefix for any HTTP method call to return
27+
the raw response object instead of the parsed content.
28+
29+
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
30+
"""
31+
return HealthResourceWithRawResponse(self)
32+
33+
@cached_property
34+
def with_streaming_response(self) -> HealthResourceWithStreamingResponse:
35+
"""
36+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
37+
38+
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
39+
"""
40+
return HealthResourceWithStreamingResponse(self)
41+
42+
def get(
43+
self,
44+
dataset_id: str,
45+
*,
46+
account_id: float,
47+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
48+
# The extra values given here take precedence over values defined on the client or passed to this method.
49+
extra_headers: Headers | None = None,
50+
extra_query: Query | None = None,
51+
extra_body: Body | None = None,
52+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
53+
) -> HealthGetResponse:
54+
"""
55+
Benchmark Durable Object warmup
56+
57+
Args:
58+
account_id: Account ID.
59+
60+
dataset_id: Dataset ID.
61+
62+
extra_headers: Send extra headers
63+
64+
extra_query: Add additional query parameters to the request
65+
66+
extra_body: Add additional JSON properties to the request
67+
68+
timeout: Override the client-level default timeout for this request, in seconds
69+
"""
70+
if not dataset_id:
71+
raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}")
72+
return self._get(
73+
f"/accounts/{account_id}/cloudforce-one/events/dataset/{dataset_id}/health",
74+
options=make_request_options(
75+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
76+
),
77+
cast_to=HealthGetResponse,
78+
)
79+
80+
81+
class AsyncHealthResource(AsyncAPIResource):
82+
@cached_property
83+
def with_raw_response(self) -> AsyncHealthResourceWithRawResponse:
84+
"""
85+
This property can be used as a prefix for any HTTP method call to return
86+
the raw response object instead of the parsed content.
87+
88+
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
89+
"""
90+
return AsyncHealthResourceWithRawResponse(self)
91+
92+
@cached_property
93+
def with_streaming_response(self) -> AsyncHealthResourceWithStreamingResponse:
94+
"""
95+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
96+
97+
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
98+
"""
99+
return AsyncHealthResourceWithStreamingResponse(self)
100+
101+
async def get(
102+
self,
103+
dataset_id: str,
104+
*,
105+
account_id: float,
106+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
107+
# The extra values given here take precedence over values defined on the client or passed to this method.
108+
extra_headers: Headers | None = None,
109+
extra_query: Query | None = None,
110+
extra_body: Body | None = None,
111+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
112+
) -> HealthGetResponse:
113+
"""
114+
Benchmark Durable Object warmup
115+
116+
Args:
117+
account_id: Account ID.
118+
119+
dataset_id: Dataset ID.
120+
121+
extra_headers: Send extra headers
122+
123+
extra_query: Add additional query parameters to the request
124+
125+
extra_body: Add additional JSON properties to the request
126+
127+
timeout: Override the client-level default timeout for this request, in seconds
128+
"""
129+
if not dataset_id:
130+
raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}")
131+
return await self._get(
132+
f"/accounts/{account_id}/cloudforce-one/events/dataset/{dataset_id}/health",
133+
options=make_request_options(
134+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
135+
),
136+
cast_to=HealthGetResponse,
137+
)
138+
139+
140+
class HealthResourceWithRawResponse:
141+
def __init__(self, health: HealthResource) -> None:
142+
self._health = health
143+
144+
self.get = to_raw_response_wrapper(
145+
health.get,
146+
)
147+
148+
149+
class AsyncHealthResourceWithRawResponse:
150+
def __init__(self, health: AsyncHealthResource) -> None:
151+
self._health = health
152+
153+
self.get = async_to_raw_response_wrapper(
154+
health.get,
155+
)
156+
157+
158+
class HealthResourceWithStreamingResponse:
159+
def __init__(self, health: HealthResource) -> None:
160+
self._health = health
161+
162+
self.get = to_streamed_response_wrapper(
163+
health.get,
164+
)
165+
166+
167+
class AsyncHealthResourceWithStreamingResponse:
168+
def __init__(self, health: AsyncHealthResource) -> None:
169+
self._health = health
170+
171+
self.get = async_to_streamed_response_wrapper(
172+
health.get,
173+
)

0 commit comments

Comments
 (0)