Skip to content

Commit 2f9ce7e

Browse files
feat(api): api update
1 parent 21d0b63 commit 2f9ce7e

File tree

8 files changed

+230
-34
lines changed

8 files changed

+230
-34
lines changed

.stats.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1711
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b9fcfeab98df437762212eda4e6305e061df7a9238d8f74484537784474ca209.yml
3-
openapi_spec_hash: fe1e1ad9669931164e397f0b2b889efa
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c44e711784245749777282becf5e1a256150c5072cb948ed96149b0675b531c1.yml
3+
openapi_spec_hash: 6d1905463e807fe9db23c6668ff2734f
44
config_hash: 67f412c990647f3cb598378fa22a9db5

src/cloudflare/resources/logpush/datasets/fields.py

+57-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Type, Optional, cast
6+
from typing_extensions import Literal
67

78
import httpx
89

@@ -43,7 +44,34 @@ def with_streaming_response(self) -> FieldsResourceWithStreamingResponse:
4344

4445
def get(
4546
self,
46-
dataset_id: Optional[str],
47+
dataset_id: Optional[
48+
Literal[
49+
"access_requests",
50+
"audit_logs",
51+
"biso_user_actions",
52+
"casb_findings",
53+
"device_posture_results",
54+
"dlp_forensic_copies",
55+
"dns_firewall_logs",
56+
"dns_logs",
57+
"email_security_alerts",
58+
"firewall_events",
59+
"gateway_dns",
60+
"gateway_http",
61+
"gateway_network",
62+
"http_requests",
63+
"magic_ids_detections",
64+
"nel_reports",
65+
"network_analytics_logs",
66+
"page_shield_events",
67+
"sinkhole_http_logs",
68+
"spectrum_events",
69+
"ssh_logs",
70+
"workers_trace_events",
71+
"zaraz_events",
72+
"zero_trust_network_sessions",
73+
]
74+
],
4775
*,
4876
account_id: str | NotGiven = NOT_GIVEN,
4977
zone_id: str | NotGiven = NOT_GIVEN,
@@ -124,7 +152,34 @@ def with_streaming_response(self) -> AsyncFieldsResourceWithStreamingResponse:
124152

125153
async def get(
126154
self,
127-
dataset_id: Optional[str],
155+
dataset_id: Optional[
156+
Literal[
157+
"access_requests",
158+
"audit_logs",
159+
"biso_user_actions",
160+
"casb_findings",
161+
"device_posture_results",
162+
"dlp_forensic_copies",
163+
"dns_firewall_logs",
164+
"dns_logs",
165+
"email_security_alerts",
166+
"firewall_events",
167+
"gateway_dns",
168+
"gateway_http",
169+
"gateway_network",
170+
"http_requests",
171+
"magic_ids_detections",
172+
"nel_reports",
173+
"network_analytics_logs",
174+
"page_shield_events",
175+
"sinkhole_http_logs",
176+
"spectrum_events",
177+
"ssh_logs",
178+
"workers_trace_events",
179+
"zaraz_events",
180+
"zero_trust_network_sessions",
181+
]
182+
],
128183
*,
129184
account_id: str | NotGiven = NOT_GIVEN,
130185
zone_id: str | NotGiven = NOT_GIVEN,

src/cloudflare/resources/logpush/datasets/jobs.py

+57-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Optional
6+
from typing_extensions import Literal
67

78
import httpx
89

@@ -44,7 +45,34 @@ def with_streaming_response(self) -> JobsResourceWithStreamingResponse:
4445

4546
def get(
4647
self,
47-
dataset_id: Optional[str],
48+
dataset_id: Optional[
49+
Literal[
50+
"access_requests",
51+
"audit_logs",
52+
"biso_user_actions",
53+
"casb_findings",
54+
"device_posture_results",
55+
"dlp_forensic_copies",
56+
"dns_firewall_logs",
57+
"dns_logs",
58+
"email_security_alerts",
59+
"firewall_events",
60+
"gateway_dns",
61+
"gateway_http",
62+
"gateway_network",
63+
"http_requests",
64+
"magic_ids_detections",
65+
"nel_reports",
66+
"network_analytics_logs",
67+
"page_shield_events",
68+
"sinkhole_http_logs",
69+
"spectrum_events",
70+
"ssh_logs",
71+
"workers_trace_events",
72+
"zaraz_events",
73+
"zero_trust_network_sessions",
74+
]
75+
],
4876
*,
4977
account_id: str | NotGiven = NOT_GIVEN,
5078
zone_id: str | NotGiven = NOT_GIVEN,
@@ -120,7 +148,34 @@ def with_streaming_response(self) -> AsyncJobsResourceWithStreamingResponse:
120148

121149
def get(
122150
self,
123-
dataset_id: Optional[str],
151+
dataset_id: Optional[
152+
Literal[
153+
"access_requests",
154+
"audit_logs",
155+
"biso_user_actions",
156+
"casb_findings",
157+
"device_posture_results",
158+
"dlp_forensic_copies",
159+
"dns_firewall_logs",
160+
"dns_logs",
161+
"email_security_alerts",
162+
"firewall_events",
163+
"gateway_dns",
164+
"gateway_http",
165+
"gateway_network",
166+
"http_requests",
167+
"magic_ids_detections",
168+
"nel_reports",
169+
"network_analytics_logs",
170+
"page_shield_events",
171+
"sinkhole_http_logs",
172+
"spectrum_events",
173+
"ssh_logs",
174+
"workers_trace_events",
175+
"zaraz_events",
176+
"zero_trust_network_sessions",
177+
]
178+
],
124179
*,
125180
account_id: str | NotGiven = NOT_GIVEN,
126181
zone_id: str | NotGiven = NOT_GIVEN,

src/cloudflare/resources/logpush/jobs.py

+58-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,35 @@ def create(
5757
destination_conf: str,
5858
account_id: str | NotGiven = NOT_GIVEN,
5959
zone_id: str | NotGiven = NOT_GIVEN,
60-
dataset: Optional[str] | NotGiven = NOT_GIVEN,
60+
dataset: Optional[
61+
Literal[
62+
"access_requests",
63+
"audit_logs",
64+
"biso_user_actions",
65+
"casb_findings",
66+
"device_posture_results",
67+
"dlp_forensic_copies",
68+
"dns_firewall_logs",
69+
"dns_logs",
70+
"email_security_alerts",
71+
"firewall_events",
72+
"gateway_dns",
73+
"gateway_http",
74+
"gateway_network",
75+
"http_requests",
76+
"magic_ids_detections",
77+
"nel_reports",
78+
"network_analytics_logs",
79+
"page_shield_events",
80+
"sinkhole_http_logs",
81+
"spectrum_events",
82+
"ssh_logs",
83+
"workers_trace_events",
84+
"zaraz_events",
85+
"zero_trust_network_sessions",
86+
]
87+
]
88+
| NotGiven = NOT_GIVEN,
6189
enabled: bool | NotGiven = NOT_GIVEN,
6290
frequency: Optional[Literal["high", "low"]] | NotGiven = NOT_GIVEN,
6391
kind: Optional[Literal["edge"]] | NotGiven = NOT_GIVEN,
@@ -497,7 +525,35 @@ async def create(
497525
destination_conf: str,
498526
account_id: str | NotGiven = NOT_GIVEN,
499527
zone_id: str | NotGiven = NOT_GIVEN,
500-
dataset: Optional[str] | NotGiven = NOT_GIVEN,
528+
dataset: Optional[
529+
Literal[
530+
"access_requests",
531+
"audit_logs",
532+
"biso_user_actions",
533+
"casb_findings",
534+
"device_posture_results",
535+
"dlp_forensic_copies",
536+
"dns_firewall_logs",
537+
"dns_logs",
538+
"email_security_alerts",
539+
"firewall_events",
540+
"gateway_dns",
541+
"gateway_http",
542+
"gateway_network",
543+
"http_requests",
544+
"magic_ids_detections",
545+
"nel_reports",
546+
"network_analytics_logs",
547+
"page_shield_events",
548+
"sinkhole_http_logs",
549+
"spectrum_events",
550+
"ssh_logs",
551+
"workers_trace_events",
552+
"zaraz_events",
553+
"zero_trust_network_sessions",
554+
]
555+
]
556+
| NotGiven = NOT_GIVEN,
501557
enabled: bool | NotGiven = NOT_GIVEN,
502558
frequency: Optional[Literal["high", "low"]] | NotGiven = NOT_GIVEN,
503559
kind: Optional[Literal["edge"]] | NotGiven = NOT_GIVEN,

src/cloudflare/types/logpush/job_create_params.py

+28-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,34 @@ class JobCreateParams(TypedDict, total=False):
2424
zone_id: str
2525
"""The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
2626

27-
dataset: Optional[str]
27+
dataset: Optional[
28+
Literal[
29+
"access_requests",
30+
"audit_logs",
31+
"biso_user_actions",
32+
"casb_findings",
33+
"device_posture_results",
34+
"dlp_forensic_copies",
35+
"dns_firewall_logs",
36+
"dns_logs",
37+
"email_security_alerts",
38+
"firewall_events",
39+
"gateway_dns",
40+
"gateway_http",
41+
"gateway_network",
42+
"http_requests",
43+
"magic_ids_detections",
44+
"nel_reports",
45+
"network_analytics_logs",
46+
"page_shield_events",
47+
"sinkhole_http_logs",
48+
"spectrum_events",
49+
"ssh_logs",
50+
"workers_trace_events",
51+
"zaraz_events",
52+
"zero_trust_network_sessions",
53+
]
54+
]
2855
"""Name of the dataset.
2956
3057
A list of supported datasets can be found on the

src/cloudflare/types/logpush/logpush_job.py

+28-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,34 @@ class LogpushJob(BaseModel):
1414
id: Optional[int] = None
1515
"""Unique id of the job."""
1616

17-
dataset: Optional[str] = None
17+
dataset: Optional[
18+
Literal[
19+
"access_requests",
20+
"audit_logs",
21+
"biso_user_actions",
22+
"casb_findings",
23+
"device_posture_results",
24+
"dlp_forensic_copies",
25+
"dns_firewall_logs",
26+
"dns_logs",
27+
"email_security_alerts",
28+
"firewall_events",
29+
"gateway_dns",
30+
"gateway_http",
31+
"gateway_network",
32+
"http_requests",
33+
"magic_ids_detections",
34+
"nel_reports",
35+
"network_analytics_logs",
36+
"page_shield_events",
37+
"sinkhole_http_logs",
38+
"spectrum_events",
39+
"ssh_logs",
40+
"workers_trace_events",
41+
"zaraz_events",
42+
"zero_trust_network_sessions",
43+
]
44+
] = None
1845
"""Name of the dataset.
1946
2047
A list of supported datasets can be found on the

tests/api_resources/logpush/datasets/test_fields.py

-12
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,6 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
6565
@pytest.mark.skip(reason="TODO: investigate broken test")
6666
@parametrize
6767
def test_path_params_get(self, client: Cloudflare) -> None:
68-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"):
69-
client.logpush.datasets.fields.with_raw_response.get(
70-
dataset_id="",
71-
account_id="account_id",
72-
)
73-
7468
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
7569
client.logpush.datasets.fields.with_raw_response.get(
7670
dataset_id="gateway_dns",
@@ -136,12 +130,6 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
136130
@pytest.mark.skip(reason="TODO: investigate broken test")
137131
@parametrize
138132
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
139-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"):
140-
await async_client.logpush.datasets.fields.with_raw_response.get(
141-
dataset_id="",
142-
account_id="account_id",
143-
)
144-
145133
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
146134
await async_client.logpush.datasets.fields.with_raw_response.get(
147135
dataset_id="gateway_dns",

tests/api_resources/logpush/datasets/test_jobs.py

-12
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
6767
@pytest.mark.skip(reason="TODO: investigate broken test")
6868
@parametrize
6969
def test_path_params_get(self, client: Cloudflare) -> None:
70-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"):
71-
client.logpush.datasets.jobs.with_raw_response.get(
72-
dataset_id="",
73-
account_id="account_id",
74-
)
75-
7670
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
7771
client.logpush.datasets.jobs.with_raw_response.get(
7872
dataset_id="gateway_dns",
@@ -138,12 +132,6 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
138132
@pytest.mark.skip(reason="TODO: investigate broken test")
139133
@parametrize
140134
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
141-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"):
142-
await async_client.logpush.datasets.jobs.with_raw_response.get(
143-
dataset_id="",
144-
account_id="account_id",
145-
)
146-
147135
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
148136
await async_client.logpush.datasets.jobs.with_raw_response.get(
149137
dataset_id="gateway_dns",

0 commit comments

Comments
 (0)