Skip to content

Commit 0a45fe8

Browse files
feat(threat_events): fix create endpoint (#2532)
1 parent e1a2d25 commit 0a45fe8

File tree

19 files changed

+274
-3532
lines changed

19 files changed

+274
-3532
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1610
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-30da43ea5d0d999bce706d59618514c0c59d657ea27ad2e228663d731023449f.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0f0082a0942d9f9edb37ef99423f7cdf16d0bfeb57c6ee5728e830b2a9ebff87.yml

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8506,7 +8506,7 @@ from cloudflare.types.cloudforce_one import (
85068506

85078507
Methods:
85088508

8509-
- <code title="post /accounts/{account_id}/cloudforce-one/events">client.cloudforce_one.threat_events.<a href="./src/cloudflare/resources/cloudforce_one/threat_events/threat_events.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/cloudforce_one/threat_event_create_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/threat_event_create_response.py">ThreatEventCreateResponse</a></code>
8509+
- <code title="post /accounts/{account_id}/cloudforce-one/events/create">client.cloudforce_one.threat_events.<a href="./src/cloudflare/resources/cloudforce_one/threat_events/threat_events.py">create</a>(\*, path_account_id, \*\*<a href="src/cloudflare/types/cloudforce_one/threat_event_create_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/threat_event_create_response.py">ThreatEventCreateResponse</a></code>
85108510
- <code title="delete /accounts/{account_id}/cloudforce-one/events/{event_id}">client.cloudforce_one.threat_events.<a href="./src/cloudflare/resources/cloudforce_one/threat_events/threat_events.py">delete</a>(event_id, \*, account_id) -> <a href="./src/cloudflare/types/cloudforce_one/threat_event_delete_response.py">ThreatEventDeleteResponse</a></code>
85118511
- <code title="post /accounts/{account_id}/cloudforce-one/events/create/bulk">client.cloudforce_one.threat_events.<a href="./src/cloudflare/resources/cloudforce_one/threat_events/threat_events.py">bulk_create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/cloudforce_one/threat_event_bulk_create_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/threat_event_bulk_create_response.py">ThreatEventBulkCreateResponse</a></code>
85128512
- <code title="patch /accounts/{account_id}/cloudforce-one/events/{event_id}">client.cloudforce_one.threat_events.<a href="./src/cloudflare/resources/cloudforce_one/threat_events/threat_events.py">edit</a>(event_id, \*, account_id, \*\*<a href="src/cloudflare/types/cloudforce_one/threat_event_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/threat_event_edit_response.py">ThreatEventEditResponse</a></code>

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

Lines changed: 62 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from typing import List, Union, Iterable
66
from datetime import datetime
7-
from typing_extensions import Literal
87

98
import httpx
109

@@ -203,13 +202,21 @@ def with_streaming_response(self) -> ThreatEventsResourceWithStreamingResponse:
203202
def create(
204203
self,
205204
*,
206-
account_id: float,
207-
dataset_id: List[str] | NotGiven = NOT_GIVEN,
208-
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
209-
order_by: str | NotGiven = NOT_GIVEN,
210-
page: float | NotGiven = NOT_GIVEN,
211-
page_size: float | NotGiven = NOT_GIVEN,
212-
search: Iterable[threat_event_create_params.Search] | NotGiven = NOT_GIVEN,
205+
path_account_id: float,
206+
attacker: str,
207+
attacker_country: str,
208+
category: str,
209+
date: Union[str, datetime],
210+
event: str,
211+
indicator_type: str,
212+
raw: threat_event_create_params.Raw,
213+
tlp: str,
214+
body_account_id: float | NotGiven = NOT_GIVEN,
215+
dataset_id: str | NotGiven = NOT_GIVEN,
216+
indicator: str | NotGiven = NOT_GIVEN,
217+
tags: List[str] | NotGiven = NOT_GIVEN,
218+
target_country: str | NotGiven = NOT_GIVEN,
219+
target_industry: str | NotGiven = NOT_GIVEN,
213220
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
214221
# The extra values given here take precedence over values defined on the client or passed to this method.
215222
extra_headers: Headers | None = None,
@@ -218,10 +225,10 @@ def create(
218225
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
219226
) -> ThreatEventCreateResponse:
220227
"""
221-
Filter and list events
228+
Creates a new event
222229
223230
Args:
224-
account_id: Account ID
231+
path_account_id: Account ID
225232
226233
extra_headers: Send extra headers
227234
@@ -232,15 +239,23 @@ def create(
232239
timeout: Override the client-level default timeout for this request, in seconds
233240
"""
234241
return self._post(
235-
f"/accounts/{account_id}/cloudforce-one/events",
242+
f"/accounts/{path_account_id}/cloudforce-one/events/create",
236243
body=maybe_transform(
237244
{
245+
"attacker": attacker,
246+
"attacker_country": attacker_country,
247+
"category": category,
248+
"date": date,
249+
"event": event,
250+
"indicator_type": indicator_type,
251+
"raw": raw,
252+
"tlp": tlp,
253+
"body_account_id": body_account_id,
238254
"dataset_id": dataset_id,
239-
"order": order,
240-
"order_by": order_by,
241-
"page": page,
242-
"page_size": page_size,
243-
"search": search,
255+
"indicator": indicator,
256+
"tags": tags,
257+
"target_country": target_country,
258+
"target_industry": target_industry,
244259
},
245260
threat_event_create_params.ThreatEventCreateParams,
246261
),
@@ -503,13 +518,21 @@ def with_streaming_response(self) -> AsyncThreatEventsResourceWithStreamingRespo
503518
async def create(
504519
self,
505520
*,
506-
account_id: float,
507-
dataset_id: List[str] | NotGiven = NOT_GIVEN,
508-
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
509-
order_by: str | NotGiven = NOT_GIVEN,
510-
page: float | NotGiven = NOT_GIVEN,
511-
page_size: float | NotGiven = NOT_GIVEN,
512-
search: Iterable[threat_event_create_params.Search] | NotGiven = NOT_GIVEN,
521+
path_account_id: float,
522+
attacker: str,
523+
attacker_country: str,
524+
category: str,
525+
date: Union[str, datetime],
526+
event: str,
527+
indicator_type: str,
528+
raw: threat_event_create_params.Raw,
529+
tlp: str,
530+
body_account_id: float | NotGiven = NOT_GIVEN,
531+
dataset_id: str | NotGiven = NOT_GIVEN,
532+
indicator: str | NotGiven = NOT_GIVEN,
533+
tags: List[str] | NotGiven = NOT_GIVEN,
534+
target_country: str | NotGiven = NOT_GIVEN,
535+
target_industry: str | NotGiven = NOT_GIVEN,
513536
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
514537
# The extra values given here take precedence over values defined on the client or passed to this method.
515538
extra_headers: Headers | None = None,
@@ -518,10 +541,10 @@ async def create(
518541
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
519542
) -> ThreatEventCreateResponse:
520543
"""
521-
Filter and list events
544+
Creates a new event
522545
523546
Args:
524-
account_id: Account ID
547+
path_account_id: Account ID
525548
526549
extra_headers: Send extra headers
527550
@@ -532,15 +555,23 @@ async def create(
532555
timeout: Override the client-level default timeout for this request, in seconds
533556
"""
534557
return await self._post(
535-
f"/accounts/{account_id}/cloudforce-one/events",
558+
f"/accounts/{path_account_id}/cloudforce-one/events/create",
536559
body=await async_maybe_transform(
537560
{
561+
"attacker": attacker,
562+
"attacker_country": attacker_country,
563+
"category": category,
564+
"date": date,
565+
"event": event,
566+
"indicator_type": indicator_type,
567+
"raw": raw,
568+
"tlp": tlp,
569+
"body_account_id": body_account_id,
538570
"dataset_id": dataset_id,
539-
"order": order,
540-
"order_by": order_by,
541-
"page": page,
542-
"page_size": page_size,
543-
"search": search,
571+
"indicator": indicator,
572+
"tags": tags,
573+
"target_country": target_country,
574+
"target_industry": target_industry,
544575
},
545576
threat_event_create_params.ThreatEventCreateParams,
546577
),

src/cloudflare/resources/email_security/investigate/investigate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def list(
141141
detections_only: bool | NotGiven = NOT_GIVEN,
142142
domain: str | NotGiven = NOT_GIVEN,
143143
end: Union[str, datetime] | NotGiven = NOT_GIVEN,
144-
final_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | NotGiven = NOT_GIVEN,
144+
final_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK"] | NotGiven = NOT_GIVEN,
145145
message_action: Literal["PREVIEW", "QUARANTINE_RELEASED", "MOVED"] | NotGiven = NOT_GIVEN,
146146
message_id: str | NotGiven = NOT_GIVEN,
147147
metric: str | NotGiven = NOT_GIVEN,
@@ -351,7 +351,7 @@ def list(
351351
detections_only: bool | NotGiven = NOT_GIVEN,
352352
domain: str | NotGiven = NOT_GIVEN,
353353
end: Union[str, datetime] | NotGiven = NOT_GIVEN,
354-
final_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | NotGiven = NOT_GIVEN,
354+
final_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK"] | NotGiven = NOT_GIVEN,
355355
message_action: Literal["PREVIEW", "QUARANTINE_RELEASED", "MOVED"] | NotGiven = NOT_GIVEN,
356356
message_id: str | NotGiven = NOT_GIVEN,
357357
metric: str | NotGiven = NOT_GIVEN,

src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/secrets.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def update(
6868
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
6969
) -> Optional[SecretUpdateResponse]:
7070
"""
71-
Add a secret to a script uploaded to a Workers for Platforms namespace.
71+
Put secrets to a script uploaded to a Workers for Platforms namespace.
7272
7373
Args:
7474
account_id: Identifier
@@ -132,7 +132,7 @@ def list(
132132
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
133133
) -> SyncSinglePage[SecretListResponse]:
134134
"""
135-
List secrets bound to a script uploaded to a Workers for Platforms namespace.
135+
List secrets from a script uploaded to a Workers for Platforms namespace.
136136
137137
Args:
138138
account_id: Identifier
@@ -179,8 +179,7 @@ def get(
179179
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
180180
) -> Optional[SecretGetResponse]:
181181
"""
182-
Get a given secret binding (value omitted) on a script uploaded to a Workers for
183-
Platforms namespace.
182+
Get secret from a script uploaded to a Workers for Platforms namespace.
184183
185184
Args:
186185
account_id: Identifier
@@ -257,7 +256,7 @@ async def update(
257256
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
258257
) -> Optional[SecretUpdateResponse]:
259258
"""
260-
Add a secret to a script uploaded to a Workers for Platforms namespace.
259+
Put secrets to a script uploaded to a Workers for Platforms namespace.
261260
262261
Args:
263262
account_id: Identifier
@@ -321,7 +320,7 @@ def list(
321320
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
322321
) -> AsyncPaginator[SecretListResponse, AsyncSinglePage[SecretListResponse]]:
323322
"""
324-
List secrets bound to a script uploaded to a Workers for Platforms namespace.
323+
List secrets from a script uploaded to a Workers for Platforms namespace.
325324
326325
Args:
327326
account_id: Identifier
@@ -368,8 +367,7 @@ async def get(
368367
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
369368
) -> Optional[SecretGetResponse]:
370369
"""
371-
Get a given secret binding (value omitted) on a script uploaded to a Workers for
372-
Platforms namespace.
370+
Get secret from a script uploaded to a Workers for Platforms namespace.
373371
374372
Args:
375373
account_id: Identifier

0 commit comments

Comments
 (0)