Skip to content

Commit 51a0005

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): api update (#2211)
1 parent 458a4a5 commit 51a0005

29 files changed

+277
-712
lines changed

.stats.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 1451
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3151e81bdc8e6e6f3dc90b21f78c472b90c934926fef1dad65df1f1e13f21b6d.yml
1+
configured_endpoints: 1448
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-96e28d4d04ac2f1a00dda1130ef53e8bd9f2f1590e5d7ba8bed38cad29f8b2de.yml

api.md

-6
Original file line numberDiff line numberDiff line change
@@ -1367,19 +1367,13 @@ Types:
13671367
from cloudflare.types.email_security.settings import (
13681368
TrustedDomainCreateResponse,
13691369
TrustedDomainListResponse,
1370-
TrustedDomainDeleteResponse,
1371-
TrustedDomainEditResponse,
1372-
TrustedDomainGetResponse,
13731370
)
13741371
```
13751372

13761373
Methods:
13771374

13781375
- <code title="post /accounts/{account_id}/email-security/settings/trusted_domains">client.email_security.settings.trusted_domains.<a href="./src/cloudflare/resources/email_security/settings/trusted_domains.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/email_security/settings/trusted_domain_create_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/settings/trusted_domain_create_response.py">TrustedDomainCreateResponse</a></code>
13791376
- <code title="get /accounts/{account_id}/email-security/settings/trusted_domains">client.email_security.settings.trusted_domains.<a href="./src/cloudflare/resources/email_security/settings/trusted_domains.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/email_security/settings/trusted_domain_list_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/settings/trusted_domain_list_response.py">SyncV4PagePaginationArray[TrustedDomainListResponse]</a></code>
1380-
- <code title="delete /accounts/{account_id}/email-security/settings/trusted_domains/{pattern_id}">client.email_security.settings.trusted_domains.<a href="./src/cloudflare/resources/email_security/settings/trusted_domains.py">delete</a>(pattern_id, \*, account_id) -> <a href="./src/cloudflare/types/email_security/settings/trusted_domain_delete_response.py">TrustedDomainDeleteResponse</a></code>
1381-
- <code title="patch /accounts/{account_id}/email-security/settings/trusted_domains/{pattern_id}">client.email_security.settings.trusted_domains.<a href="./src/cloudflare/resources/email_security/settings/trusted_domains.py">edit</a>(pattern_id, \*, account_id, \*\*<a href="src/cloudflare/types/email_security/settings/trusted_domain_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/settings/trusted_domain_edit_response.py">TrustedDomainEditResponse</a></code>
1382-
- <code title="get /accounts/{account_id}/email-security/settings/trusted_domains/{pattern_id}">client.email_security.settings.trusted_domains.<a href="./src/cloudflare/resources/email_security/settings/trusted_domains.py">get</a>(pattern_id, \*, account_id) -> <a href="./src/cloudflare/types/email_security/settings/trusted_domain_get_response.py">TrustedDomainGetResponse</a></code>
13831377

13841378
## Submissions
13851379

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

+8-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Type, cast
5+
from typing import Type, cast
66

77
import httpx
88

@@ -21,6 +21,7 @@
2121
)
2222
from ...._wrappers import ResultWrapper
2323
from ...._base_client import make_request_options
24+
from ....types.email_security.investigate import preview_create_params
2425
from ....types.email_security.investigate.preview_get_response import PreviewGetResponse
2526
from ....types.email_security.investigate.preview_create_response import PreviewCreateResponse
2627

@@ -51,7 +52,7 @@ def create(
5152
self,
5253
*,
5354
account_id: str,
54-
body: List[str],
55+
postfix_id: str,
5556
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5657
# The extra values given here take precedence over values defined on the client or passed to this method.
5758
extra_headers: Headers | None = None,
@@ -65,7 +66,7 @@ def create(
6566
Args:
6667
account_id: Account Identifier
6768
68-
body: A list of messages identfied by their `postfix_id`s that should be released.
69+
postfix_id: The identifier of the message.
6970
7071
extra_headers: Send extra headers
7172
@@ -79,7 +80,7 @@ def create(
7980
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
8081
return self._post(
8182
f"/accounts/{account_id}/email-security/investigate/preview",
82-
body=maybe_transform(body, List[str]),
83+
body=maybe_transform({"postfix_id": postfix_id}, preview_create_params.PreviewCreateParams),
8384
options=make_request_options(
8485
extra_headers=extra_headers,
8586
extra_query=extra_query,
@@ -160,7 +161,7 @@ async def create(
160161
self,
161162
*,
162163
account_id: str,
163-
body: List[str],
164+
postfix_id: str,
164165
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
165166
# The extra values given here take precedence over values defined on the client or passed to this method.
166167
extra_headers: Headers | None = None,
@@ -174,7 +175,7 @@ async def create(
174175
Args:
175176
account_id: Account Identifier
176177
177-
body: A list of messages identfied by their `postfix_id`s that should be released.
178+
postfix_id: The identifier of the message.
178179
179180
extra_headers: Send extra headers
180181
@@ -188,7 +189,7 @@ async def create(
188189
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
189190
return await self._post(
190191
f"/accounts/{account_id}/email-security/investigate/preview",
191-
body=await async_maybe_transform(body, List[str]),
192+
body=await async_maybe_transform({"postfix_id": postfix_id}, preview_create_params.PreviewCreateParams),
192193
options=make_request_options(
193194
extra_headers=extra_headers,
194195
extra_query=extra_query,

src/cloudflare/resources/email_security/settings/allow_policies.py

+24
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,12 @@ def list(
139139
*,
140140
account_id: str,
141141
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
142+
is_acceptable_sender: bool | NotGiven = NOT_GIVEN,
143+
is_exempt_recipient: bool | NotGiven = NOT_GIVEN,
142144
is_recipient: bool | NotGiven = NOT_GIVEN,
143145
is_sender: bool | NotGiven = NOT_GIVEN,
144146
is_spoof: bool | NotGiven = NOT_GIVEN,
147+
is_trusted_sender: bool | NotGiven = NOT_GIVEN,
145148
order: Literal["pattern", "created_at"] | NotGiven = NOT_GIVEN,
146149
page: int | NotGiven = NOT_GIVEN,
147150
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | NotGiven = NOT_GIVEN,
@@ -194,9 +197,12 @@ def list(
194197
query=maybe_transform(
195198
{
196199
"direction": direction,
200+
"is_acceptable_sender": is_acceptable_sender,
201+
"is_exempt_recipient": is_exempt_recipient,
197202
"is_recipient": is_recipient,
198203
"is_sender": is_sender,
199204
"is_spoof": is_spoof,
205+
"is_trusted_sender": is_trusted_sender,
200206
"order": order,
201207
"page": page,
202208
"pattern_type": pattern_type,
@@ -228,6 +234,8 @@ def delete(
228234
Args:
229235
account_id: Account Identifier
230236
237+
policy_id: The unique identifier for the allow policy.
238+
231239
extra_headers: Send extra headers
232240
233241
extra_query: Add additional query parameters to the request
@@ -276,6 +284,8 @@ def edit(
276284
Args:
277285
account_id: Account Identifier
278286
287+
policy_id: The unique identifier for the allow policy.
288+
279289
is_acceptable_sender: Messages from this sender will be exempted from Spam, Spoof and Bulk
280290
dispositions. Note: This will not exempt messages with Malicious or Suspicious
281291
dispositions.
@@ -340,6 +350,8 @@ def get(
340350
Args:
341351
account_id: Account Identifier
342352
353+
policy_id: The unique identifier for the allow policy.
354+
343355
extra_headers: Send extra headers
344356
345357
extra_query: Add additional query parameters to the request
@@ -465,9 +477,12 @@ def list(
465477
*,
466478
account_id: str,
467479
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
480+
is_acceptable_sender: bool | NotGiven = NOT_GIVEN,
481+
is_exempt_recipient: bool | NotGiven = NOT_GIVEN,
468482
is_recipient: bool | NotGiven = NOT_GIVEN,
469483
is_sender: bool | NotGiven = NOT_GIVEN,
470484
is_spoof: bool | NotGiven = NOT_GIVEN,
485+
is_trusted_sender: bool | NotGiven = NOT_GIVEN,
471486
order: Literal["pattern", "created_at"] | NotGiven = NOT_GIVEN,
472487
page: int | NotGiven = NOT_GIVEN,
473488
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | NotGiven = NOT_GIVEN,
@@ -520,9 +535,12 @@ def list(
520535
query=maybe_transform(
521536
{
522537
"direction": direction,
538+
"is_acceptable_sender": is_acceptable_sender,
539+
"is_exempt_recipient": is_exempt_recipient,
523540
"is_recipient": is_recipient,
524541
"is_sender": is_sender,
525542
"is_spoof": is_spoof,
543+
"is_trusted_sender": is_trusted_sender,
526544
"order": order,
527545
"page": page,
528546
"pattern_type": pattern_type,
@@ -554,6 +572,8 @@ async def delete(
554572
Args:
555573
account_id: Account Identifier
556574
575+
policy_id: The unique identifier for the allow policy.
576+
557577
extra_headers: Send extra headers
558578
559579
extra_query: Add additional query parameters to the request
@@ -602,6 +622,8 @@ async def edit(
602622
Args:
603623
account_id: Account Identifier
604624
625+
policy_id: The unique identifier for the allow policy.
626+
605627
is_acceptable_sender: Messages from this sender will be exempted from Spam, Spoof and Bulk
606628
dispositions. Note: This will not exempt messages with Malicious or Suspicious
607629
dispositions.
@@ -666,6 +688,8 @@ async def get(
666688
Args:
667689
account_id: Account Identifier
668690
691+
policy_id: The unique identifier for the allow policy.
692+
669693
extra_headers: Send extra headers
670694
671695
extra_query: Add additional query parameters to the request

src/cloudflare/resources/email_security/settings/domains.py

+48
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,29 @@ def edit(
213213
domain_id: int,
214214
*,
215215
account_id: str,
216+
ip_restrictions: List[str],
216217
domain: Optional[str] | NotGiven = NOT_GIVEN,
218+
drop_dispositions: List[
219+
Literal[
220+
"MALICIOUS",
221+
"MALICIOUS-BEC",
222+
"SUSPICIOUS",
223+
"SPOOF",
224+
"SPAM",
225+
"BULK",
226+
"ENCRYPTED",
227+
"EXTERNAL",
228+
"UNKNOWN",
229+
"NONE",
230+
]
231+
]
232+
| NotGiven = NOT_GIVEN,
217233
folder: Literal["AllItems", "Inbox"] | NotGiven = NOT_GIVEN,
218234
integration_id: Optional[str] | NotGiven = NOT_GIVEN,
219235
lookback_hops: Optional[int] | NotGiven = NOT_GIVEN,
236+
require_tls_inbound: bool | NotGiven = NOT_GIVEN,
237+
require_tls_outbound: bool | NotGiven = NOT_GIVEN,
238+
transport: str | NotGiven = NOT_GIVEN,
220239
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
221240
# The extra values given here take precedence over values defined on the client or passed to this method.
222241
extra_headers: Headers | None = None,
@@ -246,10 +265,15 @@ def edit(
246265
f"/accounts/{account_id}/email-security/settings/domains/{domain_id}",
247266
body=maybe_transform(
248267
{
268+
"ip_restrictions": ip_restrictions,
249269
"domain": domain,
270+
"drop_dispositions": drop_dispositions,
250271
"folder": folder,
251272
"integration_id": integration_id,
252273
"lookback_hops": lookback_hops,
274+
"require_tls_inbound": require_tls_inbound,
275+
"require_tls_outbound": require_tls_outbound,
276+
"transport": transport,
253277
},
254278
domain_edit_params.DomainEditParams,
255279
),
@@ -486,10 +510,29 @@ async def edit(
486510
domain_id: int,
487511
*,
488512
account_id: str,
513+
ip_restrictions: List[str],
489514
domain: Optional[str] | NotGiven = NOT_GIVEN,
515+
drop_dispositions: List[
516+
Literal[
517+
"MALICIOUS",
518+
"MALICIOUS-BEC",
519+
"SUSPICIOUS",
520+
"SPOOF",
521+
"SPAM",
522+
"BULK",
523+
"ENCRYPTED",
524+
"EXTERNAL",
525+
"UNKNOWN",
526+
"NONE",
527+
]
528+
]
529+
| NotGiven = NOT_GIVEN,
490530
folder: Literal["AllItems", "Inbox"] | NotGiven = NOT_GIVEN,
491531
integration_id: Optional[str] | NotGiven = NOT_GIVEN,
492532
lookback_hops: Optional[int] | NotGiven = NOT_GIVEN,
533+
require_tls_inbound: bool | NotGiven = NOT_GIVEN,
534+
require_tls_outbound: bool | NotGiven = NOT_GIVEN,
535+
transport: str | NotGiven = NOT_GIVEN,
493536
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
494537
# The extra values given here take precedence over values defined on the client or passed to this method.
495538
extra_headers: Headers | None = None,
@@ -519,10 +562,15 @@ async def edit(
519562
f"/accounts/{account_id}/email-security/settings/domains/{domain_id}",
520563
body=await async_maybe_transform(
521564
{
565+
"ip_restrictions": ip_restrictions,
522566
"domain": domain,
567+
"drop_dispositions": drop_dispositions,
523568
"folder": folder,
524569
"integration_id": integration_id,
525570
"lookback_hops": lookback_hops,
571+
"require_tls_inbound": require_tls_inbound,
572+
"require_tls_outbound": require_tls_outbound,
573+
"transport": transport,
526574
},
527575
domain_edit_params.DomainEditParams,
528576
),

0 commit comments

Comments
 (0)