mirror of
https://github.com/cloudflare/cloudflare-python.git
synced 2026-01-17 07:10:37 +00:00
chore(api): update composite API spec
This commit is contained in:
parent
d6049bf56f
commit
0f8715705d
469 changed files with 16491 additions and 16089 deletions
|
|
@ -1,4 +1,4 @@
|
|||
configured_endpoints: 1912
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cc732ca8d1d7f1c11a1ee579060ddfd8f953a3ad94fd5053056b53370129d040.yml
|
||||
openapi_spec_hash: a3e1e833dfe13845abd1e2227993a979
|
||||
configured_endpoints: 1875
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e425e4abe3f3161feed50a8cd861dd25c6ec32ee162b4eb4d225c4e5cb7b3ca9.yml
|
||||
openapi_spec_hash: 955676955a801dbe5084d8ffe2730791
|
||||
config_hash: e4fdda880afe9a26b032ec5128e42dc2
|
||||
|
|
|
|||
331
api.md
331
api.md
|
|
@ -771,18 +771,20 @@ from cloudflare.types.ssl import (
|
|||
Status,
|
||||
ValidationMethod,
|
||||
CertificatePackCreateResponse,
|
||||
CertificatePackListResponse,
|
||||
CertificatePackDeleteResponse,
|
||||
CertificatePackEditResponse,
|
||||
CertificatePackGetResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /zones/{zone_id}/ssl/certificate_packs/order">client.ssl.certificate_packs.<a href="./src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py">create</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/ssl/certificate_pack_create_params.py">params</a>) -> <a href="./src/cloudflare/types/ssl/certificate_pack_create_response.py">Optional[CertificatePackCreateResponse]</a></code>
|
||||
- <code title="get /zones/{zone_id}/ssl/certificate_packs">client.ssl.certificate_packs.<a href="./src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py">list</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/ssl/certificate_pack_list_params.py">params</a>) -> SyncSinglePage[object]</code>
|
||||
- <code title="get /zones/{zone_id}/ssl/certificate_packs">client.ssl.certificate_packs.<a href="./src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py">list</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/ssl/certificate_pack_list_params.py">params</a>) -> <a href="./src/cloudflare/types/ssl/certificate_pack_list_response.py">SyncSinglePage[CertificatePackListResponse]</a></code>
|
||||
- <code title="delete /zones/{zone_id}/ssl/certificate_packs/{certificate_pack_id}">client.ssl.certificate_packs.<a href="./src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py">delete</a>(certificate_pack_id, \*, zone_id) -> <a href="./src/cloudflare/types/ssl/certificate_pack_delete_response.py">Optional[CertificatePackDeleteResponse]</a></code>
|
||||
- <code title="patch /zones/{zone_id}/ssl/certificate_packs/{certificate_pack_id}">client.ssl.certificate_packs.<a href="./src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py">edit</a>(certificate_pack_id, \*, zone_id, \*\*<a href="src/cloudflare/types/ssl/certificate_pack_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/ssl/certificate_pack_edit_response.py">Optional[CertificatePackEditResponse]</a></code>
|
||||
- <code title="get /zones/{zone_id}/ssl/certificate_packs/{certificate_pack_id}">client.ssl.certificate_packs.<a href="./src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py">get</a>(certificate_pack_id, \*, zone_id) -> object</code>
|
||||
- <code title="get /zones/{zone_id}/ssl/certificate_packs/{certificate_pack_id}">client.ssl.certificate_packs.<a href="./src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py">get</a>(certificate_pack_id, \*, zone_id) -> <a href="./src/cloudflare/types/ssl/certificate_pack_get_response.py">Optional[CertificatePackGetResponse]</a></code>
|
||||
|
||||
### Quota
|
||||
|
||||
|
|
@ -1337,225 +1339,6 @@ Methods:
|
|||
- <code title="delete /accounts/{account_id}/secondary_dns/tsigs/{tsig_id}">client.dns.zone_transfers.tsigs.<a href="./src/cloudflare/resources/dns/zone_transfers/tsigs.py">delete</a>(tsig_id, \*, account_id) -> <a href="./src/cloudflare/types/dns/zone_transfers/tsig_delete_response.py">Optional[TSIGDeleteResponse]</a></code>
|
||||
- <code title="get /accounts/{account_id}/secondary_dns/tsigs/{tsig_id}">client.dns.zone_transfers.tsigs.<a href="./src/cloudflare/resources/dns/zone_transfers/tsigs.py">get</a>(tsig_id, \*, account_id) -> <a href="./src/cloudflare/types/dns/zone_transfers/tsig.py">Optional[TSIG]</a></code>
|
||||
|
||||
# EmailSecurity
|
||||
|
||||
## Investigate
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.email_security import InvestigateListResponse, InvestigateGetResponse
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="get /accounts/{account_id}/email-security/investigate">client.email_security.investigate.<a href="./src/cloudflare/resources/email_security/investigate/investigate.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/email_security/investigate_list_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/investigate_list_response.py">SyncV4PagePaginationArray[InvestigateListResponse]</a></code>
|
||||
- <code title="get /accounts/{account_id}/email-security/investigate/{postfix_id}">client.email_security.investigate.<a href="./src/cloudflare/resources/email_security/investigate/investigate.py">get</a>(postfix_id, \*, account_id) -> <a href="./src/cloudflare/types/email_security/investigate_get_response.py">InvestigateGetResponse</a></code>
|
||||
|
||||
### Detections
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.email_security.investigate import DetectionGetResponse
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="get /accounts/{account_id}/email-security/investigate/{postfix_id}/detections">client.email_security.investigate.detections.<a href="./src/cloudflare/resources/email_security/investigate/detections.py">get</a>(postfix_id, \*, account_id) -> <a href="./src/cloudflare/types/email_security/investigate/detection_get_response.py">DetectionGetResponse</a></code>
|
||||
|
||||
### Preview
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.email_security.investigate import PreviewCreateResponse, PreviewGetResponse
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_id}/email-security/investigate/preview">client.email_security.investigate.preview.<a href="./src/cloudflare/resources/email_security/investigate/preview.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/email_security/investigate/preview_create_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/investigate/preview_create_response.py">PreviewCreateResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/email-security/investigate/{postfix_id}/preview">client.email_security.investigate.preview.<a href="./src/cloudflare/resources/email_security/investigate/preview.py">get</a>(postfix_id, \*, account_id) -> <a href="./src/cloudflare/types/email_security/investigate/preview_get_response.py">PreviewGetResponse</a></code>
|
||||
|
||||
### Raw
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.email_security.investigate import RawGetResponse
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="get /accounts/{account_id}/email-security/investigate/{postfix_id}/raw">client.email_security.investigate.raw.<a href="./src/cloudflare/resources/email_security/investigate/raw.py">get</a>(postfix_id, \*, account_id) -> <a href="./src/cloudflare/types/email_security/investigate/raw_get_response.py">RawGetResponse</a></code>
|
||||
|
||||
### Trace
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.email_security.investigate import TraceGetResponse
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="get /accounts/{account_id}/email-security/investigate/{postfix_id}/trace">client.email_security.investigate.trace.<a href="./src/cloudflare/resources/email_security/investigate/trace.py">get</a>(postfix_id, \*, account_id) -> <a href="./src/cloudflare/types/email_security/investigate/trace_get_response.py">TraceGetResponse</a></code>
|
||||
|
||||
### Move
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.email_security.investigate import MoveCreateResponse, MoveBulkResponse
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_id}/email-security/investigate/{postfix_id}/move">client.email_security.investigate.move.<a href="./src/cloudflare/resources/email_security/investigate/move.py">create</a>(postfix_id, \*, account_id, \*\*<a href="src/cloudflare/types/email_security/investigate/move_create_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/investigate/move_create_response.py">SyncSinglePage[MoveCreateResponse]</a></code>
|
||||
- <code title="post /accounts/{account_id}/email-security/investigate/move">client.email_security.investigate.move.<a href="./src/cloudflare/resources/email_security/investigate/move.py">bulk</a>(\*, account_id, \*\*<a href="src/cloudflare/types/email_security/investigate/move_bulk_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/investigate/move_bulk_response.py">SyncSinglePage[MoveBulkResponse]</a></code>
|
||||
|
||||
### Reclassify
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_id}/email-security/investigate/{postfix_id}/reclassify">client.email_security.investigate.reclassify.<a href="./src/cloudflare/resources/email_security/investigate/reclassify.py">create</a>(postfix_id, \*, account_id, \*\*<a href="src/cloudflare/types/email_security/investigate/reclassify_create_params.py">params</a>) -> object</code>
|
||||
|
||||
### Release
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.email_security.investigate import ReleaseBulkResponse
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_id}/email-security/investigate/release">client.email_security.investigate.release.<a href="./src/cloudflare/resources/email_security/investigate/release.py">bulk</a>(\*, account_id, \*\*<a href="src/cloudflare/types/email_security/investigate/release_bulk_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/investigate/release_bulk_response.py">SyncSinglePage[ReleaseBulkResponse]</a></code>
|
||||
|
||||
## Settings
|
||||
|
||||
### AllowPolicies
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.email_security.settings import (
|
||||
AllowPolicyCreateResponse,
|
||||
AllowPolicyListResponse,
|
||||
AllowPolicyDeleteResponse,
|
||||
AllowPolicyEditResponse,
|
||||
AllowPolicyGetResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_id}/email-security/settings/allow_policies">client.email_security.settings.allow_policies.<a href="./src/cloudflare/resources/email_security/settings/allow_policies.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/email_security/settings/allow_policy_create_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/settings/allow_policy_create_response.py">AllowPolicyCreateResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/email-security/settings/allow_policies">client.email_security.settings.allow_policies.<a href="./src/cloudflare/resources/email_security/settings/allow_policies.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/email_security/settings/allow_policy_list_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/settings/allow_policy_list_response.py">SyncV4PagePaginationArray[AllowPolicyListResponse]</a></code>
|
||||
- <code title="delete /accounts/{account_id}/email-security/settings/allow_policies/{policy_id}">client.email_security.settings.allow_policies.<a href="./src/cloudflare/resources/email_security/settings/allow_policies.py">delete</a>(policy_id, \*, account_id) -> <a href="./src/cloudflare/types/email_security/settings/allow_policy_delete_response.py">AllowPolicyDeleteResponse</a></code>
|
||||
- <code title="patch /accounts/{account_id}/email-security/settings/allow_policies/{policy_id}">client.email_security.settings.allow_policies.<a href="./src/cloudflare/resources/email_security/settings/allow_policies.py">edit</a>(policy_id, \*, account_id, \*\*<a href="src/cloudflare/types/email_security/settings/allow_policy_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/settings/allow_policy_edit_response.py">AllowPolicyEditResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/email-security/settings/allow_policies/{policy_id}">client.email_security.settings.allow_policies.<a href="./src/cloudflare/resources/email_security/settings/allow_policies.py">get</a>(policy_id, \*, account_id) -> <a href="./src/cloudflare/types/email_security/settings/allow_policy_get_response.py">AllowPolicyGetResponse</a></code>
|
||||
|
||||
### BlockSenders
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.email_security.settings import (
|
||||
BlockSenderCreateResponse,
|
||||
BlockSenderListResponse,
|
||||
BlockSenderDeleteResponse,
|
||||
BlockSenderEditResponse,
|
||||
BlockSenderGetResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_id}/email-security/settings/block_senders">client.email_security.settings.block_senders.<a href="./src/cloudflare/resources/email_security/settings/block_senders.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/email_security/settings/block_sender_create_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/settings/block_sender_create_response.py">BlockSenderCreateResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/email-security/settings/block_senders">client.email_security.settings.block_senders.<a href="./src/cloudflare/resources/email_security/settings/block_senders.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/email_security/settings/block_sender_list_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/settings/block_sender_list_response.py">SyncV4PagePaginationArray[BlockSenderListResponse]</a></code>
|
||||
- <code title="delete /accounts/{account_id}/email-security/settings/block_senders/{pattern_id}">client.email_security.settings.block_senders.<a href="./src/cloudflare/resources/email_security/settings/block_senders.py">delete</a>(pattern_id, \*, account_id) -> <a href="./src/cloudflare/types/email_security/settings/block_sender_delete_response.py">BlockSenderDeleteResponse</a></code>
|
||||
- <code title="patch /accounts/{account_id}/email-security/settings/block_senders/{pattern_id}">client.email_security.settings.block_senders.<a href="./src/cloudflare/resources/email_security/settings/block_senders.py">edit</a>(pattern_id, \*, account_id, \*\*<a href="src/cloudflare/types/email_security/settings/block_sender_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/settings/block_sender_edit_response.py">BlockSenderEditResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/email-security/settings/block_senders/{pattern_id}">client.email_security.settings.block_senders.<a href="./src/cloudflare/resources/email_security/settings/block_senders.py">get</a>(pattern_id, \*, account_id) -> <a href="./src/cloudflare/types/email_security/settings/block_sender_get_response.py">BlockSenderGetResponse</a></code>
|
||||
|
||||
### Domains
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.email_security.settings import (
|
||||
DomainListResponse,
|
||||
DomainDeleteResponse,
|
||||
DomainBulkDeleteResponse,
|
||||
DomainEditResponse,
|
||||
DomainGetResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="get /accounts/{account_id}/email-security/settings/domains">client.email_security.settings.domains.<a href="./src/cloudflare/resources/email_security/settings/domains.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/email_security/settings/domain_list_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/settings/domain_list_response.py">SyncV4PagePaginationArray[DomainListResponse]</a></code>
|
||||
- <code title="delete /accounts/{account_id}/email-security/settings/domains/{domain_id}">client.email_security.settings.domains.<a href="./src/cloudflare/resources/email_security/settings/domains.py">delete</a>(domain_id, \*, account_id) -> <a href="./src/cloudflare/types/email_security/settings/domain_delete_response.py">DomainDeleteResponse</a></code>
|
||||
- <code title="delete /accounts/{account_id}/email-security/settings/domains">client.email_security.settings.domains.<a href="./src/cloudflare/resources/email_security/settings/domains.py">bulk_delete</a>(\*, account_id) -> <a href="./src/cloudflare/types/email_security/settings/domain_bulk_delete_response.py">SyncSinglePage[DomainBulkDeleteResponse]</a></code>
|
||||
- <code title="patch /accounts/{account_id}/email-security/settings/domains/{domain_id}">client.email_security.settings.domains.<a href="./src/cloudflare/resources/email_security/settings/domains.py">edit</a>(domain_id, \*, account_id, \*\*<a href="src/cloudflare/types/email_security/settings/domain_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/settings/domain_edit_response.py">DomainEditResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/email-security/settings/domains/{domain_id}">client.email_security.settings.domains.<a href="./src/cloudflare/resources/email_security/settings/domains.py">get</a>(domain_id, \*, account_id) -> <a href="./src/cloudflare/types/email_security/settings/domain_get_response.py">DomainGetResponse</a></code>
|
||||
|
||||
### ImpersonationRegistry
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.email_security.settings import (
|
||||
ImpersonationRegistryCreateResponse,
|
||||
ImpersonationRegistryListResponse,
|
||||
ImpersonationRegistryDeleteResponse,
|
||||
ImpersonationRegistryEditResponse,
|
||||
ImpersonationRegistryGetResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_id}/email-security/settings/impersonation_registry">client.email_security.settings.impersonation_registry.<a href="./src/cloudflare/resources/email_security/settings/impersonation_registry.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/email_security/settings/impersonation_registry_create_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/settings/impersonation_registry_create_response.py">ImpersonationRegistryCreateResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/email-security/settings/impersonation_registry">client.email_security.settings.impersonation_registry.<a href="./src/cloudflare/resources/email_security/settings/impersonation_registry.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/email_security/settings/impersonation_registry_list_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/settings/impersonation_registry_list_response.py">SyncV4PagePaginationArray[ImpersonationRegistryListResponse]</a></code>
|
||||
- <code title="delete /accounts/{account_id}/email-security/settings/impersonation_registry/{display_name_id}">client.email_security.settings.impersonation_registry.<a href="./src/cloudflare/resources/email_security/settings/impersonation_registry.py">delete</a>(display_name_id, \*, account_id) -> <a href="./src/cloudflare/types/email_security/settings/impersonation_registry_delete_response.py">ImpersonationRegistryDeleteResponse</a></code>
|
||||
- <code title="patch /accounts/{account_id}/email-security/settings/impersonation_registry/{display_name_id}">client.email_security.settings.impersonation_registry.<a href="./src/cloudflare/resources/email_security/settings/impersonation_registry.py">edit</a>(display_name_id, \*, account_id, \*\*<a href="src/cloudflare/types/email_security/settings/impersonation_registry_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/settings/impersonation_registry_edit_response.py">ImpersonationRegistryEditResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/email-security/settings/impersonation_registry/{display_name_id}">client.email_security.settings.impersonation_registry.<a href="./src/cloudflare/resources/email_security/settings/impersonation_registry.py">get</a>(display_name_id, \*, account_id) -> <a href="./src/cloudflare/types/email_security/settings/impersonation_registry_get_response.py">ImpersonationRegistryGetResponse</a></code>
|
||||
|
||||
### TrustedDomains
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.email_security.settings import (
|
||||
TrustedDomainCreateResponse,
|
||||
TrustedDomainListResponse,
|
||||
TrustedDomainDeleteResponse,
|
||||
TrustedDomainEditResponse,
|
||||
TrustedDomainGetResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <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>
|
||||
- <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>
|
||||
- <code title="delete /accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}">client.email_security.settings.trusted_domains.<a href="./src/cloudflare/resources/email_security/settings/trusted_domains.py">delete</a>(trusted_domain_id, \*, account_id) -> <a href="./src/cloudflare/types/email_security/settings/trusted_domain_delete_response.py">TrustedDomainDeleteResponse</a></code>
|
||||
- <code title="patch /accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}">client.email_security.settings.trusted_domains.<a href="./src/cloudflare/resources/email_security/settings/trusted_domains.py">edit</a>(trusted_domain_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>
|
||||
- <code title="get /accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}">client.email_security.settings.trusted_domains.<a href="./src/cloudflare/resources/email_security/settings/trusted_domains.py">get</a>(trusted_domain_id, \*, account_id) -> <a href="./src/cloudflare/types/email_security/settings/trusted_domain_get_response.py">TrustedDomainGetResponse</a></code>
|
||||
|
||||
## Submissions
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.email_security import SubmissionListResponse
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="get /accounts/{account_id}/email-security/submissions">client.email_security.submissions.<a href="./src/cloudflare/resources/email_security/submissions.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/email_security/submission_list_params.py">params</a>) -> <a href="./src/cloudflare/types/email_security/submission_list_response.py">SyncV4PagePaginationArray[SubmissionListResponse]</a></code>
|
||||
|
||||
# EmailRouting
|
||||
|
||||
Types:
|
||||
|
|
@ -4501,28 +4284,48 @@ Methods:
|
|||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.pages import Deployment, Project, Stage
|
||||
from cloudflare.types.pages import (
|
||||
Deployment,
|
||||
Project,
|
||||
Stage,
|
||||
ProjectCreateResponse,
|
||||
ProjectListResponse,
|
||||
ProjectEditResponse,
|
||||
ProjectGetResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_id}/pages/projects">client.pages.projects.<a href="./src/cloudflare/resources/pages/projects/projects.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/pages/project_create_params.py">params</a>) -> <a href="./src/cloudflare/types/pages/project.py">Project</a></code>
|
||||
- <code title="get /accounts/{account_id}/pages/projects">client.pages.projects.<a href="./src/cloudflare/resources/pages/projects/projects.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/pages/project_list_params.py">params</a>) -> <a href="./src/cloudflare/types/pages/deployment.py">SyncV4PagePaginationArray[Deployment]</a></code>
|
||||
- <code title="post /accounts/{account_id}/pages/projects">client.pages.projects.<a href="./src/cloudflare/resources/pages/projects/projects.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/pages/project_create_params.py">params</a>) -> <a href="./src/cloudflare/types/pages/project_create_response.py">ProjectCreateResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/pages/projects">client.pages.projects.<a href="./src/cloudflare/resources/pages/projects/projects.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/pages/project_list_params.py">params</a>) -> <a href="./src/cloudflare/types/pages/project_list_response.py">SyncV4PagePaginationArray[ProjectListResponse]</a></code>
|
||||
- <code title="delete /accounts/{account_id}/pages/projects/{project_name}">client.pages.projects.<a href="./src/cloudflare/resources/pages/projects/projects.py">delete</a>(project_name, \*, account_id) -> object</code>
|
||||
- <code title="patch /accounts/{account_id}/pages/projects/{project_name}">client.pages.projects.<a href="./src/cloudflare/resources/pages/projects/projects.py">edit</a>(project_name, \*, account_id, \*\*<a href="src/cloudflare/types/pages/project_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/pages/project.py">Project</a></code>
|
||||
- <code title="get /accounts/{account_id}/pages/projects/{project_name}">client.pages.projects.<a href="./src/cloudflare/resources/pages/projects/projects.py">get</a>(project_name, \*, account_id) -> <a href="./src/cloudflare/types/pages/project.py">Project</a></code>
|
||||
- <code title="patch /accounts/{account_id}/pages/projects/{project_name}">client.pages.projects.<a href="./src/cloudflare/resources/pages/projects/projects.py">edit</a>(project_name, \*, account_id, \*\*<a href="src/cloudflare/types/pages/project_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/pages/project_edit_response.py">ProjectEditResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/pages/projects/{project_name}">client.pages.projects.<a href="./src/cloudflare/resources/pages/projects/projects.py">get</a>(project_name, \*, account_id) -> <a href="./src/cloudflare/types/pages/project_get_response.py">ProjectGetResponse</a></code>
|
||||
- <code title="post /accounts/{account_id}/pages/projects/{project_name}/purge_build_cache">client.pages.projects.<a href="./src/cloudflare/resources/pages/projects/projects.py">purge_build_cache</a>(project_name, \*, account_id) -> object</code>
|
||||
|
||||
### Deployments
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.pages.projects import (
|
||||
DeploymentCreateResponse,
|
||||
DeploymentListResponse,
|
||||
DeploymentGetResponse,
|
||||
DeploymentRetryResponse,
|
||||
DeploymentRollbackResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_id}/pages/projects/{project_name}/deployments">client.pages.projects.deployments.<a href="./src/cloudflare/resources/pages/projects/deployments/deployments.py">create</a>(project_name, \*, account_id, \*\*<a href="src/cloudflare/types/pages/projects/deployment_create_params.py">params</a>) -> <a href="./src/cloudflare/types/pages/deployment.py">Deployment</a></code>
|
||||
- <code title="get /accounts/{account_id}/pages/projects/{project_name}/deployments">client.pages.projects.deployments.<a href="./src/cloudflare/resources/pages/projects/deployments/deployments.py">list</a>(project_name, \*, account_id, \*\*<a href="src/cloudflare/types/pages/projects/deployment_list_params.py">params</a>) -> <a href="./src/cloudflare/types/pages/deployment.py">SyncV4PagePaginationArray[Deployment]</a></code>
|
||||
- <code title="post /accounts/{account_id}/pages/projects/{project_name}/deployments">client.pages.projects.deployments.<a href="./src/cloudflare/resources/pages/projects/deployments/deployments.py">create</a>(project_name, \*, account_id, \*\*<a href="src/cloudflare/types/pages/projects/deployment_create_params.py">params</a>) -> <a href="./src/cloudflare/types/pages/projects/deployment_create_response.py">DeploymentCreateResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/pages/projects/{project_name}/deployments">client.pages.projects.deployments.<a href="./src/cloudflare/resources/pages/projects/deployments/deployments.py">list</a>(project_name, \*, account_id, \*\*<a href="src/cloudflare/types/pages/projects/deployment_list_params.py">params</a>) -> <a href="./src/cloudflare/types/pages/projects/deployment_list_response.py">SyncV4PagePaginationArray[DeploymentListResponse]</a></code>
|
||||
- <code title="delete /accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}">client.pages.projects.deployments.<a href="./src/cloudflare/resources/pages/projects/deployments/deployments.py">delete</a>(deployment_id, \*, account_id, project_name) -> object</code>
|
||||
- <code title="get /accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}">client.pages.projects.deployments.<a href="./src/cloudflare/resources/pages/projects/deployments/deployments.py">get</a>(deployment_id, \*, account_id, project_name) -> <a href="./src/cloudflare/types/pages/deployment.py">Deployment</a></code>
|
||||
- <code title="post /accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/retry">client.pages.projects.deployments.<a href="./src/cloudflare/resources/pages/projects/deployments/deployments.py">retry</a>(deployment_id, \*, account_id, project_name, \*\*<a href="src/cloudflare/types/pages/projects/deployment_retry_params.py">params</a>) -> <a href="./src/cloudflare/types/pages/deployment.py">Deployment</a></code>
|
||||
- <code title="post /accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/rollback">client.pages.projects.deployments.<a href="./src/cloudflare/resources/pages/projects/deployments/deployments.py">rollback</a>(deployment_id, \*, account_id, project_name, \*\*<a href="src/cloudflare/types/pages/projects/deployment_rollback_params.py">params</a>) -> <a href="./src/cloudflare/types/pages/deployment.py">Deployment</a></code>
|
||||
- <code title="get /accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}">client.pages.projects.deployments.<a href="./src/cloudflare/resources/pages/projects/deployments/deployments.py">get</a>(deployment_id, \*, account_id, project_name) -> <a href="./src/cloudflare/types/pages/projects/deployment_get_response.py">DeploymentGetResponse</a></code>
|
||||
- <code title="post /accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/retry">client.pages.projects.deployments.<a href="./src/cloudflare/resources/pages/projects/deployments/deployments.py">retry</a>(deployment_id, \*, account_id, project_name) -> <a href="./src/cloudflare/types/pages/projects/deployment_retry_response.py">DeploymentRetryResponse</a></code>
|
||||
- <code title="post /accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/rollback">client.pages.projects.deployments.<a href="./src/cloudflare/resources/pages/projects/deployments/deployments.py">rollback</a>(deployment_id, \*, account_id, project_name) -> <a href="./src/cloudflare/types/pages/projects/deployment_rollback_response.py">DeploymentRollbackResponse</a></code>
|
||||
|
||||
#### History
|
||||
|
||||
|
|
@ -4553,11 +4356,11 @@ from cloudflare.types.pages.projects import (
|
|||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_id}/pages/projects/{project_name}/domains">client.pages.projects.domains.<a href="./src/cloudflare/resources/pages/projects/domains.py">create</a>(project_name, \*, account_id, \*\*<a href="src/cloudflare/types/pages/projects/domain_create_params.py">params</a>) -> <a href="./src/cloudflare/types/pages/projects/domain_create_response.py">Optional[DomainCreateResponse]</a></code>
|
||||
- <code title="post /accounts/{account_id}/pages/projects/{project_name}/domains">client.pages.projects.domains.<a href="./src/cloudflare/resources/pages/projects/domains.py">create</a>(project_name, \*, account_id, \*\*<a href="src/cloudflare/types/pages/projects/domain_create_params.py">params</a>) -> <a href="./src/cloudflare/types/pages/projects/domain_create_response.py">DomainCreateResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/pages/projects/{project_name}/domains">client.pages.projects.domains.<a href="./src/cloudflare/resources/pages/projects/domains.py">list</a>(project_name, \*, account_id) -> <a href="./src/cloudflare/types/pages/projects/domain_list_response.py">SyncSinglePage[DomainListResponse]</a></code>
|
||||
- <code title="delete /accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}">client.pages.projects.domains.<a href="./src/cloudflare/resources/pages/projects/domains.py">delete</a>(domain_name, \*, account_id, project_name) -> object</code>
|
||||
- <code title="patch /accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}">client.pages.projects.domains.<a href="./src/cloudflare/resources/pages/projects/domains.py">edit</a>(domain_name, \*, account_id, project_name, \*\*<a href="src/cloudflare/types/pages/projects/domain_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/pages/projects/domain_edit_response.py">Optional[DomainEditResponse]</a></code>
|
||||
- <code title="get /accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}">client.pages.projects.domains.<a href="./src/cloudflare/resources/pages/projects/domains.py">get</a>(domain_name, \*, account_id, project_name) -> <a href="./src/cloudflare/types/pages/projects/domain_get_response.py">Optional[DomainGetResponse]</a></code>
|
||||
- <code title="patch /accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}">client.pages.projects.domains.<a href="./src/cloudflare/resources/pages/projects/domains.py">edit</a>(domain_name, \*, account_id, project_name) -> <a href="./src/cloudflare/types/pages/projects/domain_edit_response.py">DomainEditResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}">client.pages.projects.domains.<a href="./src/cloudflare/resources/pages/projects/domains.py">get</a>(domain_name, \*, account_id, project_name) -> <a href="./src/cloudflare/types/pages/projects/domain_get_response.py">DomainGetResponse</a></code>
|
||||
|
||||
# Registrar
|
||||
|
||||
|
|
@ -6571,29 +6374,40 @@ Methods:
|
|||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.zero_trust.dlp import Dataset, DatasetArray, DatasetCreation
|
||||
from cloudflare.types.zero_trust.dlp import (
|
||||
Dataset,
|
||||
DatasetArray,
|
||||
DatasetCreation,
|
||||
DatasetCreateResponse,
|
||||
DatasetUpdateResponse,
|
||||
DatasetGetResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_id}/dlp/datasets">client.zero_trust.dlp.datasets.<a href="./src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/dlp/dataset_create_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/dlp/dataset_creation.py">Optional[DatasetCreation]</a></code>
|
||||
- <code title="put /accounts/{account_id}/dlp/datasets/{dataset_id}">client.zero_trust.dlp.datasets.<a href="./src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py">update</a>(dataset_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/dlp/dataset_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/dlp/dataset.py">Optional[Dataset]</a></code>
|
||||
- <code title="post /accounts/{account_id}/dlp/datasets">client.zero_trust.dlp.datasets.<a href="./src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/dlp/dataset_create_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/dlp/dataset_create_response.py">Optional[DatasetCreateResponse]</a></code>
|
||||
- <code title="put /accounts/{account_id}/dlp/datasets/{dataset_id}">client.zero_trust.dlp.datasets.<a href="./src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py">update</a>(dataset_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/dlp/dataset_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/dlp/dataset_update_response.py">Optional[DatasetUpdateResponse]</a></code>
|
||||
- <code title="get /accounts/{account_id}/dlp/datasets">client.zero_trust.dlp.datasets.<a href="./src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/zero_trust/dlp/dataset.py">SyncSinglePage[Dataset]</a></code>
|
||||
- <code title="delete /accounts/{account_id}/dlp/datasets/{dataset_id}">client.zero_trust.dlp.datasets.<a href="./src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py">delete</a>(dataset_id, \*, account_id) -> None</code>
|
||||
- <code title="get /accounts/{account_id}/dlp/datasets/{dataset_id}">client.zero_trust.dlp.datasets.<a href="./src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py">get</a>(dataset_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/dlp/dataset.py">Optional[Dataset]</a></code>
|
||||
- <code title="get /accounts/{account_id}/dlp/datasets/{dataset_id}">client.zero_trust.dlp.datasets.<a href="./src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py">get</a>(dataset_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/dlp/dataset_get_response.py">Optional[DatasetGetResponse]</a></code>
|
||||
|
||||
#### Upload
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.zero_trust.dlp.datasets import NewVersion
|
||||
from cloudflare.types.zero_trust.dlp.datasets import (
|
||||
NewVersion,
|
||||
UploadCreateResponse,
|
||||
UploadEditResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_id}/dlp/datasets/{dataset_id}/upload">client.zero_trust.dlp.datasets.upload.<a href="./src/cloudflare/resources/zero_trust/dlp/datasets/upload.py">create</a>(dataset_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/dlp/datasets/new_version.py">Optional[NewVersion]</a></code>
|
||||
- <code title="post /accounts/{account_id}/dlp/datasets/{dataset_id}/upload/{version}">client.zero_trust.dlp.datasets.upload.<a href="./src/cloudflare/resources/zero_trust/dlp/datasets/upload.py">edit</a>(version, dataset, \*, account_id, dataset_id, \*\*<a href="src/cloudflare/types/zero_trust/dlp/datasets/upload_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/dlp/dataset.py">Optional[Dataset]</a></code>
|
||||
- <code title="post /accounts/{account_id}/dlp/datasets/{dataset_id}/upload">client.zero_trust.dlp.datasets.upload.<a href="./src/cloudflare/resources/zero_trust/dlp/datasets/upload.py">create</a>(dataset_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/dlp/datasets/upload_create_response.py">Optional[UploadCreateResponse]</a></code>
|
||||
- <code title="post /accounts/{account_id}/dlp/datasets/{dataset_id}/upload/{version}">client.zero_trust.dlp.datasets.upload.<a href="./src/cloudflare/resources/zero_trust/dlp/datasets/upload.py">edit</a>(version, dataset, \*, account_id, dataset_id, \*\*<a href="src/cloudflare/types/zero_trust/dlp/datasets/upload_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/dlp/datasets/upload_edit_response.py">Optional[UploadEditResponse]</a></code>
|
||||
|
||||
#### Versions
|
||||
|
||||
|
|
@ -6691,42 +6505,57 @@ Methods:
|
|||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.zero_trust.dlp import ContextAwareness, Profile, SkipConfiguration
|
||||
from cloudflare.types.zero_trust.dlp import (
|
||||
ContextAwareness,
|
||||
Profile,
|
||||
SkipConfiguration,
|
||||
ProfileGetResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="get /accounts/{account_id}/dlp/profiles">client.zero_trust.dlp.profiles.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/dlp/profile_list_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/dlp/profile.py">SyncSinglePage[Profile]</a></code>
|
||||
- <code title="get /accounts/{account_id}/dlp/profiles/{profile_id}">client.zero_trust.dlp.profiles.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py">get</a>(profile_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/dlp/profile.py">Optional[Profile]</a></code>
|
||||
- <code title="get /accounts/{account_id}/dlp/profiles/{profile_id}">client.zero_trust.dlp.profiles.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py">get</a>(profile_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/dlp/profile_get_response.py">Optional[ProfileGetResponse]</a></code>
|
||||
|
||||
#### Custom
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.zero_trust.dlp.profiles import CustomProfile, Pattern
|
||||
from cloudflare.types.zero_trust.dlp.profiles import (
|
||||
CustomProfile,
|
||||
Pattern,
|
||||
CustomCreateResponse,
|
||||
CustomUpdateResponse,
|
||||
CustomGetResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_id}/dlp/profiles/custom">client.zero_trust.dlp.profiles.custom.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/custom.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/dlp/profile.py">Optional[Profile]</a></code>
|
||||
- <code title="put /accounts/{account_id}/dlp/profiles/custom/{profile_id}">client.zero_trust.dlp.profiles.custom.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/custom.py">update</a>(profile_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/dlp/profile.py">Optional[Profile]</a></code>
|
||||
- <code title="post /accounts/{account_id}/dlp/profiles/custom">client.zero_trust.dlp.profiles.custom.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/custom.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py">Optional[CustomCreateResponse]</a></code>
|
||||
- <code title="put /accounts/{account_id}/dlp/profiles/custom/{profile_id}">client.zero_trust.dlp.profiles.custom.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/custom.py">update</a>(profile_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/dlp/profiles/custom_update_response.py">Optional[CustomUpdateResponse]</a></code>
|
||||
- <code title="delete /accounts/{account_id}/dlp/profiles/custom/{profile_id}">client.zero_trust.dlp.profiles.custom.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/custom.py">delete</a>(profile_id, \*, account_id) -> object</code>
|
||||
- <code title="get /accounts/{account_id}/dlp/profiles/custom/{profile_id}">client.zero_trust.dlp.profiles.custom.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/custom.py">get</a>(profile_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/dlp/profile.py">Optional[Profile]</a></code>
|
||||
- <code title="get /accounts/{account_id}/dlp/profiles/custom/{profile_id}">client.zero_trust.dlp.profiles.custom.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/custom.py">get</a>(profile_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/dlp/profiles/custom_get_response.py">Optional[CustomGetResponse]</a></code>
|
||||
|
||||
#### Predefined
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.zero_trust.dlp.profiles import PredefinedProfile
|
||||
from cloudflare.types.zero_trust.dlp.profiles import (
|
||||
PredefinedProfile,
|
||||
PredefinedUpdateResponse,
|
||||
PredefinedGetResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="put /accounts/{account_id}/dlp/profiles/predefined/{profile_id}/config">client.zero_trust.dlp.profiles.predefined.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py">update</a>(profile_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/dlp/profiles/predefined_profile.py">Optional[PredefinedProfile]</a></code>
|
||||
- <code title="put /accounts/{account_id}/dlp/profiles/predefined/{profile_id}/config">client.zero_trust.dlp.profiles.predefined.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py">update</a>(profile_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_response.py">Optional[PredefinedUpdateResponse]</a></code>
|
||||
- <code title="delete /accounts/{account_id}/dlp/profiles/predefined/{profile_id}">client.zero_trust.dlp.profiles.predefined.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py">delete</a>(profile_id, \*, account_id) -> object</code>
|
||||
- <code title="get /accounts/{account_id}/dlp/profiles/predefined/{profile_id}/config">client.zero_trust.dlp.profiles.predefined.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py">get</a>(profile_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/dlp/profiles/predefined_profile.py">Optional[PredefinedProfile]</a></code>
|
||||
- <code title="get /accounts/{account_id}/dlp/profiles/predefined/{profile_id}/config">client.zero_trust.dlp.profiles.predefined.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py">get</a>(profile_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/dlp/profiles/predefined_get_response.py">Optional[PredefinedGetResponse]</a></code>
|
||||
|
||||
### Limits
|
||||
|
||||
|
|
@ -9678,7 +9507,7 @@ from cloudflare.types.iam import PermissionGroupListResponse, PermissionGroupGet
|
|||
Methods:
|
||||
|
||||
- <code title="get /accounts/{account_id}/iam/permission_groups">client.iam.permission_groups.<a href="./src/cloudflare/resources/iam/permission_groups.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/iam/permission_group_list_params.py">params</a>) -> <a href="./src/cloudflare/types/iam/permission_group_list_response.py">SyncV4PagePaginationArray[PermissionGroupListResponse]</a></code>
|
||||
- <code title="get /accounts/{account_id}/iam/permission_groups/{permission_group_id}">client.iam.permission_groups.<a href="./src/cloudflare/resources/iam/permission_groups.py">get</a>(permission_group_id, \*, account_id) -> <a href="./src/cloudflare/types/iam/permission_group_get_response.py">PermissionGroupGetResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/iam/permission_groups/{permission_group_id}">client.iam.permission_groups.<a href="./src/cloudflare/resources/iam/permission_groups.py">get</a>(permission_group_id, \*, account_id) -> <a href="./src/cloudflare/types/iam/permission_group_get_response.py">Optional[PermissionGroupGetResponse]</a></code>
|
||||
|
||||
## ResourceGroups
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,6 @@ if TYPE_CHECKING:
|
|||
bot_management,
|
||||
cloudforce_one,
|
||||
dcv_delegation,
|
||||
email_security,
|
||||
load_balancers,
|
||||
cloud_connector,
|
||||
durable_objects,
|
||||
|
|
@ -208,7 +207,6 @@ if TYPE_CHECKING:
|
|||
from .resources.secrets_store.secrets_store import SecretsStoreResource, AsyncSecretsStoreResource
|
||||
from .resources.waiting_rooms.waiting_rooms import WaitingRoomsResource, AsyncWaitingRoomsResource
|
||||
from .resources.cloudforce_one.cloudforce_one import CloudforceOneResource, AsyncCloudforceOneResource
|
||||
from .resources.email_security.email_security import EmailSecurityResource, AsyncEmailSecurityResource
|
||||
from .resources.load_balancers.load_balancers import LoadBalancersResource, AsyncLoadBalancersResource
|
||||
from .resources.origin_post_quantum_encryption import (
|
||||
OriginPostQuantumEncryptionResource,
|
||||
|
|
@ -463,12 +461,6 @@ class Cloudflare(SyncAPIClient):
|
|||
|
||||
return DNSResource(self)
|
||||
|
||||
@cached_property
|
||||
def email_security(self) -> EmailSecurityResource:
|
||||
from .resources.email_security import EmailSecurityResource
|
||||
|
||||
return EmailSecurityResource(self)
|
||||
|
||||
@cached_property
|
||||
def email_routing(self) -> EmailRoutingResource:
|
||||
from .resources.email_routing import EmailRoutingResource
|
||||
|
|
@ -1313,12 +1305,6 @@ class AsyncCloudflare(AsyncAPIClient):
|
|||
|
||||
return AsyncDNSResource(self)
|
||||
|
||||
@cached_property
|
||||
def email_security(self) -> AsyncEmailSecurityResource:
|
||||
from .resources.email_security import AsyncEmailSecurityResource
|
||||
|
||||
return AsyncEmailSecurityResource(self)
|
||||
|
||||
@cached_property
|
||||
def email_routing(self) -> AsyncEmailRoutingResource:
|
||||
from .resources.email_routing import AsyncEmailRoutingResource
|
||||
|
|
@ -2091,12 +2077,6 @@ class CloudflareWithRawResponse:
|
|||
|
||||
return DNSResourceWithRawResponse(self._client.dns)
|
||||
|
||||
@cached_property
|
||||
def email_security(self) -> email_security.EmailSecurityResourceWithRawResponse:
|
||||
from .resources.email_security import EmailSecurityResourceWithRawResponse
|
||||
|
||||
return EmailSecurityResourceWithRawResponse(self._client.email_security)
|
||||
|
||||
@cached_property
|
||||
def email_routing(self) -> email_routing.EmailRoutingResourceWithRawResponse:
|
||||
from .resources.email_routing import EmailRoutingResourceWithRawResponse
|
||||
|
|
@ -2688,12 +2668,6 @@ class AsyncCloudflareWithRawResponse:
|
|||
|
||||
return AsyncDNSResourceWithRawResponse(self._client.dns)
|
||||
|
||||
@cached_property
|
||||
def email_security(self) -> email_security.AsyncEmailSecurityResourceWithRawResponse:
|
||||
from .resources.email_security import AsyncEmailSecurityResourceWithRawResponse
|
||||
|
||||
return AsyncEmailSecurityResourceWithRawResponse(self._client.email_security)
|
||||
|
||||
@cached_property
|
||||
def email_routing(self) -> email_routing.AsyncEmailRoutingResourceWithRawResponse:
|
||||
from .resources.email_routing import AsyncEmailRoutingResourceWithRawResponse
|
||||
|
|
@ -3285,12 +3259,6 @@ class CloudflareWithStreamedResponse:
|
|||
|
||||
return DNSResourceWithStreamingResponse(self._client.dns)
|
||||
|
||||
@cached_property
|
||||
def email_security(self) -> email_security.EmailSecurityResourceWithStreamingResponse:
|
||||
from .resources.email_security import EmailSecurityResourceWithStreamingResponse
|
||||
|
||||
return EmailSecurityResourceWithStreamingResponse(self._client.email_security)
|
||||
|
||||
@cached_property
|
||||
def email_routing(self) -> email_routing.EmailRoutingResourceWithStreamingResponse:
|
||||
from .resources.email_routing import EmailRoutingResourceWithStreamingResponse
|
||||
|
|
@ -3884,12 +3852,6 @@ class AsyncCloudflareWithStreamedResponse:
|
|||
|
||||
return AsyncDNSResourceWithStreamingResponse(self._client.dns)
|
||||
|
||||
@cached_property
|
||||
def email_security(self) -> email_security.AsyncEmailSecurityResourceWithStreamingResponse:
|
||||
from .resources.email_security import AsyncEmailSecurityResourceWithStreamingResponse
|
||||
|
||||
return AsyncEmailSecurityResourceWithStreamingResponse(self._client.email_security)
|
||||
|
||||
@cached_property
|
||||
def email_routing(self) -> email_routing.AsyncEmailRoutingResourceWithStreamingResponse:
|
||||
from .resources.email_routing import AsyncEmailRoutingResourceWithStreamingResponse
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ class AuditResource(SyncAPIResource):
|
|||
account_id: str,
|
||||
before: Union[str, date],
|
||||
since: Union[str, date],
|
||||
id: audit_list_params.ID | Omit = omit,
|
||||
account_name: audit_list_params.AccountName | Omit = omit,
|
||||
action_result: audit_list_params.ActionResult | Omit = omit,
|
||||
action_type: audit_list_params.ActionType | Omit = omit,
|
||||
|
|
@ -62,7 +63,6 @@ class AuditResource(SyncAPIResource):
|
|||
actor_token_id: audit_list_params.ActorTokenID | Omit = omit,
|
||||
actor_token_name: audit_list_params.ActorTokenName | Omit = omit,
|
||||
actor_type: audit_list_params.ActorType | Omit = omit,
|
||||
audit_log_id: audit_list_params.AuditLogID | Omit = omit,
|
||||
cursor: str | Omit = omit,
|
||||
direction: Literal["desc", "asc"] | Omit = omit,
|
||||
limit: float | Omit = omit,
|
||||
|
|
@ -134,6 +134,7 @@ class AuditResource(SyncAPIResource):
|
|||
{
|
||||
"before": before,
|
||||
"since": since,
|
||||
"id": id,
|
||||
"account_name": account_name,
|
||||
"action_result": action_result,
|
||||
"action_type": action_type,
|
||||
|
|
@ -144,7 +145,6 @@ class AuditResource(SyncAPIResource):
|
|||
"actor_token_id": actor_token_id,
|
||||
"actor_token_name": actor_token_name,
|
||||
"actor_type": actor_type,
|
||||
"audit_log_id": audit_log_id,
|
||||
"cursor": cursor,
|
||||
"direction": direction,
|
||||
"limit": limit,
|
||||
|
|
@ -192,6 +192,7 @@ class AsyncAuditResource(AsyncAPIResource):
|
|||
account_id: str,
|
||||
before: Union[str, date],
|
||||
since: Union[str, date],
|
||||
id: audit_list_params.ID | Omit = omit,
|
||||
account_name: audit_list_params.AccountName | Omit = omit,
|
||||
action_result: audit_list_params.ActionResult | Omit = omit,
|
||||
action_type: audit_list_params.ActionType | Omit = omit,
|
||||
|
|
@ -202,7 +203,6 @@ class AsyncAuditResource(AsyncAPIResource):
|
|||
actor_token_id: audit_list_params.ActorTokenID | Omit = omit,
|
||||
actor_token_name: audit_list_params.ActorTokenName | Omit = omit,
|
||||
actor_type: audit_list_params.ActorType | Omit = omit,
|
||||
audit_log_id: audit_list_params.AuditLogID | Omit = omit,
|
||||
cursor: str | Omit = omit,
|
||||
direction: Literal["desc", "asc"] | Omit = omit,
|
||||
limit: float | Omit = omit,
|
||||
|
|
@ -274,6 +274,7 @@ class AsyncAuditResource(AsyncAPIResource):
|
|||
{
|
||||
"before": before,
|
||||
"since": since,
|
||||
"id": id,
|
||||
"account_name": account_name,
|
||||
"action_result": action_result,
|
||||
"action_type": action_type,
|
||||
|
|
@ -284,7 +285,6 @@ class AsyncAuditResource(AsyncAPIResource):
|
|||
"actor_token_id": actor_token_id,
|
||||
"actor_token_name": actor_token_name,
|
||||
"actor_type": actor_type,
|
||||
"audit_log_id": audit_log_id,
|
||||
"cursor": cursor,
|
||||
"direction": direction,
|
||||
"limit": limit,
|
||||
|
|
|
|||
|
|
@ -183,7 +183,6 @@ class ThreatEventsResource(SyncAPIResource):
|
|||
category: str,
|
||||
date: Union[str, datetime],
|
||||
event: str,
|
||||
indicator_type: str,
|
||||
raw: threat_event_create_params.Raw,
|
||||
tlp: str,
|
||||
body_account_id: float | Omit = omit,
|
||||
|
|
@ -191,6 +190,8 @@ class ThreatEventsResource(SyncAPIResource):
|
|||
attacker_country: str | Omit = omit,
|
||||
dataset_id: str | Omit = omit,
|
||||
indicator: str | Omit = omit,
|
||||
indicators: Iterable[threat_event_create_params.Indicator] | Omit = omit,
|
||||
indicator_type: str | Omit = omit,
|
||||
insight: str | Omit = omit,
|
||||
tags: SequenceNotStr[str] | Omit = omit,
|
||||
target_country: str | Omit = omit,
|
||||
|
|
@ -211,6 +212,9 @@ class ThreatEventsResource(SyncAPIResource):
|
|||
Args:
|
||||
path_account_id: Account ID.
|
||||
|
||||
indicators: Array of indicators for this event. Supports multiple indicators per event for
|
||||
complex scenarios.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -228,7 +232,6 @@ class ThreatEventsResource(SyncAPIResource):
|
|||
"category": category,
|
||||
"date": date,
|
||||
"event": event,
|
||||
"indicator_type": indicator_type,
|
||||
"raw": raw,
|
||||
"tlp": tlp,
|
||||
"body_account_id": body_account_id,
|
||||
|
|
@ -236,6 +239,8 @@ class ThreatEventsResource(SyncAPIResource):
|
|||
"attacker_country": attacker_country,
|
||||
"dataset_id": dataset_id,
|
||||
"indicator": indicator,
|
||||
"indicators": indicators,
|
||||
"indicator_type": indicator_type,
|
||||
"insight": insight,
|
||||
"tags": tags,
|
||||
"target_country": target_country,
|
||||
|
|
@ -582,7 +587,6 @@ class AsyncThreatEventsResource(AsyncAPIResource):
|
|||
category: str,
|
||||
date: Union[str, datetime],
|
||||
event: str,
|
||||
indicator_type: str,
|
||||
raw: threat_event_create_params.Raw,
|
||||
tlp: str,
|
||||
body_account_id: float | Omit = omit,
|
||||
|
|
@ -590,6 +594,8 @@ class AsyncThreatEventsResource(AsyncAPIResource):
|
|||
attacker_country: str | Omit = omit,
|
||||
dataset_id: str | Omit = omit,
|
||||
indicator: str | Omit = omit,
|
||||
indicators: Iterable[threat_event_create_params.Indicator] | Omit = omit,
|
||||
indicator_type: str | Omit = omit,
|
||||
insight: str | Omit = omit,
|
||||
tags: SequenceNotStr[str] | Omit = omit,
|
||||
target_country: str | Omit = omit,
|
||||
|
|
@ -610,6 +616,9 @@ class AsyncThreatEventsResource(AsyncAPIResource):
|
|||
Args:
|
||||
path_account_id: Account ID.
|
||||
|
||||
indicators: Array of indicators for this event. Supports multiple indicators per event for
|
||||
complex scenarios.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -627,7 +636,6 @@ class AsyncThreatEventsResource(AsyncAPIResource):
|
|||
"category": category,
|
||||
"date": date,
|
||||
"event": event,
|
||||
"indicator_type": indicator_type,
|
||||
"raw": raw,
|
||||
"tlp": tlp,
|
||||
"body_account_id": body_account_id,
|
||||
|
|
@ -635,6 +643,8 @@ class AsyncThreatEventsResource(AsyncAPIResource):
|
|||
"attacker_country": attacker_country,
|
||||
"dataset_id": dataset_id,
|
||||
"indicator": indicator,
|
||||
"indicators": indicators,
|
||||
"indicator_type": indicator_type,
|
||||
"insight": insight,
|
||||
"tags": tags,
|
||||
"target_country": target_country,
|
||||
|
|
|
|||
|
|
@ -1,61 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from .settings import (
|
||||
SettingsResource,
|
||||
AsyncSettingsResource,
|
||||
SettingsResourceWithRawResponse,
|
||||
AsyncSettingsResourceWithRawResponse,
|
||||
SettingsResourceWithStreamingResponse,
|
||||
AsyncSettingsResourceWithStreamingResponse,
|
||||
)
|
||||
from .investigate import (
|
||||
InvestigateResource,
|
||||
AsyncInvestigateResource,
|
||||
InvestigateResourceWithRawResponse,
|
||||
AsyncInvestigateResourceWithRawResponse,
|
||||
InvestigateResourceWithStreamingResponse,
|
||||
AsyncInvestigateResourceWithStreamingResponse,
|
||||
)
|
||||
from .submissions import (
|
||||
SubmissionsResource,
|
||||
AsyncSubmissionsResource,
|
||||
SubmissionsResourceWithRawResponse,
|
||||
AsyncSubmissionsResourceWithRawResponse,
|
||||
SubmissionsResourceWithStreamingResponse,
|
||||
AsyncSubmissionsResourceWithStreamingResponse,
|
||||
)
|
||||
from .email_security import (
|
||||
EmailSecurityResource,
|
||||
AsyncEmailSecurityResource,
|
||||
EmailSecurityResourceWithRawResponse,
|
||||
AsyncEmailSecurityResourceWithRawResponse,
|
||||
EmailSecurityResourceWithStreamingResponse,
|
||||
AsyncEmailSecurityResourceWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"InvestigateResource",
|
||||
"AsyncInvestigateResource",
|
||||
"InvestigateResourceWithRawResponse",
|
||||
"AsyncInvestigateResourceWithRawResponse",
|
||||
"InvestigateResourceWithStreamingResponse",
|
||||
"AsyncInvestigateResourceWithStreamingResponse",
|
||||
"SettingsResource",
|
||||
"AsyncSettingsResource",
|
||||
"SettingsResourceWithRawResponse",
|
||||
"AsyncSettingsResourceWithRawResponse",
|
||||
"SettingsResourceWithStreamingResponse",
|
||||
"AsyncSettingsResourceWithStreamingResponse",
|
||||
"SubmissionsResource",
|
||||
"AsyncSubmissionsResource",
|
||||
"SubmissionsResourceWithRawResponse",
|
||||
"AsyncSubmissionsResourceWithRawResponse",
|
||||
"SubmissionsResourceWithStreamingResponse",
|
||||
"AsyncSubmissionsResourceWithStreamingResponse",
|
||||
"EmailSecurityResource",
|
||||
"AsyncEmailSecurityResource",
|
||||
"EmailSecurityResourceWithRawResponse",
|
||||
"AsyncEmailSecurityResourceWithRawResponse",
|
||||
"EmailSecurityResourceWithStreamingResponse",
|
||||
"AsyncEmailSecurityResourceWithStreamingResponse",
|
||||
]
|
||||
|
|
@ -1,166 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from ..._compat import cached_property
|
||||
from ..._resource import SyncAPIResource, AsyncAPIResource
|
||||
from .submissions import (
|
||||
SubmissionsResource,
|
||||
AsyncSubmissionsResource,
|
||||
SubmissionsResourceWithRawResponse,
|
||||
AsyncSubmissionsResourceWithRawResponse,
|
||||
SubmissionsResourceWithStreamingResponse,
|
||||
AsyncSubmissionsResourceWithStreamingResponse,
|
||||
)
|
||||
from .settings.settings import (
|
||||
SettingsResource,
|
||||
AsyncSettingsResource,
|
||||
SettingsResourceWithRawResponse,
|
||||
AsyncSettingsResourceWithRawResponse,
|
||||
SettingsResourceWithStreamingResponse,
|
||||
AsyncSettingsResourceWithStreamingResponse,
|
||||
)
|
||||
from .investigate.investigate import (
|
||||
InvestigateResource,
|
||||
AsyncInvestigateResource,
|
||||
InvestigateResourceWithRawResponse,
|
||||
AsyncInvestigateResourceWithRawResponse,
|
||||
InvestigateResourceWithStreamingResponse,
|
||||
AsyncInvestigateResourceWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = ["EmailSecurityResource", "AsyncEmailSecurityResource"]
|
||||
|
||||
|
||||
class EmailSecurityResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def investigate(self) -> InvestigateResource:
|
||||
return InvestigateResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def settings(self) -> SettingsResource:
|
||||
return SettingsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def submissions(self) -> SubmissionsResource:
|
||||
return SubmissionsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> EmailSecurityResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return EmailSecurityResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> EmailSecurityResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return EmailSecurityResourceWithStreamingResponse(self)
|
||||
|
||||
|
||||
class AsyncEmailSecurityResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def investigate(self) -> AsyncInvestigateResource:
|
||||
return AsyncInvestigateResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def settings(self) -> AsyncSettingsResource:
|
||||
return AsyncSettingsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def submissions(self) -> AsyncSubmissionsResource:
|
||||
return AsyncSubmissionsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncEmailSecurityResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncEmailSecurityResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncEmailSecurityResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncEmailSecurityResourceWithStreamingResponse(self)
|
||||
|
||||
|
||||
class EmailSecurityResourceWithRawResponse:
|
||||
def __init__(self, email_security: EmailSecurityResource) -> None:
|
||||
self._email_security = email_security
|
||||
|
||||
@cached_property
|
||||
def investigate(self) -> InvestigateResourceWithRawResponse:
|
||||
return InvestigateResourceWithRawResponse(self._email_security.investigate)
|
||||
|
||||
@cached_property
|
||||
def settings(self) -> SettingsResourceWithRawResponse:
|
||||
return SettingsResourceWithRawResponse(self._email_security.settings)
|
||||
|
||||
@cached_property
|
||||
def submissions(self) -> SubmissionsResourceWithRawResponse:
|
||||
return SubmissionsResourceWithRawResponse(self._email_security.submissions)
|
||||
|
||||
|
||||
class AsyncEmailSecurityResourceWithRawResponse:
|
||||
def __init__(self, email_security: AsyncEmailSecurityResource) -> None:
|
||||
self._email_security = email_security
|
||||
|
||||
@cached_property
|
||||
def investigate(self) -> AsyncInvestigateResourceWithRawResponse:
|
||||
return AsyncInvestigateResourceWithRawResponse(self._email_security.investigate)
|
||||
|
||||
@cached_property
|
||||
def settings(self) -> AsyncSettingsResourceWithRawResponse:
|
||||
return AsyncSettingsResourceWithRawResponse(self._email_security.settings)
|
||||
|
||||
@cached_property
|
||||
def submissions(self) -> AsyncSubmissionsResourceWithRawResponse:
|
||||
return AsyncSubmissionsResourceWithRawResponse(self._email_security.submissions)
|
||||
|
||||
|
||||
class EmailSecurityResourceWithStreamingResponse:
|
||||
def __init__(self, email_security: EmailSecurityResource) -> None:
|
||||
self._email_security = email_security
|
||||
|
||||
@cached_property
|
||||
def investigate(self) -> InvestigateResourceWithStreamingResponse:
|
||||
return InvestigateResourceWithStreamingResponse(self._email_security.investigate)
|
||||
|
||||
@cached_property
|
||||
def settings(self) -> SettingsResourceWithStreamingResponse:
|
||||
return SettingsResourceWithStreamingResponse(self._email_security.settings)
|
||||
|
||||
@cached_property
|
||||
def submissions(self) -> SubmissionsResourceWithStreamingResponse:
|
||||
return SubmissionsResourceWithStreamingResponse(self._email_security.submissions)
|
||||
|
||||
|
||||
class AsyncEmailSecurityResourceWithStreamingResponse:
|
||||
def __init__(self, email_security: AsyncEmailSecurityResource) -> None:
|
||||
self._email_security = email_security
|
||||
|
||||
@cached_property
|
||||
def investigate(self) -> AsyncInvestigateResourceWithStreamingResponse:
|
||||
return AsyncInvestigateResourceWithStreamingResponse(self._email_security.investigate)
|
||||
|
||||
@cached_property
|
||||
def settings(self) -> AsyncSettingsResourceWithStreamingResponse:
|
||||
return AsyncSettingsResourceWithStreamingResponse(self._email_security.settings)
|
||||
|
||||
@cached_property
|
||||
def submissions(self) -> AsyncSubmissionsResourceWithStreamingResponse:
|
||||
return AsyncSubmissionsResourceWithStreamingResponse(self._email_security.submissions)
|
||||
|
|
@ -1,117 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from .raw import (
|
||||
RawResource,
|
||||
AsyncRawResource,
|
||||
RawResourceWithRawResponse,
|
||||
AsyncRawResourceWithRawResponse,
|
||||
RawResourceWithStreamingResponse,
|
||||
AsyncRawResourceWithStreamingResponse,
|
||||
)
|
||||
from .move import (
|
||||
MoveResource,
|
||||
AsyncMoveResource,
|
||||
MoveResourceWithRawResponse,
|
||||
AsyncMoveResourceWithRawResponse,
|
||||
MoveResourceWithStreamingResponse,
|
||||
AsyncMoveResourceWithStreamingResponse,
|
||||
)
|
||||
from .trace import (
|
||||
TraceResource,
|
||||
AsyncTraceResource,
|
||||
TraceResourceWithRawResponse,
|
||||
AsyncTraceResourceWithRawResponse,
|
||||
TraceResourceWithStreamingResponse,
|
||||
AsyncTraceResourceWithStreamingResponse,
|
||||
)
|
||||
from .preview import (
|
||||
PreviewResource,
|
||||
AsyncPreviewResource,
|
||||
PreviewResourceWithRawResponse,
|
||||
AsyncPreviewResourceWithRawResponse,
|
||||
PreviewResourceWithStreamingResponse,
|
||||
AsyncPreviewResourceWithStreamingResponse,
|
||||
)
|
||||
from .release import (
|
||||
ReleaseResource,
|
||||
AsyncReleaseResource,
|
||||
ReleaseResourceWithRawResponse,
|
||||
AsyncReleaseResourceWithRawResponse,
|
||||
ReleaseResourceWithStreamingResponse,
|
||||
AsyncReleaseResourceWithStreamingResponse,
|
||||
)
|
||||
from .detections import (
|
||||
DetectionsResource,
|
||||
AsyncDetectionsResource,
|
||||
DetectionsResourceWithRawResponse,
|
||||
AsyncDetectionsResourceWithRawResponse,
|
||||
DetectionsResourceWithStreamingResponse,
|
||||
AsyncDetectionsResourceWithStreamingResponse,
|
||||
)
|
||||
from .reclassify import (
|
||||
ReclassifyResource,
|
||||
AsyncReclassifyResource,
|
||||
ReclassifyResourceWithRawResponse,
|
||||
AsyncReclassifyResourceWithRawResponse,
|
||||
ReclassifyResourceWithStreamingResponse,
|
||||
AsyncReclassifyResourceWithStreamingResponse,
|
||||
)
|
||||
from .investigate import (
|
||||
InvestigateResource,
|
||||
AsyncInvestigateResource,
|
||||
InvestigateResourceWithRawResponse,
|
||||
AsyncInvestigateResourceWithRawResponse,
|
||||
InvestigateResourceWithStreamingResponse,
|
||||
AsyncInvestigateResourceWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"DetectionsResource",
|
||||
"AsyncDetectionsResource",
|
||||
"DetectionsResourceWithRawResponse",
|
||||
"AsyncDetectionsResourceWithRawResponse",
|
||||
"DetectionsResourceWithStreamingResponse",
|
||||
"AsyncDetectionsResourceWithStreamingResponse",
|
||||
"PreviewResource",
|
||||
"AsyncPreviewResource",
|
||||
"PreviewResourceWithRawResponse",
|
||||
"AsyncPreviewResourceWithRawResponse",
|
||||
"PreviewResourceWithStreamingResponse",
|
||||
"AsyncPreviewResourceWithStreamingResponse",
|
||||
"RawResource",
|
||||
"AsyncRawResource",
|
||||
"RawResourceWithRawResponse",
|
||||
"AsyncRawResourceWithRawResponse",
|
||||
"RawResourceWithStreamingResponse",
|
||||
"AsyncRawResourceWithStreamingResponse",
|
||||
"TraceResource",
|
||||
"AsyncTraceResource",
|
||||
"TraceResourceWithRawResponse",
|
||||
"AsyncTraceResourceWithRawResponse",
|
||||
"TraceResourceWithStreamingResponse",
|
||||
"AsyncTraceResourceWithStreamingResponse",
|
||||
"MoveResource",
|
||||
"AsyncMoveResource",
|
||||
"MoveResourceWithRawResponse",
|
||||
"AsyncMoveResourceWithRawResponse",
|
||||
"MoveResourceWithStreamingResponse",
|
||||
"AsyncMoveResourceWithStreamingResponse",
|
||||
"ReclassifyResource",
|
||||
"AsyncReclassifyResource",
|
||||
"ReclassifyResourceWithRawResponse",
|
||||
"AsyncReclassifyResourceWithRawResponse",
|
||||
"ReclassifyResourceWithStreamingResponse",
|
||||
"AsyncReclassifyResourceWithStreamingResponse",
|
||||
"ReleaseResource",
|
||||
"AsyncReleaseResource",
|
||||
"ReleaseResourceWithRawResponse",
|
||||
"AsyncReleaseResourceWithRawResponse",
|
||||
"ReleaseResourceWithStreamingResponse",
|
||||
"AsyncReleaseResourceWithStreamingResponse",
|
||||
"InvestigateResource",
|
||||
"AsyncInvestigateResource",
|
||||
"InvestigateResourceWithRawResponse",
|
||||
"AsyncInvestigateResourceWithRawResponse",
|
||||
"InvestigateResourceWithStreamingResponse",
|
||||
"AsyncInvestigateResourceWithStreamingResponse",
|
||||
]
|
||||
|
|
@ -1,190 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import Body, Query, Headers, NotGiven, not_given
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import make_request_options
|
||||
from ....types.email_security.investigate.detection_get_response import DetectionGetResponse
|
||||
|
||||
__all__ = ["DetectionsResource", "AsyncDetectionsResource"]
|
||||
|
||||
|
||||
class DetectionsResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> DetectionsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return DetectionsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> DetectionsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return DetectionsResourceWithStreamingResponse(self)
|
||||
|
||||
def get(
|
||||
self,
|
||||
postfix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> DetectionGetResponse:
|
||||
"""
|
||||
Returns detection details such as threat categories and sender information for
|
||||
non-benign messages.
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
postfix_id: The identifier of the message.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not postfix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/email-security/investigate/{postfix_id}/detections",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[DetectionGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[DetectionGetResponse], ResultWrapper[DetectionGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncDetectionsResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncDetectionsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncDetectionsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncDetectionsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncDetectionsResourceWithStreamingResponse(self)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
postfix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> DetectionGetResponse:
|
||||
"""
|
||||
Returns detection details such as threat categories and sender information for
|
||||
non-benign messages.
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
postfix_id: The identifier of the message.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not postfix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/email-security/investigate/{postfix_id}/detections",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[DetectionGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[DetectionGetResponse], ResultWrapper[DetectionGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class DetectionsResourceWithRawResponse:
|
||||
def __init__(self, detections: DetectionsResource) -> None:
|
||||
self._detections = detections
|
||||
|
||||
self.get = to_raw_response_wrapper(
|
||||
detections.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncDetectionsResourceWithRawResponse:
|
||||
def __init__(self, detections: AsyncDetectionsResource) -> None:
|
||||
self._detections = detections
|
||||
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
detections.get,
|
||||
)
|
||||
|
||||
|
||||
class DetectionsResourceWithStreamingResponse:
|
||||
def __init__(self, detections: DetectionsResource) -> None:
|
||||
self._detections = detections
|
||||
|
||||
self.get = to_streamed_response_wrapper(
|
||||
detections.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncDetectionsResourceWithStreamingResponse:
|
||||
def __init__(self, detections: AsyncDetectionsResource) -> None:
|
||||
self._detections = detections
|
||||
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
detections.get,
|
||||
)
|
||||
|
|
@ -1,672 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Union, Optional, cast
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from .raw import (
|
||||
RawResource,
|
||||
AsyncRawResource,
|
||||
RawResourceWithRawResponse,
|
||||
AsyncRawResourceWithRawResponse,
|
||||
RawResourceWithStreamingResponse,
|
||||
AsyncRawResourceWithStreamingResponse,
|
||||
)
|
||||
from .move import (
|
||||
MoveResource,
|
||||
AsyncMoveResource,
|
||||
MoveResourceWithRawResponse,
|
||||
AsyncMoveResourceWithRawResponse,
|
||||
MoveResourceWithStreamingResponse,
|
||||
AsyncMoveResourceWithStreamingResponse,
|
||||
)
|
||||
from .trace import (
|
||||
TraceResource,
|
||||
AsyncTraceResource,
|
||||
TraceResourceWithRawResponse,
|
||||
AsyncTraceResourceWithRawResponse,
|
||||
TraceResourceWithStreamingResponse,
|
||||
AsyncTraceResourceWithStreamingResponse,
|
||||
)
|
||||
from .preview import (
|
||||
PreviewResource,
|
||||
AsyncPreviewResource,
|
||||
PreviewResourceWithRawResponse,
|
||||
AsyncPreviewResourceWithRawResponse,
|
||||
PreviewResourceWithStreamingResponse,
|
||||
AsyncPreviewResourceWithStreamingResponse,
|
||||
)
|
||||
from .release import (
|
||||
ReleaseResource,
|
||||
AsyncReleaseResource,
|
||||
ReleaseResourceWithRawResponse,
|
||||
AsyncReleaseResourceWithRawResponse,
|
||||
ReleaseResourceWithStreamingResponse,
|
||||
AsyncReleaseResourceWithStreamingResponse,
|
||||
)
|
||||
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
||||
from ...._utils import maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from .detections import (
|
||||
DetectionsResource,
|
||||
AsyncDetectionsResource,
|
||||
DetectionsResourceWithRawResponse,
|
||||
AsyncDetectionsResourceWithRawResponse,
|
||||
DetectionsResourceWithStreamingResponse,
|
||||
AsyncDetectionsResourceWithStreamingResponse,
|
||||
)
|
||||
from .reclassify import (
|
||||
ReclassifyResource,
|
||||
AsyncReclassifyResource,
|
||||
ReclassifyResourceWithRawResponse,
|
||||
AsyncReclassifyResourceWithRawResponse,
|
||||
ReclassifyResourceWithStreamingResponse,
|
||||
AsyncReclassifyResourceWithStreamingResponse,
|
||||
)
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.email_security import investigate_list_params
|
||||
from ....types.email_security.investigate_get_response import InvestigateGetResponse
|
||||
from ....types.email_security.investigate_list_response import InvestigateListResponse
|
||||
|
||||
__all__ = ["InvestigateResource", "AsyncInvestigateResource"]
|
||||
|
||||
|
||||
class InvestigateResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def detections(self) -> DetectionsResource:
|
||||
return DetectionsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def preview(self) -> PreviewResource:
|
||||
return PreviewResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def raw(self) -> RawResource:
|
||||
return RawResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def trace(self) -> TraceResource:
|
||||
return TraceResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def move(self) -> MoveResource:
|
||||
return MoveResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def reclassify(self) -> ReclassifyResource:
|
||||
return ReclassifyResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def release(self) -> ReleaseResource:
|
||||
return ReleaseResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> InvestigateResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return InvestigateResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> InvestigateResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return InvestigateResourceWithStreamingResponse(self)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
action_log: bool | Omit = omit,
|
||||
alert_id: str | Omit = omit,
|
||||
cursor: str | Omit = omit,
|
||||
detections_only: bool | Omit = omit,
|
||||
domain: str | Omit = omit,
|
||||
end: Union[str, datetime] | Omit = omit,
|
||||
final_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit,
|
||||
message_action: Literal["PREVIEW", "QUARANTINE_RELEASED", "MOVED"] | Omit = omit,
|
||||
message_id: str | Omit = omit,
|
||||
metric: str | Omit = omit,
|
||||
page: Optional[int] | Omit = omit,
|
||||
per_page: int | Omit = omit,
|
||||
query: str | Omit = omit,
|
||||
recipient: str | Omit = omit,
|
||||
sender: str | Omit = omit,
|
||||
start: Union[str, datetime] | Omit = omit,
|
||||
subject: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> SyncV4PagePaginationArray[InvestigateListResponse]:
|
||||
"""
|
||||
Returns information for each email that matches the search parameter(s).
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
action_log: Determines if the message action log is included in the response.
|
||||
|
||||
detections_only: Determines if the search results will include detections or not.
|
||||
|
||||
domain: The sender domains the search filters by.
|
||||
|
||||
end: The end of the search date range. Defaults to `now`.
|
||||
|
||||
final_disposition: The dispositions the search filters by.
|
||||
|
||||
message_action: The message actions the search filters by.
|
||||
|
||||
page: Deprecated: Use cursor pagination instead.
|
||||
|
||||
per_page: The number of results per page.
|
||||
|
||||
query: The space-delimited term used in the query. The search is case-insensitive.
|
||||
|
||||
The content of the following email metadata fields are searched:
|
||||
|
||||
- alert_id
|
||||
- CC
|
||||
- From (envelope_from)
|
||||
- From Name
|
||||
- final_disposition
|
||||
- md5 hash (of any attachment)
|
||||
- sha1 hash (of any attachment)
|
||||
- sha256 hash (of any attachment)
|
||||
- name (of any attachment)
|
||||
- Reason
|
||||
- Received DateTime (yyyy-mm-ddThh:mm:ss)
|
||||
- Sent DateTime (yyyy-mm-ddThh:mm:ss)
|
||||
- ReplyTo
|
||||
- To (envelope_to)
|
||||
- To Name
|
||||
- Message-ID
|
||||
- smtp_helo_server_ip
|
||||
- smtp_previous_hop_ip
|
||||
- x_originating_ip
|
||||
- Subject
|
||||
|
||||
start: The beginning of the search date range. Defaults to `now - 30 days`.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/investigate",
|
||||
page=SyncV4PagePaginationArray[InvestigateListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"action_log": action_log,
|
||||
"alert_id": alert_id,
|
||||
"cursor": cursor,
|
||||
"detections_only": detections_only,
|
||||
"domain": domain,
|
||||
"end": end,
|
||||
"final_disposition": final_disposition,
|
||||
"message_action": message_action,
|
||||
"message_id": message_id,
|
||||
"metric": metric,
|
||||
"page": page,
|
||||
"per_page": per_page,
|
||||
"query": query,
|
||||
"recipient": recipient,
|
||||
"sender": sender,
|
||||
"start": start,
|
||||
"subject": subject,
|
||||
},
|
||||
investigate_list_params.InvestigateListParams,
|
||||
),
|
||||
),
|
||||
model=InvestigateListResponse,
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
postfix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> InvestigateGetResponse:
|
||||
"""
|
||||
Get message details
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
postfix_id: The identifier of the message.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not postfix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/email-security/investigate/{postfix_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[InvestigateGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[InvestigateGetResponse], ResultWrapper[InvestigateGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncInvestigateResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def detections(self) -> AsyncDetectionsResource:
|
||||
return AsyncDetectionsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def preview(self) -> AsyncPreviewResource:
|
||||
return AsyncPreviewResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def raw(self) -> AsyncRawResource:
|
||||
return AsyncRawResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def trace(self) -> AsyncTraceResource:
|
||||
return AsyncTraceResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def move(self) -> AsyncMoveResource:
|
||||
return AsyncMoveResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def reclassify(self) -> AsyncReclassifyResource:
|
||||
return AsyncReclassifyResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def release(self) -> AsyncReleaseResource:
|
||||
return AsyncReleaseResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncInvestigateResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncInvestigateResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncInvestigateResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncInvestigateResourceWithStreamingResponse(self)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
action_log: bool | Omit = omit,
|
||||
alert_id: str | Omit = omit,
|
||||
cursor: str | Omit = omit,
|
||||
detections_only: bool | Omit = omit,
|
||||
domain: str | Omit = omit,
|
||||
end: Union[str, datetime] | Omit = omit,
|
||||
final_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit,
|
||||
message_action: Literal["PREVIEW", "QUARANTINE_RELEASED", "MOVED"] | Omit = omit,
|
||||
message_id: str | Omit = omit,
|
||||
metric: str | Omit = omit,
|
||||
page: Optional[int] | Omit = omit,
|
||||
per_page: int | Omit = omit,
|
||||
query: str | Omit = omit,
|
||||
recipient: str | Omit = omit,
|
||||
sender: str | Omit = omit,
|
||||
start: Union[str, datetime] | Omit = omit,
|
||||
subject: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AsyncPaginator[InvestigateListResponse, AsyncV4PagePaginationArray[InvestigateListResponse]]:
|
||||
"""
|
||||
Returns information for each email that matches the search parameter(s).
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
action_log: Determines if the message action log is included in the response.
|
||||
|
||||
detections_only: Determines if the search results will include detections or not.
|
||||
|
||||
domain: The sender domains the search filters by.
|
||||
|
||||
end: The end of the search date range. Defaults to `now`.
|
||||
|
||||
final_disposition: The dispositions the search filters by.
|
||||
|
||||
message_action: The message actions the search filters by.
|
||||
|
||||
page: Deprecated: Use cursor pagination instead.
|
||||
|
||||
per_page: The number of results per page.
|
||||
|
||||
query: The space-delimited term used in the query. The search is case-insensitive.
|
||||
|
||||
The content of the following email metadata fields are searched:
|
||||
|
||||
- alert_id
|
||||
- CC
|
||||
- From (envelope_from)
|
||||
- From Name
|
||||
- final_disposition
|
||||
- md5 hash (of any attachment)
|
||||
- sha1 hash (of any attachment)
|
||||
- sha256 hash (of any attachment)
|
||||
- name (of any attachment)
|
||||
- Reason
|
||||
- Received DateTime (yyyy-mm-ddThh:mm:ss)
|
||||
- Sent DateTime (yyyy-mm-ddThh:mm:ss)
|
||||
- ReplyTo
|
||||
- To (envelope_to)
|
||||
- To Name
|
||||
- Message-ID
|
||||
- smtp_helo_server_ip
|
||||
- smtp_previous_hop_ip
|
||||
- x_originating_ip
|
||||
- Subject
|
||||
|
||||
start: The beginning of the search date range. Defaults to `now - 30 days`.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/investigate",
|
||||
page=AsyncV4PagePaginationArray[InvestigateListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"action_log": action_log,
|
||||
"alert_id": alert_id,
|
||||
"cursor": cursor,
|
||||
"detections_only": detections_only,
|
||||
"domain": domain,
|
||||
"end": end,
|
||||
"final_disposition": final_disposition,
|
||||
"message_action": message_action,
|
||||
"message_id": message_id,
|
||||
"metric": metric,
|
||||
"page": page,
|
||||
"per_page": per_page,
|
||||
"query": query,
|
||||
"recipient": recipient,
|
||||
"sender": sender,
|
||||
"start": start,
|
||||
"subject": subject,
|
||||
},
|
||||
investigate_list_params.InvestigateListParams,
|
||||
),
|
||||
),
|
||||
model=InvestigateListResponse,
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
postfix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> InvestigateGetResponse:
|
||||
"""
|
||||
Get message details
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
postfix_id: The identifier of the message.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not postfix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/email-security/investigate/{postfix_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[InvestigateGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[InvestigateGetResponse], ResultWrapper[InvestigateGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class InvestigateResourceWithRawResponse:
|
||||
def __init__(self, investigate: InvestigateResource) -> None:
|
||||
self._investigate = investigate
|
||||
|
||||
self.list = to_raw_response_wrapper(
|
||||
investigate.list,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
investigate.get,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def detections(self) -> DetectionsResourceWithRawResponse:
|
||||
return DetectionsResourceWithRawResponse(self._investigate.detections)
|
||||
|
||||
@cached_property
|
||||
def preview(self) -> PreviewResourceWithRawResponse:
|
||||
return PreviewResourceWithRawResponse(self._investigate.preview)
|
||||
|
||||
@cached_property
|
||||
def raw(self) -> RawResourceWithRawResponse:
|
||||
return RawResourceWithRawResponse(self._investigate.raw)
|
||||
|
||||
@cached_property
|
||||
def trace(self) -> TraceResourceWithRawResponse:
|
||||
return TraceResourceWithRawResponse(self._investigate.trace)
|
||||
|
||||
@cached_property
|
||||
def move(self) -> MoveResourceWithRawResponse:
|
||||
return MoveResourceWithRawResponse(self._investigate.move)
|
||||
|
||||
@cached_property
|
||||
def reclassify(self) -> ReclassifyResourceWithRawResponse:
|
||||
return ReclassifyResourceWithRawResponse(self._investigate.reclassify)
|
||||
|
||||
@cached_property
|
||||
def release(self) -> ReleaseResourceWithRawResponse:
|
||||
return ReleaseResourceWithRawResponse(self._investigate.release)
|
||||
|
||||
|
||||
class AsyncInvestigateResourceWithRawResponse:
|
||||
def __init__(self, investigate: AsyncInvestigateResource) -> None:
|
||||
self._investigate = investigate
|
||||
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
investigate.list,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
investigate.get,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def detections(self) -> AsyncDetectionsResourceWithRawResponse:
|
||||
return AsyncDetectionsResourceWithRawResponse(self._investigate.detections)
|
||||
|
||||
@cached_property
|
||||
def preview(self) -> AsyncPreviewResourceWithRawResponse:
|
||||
return AsyncPreviewResourceWithRawResponse(self._investigate.preview)
|
||||
|
||||
@cached_property
|
||||
def raw(self) -> AsyncRawResourceWithRawResponse:
|
||||
return AsyncRawResourceWithRawResponse(self._investigate.raw)
|
||||
|
||||
@cached_property
|
||||
def trace(self) -> AsyncTraceResourceWithRawResponse:
|
||||
return AsyncTraceResourceWithRawResponse(self._investigate.trace)
|
||||
|
||||
@cached_property
|
||||
def move(self) -> AsyncMoveResourceWithRawResponse:
|
||||
return AsyncMoveResourceWithRawResponse(self._investigate.move)
|
||||
|
||||
@cached_property
|
||||
def reclassify(self) -> AsyncReclassifyResourceWithRawResponse:
|
||||
return AsyncReclassifyResourceWithRawResponse(self._investigate.reclassify)
|
||||
|
||||
@cached_property
|
||||
def release(self) -> AsyncReleaseResourceWithRawResponse:
|
||||
return AsyncReleaseResourceWithRawResponse(self._investigate.release)
|
||||
|
||||
|
||||
class InvestigateResourceWithStreamingResponse:
|
||||
def __init__(self, investigate: InvestigateResource) -> None:
|
||||
self._investigate = investigate
|
||||
|
||||
self.list = to_streamed_response_wrapper(
|
||||
investigate.list,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
investigate.get,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def detections(self) -> DetectionsResourceWithStreamingResponse:
|
||||
return DetectionsResourceWithStreamingResponse(self._investigate.detections)
|
||||
|
||||
@cached_property
|
||||
def preview(self) -> PreviewResourceWithStreamingResponse:
|
||||
return PreviewResourceWithStreamingResponse(self._investigate.preview)
|
||||
|
||||
@cached_property
|
||||
def raw(self) -> RawResourceWithStreamingResponse:
|
||||
return RawResourceWithStreamingResponse(self._investigate.raw)
|
||||
|
||||
@cached_property
|
||||
def trace(self) -> TraceResourceWithStreamingResponse:
|
||||
return TraceResourceWithStreamingResponse(self._investigate.trace)
|
||||
|
||||
@cached_property
|
||||
def move(self) -> MoveResourceWithStreamingResponse:
|
||||
return MoveResourceWithStreamingResponse(self._investigate.move)
|
||||
|
||||
@cached_property
|
||||
def reclassify(self) -> ReclassifyResourceWithStreamingResponse:
|
||||
return ReclassifyResourceWithStreamingResponse(self._investigate.reclassify)
|
||||
|
||||
@cached_property
|
||||
def release(self) -> ReleaseResourceWithStreamingResponse:
|
||||
return ReleaseResourceWithStreamingResponse(self._investigate.release)
|
||||
|
||||
|
||||
class AsyncInvestigateResourceWithStreamingResponse:
|
||||
def __init__(self, investigate: AsyncInvestigateResource) -> None:
|
||||
self._investigate = investigate
|
||||
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
investigate.list,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
investigate.get,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def detections(self) -> AsyncDetectionsResourceWithStreamingResponse:
|
||||
return AsyncDetectionsResourceWithStreamingResponse(self._investigate.detections)
|
||||
|
||||
@cached_property
|
||||
def preview(self) -> AsyncPreviewResourceWithStreamingResponse:
|
||||
return AsyncPreviewResourceWithStreamingResponse(self._investigate.preview)
|
||||
|
||||
@cached_property
|
||||
def raw(self) -> AsyncRawResourceWithStreamingResponse:
|
||||
return AsyncRawResourceWithStreamingResponse(self._investigate.raw)
|
||||
|
||||
@cached_property
|
||||
def trace(self) -> AsyncTraceResourceWithStreamingResponse:
|
||||
return AsyncTraceResourceWithStreamingResponse(self._investigate.trace)
|
||||
|
||||
@cached_property
|
||||
def move(self) -> AsyncMoveResourceWithStreamingResponse:
|
||||
return AsyncMoveResourceWithStreamingResponse(self._investigate.move)
|
||||
|
||||
@cached_property
|
||||
def reclassify(self) -> AsyncReclassifyResourceWithStreamingResponse:
|
||||
return AsyncReclassifyResourceWithStreamingResponse(self._investigate.reclassify)
|
||||
|
||||
@cached_property
|
||||
def release(self) -> AsyncReleaseResourceWithStreamingResponse:
|
||||
return AsyncReleaseResourceWithStreamingResponse(self._investigate.release)
|
||||
|
|
@ -1,303 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import Body, Query, Headers, NotGiven, SequenceNotStr, not_given
|
||||
from ...._utils import maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ....pagination import SyncSinglePage, AsyncSinglePage
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.email_security.investigate import move_bulk_params, move_create_params
|
||||
from ....types.email_security.investigate.move_bulk_response import MoveBulkResponse
|
||||
from ....types.email_security.investigate.move_create_response import MoveCreateResponse
|
||||
|
||||
__all__ = ["MoveResource", "AsyncMoveResource"]
|
||||
|
||||
|
||||
class MoveResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> MoveResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return MoveResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> MoveResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return MoveResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
postfix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
destination: Literal[
|
||||
"Inbox", "JunkEmail", "DeletedItems", "RecoverableItemsDeletions", "RecoverableItemsPurges"
|
||||
],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> SyncSinglePage[MoveCreateResponse]:
|
||||
"""
|
||||
Move a message
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
postfix_id: The identifier of the message.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not postfix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/investigate/{postfix_id}/move",
|
||||
page=SyncSinglePage[MoveCreateResponse],
|
||||
body=maybe_transform({"destination": destination}, move_create_params.MoveCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=MoveCreateResponse,
|
||||
method="post",
|
||||
)
|
||||
|
||||
def bulk(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
destination: Literal[
|
||||
"Inbox", "JunkEmail", "DeletedItems", "RecoverableItemsDeletions", "RecoverableItemsPurges"
|
||||
],
|
||||
postfix_ids: SequenceNotStr[str],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> SyncSinglePage[MoveBulkResponse]:
|
||||
"""
|
||||
Move multiple messages
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/investigate/move",
|
||||
page=SyncSinglePage[MoveBulkResponse],
|
||||
body=maybe_transform(
|
||||
{
|
||||
"destination": destination,
|
||||
"postfix_ids": postfix_ids,
|
||||
},
|
||||
move_bulk_params.MoveBulkParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=MoveBulkResponse,
|
||||
method="post",
|
||||
)
|
||||
|
||||
|
||||
class AsyncMoveResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncMoveResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncMoveResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncMoveResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncMoveResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
postfix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
destination: Literal[
|
||||
"Inbox", "JunkEmail", "DeletedItems", "RecoverableItemsDeletions", "RecoverableItemsPurges"
|
||||
],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AsyncPaginator[MoveCreateResponse, AsyncSinglePage[MoveCreateResponse]]:
|
||||
"""
|
||||
Move a message
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
postfix_id: The identifier of the message.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not postfix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/investigate/{postfix_id}/move",
|
||||
page=AsyncSinglePage[MoveCreateResponse],
|
||||
body=maybe_transform({"destination": destination}, move_create_params.MoveCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=MoveCreateResponse,
|
||||
method="post",
|
||||
)
|
||||
|
||||
def bulk(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
destination: Literal[
|
||||
"Inbox", "JunkEmail", "DeletedItems", "RecoverableItemsDeletions", "RecoverableItemsPurges"
|
||||
],
|
||||
postfix_ids: SequenceNotStr[str],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AsyncPaginator[MoveBulkResponse, AsyncSinglePage[MoveBulkResponse]]:
|
||||
"""
|
||||
Move multiple messages
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/investigate/move",
|
||||
page=AsyncSinglePage[MoveBulkResponse],
|
||||
body=maybe_transform(
|
||||
{
|
||||
"destination": destination,
|
||||
"postfix_ids": postfix_ids,
|
||||
},
|
||||
move_bulk_params.MoveBulkParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=MoveBulkResponse,
|
||||
method="post",
|
||||
)
|
||||
|
||||
|
||||
class MoveResourceWithRawResponse:
|
||||
def __init__(self, move: MoveResource) -> None:
|
||||
self._move = move
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
move.create,
|
||||
)
|
||||
self.bulk = to_raw_response_wrapper(
|
||||
move.bulk,
|
||||
)
|
||||
|
||||
|
||||
class AsyncMoveResourceWithRawResponse:
|
||||
def __init__(self, move: AsyncMoveResource) -> None:
|
||||
self._move = move
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
move.create,
|
||||
)
|
||||
self.bulk = async_to_raw_response_wrapper(
|
||||
move.bulk,
|
||||
)
|
||||
|
||||
|
||||
class MoveResourceWithStreamingResponse:
|
||||
def __init__(self, move: MoveResource) -> None:
|
||||
self._move = move
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
move.create,
|
||||
)
|
||||
self.bulk = to_streamed_response_wrapper(
|
||||
move.bulk,
|
||||
)
|
||||
|
||||
|
||||
class AsyncMoveResourceWithStreamingResponse:
|
||||
def __init__(self, move: AsyncMoveResource) -> None:
|
||||
self._move = move
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
move.create,
|
||||
)
|
||||
self.bulk = async_to_streamed_response_wrapper(
|
||||
move.bulk,
|
||||
)
|
||||
|
|
@ -1,291 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import Body, Query, Headers, NotGiven, not_given
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import make_request_options
|
||||
from ....types.email_security.investigate import preview_create_params
|
||||
from ....types.email_security.investigate.preview_get_response import PreviewGetResponse
|
||||
from ....types.email_security.investigate.preview_create_response import PreviewCreateResponse
|
||||
|
||||
__all__ = ["PreviewResource", "AsyncPreviewResource"]
|
||||
|
||||
|
||||
class PreviewResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> PreviewResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return PreviewResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> PreviewResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return PreviewResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
postfix_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> PreviewCreateResponse:
|
||||
"""
|
||||
Preview for non-detection messages
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
postfix_id: The identifier of the message.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_id}/email-security/investigate/preview",
|
||||
body=maybe_transform({"postfix_id": postfix_id}, preview_create_params.PreviewCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[PreviewCreateResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[PreviewCreateResponse], ResultWrapper[PreviewCreateResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
postfix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> PreviewGetResponse:
|
||||
"""
|
||||
Returns a preview of the message body as a base64 encoded PNG image for
|
||||
non-benign messages.
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
postfix_id: The identifier of the message.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not postfix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/email-security/investigate/{postfix_id}/preview",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[PreviewGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[PreviewGetResponse], ResultWrapper[PreviewGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncPreviewResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncPreviewResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncPreviewResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncPreviewResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncPreviewResourceWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
postfix_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> PreviewCreateResponse:
|
||||
"""
|
||||
Preview for non-detection messages
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
postfix_id: The identifier of the message.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_id}/email-security/investigate/preview",
|
||||
body=await async_maybe_transform({"postfix_id": postfix_id}, preview_create_params.PreviewCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[PreviewCreateResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[PreviewCreateResponse], ResultWrapper[PreviewCreateResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
postfix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> PreviewGetResponse:
|
||||
"""
|
||||
Returns a preview of the message body as a base64 encoded PNG image for
|
||||
non-benign messages.
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
postfix_id: The identifier of the message.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not postfix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/email-security/investigate/{postfix_id}/preview",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[PreviewGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[PreviewGetResponse], ResultWrapper[PreviewGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class PreviewResourceWithRawResponse:
|
||||
def __init__(self, preview: PreviewResource) -> None:
|
||||
self._preview = preview
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
preview.create,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
preview.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncPreviewResourceWithRawResponse:
|
||||
def __init__(self, preview: AsyncPreviewResource) -> None:
|
||||
self._preview = preview
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
preview.create,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
preview.get,
|
||||
)
|
||||
|
||||
|
||||
class PreviewResourceWithStreamingResponse:
|
||||
def __init__(self, preview: PreviewResource) -> None:
|
||||
self._preview = preview
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
preview.create,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
preview.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncPreviewResourceWithStreamingResponse:
|
||||
def __init__(self, preview: AsyncPreviewResource) -> None:
|
||||
self._preview = preview
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
preview.create,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
preview.get,
|
||||
)
|
||||
|
|
@ -1,188 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import Body, Query, Headers, NotGiven, not_given
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import make_request_options
|
||||
from ....types.email_security.investigate.raw_get_response import RawGetResponse
|
||||
|
||||
__all__ = ["RawResource", "AsyncRawResource"]
|
||||
|
||||
|
||||
class RawResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> RawResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return RawResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> RawResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return RawResourceWithStreamingResponse(self)
|
||||
|
||||
def get(
|
||||
self,
|
||||
postfix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> RawGetResponse:
|
||||
"""
|
||||
Returns the raw eml of any non-benign message.
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
postfix_id: The identifier of the message.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not postfix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/email-security/investigate/{postfix_id}/raw",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[RawGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[RawGetResponse], ResultWrapper[RawGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncRawResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncRawResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncRawResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncRawResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncRawResourceWithStreamingResponse(self)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
postfix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> RawGetResponse:
|
||||
"""
|
||||
Returns the raw eml of any non-benign message.
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
postfix_id: The identifier of the message.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not postfix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/email-security/investigate/{postfix_id}/raw",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[RawGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[RawGetResponse], ResultWrapper[RawGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class RawResourceWithRawResponse:
|
||||
def __init__(self, raw: RawResource) -> None:
|
||||
self._raw = raw
|
||||
|
||||
self.get = to_raw_response_wrapper(
|
||||
raw.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncRawResourceWithRawResponse:
|
||||
def __init__(self, raw: AsyncRawResource) -> None:
|
||||
self._raw = raw
|
||||
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
raw.get,
|
||||
)
|
||||
|
||||
|
||||
class RawResourceWithStreamingResponse:
|
||||
def __init__(self, raw: RawResource) -> None:
|
||||
self._raw = raw
|
||||
|
||||
self.get = to_streamed_response_wrapper(
|
||||
raw.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncRawResourceWithStreamingResponse:
|
||||
def __init__(self, raw: AsyncRawResource) -> None:
|
||||
self._raw = raw
|
||||
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
raw.get,
|
||||
)
|
||||
|
|
@ -1,216 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import make_request_options
|
||||
from ....types.email_security.investigate import reclassify_create_params
|
||||
|
||||
__all__ = ["ReclassifyResource", "AsyncReclassifyResource"]
|
||||
|
||||
|
||||
class ReclassifyResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> ReclassifyResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return ReclassifyResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> ReclassifyResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return ReclassifyResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
postfix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
expected_disposition: Literal["NONE", "BULK", "MALICIOUS", "SPAM", "SPOOF", "SUSPICIOUS"],
|
||||
eml_content: str | Omit = omit,
|
||||
escalated_submission_id: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> object:
|
||||
"""
|
||||
Change email classfication
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
postfix_id: The identifier of the message.
|
||||
|
||||
eml_content: Base64 encoded content of the EML file
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not postfix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_id}/email-security/investigate/{postfix_id}/reclassify",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"expected_disposition": expected_disposition,
|
||||
"eml_content": eml_content,
|
||||
"escalated_submission_id": escalated_submission_id,
|
||||
},
|
||||
reclassify_create_params.ReclassifyCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[object]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[object], ResultWrapper[object]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncReclassifyResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncReclassifyResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncReclassifyResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncReclassifyResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncReclassifyResourceWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
postfix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
expected_disposition: Literal["NONE", "BULK", "MALICIOUS", "SPAM", "SPOOF", "SUSPICIOUS"],
|
||||
eml_content: str | Omit = omit,
|
||||
escalated_submission_id: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> object:
|
||||
"""
|
||||
Change email classfication
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
postfix_id: The identifier of the message.
|
||||
|
||||
eml_content: Base64 encoded content of the EML file
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not postfix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_id}/email-security/investigate/{postfix_id}/reclassify",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"expected_disposition": expected_disposition,
|
||||
"eml_content": eml_content,
|
||||
"escalated_submission_id": escalated_submission_id,
|
||||
},
|
||||
reclassify_create_params.ReclassifyCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[object]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[object], ResultWrapper[object]),
|
||||
)
|
||||
|
||||
|
||||
class ReclassifyResourceWithRawResponse:
|
||||
def __init__(self, reclassify: ReclassifyResource) -> None:
|
||||
self._reclassify = reclassify
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
reclassify.create,
|
||||
)
|
||||
|
||||
|
||||
class AsyncReclassifyResourceWithRawResponse:
|
||||
def __init__(self, reclassify: AsyncReclassifyResource) -> None:
|
||||
self._reclassify = reclassify
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
reclassify.create,
|
||||
)
|
||||
|
||||
|
||||
class ReclassifyResourceWithStreamingResponse:
|
||||
def __init__(self, reclassify: ReclassifyResource) -> None:
|
||||
self._reclassify = reclassify
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
reclassify.create,
|
||||
)
|
||||
|
||||
|
||||
class AsyncReclassifyResourceWithStreamingResponse:
|
||||
def __init__(self, reclassify: AsyncReclassifyResource) -> None:
|
||||
self._reclassify = reclassify
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
reclassify.create,
|
||||
)
|
||||
|
|
@ -1,181 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import Body, Query, Headers, NotGiven, SequenceNotStr, not_given
|
||||
from ...._utils import maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ....pagination import SyncSinglePage, AsyncSinglePage
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.email_security.investigate.release_bulk_response import ReleaseBulkResponse
|
||||
|
||||
__all__ = ["ReleaseResource", "AsyncReleaseResource"]
|
||||
|
||||
|
||||
class ReleaseResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> ReleaseResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return ReleaseResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> ReleaseResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return ReleaseResourceWithStreamingResponse(self)
|
||||
|
||||
def bulk(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
body: SequenceNotStr[str],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> SyncSinglePage[ReleaseBulkResponse]:
|
||||
"""
|
||||
Release messages from quarantine
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
body: A list of messages identfied by their `postfix_id`s that should be released.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/investigate/release",
|
||||
page=SyncSinglePage[ReleaseBulkResponse],
|
||||
body=maybe_transform(body, SequenceNotStr[str]),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=ReleaseBulkResponse,
|
||||
method="post",
|
||||
)
|
||||
|
||||
|
||||
class AsyncReleaseResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncReleaseResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncReleaseResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncReleaseResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncReleaseResourceWithStreamingResponse(self)
|
||||
|
||||
def bulk(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
body: SequenceNotStr[str],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AsyncPaginator[ReleaseBulkResponse, AsyncSinglePage[ReleaseBulkResponse]]:
|
||||
"""
|
||||
Release messages from quarantine
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
body: A list of messages identfied by their `postfix_id`s that should be released.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/investigate/release",
|
||||
page=AsyncSinglePage[ReleaseBulkResponse],
|
||||
body=maybe_transform(body, SequenceNotStr[str]),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=ReleaseBulkResponse,
|
||||
method="post",
|
||||
)
|
||||
|
||||
|
||||
class ReleaseResourceWithRawResponse:
|
||||
def __init__(self, release: ReleaseResource) -> None:
|
||||
self._release = release
|
||||
|
||||
self.bulk = to_raw_response_wrapper(
|
||||
release.bulk,
|
||||
)
|
||||
|
||||
|
||||
class AsyncReleaseResourceWithRawResponse:
|
||||
def __init__(self, release: AsyncReleaseResource) -> None:
|
||||
self._release = release
|
||||
|
||||
self.bulk = async_to_raw_response_wrapper(
|
||||
release.bulk,
|
||||
)
|
||||
|
||||
|
||||
class ReleaseResourceWithStreamingResponse:
|
||||
def __init__(self, release: ReleaseResource) -> None:
|
||||
self._release = release
|
||||
|
||||
self.bulk = to_streamed_response_wrapper(
|
||||
release.bulk,
|
||||
)
|
||||
|
||||
|
||||
class AsyncReleaseResourceWithStreamingResponse:
|
||||
def __init__(self, release: AsyncReleaseResource) -> None:
|
||||
self._release = release
|
||||
|
||||
self.bulk = async_to_streamed_response_wrapper(
|
||||
release.bulk,
|
||||
)
|
||||
|
|
@ -1,188 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import Body, Query, Headers, NotGiven, not_given
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import make_request_options
|
||||
from ....types.email_security.investigate.trace_get_response import TraceGetResponse
|
||||
|
||||
__all__ = ["TraceResource", "AsyncTraceResource"]
|
||||
|
||||
|
||||
class TraceResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> TraceResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return TraceResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> TraceResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return TraceResourceWithStreamingResponse(self)
|
||||
|
||||
def get(
|
||||
self,
|
||||
postfix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> TraceGetResponse:
|
||||
"""
|
||||
Get email trace
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
postfix_id: The identifier of the message.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not postfix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/email-security/investigate/{postfix_id}/trace",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[TraceGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[TraceGetResponse], ResultWrapper[TraceGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncTraceResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncTraceResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncTraceResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncTraceResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncTraceResourceWithStreamingResponse(self)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
postfix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> TraceGetResponse:
|
||||
"""
|
||||
Get email trace
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
postfix_id: The identifier of the message.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not postfix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/email-security/investigate/{postfix_id}/trace",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[TraceGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[TraceGetResponse], ResultWrapper[TraceGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class TraceResourceWithRawResponse:
|
||||
def __init__(self, trace: TraceResource) -> None:
|
||||
self._trace = trace
|
||||
|
||||
self.get = to_raw_response_wrapper(
|
||||
trace.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncTraceResourceWithRawResponse:
|
||||
def __init__(self, trace: AsyncTraceResource) -> None:
|
||||
self._trace = trace
|
||||
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
trace.get,
|
||||
)
|
||||
|
||||
|
||||
class TraceResourceWithStreamingResponse:
|
||||
def __init__(self, trace: TraceResource) -> None:
|
||||
self._trace = trace
|
||||
|
||||
self.get = to_streamed_response_wrapper(
|
||||
trace.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncTraceResourceWithStreamingResponse:
|
||||
def __init__(self, trace: AsyncTraceResource) -> None:
|
||||
self._trace = trace
|
||||
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
trace.get,
|
||||
)
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from .domains import (
|
||||
DomainsResource,
|
||||
AsyncDomainsResource,
|
||||
DomainsResourceWithRawResponse,
|
||||
AsyncDomainsResourceWithRawResponse,
|
||||
DomainsResourceWithStreamingResponse,
|
||||
AsyncDomainsResourceWithStreamingResponse,
|
||||
)
|
||||
from .settings import (
|
||||
SettingsResource,
|
||||
AsyncSettingsResource,
|
||||
SettingsResourceWithRawResponse,
|
||||
AsyncSettingsResourceWithRawResponse,
|
||||
SettingsResourceWithStreamingResponse,
|
||||
AsyncSettingsResourceWithStreamingResponse,
|
||||
)
|
||||
from .block_senders import (
|
||||
BlockSendersResource,
|
||||
AsyncBlockSendersResource,
|
||||
BlockSendersResourceWithRawResponse,
|
||||
AsyncBlockSendersResourceWithRawResponse,
|
||||
BlockSendersResourceWithStreamingResponse,
|
||||
AsyncBlockSendersResourceWithStreamingResponse,
|
||||
)
|
||||
from .allow_policies import (
|
||||
AllowPoliciesResource,
|
||||
AsyncAllowPoliciesResource,
|
||||
AllowPoliciesResourceWithRawResponse,
|
||||
AsyncAllowPoliciesResourceWithRawResponse,
|
||||
AllowPoliciesResourceWithStreamingResponse,
|
||||
AsyncAllowPoliciesResourceWithStreamingResponse,
|
||||
)
|
||||
from .trusted_domains import (
|
||||
TrustedDomainsResource,
|
||||
AsyncTrustedDomainsResource,
|
||||
TrustedDomainsResourceWithRawResponse,
|
||||
AsyncTrustedDomainsResourceWithRawResponse,
|
||||
TrustedDomainsResourceWithStreamingResponse,
|
||||
AsyncTrustedDomainsResourceWithStreamingResponse,
|
||||
)
|
||||
from .impersonation_registry import (
|
||||
ImpersonationRegistryResource,
|
||||
AsyncImpersonationRegistryResource,
|
||||
ImpersonationRegistryResourceWithRawResponse,
|
||||
AsyncImpersonationRegistryResourceWithRawResponse,
|
||||
ImpersonationRegistryResourceWithStreamingResponse,
|
||||
AsyncImpersonationRegistryResourceWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"AllowPoliciesResource",
|
||||
"AsyncAllowPoliciesResource",
|
||||
"AllowPoliciesResourceWithRawResponse",
|
||||
"AsyncAllowPoliciesResourceWithRawResponse",
|
||||
"AllowPoliciesResourceWithStreamingResponse",
|
||||
"AsyncAllowPoliciesResourceWithStreamingResponse",
|
||||
"BlockSendersResource",
|
||||
"AsyncBlockSendersResource",
|
||||
"BlockSendersResourceWithRawResponse",
|
||||
"AsyncBlockSendersResourceWithRawResponse",
|
||||
"BlockSendersResourceWithStreamingResponse",
|
||||
"AsyncBlockSendersResourceWithStreamingResponse",
|
||||
"DomainsResource",
|
||||
"AsyncDomainsResource",
|
||||
"DomainsResourceWithRawResponse",
|
||||
"AsyncDomainsResourceWithRawResponse",
|
||||
"DomainsResourceWithStreamingResponse",
|
||||
"AsyncDomainsResourceWithStreamingResponse",
|
||||
"ImpersonationRegistryResource",
|
||||
"AsyncImpersonationRegistryResource",
|
||||
"ImpersonationRegistryResourceWithRawResponse",
|
||||
"AsyncImpersonationRegistryResourceWithRawResponse",
|
||||
"ImpersonationRegistryResourceWithStreamingResponse",
|
||||
"AsyncImpersonationRegistryResourceWithStreamingResponse",
|
||||
"TrustedDomainsResource",
|
||||
"AsyncTrustedDomainsResource",
|
||||
"TrustedDomainsResourceWithRawResponse",
|
||||
"AsyncTrustedDomainsResourceWithRawResponse",
|
||||
"TrustedDomainsResourceWithStreamingResponse",
|
||||
"AsyncTrustedDomainsResourceWithStreamingResponse",
|
||||
"SettingsResource",
|
||||
"AsyncSettingsResource",
|
||||
"SettingsResourceWithRawResponse",
|
||||
"AsyncSettingsResourceWithRawResponse",
|
||||
"SettingsResourceWithStreamingResponse",
|
||||
"AsyncSettingsResourceWithStreamingResponse",
|
||||
]
|
||||
|
|
@ -1,798 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.email_security.settings import (
|
||||
allow_policy_edit_params,
|
||||
allow_policy_list_params,
|
||||
allow_policy_create_params,
|
||||
)
|
||||
from ....types.email_security.settings.allow_policy_get_response import AllowPolicyGetResponse
|
||||
from ....types.email_security.settings.allow_policy_edit_response import AllowPolicyEditResponse
|
||||
from ....types.email_security.settings.allow_policy_list_response import AllowPolicyListResponse
|
||||
from ....types.email_security.settings.allow_policy_create_response import AllowPolicyCreateResponse
|
||||
from ....types.email_security.settings.allow_policy_delete_response import AllowPolicyDeleteResponse
|
||||
|
||||
__all__ = ["AllowPoliciesResource", "AsyncAllowPoliciesResource"]
|
||||
|
||||
|
||||
class AllowPoliciesResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AllowPoliciesResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AllowPoliciesResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AllowPoliciesResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AllowPoliciesResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
is_acceptable_sender: bool,
|
||||
is_exempt_recipient: bool,
|
||||
is_regex: bool,
|
||||
is_trusted_sender: bool,
|
||||
pattern: str,
|
||||
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"],
|
||||
verify_sender: bool,
|
||||
comments: Optional[str] | Omit = omit,
|
||||
is_recipient: bool | Omit = omit,
|
||||
is_sender: bool | Omit = omit,
|
||||
is_spoof: bool | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AllowPolicyCreateResponse:
|
||||
"""
|
||||
Create an email allow policy
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
is_acceptable_sender: Messages from this sender will be exempted from Spam, Spoof and Bulk
|
||||
dispositions. Note: This will not exempt messages with Malicious or Suspicious
|
||||
dispositions.
|
||||
|
||||
is_exempt_recipient: Messages to this recipient will bypass all detections.
|
||||
|
||||
is_trusted_sender: Messages from this sender will bypass all detections and link following.
|
||||
|
||||
verify_sender: Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
|
||||
policies that pass authentication.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_id}/email-security/settings/allow_policies",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"is_acceptable_sender": is_acceptable_sender,
|
||||
"is_exempt_recipient": is_exempt_recipient,
|
||||
"is_regex": is_regex,
|
||||
"is_trusted_sender": is_trusted_sender,
|
||||
"pattern": pattern,
|
||||
"pattern_type": pattern_type,
|
||||
"verify_sender": verify_sender,
|
||||
"comments": comments,
|
||||
"is_recipient": is_recipient,
|
||||
"is_sender": is_sender,
|
||||
"is_spoof": is_spoof,
|
||||
},
|
||||
allow_policy_create_params.AllowPolicyCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[AllowPolicyCreateResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AllowPolicyCreateResponse], ResultWrapper[AllowPolicyCreateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
direction: Literal["asc", "desc"] | Omit = omit,
|
||||
is_acceptable_sender: bool | Omit = omit,
|
||||
is_exempt_recipient: bool | Omit = omit,
|
||||
is_recipient: bool | Omit = omit,
|
||||
is_sender: bool | Omit = omit,
|
||||
is_spoof: bool | Omit = omit,
|
||||
is_trusted_sender: bool | Omit = omit,
|
||||
order: Literal["pattern", "created_at"] | Omit = omit,
|
||||
page: int | Omit = omit,
|
||||
pattern: str | Omit = omit,
|
||||
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | Omit = omit,
|
||||
per_page: int | Omit = omit,
|
||||
search: str | Omit = omit,
|
||||
verify_sender: bool | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> SyncV4PagePaginationArray[AllowPolicyListResponse]:
|
||||
"""
|
||||
Lists, searches, and sorts an account’s email allow policies.
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
direction: The sorting direction.
|
||||
|
||||
order: The field to sort by.
|
||||
|
||||
page: The page number of paginated results.
|
||||
|
||||
per_page: The number of results per page.
|
||||
|
||||
search: Allows searching in multiple properties of a record simultaneously. This
|
||||
parameter is intended for human users, not automation. Its exact behavior is
|
||||
intentionally left unspecified and is subject to change in the future.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/settings/allow_policies",
|
||||
page=SyncV4PagePaginationArray[AllowPolicyListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"direction": direction,
|
||||
"is_acceptable_sender": is_acceptable_sender,
|
||||
"is_exempt_recipient": is_exempt_recipient,
|
||||
"is_recipient": is_recipient,
|
||||
"is_sender": is_sender,
|
||||
"is_spoof": is_spoof,
|
||||
"is_trusted_sender": is_trusted_sender,
|
||||
"order": order,
|
||||
"page": page,
|
||||
"pattern": pattern,
|
||||
"pattern_type": pattern_type,
|
||||
"per_page": per_page,
|
||||
"search": search,
|
||||
"verify_sender": verify_sender,
|
||||
},
|
||||
allow_policy_list_params.AllowPolicyListParams,
|
||||
),
|
||||
),
|
||||
model=AllowPolicyListResponse,
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
policy_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AllowPolicyDeleteResponse:
|
||||
"""
|
||||
Delete an email allow policy
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
policy_id: The unique identifier for the allow policy.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._delete(
|
||||
f"/accounts/{account_id}/email-security/settings/allow_policies/{policy_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[AllowPolicyDeleteResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AllowPolicyDeleteResponse], ResultWrapper[AllowPolicyDeleteResponse]),
|
||||
)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
policy_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
comments: Optional[str] | Omit = omit,
|
||||
is_acceptable_sender: Optional[bool] | Omit = omit,
|
||||
is_exempt_recipient: Optional[bool] | Omit = omit,
|
||||
is_regex: Optional[bool] | Omit = omit,
|
||||
is_trusted_sender: Optional[bool] | Omit = omit,
|
||||
pattern: Optional[str] | Omit = omit,
|
||||
pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] | Omit = omit,
|
||||
verify_sender: Optional[bool] | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AllowPolicyEditResponse:
|
||||
"""
|
||||
Update an email allow policy
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
policy_id: The unique identifier for the allow policy.
|
||||
|
||||
is_acceptable_sender: Messages from this sender will be exempted from Spam, Spoof and Bulk
|
||||
dispositions. Note: This will not exempt messages with Malicious or Suspicious
|
||||
dispositions.
|
||||
|
||||
is_exempt_recipient: Messages to this recipient will bypass all detections.
|
||||
|
||||
is_trusted_sender: Messages from this sender will bypass all detections and link following.
|
||||
|
||||
verify_sender: Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
|
||||
policies that pass authentication.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._patch(
|
||||
f"/accounts/{account_id}/email-security/settings/allow_policies/{policy_id}",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"comments": comments,
|
||||
"is_acceptable_sender": is_acceptable_sender,
|
||||
"is_exempt_recipient": is_exempt_recipient,
|
||||
"is_regex": is_regex,
|
||||
"is_trusted_sender": is_trusted_sender,
|
||||
"pattern": pattern,
|
||||
"pattern_type": pattern_type,
|
||||
"verify_sender": verify_sender,
|
||||
},
|
||||
allow_policy_edit_params.AllowPolicyEditParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[AllowPolicyEditResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AllowPolicyEditResponse], ResultWrapper[AllowPolicyEditResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
policy_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AllowPolicyGetResponse:
|
||||
"""
|
||||
Get an email allow policy
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
policy_id: The unique identifier for the allow policy.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/email-security/settings/allow_policies/{policy_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[AllowPolicyGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AllowPolicyGetResponse], ResultWrapper[AllowPolicyGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncAllowPoliciesResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncAllowPoliciesResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncAllowPoliciesResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncAllowPoliciesResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncAllowPoliciesResourceWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
is_acceptable_sender: bool,
|
||||
is_exempt_recipient: bool,
|
||||
is_regex: bool,
|
||||
is_trusted_sender: bool,
|
||||
pattern: str,
|
||||
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"],
|
||||
verify_sender: bool,
|
||||
comments: Optional[str] | Omit = omit,
|
||||
is_recipient: bool | Omit = omit,
|
||||
is_sender: bool | Omit = omit,
|
||||
is_spoof: bool | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AllowPolicyCreateResponse:
|
||||
"""
|
||||
Create an email allow policy
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
is_acceptable_sender: Messages from this sender will be exempted from Spam, Spoof and Bulk
|
||||
dispositions. Note: This will not exempt messages with Malicious or Suspicious
|
||||
dispositions.
|
||||
|
||||
is_exempt_recipient: Messages to this recipient will bypass all detections.
|
||||
|
||||
is_trusted_sender: Messages from this sender will bypass all detections and link following.
|
||||
|
||||
verify_sender: Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
|
||||
policies that pass authentication.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_id}/email-security/settings/allow_policies",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"is_acceptable_sender": is_acceptable_sender,
|
||||
"is_exempt_recipient": is_exempt_recipient,
|
||||
"is_regex": is_regex,
|
||||
"is_trusted_sender": is_trusted_sender,
|
||||
"pattern": pattern,
|
||||
"pattern_type": pattern_type,
|
||||
"verify_sender": verify_sender,
|
||||
"comments": comments,
|
||||
"is_recipient": is_recipient,
|
||||
"is_sender": is_sender,
|
||||
"is_spoof": is_spoof,
|
||||
},
|
||||
allow_policy_create_params.AllowPolicyCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[AllowPolicyCreateResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AllowPolicyCreateResponse], ResultWrapper[AllowPolicyCreateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
direction: Literal["asc", "desc"] | Omit = omit,
|
||||
is_acceptable_sender: bool | Omit = omit,
|
||||
is_exempt_recipient: bool | Omit = omit,
|
||||
is_recipient: bool | Omit = omit,
|
||||
is_sender: bool | Omit = omit,
|
||||
is_spoof: bool | Omit = omit,
|
||||
is_trusted_sender: bool | Omit = omit,
|
||||
order: Literal["pattern", "created_at"] | Omit = omit,
|
||||
page: int | Omit = omit,
|
||||
pattern: str | Omit = omit,
|
||||
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | Omit = omit,
|
||||
per_page: int | Omit = omit,
|
||||
search: str | Omit = omit,
|
||||
verify_sender: bool | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AsyncPaginator[AllowPolicyListResponse, AsyncV4PagePaginationArray[AllowPolicyListResponse]]:
|
||||
"""
|
||||
Lists, searches, and sorts an account’s email allow policies.
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
direction: The sorting direction.
|
||||
|
||||
order: The field to sort by.
|
||||
|
||||
page: The page number of paginated results.
|
||||
|
||||
per_page: The number of results per page.
|
||||
|
||||
search: Allows searching in multiple properties of a record simultaneously. This
|
||||
parameter is intended for human users, not automation. Its exact behavior is
|
||||
intentionally left unspecified and is subject to change in the future.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/settings/allow_policies",
|
||||
page=AsyncV4PagePaginationArray[AllowPolicyListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"direction": direction,
|
||||
"is_acceptable_sender": is_acceptable_sender,
|
||||
"is_exempt_recipient": is_exempt_recipient,
|
||||
"is_recipient": is_recipient,
|
||||
"is_sender": is_sender,
|
||||
"is_spoof": is_spoof,
|
||||
"is_trusted_sender": is_trusted_sender,
|
||||
"order": order,
|
||||
"page": page,
|
||||
"pattern": pattern,
|
||||
"pattern_type": pattern_type,
|
||||
"per_page": per_page,
|
||||
"search": search,
|
||||
"verify_sender": verify_sender,
|
||||
},
|
||||
allow_policy_list_params.AllowPolicyListParams,
|
||||
),
|
||||
),
|
||||
model=AllowPolicyListResponse,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
policy_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AllowPolicyDeleteResponse:
|
||||
"""
|
||||
Delete an email allow policy
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
policy_id: The unique identifier for the allow policy.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._delete(
|
||||
f"/accounts/{account_id}/email-security/settings/allow_policies/{policy_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[AllowPolicyDeleteResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AllowPolicyDeleteResponse], ResultWrapper[AllowPolicyDeleteResponse]),
|
||||
)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
policy_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
comments: Optional[str] | Omit = omit,
|
||||
is_acceptable_sender: Optional[bool] | Omit = omit,
|
||||
is_exempt_recipient: Optional[bool] | Omit = omit,
|
||||
is_regex: Optional[bool] | Omit = omit,
|
||||
is_trusted_sender: Optional[bool] | Omit = omit,
|
||||
pattern: Optional[str] | Omit = omit,
|
||||
pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] | Omit = omit,
|
||||
verify_sender: Optional[bool] | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AllowPolicyEditResponse:
|
||||
"""
|
||||
Update an email allow policy
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
policy_id: The unique identifier for the allow policy.
|
||||
|
||||
is_acceptable_sender: Messages from this sender will be exempted from Spam, Spoof and Bulk
|
||||
dispositions. Note: This will not exempt messages with Malicious or Suspicious
|
||||
dispositions.
|
||||
|
||||
is_exempt_recipient: Messages to this recipient will bypass all detections.
|
||||
|
||||
is_trusted_sender: Messages from this sender will bypass all detections and link following.
|
||||
|
||||
verify_sender: Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
|
||||
policies that pass authentication.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._patch(
|
||||
f"/accounts/{account_id}/email-security/settings/allow_policies/{policy_id}",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"comments": comments,
|
||||
"is_acceptable_sender": is_acceptable_sender,
|
||||
"is_exempt_recipient": is_exempt_recipient,
|
||||
"is_regex": is_regex,
|
||||
"is_trusted_sender": is_trusted_sender,
|
||||
"pattern": pattern,
|
||||
"pattern_type": pattern_type,
|
||||
"verify_sender": verify_sender,
|
||||
},
|
||||
allow_policy_edit_params.AllowPolicyEditParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[AllowPolicyEditResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AllowPolicyEditResponse], ResultWrapper[AllowPolicyEditResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
policy_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AllowPolicyGetResponse:
|
||||
"""
|
||||
Get an email allow policy
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
policy_id: The unique identifier for the allow policy.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/email-security/settings/allow_policies/{policy_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[AllowPolicyGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AllowPolicyGetResponse], ResultWrapper[AllowPolicyGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AllowPoliciesResourceWithRawResponse:
|
||||
def __init__(self, allow_policies: AllowPoliciesResource) -> None:
|
||||
self._allow_policies = allow_policies
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
allow_policies.create,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
allow_policies.list,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
allow_policies.delete,
|
||||
)
|
||||
self.edit = to_raw_response_wrapper(
|
||||
allow_policies.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
allow_policies.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncAllowPoliciesResourceWithRawResponse:
|
||||
def __init__(self, allow_policies: AsyncAllowPoliciesResource) -> None:
|
||||
self._allow_policies = allow_policies
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
allow_policies.create,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
allow_policies.list,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
allow_policies.delete,
|
||||
)
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
allow_policies.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
allow_policies.get,
|
||||
)
|
||||
|
||||
|
||||
class AllowPoliciesResourceWithStreamingResponse:
|
||||
def __init__(self, allow_policies: AllowPoliciesResource) -> None:
|
||||
self._allow_policies = allow_policies
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
allow_policies.create,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
allow_policies.list,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
allow_policies.delete,
|
||||
)
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
allow_policies.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
allow_policies.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncAllowPoliciesResourceWithStreamingResponse:
|
||||
def __init__(self, allow_policies: AsyncAllowPoliciesResource) -> None:
|
||||
self._allow_policies = allow_policies
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
allow_policies.create,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
allow_policies.list,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
allow_policies.delete,
|
||||
)
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
allow_policies.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
allow_policies.get,
|
||||
)
|
||||
|
|
@ -1,682 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.email_security.settings import (
|
||||
block_sender_edit_params,
|
||||
block_sender_list_params,
|
||||
block_sender_create_params,
|
||||
)
|
||||
from ....types.email_security.settings.block_sender_get_response import BlockSenderGetResponse
|
||||
from ....types.email_security.settings.block_sender_edit_response import BlockSenderEditResponse
|
||||
from ....types.email_security.settings.block_sender_list_response import BlockSenderListResponse
|
||||
from ....types.email_security.settings.block_sender_create_response import BlockSenderCreateResponse
|
||||
from ....types.email_security.settings.block_sender_delete_response import BlockSenderDeleteResponse
|
||||
|
||||
__all__ = ["BlockSendersResource", "AsyncBlockSendersResource"]
|
||||
|
||||
|
||||
class BlockSendersResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> BlockSendersResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return BlockSendersResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> BlockSendersResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return BlockSendersResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
is_regex: bool,
|
||||
pattern: str,
|
||||
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"],
|
||||
comments: Optional[str] | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> BlockSenderCreateResponse:
|
||||
"""
|
||||
Create a blocked email sender
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_id}/email-security/settings/block_senders",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"is_regex": is_regex,
|
||||
"pattern": pattern,
|
||||
"pattern_type": pattern_type,
|
||||
"comments": comments,
|
||||
},
|
||||
block_sender_create_params.BlockSenderCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[BlockSenderCreateResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[BlockSenderCreateResponse], ResultWrapper[BlockSenderCreateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
direction: Literal["asc", "desc"] | Omit = omit,
|
||||
order: Literal["pattern", "created_at"] | Omit = omit,
|
||||
page: int | Omit = omit,
|
||||
pattern: str | Omit = omit,
|
||||
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | Omit = omit,
|
||||
per_page: int | Omit = omit,
|
||||
search: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> SyncV4PagePaginationArray[BlockSenderListResponse]:
|
||||
"""
|
||||
List blocked email senders
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
direction: The sorting direction.
|
||||
|
||||
order: The field to sort by.
|
||||
|
||||
page: The page number of paginated results.
|
||||
|
||||
per_page: The number of results per page.
|
||||
|
||||
search: Allows searching in multiple properties of a record simultaneously. This
|
||||
parameter is intended for human users, not automation. Its exact behavior is
|
||||
intentionally left unspecified and is subject to change in the future.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/settings/block_senders",
|
||||
page=SyncV4PagePaginationArray[BlockSenderListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"direction": direction,
|
||||
"order": order,
|
||||
"page": page,
|
||||
"pattern": pattern,
|
||||
"pattern_type": pattern_type,
|
||||
"per_page": per_page,
|
||||
"search": search,
|
||||
},
|
||||
block_sender_list_params.BlockSenderListParams,
|
||||
),
|
||||
),
|
||||
model=BlockSenderListResponse,
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
pattern_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> BlockSenderDeleteResponse:
|
||||
"""
|
||||
Delete a blocked email sender
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
pattern_id: The unique identifier for the allow policy.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._delete(
|
||||
f"/accounts/{account_id}/email-security/settings/block_senders/{pattern_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[BlockSenderDeleteResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[BlockSenderDeleteResponse], ResultWrapper[BlockSenderDeleteResponse]),
|
||||
)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
pattern_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
comments: Optional[str] | Omit = omit,
|
||||
is_regex: Optional[bool] | Omit = omit,
|
||||
pattern: Optional[str] | Omit = omit,
|
||||
pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> BlockSenderEditResponse:
|
||||
"""
|
||||
Update a blocked email sender
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
pattern_id: The unique identifier for the allow policy.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._patch(
|
||||
f"/accounts/{account_id}/email-security/settings/block_senders/{pattern_id}",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"comments": comments,
|
||||
"is_regex": is_regex,
|
||||
"pattern": pattern,
|
||||
"pattern_type": pattern_type,
|
||||
},
|
||||
block_sender_edit_params.BlockSenderEditParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[BlockSenderEditResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[BlockSenderEditResponse], ResultWrapper[BlockSenderEditResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
pattern_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> BlockSenderGetResponse:
|
||||
"""
|
||||
Get a blocked email sender
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
pattern_id: The unique identifier for the allow policy.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/email-security/settings/block_senders/{pattern_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[BlockSenderGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[BlockSenderGetResponse], ResultWrapper[BlockSenderGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncBlockSendersResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncBlockSendersResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncBlockSendersResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncBlockSendersResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncBlockSendersResourceWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
is_regex: bool,
|
||||
pattern: str,
|
||||
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"],
|
||||
comments: Optional[str] | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> BlockSenderCreateResponse:
|
||||
"""
|
||||
Create a blocked email sender
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_id}/email-security/settings/block_senders",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"is_regex": is_regex,
|
||||
"pattern": pattern,
|
||||
"pattern_type": pattern_type,
|
||||
"comments": comments,
|
||||
},
|
||||
block_sender_create_params.BlockSenderCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[BlockSenderCreateResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[BlockSenderCreateResponse], ResultWrapper[BlockSenderCreateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
direction: Literal["asc", "desc"] | Omit = omit,
|
||||
order: Literal["pattern", "created_at"] | Omit = omit,
|
||||
page: int | Omit = omit,
|
||||
pattern: str | Omit = omit,
|
||||
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | Omit = omit,
|
||||
per_page: int | Omit = omit,
|
||||
search: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AsyncPaginator[BlockSenderListResponse, AsyncV4PagePaginationArray[BlockSenderListResponse]]:
|
||||
"""
|
||||
List blocked email senders
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
direction: The sorting direction.
|
||||
|
||||
order: The field to sort by.
|
||||
|
||||
page: The page number of paginated results.
|
||||
|
||||
per_page: The number of results per page.
|
||||
|
||||
search: Allows searching in multiple properties of a record simultaneously. This
|
||||
parameter is intended for human users, not automation. Its exact behavior is
|
||||
intentionally left unspecified and is subject to change in the future.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/settings/block_senders",
|
||||
page=AsyncV4PagePaginationArray[BlockSenderListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"direction": direction,
|
||||
"order": order,
|
||||
"page": page,
|
||||
"pattern": pattern,
|
||||
"pattern_type": pattern_type,
|
||||
"per_page": per_page,
|
||||
"search": search,
|
||||
},
|
||||
block_sender_list_params.BlockSenderListParams,
|
||||
),
|
||||
),
|
||||
model=BlockSenderListResponse,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
pattern_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> BlockSenderDeleteResponse:
|
||||
"""
|
||||
Delete a blocked email sender
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
pattern_id: The unique identifier for the allow policy.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._delete(
|
||||
f"/accounts/{account_id}/email-security/settings/block_senders/{pattern_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[BlockSenderDeleteResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[BlockSenderDeleteResponse], ResultWrapper[BlockSenderDeleteResponse]),
|
||||
)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
pattern_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
comments: Optional[str] | Omit = omit,
|
||||
is_regex: Optional[bool] | Omit = omit,
|
||||
pattern: Optional[str] | Omit = omit,
|
||||
pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> BlockSenderEditResponse:
|
||||
"""
|
||||
Update a blocked email sender
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
pattern_id: The unique identifier for the allow policy.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._patch(
|
||||
f"/accounts/{account_id}/email-security/settings/block_senders/{pattern_id}",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"comments": comments,
|
||||
"is_regex": is_regex,
|
||||
"pattern": pattern,
|
||||
"pattern_type": pattern_type,
|
||||
},
|
||||
block_sender_edit_params.BlockSenderEditParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[BlockSenderEditResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[BlockSenderEditResponse], ResultWrapper[BlockSenderEditResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
pattern_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> BlockSenderGetResponse:
|
||||
"""
|
||||
Get a blocked email sender
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
pattern_id: The unique identifier for the allow policy.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/email-security/settings/block_senders/{pattern_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[BlockSenderGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[BlockSenderGetResponse], ResultWrapper[BlockSenderGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class BlockSendersResourceWithRawResponse:
|
||||
def __init__(self, block_senders: BlockSendersResource) -> None:
|
||||
self._block_senders = block_senders
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
block_senders.create,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
block_senders.list,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
block_senders.delete,
|
||||
)
|
||||
self.edit = to_raw_response_wrapper(
|
||||
block_senders.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
block_senders.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncBlockSendersResourceWithRawResponse:
|
||||
def __init__(self, block_senders: AsyncBlockSendersResource) -> None:
|
||||
self._block_senders = block_senders
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
block_senders.create,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
block_senders.list,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
block_senders.delete,
|
||||
)
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
block_senders.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
block_senders.get,
|
||||
)
|
||||
|
||||
|
||||
class BlockSendersResourceWithStreamingResponse:
|
||||
def __init__(self, block_senders: BlockSendersResource) -> None:
|
||||
self._block_senders = block_senders
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
block_senders.create,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
block_senders.list,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
block_senders.delete,
|
||||
)
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
block_senders.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
block_senders.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncBlockSendersResourceWithStreamingResponse:
|
||||
def __init__(self, block_senders: AsyncBlockSendersResource) -> None:
|
||||
self._block_senders = block_senders
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
block_senders.create,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
block_senders.list,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
block_senders.delete,
|
||||
)
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
block_senders.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
block_senders.get,
|
||||
)
|
||||
|
|
@ -1,720 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import List, Type, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ....pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.email_security.settings import domain_edit_params, domain_list_params
|
||||
from ....types.email_security.settings.domain_get_response import DomainGetResponse
|
||||
from ....types.email_security.settings.domain_edit_response import DomainEditResponse
|
||||
from ....types.email_security.settings.domain_list_response import DomainListResponse
|
||||
from ....types.email_security.settings.domain_delete_response import DomainDeleteResponse
|
||||
from ....types.email_security.settings.domain_bulk_delete_response import DomainBulkDeleteResponse
|
||||
|
||||
__all__ = ["DomainsResource", "AsyncDomainsResource"]
|
||||
|
||||
|
||||
class DomainsResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> DomainsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return DomainsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> DomainsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return DomainsResourceWithStreamingResponse(self)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
active_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] | Omit = omit,
|
||||
allowed_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] | Omit = omit,
|
||||
direction: Literal["asc", "desc"] | Omit = omit,
|
||||
domain: SequenceNotStr[str] | Omit = omit,
|
||||
order: Literal["domain", "created_at"] | Omit = omit,
|
||||
page: int | Omit = omit,
|
||||
per_page: int | Omit = omit,
|
||||
search: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> SyncV4PagePaginationArray[DomainListResponse]:
|
||||
"""
|
||||
Lists, searches, and sorts an account’s email domains.
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
active_delivery_mode: Filters response to domains with the currently active delivery mode.
|
||||
|
||||
allowed_delivery_mode: Filters response to domains with the provided delivery mode.
|
||||
|
||||
direction: The sorting direction.
|
||||
|
||||
domain: Filters results by the provided domains, allowing for multiple occurrences.
|
||||
|
||||
order: The field to sort by.
|
||||
|
||||
page: The page number of paginated results.
|
||||
|
||||
per_page: The number of results per page.
|
||||
|
||||
search: Allows searching in multiple properties of a record simultaneously. This
|
||||
parameter is intended for human users, not automation. Its exact behavior is
|
||||
intentionally left unspecified and is subject to change in the future.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/settings/domains",
|
||||
page=SyncV4PagePaginationArray[DomainListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"active_delivery_mode": active_delivery_mode,
|
||||
"allowed_delivery_mode": allowed_delivery_mode,
|
||||
"direction": direction,
|
||||
"domain": domain,
|
||||
"order": order,
|
||||
"page": page,
|
||||
"per_page": per_page,
|
||||
"search": search,
|
||||
},
|
||||
domain_list_params.DomainListParams,
|
||||
),
|
||||
),
|
||||
model=DomainListResponse,
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
domain_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> DomainDeleteResponse:
|
||||
"""
|
||||
Unprotect an email domain
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
domain_id: The unique identifier for the domain.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._delete(
|
||||
f"/accounts/{account_id}/email-security/settings/domains/{domain_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[DomainDeleteResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[DomainDeleteResponse], ResultWrapper[DomainDeleteResponse]),
|
||||
)
|
||||
|
||||
def bulk_delete(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> SyncSinglePage[DomainBulkDeleteResponse]:
|
||||
"""
|
||||
Unprotect multiple email domains
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/settings/domains",
|
||||
page=SyncSinglePage[DomainBulkDeleteResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=DomainBulkDeleteResponse,
|
||||
method="delete",
|
||||
)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
domain_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
ip_restrictions: SequenceNotStr[str],
|
||||
allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]] | Omit = omit,
|
||||
domain: str | Omit = omit,
|
||||
drop_dispositions: List[
|
||||
Literal[
|
||||
"MALICIOUS",
|
||||
"MALICIOUS-BEC",
|
||||
"SUSPICIOUS",
|
||||
"SPOOF",
|
||||
"SPAM",
|
||||
"BULK",
|
||||
"ENCRYPTED",
|
||||
"EXTERNAL",
|
||||
"UNKNOWN",
|
||||
"NONE",
|
||||
]
|
||||
]
|
||||
| Omit = omit,
|
||||
folder: Literal["AllItems", "Inbox"] | Omit = omit,
|
||||
integration_id: str | Omit = omit,
|
||||
lookback_hops: int | Omit = omit,
|
||||
regions: List[Literal["GLOBAL", "AU", "DE", "IN", "US"]] | Omit = omit,
|
||||
require_tls_inbound: bool | Omit = omit,
|
||||
require_tls_outbound: bool | Omit = omit,
|
||||
transport: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> DomainEditResponse:
|
||||
"""
|
||||
Update an email domain
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
domain_id: The unique identifier for the domain.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._patch(
|
||||
f"/accounts/{account_id}/email-security/settings/domains/{domain_id}",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"ip_restrictions": ip_restrictions,
|
||||
"allowed_delivery_modes": allowed_delivery_modes,
|
||||
"domain": domain,
|
||||
"drop_dispositions": drop_dispositions,
|
||||
"folder": folder,
|
||||
"integration_id": integration_id,
|
||||
"lookback_hops": lookback_hops,
|
||||
"regions": regions,
|
||||
"require_tls_inbound": require_tls_inbound,
|
||||
"require_tls_outbound": require_tls_outbound,
|
||||
"transport": transport,
|
||||
},
|
||||
domain_edit_params.DomainEditParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[DomainEditResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[DomainEditResponse], ResultWrapper[DomainEditResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
domain_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> DomainGetResponse:
|
||||
"""
|
||||
Get an email domain
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
domain_id: The unique identifier for the domain.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/email-security/settings/domains/{domain_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[DomainGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[DomainGetResponse], ResultWrapper[DomainGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncDomainsResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncDomainsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncDomainsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncDomainsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncDomainsResourceWithStreamingResponse(self)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
active_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] | Omit = omit,
|
||||
allowed_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] | Omit = omit,
|
||||
direction: Literal["asc", "desc"] | Omit = omit,
|
||||
domain: SequenceNotStr[str] | Omit = omit,
|
||||
order: Literal["domain", "created_at"] | Omit = omit,
|
||||
page: int | Omit = omit,
|
||||
per_page: int | Omit = omit,
|
||||
search: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AsyncPaginator[DomainListResponse, AsyncV4PagePaginationArray[DomainListResponse]]:
|
||||
"""
|
||||
Lists, searches, and sorts an account’s email domains.
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
active_delivery_mode: Filters response to domains with the currently active delivery mode.
|
||||
|
||||
allowed_delivery_mode: Filters response to domains with the provided delivery mode.
|
||||
|
||||
direction: The sorting direction.
|
||||
|
||||
domain: Filters results by the provided domains, allowing for multiple occurrences.
|
||||
|
||||
order: The field to sort by.
|
||||
|
||||
page: The page number of paginated results.
|
||||
|
||||
per_page: The number of results per page.
|
||||
|
||||
search: Allows searching in multiple properties of a record simultaneously. This
|
||||
parameter is intended for human users, not automation. Its exact behavior is
|
||||
intentionally left unspecified and is subject to change in the future.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/settings/domains",
|
||||
page=AsyncV4PagePaginationArray[DomainListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"active_delivery_mode": active_delivery_mode,
|
||||
"allowed_delivery_mode": allowed_delivery_mode,
|
||||
"direction": direction,
|
||||
"domain": domain,
|
||||
"order": order,
|
||||
"page": page,
|
||||
"per_page": per_page,
|
||||
"search": search,
|
||||
},
|
||||
domain_list_params.DomainListParams,
|
||||
),
|
||||
),
|
||||
model=DomainListResponse,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
domain_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> DomainDeleteResponse:
|
||||
"""
|
||||
Unprotect an email domain
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
domain_id: The unique identifier for the domain.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._delete(
|
||||
f"/accounts/{account_id}/email-security/settings/domains/{domain_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[DomainDeleteResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[DomainDeleteResponse], ResultWrapper[DomainDeleteResponse]),
|
||||
)
|
||||
|
||||
def bulk_delete(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AsyncPaginator[DomainBulkDeleteResponse, AsyncSinglePage[DomainBulkDeleteResponse]]:
|
||||
"""
|
||||
Unprotect multiple email domains
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/settings/domains",
|
||||
page=AsyncSinglePage[DomainBulkDeleteResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=DomainBulkDeleteResponse,
|
||||
method="delete",
|
||||
)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
domain_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
ip_restrictions: SequenceNotStr[str],
|
||||
allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]] | Omit = omit,
|
||||
domain: str | Omit = omit,
|
||||
drop_dispositions: List[
|
||||
Literal[
|
||||
"MALICIOUS",
|
||||
"MALICIOUS-BEC",
|
||||
"SUSPICIOUS",
|
||||
"SPOOF",
|
||||
"SPAM",
|
||||
"BULK",
|
||||
"ENCRYPTED",
|
||||
"EXTERNAL",
|
||||
"UNKNOWN",
|
||||
"NONE",
|
||||
]
|
||||
]
|
||||
| Omit = omit,
|
||||
folder: Literal["AllItems", "Inbox"] | Omit = omit,
|
||||
integration_id: str | Omit = omit,
|
||||
lookback_hops: int | Omit = omit,
|
||||
regions: List[Literal["GLOBAL", "AU", "DE", "IN", "US"]] | Omit = omit,
|
||||
require_tls_inbound: bool | Omit = omit,
|
||||
require_tls_outbound: bool | Omit = omit,
|
||||
transport: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> DomainEditResponse:
|
||||
"""
|
||||
Update an email domain
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
domain_id: The unique identifier for the domain.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._patch(
|
||||
f"/accounts/{account_id}/email-security/settings/domains/{domain_id}",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"ip_restrictions": ip_restrictions,
|
||||
"allowed_delivery_modes": allowed_delivery_modes,
|
||||
"domain": domain,
|
||||
"drop_dispositions": drop_dispositions,
|
||||
"folder": folder,
|
||||
"integration_id": integration_id,
|
||||
"lookback_hops": lookback_hops,
|
||||
"regions": regions,
|
||||
"require_tls_inbound": require_tls_inbound,
|
||||
"require_tls_outbound": require_tls_outbound,
|
||||
"transport": transport,
|
||||
},
|
||||
domain_edit_params.DomainEditParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[DomainEditResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[DomainEditResponse], ResultWrapper[DomainEditResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
domain_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> DomainGetResponse:
|
||||
"""
|
||||
Get an email domain
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
domain_id: The unique identifier for the domain.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/email-security/settings/domains/{domain_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[DomainGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[DomainGetResponse], ResultWrapper[DomainGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class DomainsResourceWithRawResponse:
|
||||
def __init__(self, domains: DomainsResource) -> None:
|
||||
self._domains = domains
|
||||
|
||||
self.list = to_raw_response_wrapper(
|
||||
domains.list,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
domains.delete,
|
||||
)
|
||||
self.bulk_delete = to_raw_response_wrapper(
|
||||
domains.bulk_delete,
|
||||
)
|
||||
self.edit = to_raw_response_wrapper(
|
||||
domains.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
domains.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncDomainsResourceWithRawResponse:
|
||||
def __init__(self, domains: AsyncDomainsResource) -> None:
|
||||
self._domains = domains
|
||||
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
domains.list,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
domains.delete,
|
||||
)
|
||||
self.bulk_delete = async_to_raw_response_wrapper(
|
||||
domains.bulk_delete,
|
||||
)
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
domains.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
domains.get,
|
||||
)
|
||||
|
||||
|
||||
class DomainsResourceWithStreamingResponse:
|
||||
def __init__(self, domains: DomainsResource) -> None:
|
||||
self._domains = domains
|
||||
|
||||
self.list = to_streamed_response_wrapper(
|
||||
domains.list,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
domains.delete,
|
||||
)
|
||||
self.bulk_delete = to_streamed_response_wrapper(
|
||||
domains.bulk_delete,
|
||||
)
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
domains.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
domains.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncDomainsResourceWithStreamingResponse:
|
||||
def __init__(self, domains: AsyncDomainsResource) -> None:
|
||||
self._domains = domains
|
||||
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
domains.list,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
domains.delete,
|
||||
)
|
||||
self.bulk_delete = async_to_streamed_response_wrapper(
|
||||
domains.bulk_delete,
|
||||
)
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
domains.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
domains.get,
|
||||
)
|
||||
|
|
@ -1,662 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.email_security.settings import (
|
||||
impersonation_registry_edit_params,
|
||||
impersonation_registry_list_params,
|
||||
impersonation_registry_create_params,
|
||||
)
|
||||
from ....types.email_security.settings.impersonation_registry_get_response import ImpersonationRegistryGetResponse
|
||||
from ....types.email_security.settings.impersonation_registry_edit_response import ImpersonationRegistryEditResponse
|
||||
from ....types.email_security.settings.impersonation_registry_list_response import ImpersonationRegistryListResponse
|
||||
from ....types.email_security.settings.impersonation_registry_create_response import ImpersonationRegistryCreateResponse
|
||||
from ....types.email_security.settings.impersonation_registry_delete_response import ImpersonationRegistryDeleteResponse
|
||||
|
||||
__all__ = ["ImpersonationRegistryResource", "AsyncImpersonationRegistryResource"]
|
||||
|
||||
|
||||
class ImpersonationRegistryResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> ImpersonationRegistryResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return ImpersonationRegistryResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> ImpersonationRegistryResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return ImpersonationRegistryResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
email: str,
|
||||
is_email_regex: bool,
|
||||
name: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> ImpersonationRegistryCreateResponse:
|
||||
"""
|
||||
Create an entry in impersonation registry
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_id}/email-security/settings/impersonation_registry",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"email": email,
|
||||
"is_email_regex": is_email_regex,
|
||||
"name": name,
|
||||
},
|
||||
impersonation_registry_create_params.ImpersonationRegistryCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[ImpersonationRegistryCreateResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[ImpersonationRegistryCreateResponse], ResultWrapper[ImpersonationRegistryCreateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
direction: Literal["asc", "desc"] | Omit = omit,
|
||||
order: Literal["name", "email", "created_at"] | Omit = omit,
|
||||
page: int | Omit = omit,
|
||||
per_page: int | Omit = omit,
|
||||
provenance: Literal["A1S_INTERNAL", "SNOOPY-CASB_OFFICE_365", "SNOOPY-OFFICE_365", "SNOOPY-GOOGLE_DIRECTORY"]
|
||||
| Omit = omit,
|
||||
search: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> SyncV4PagePaginationArray[ImpersonationRegistryListResponse]:
|
||||
"""
|
||||
Lists, searches, and sorts entries in the impersonation registry.
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
direction: The sorting direction.
|
||||
|
||||
order: The field to sort by.
|
||||
|
||||
page: The page number of paginated results.
|
||||
|
||||
per_page: The number of results per page.
|
||||
|
||||
search: Allows searching in multiple properties of a record simultaneously. This
|
||||
parameter is intended for human users, not automation. Its exact behavior is
|
||||
intentionally left unspecified and is subject to change in the future.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/settings/impersonation_registry",
|
||||
page=SyncV4PagePaginationArray[ImpersonationRegistryListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"direction": direction,
|
||||
"order": order,
|
||||
"page": page,
|
||||
"per_page": per_page,
|
||||
"provenance": provenance,
|
||||
"search": search,
|
||||
},
|
||||
impersonation_registry_list_params.ImpersonationRegistryListParams,
|
||||
),
|
||||
),
|
||||
model=ImpersonationRegistryListResponse,
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
display_name_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> ImpersonationRegistryDeleteResponse:
|
||||
"""
|
||||
Delete an entry from impersonation registry
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._delete(
|
||||
f"/accounts/{account_id}/email-security/settings/impersonation_registry/{display_name_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[ImpersonationRegistryDeleteResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[ImpersonationRegistryDeleteResponse], ResultWrapper[ImpersonationRegistryDeleteResponse]),
|
||||
)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
display_name_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
email: Optional[str] | Omit = omit,
|
||||
is_email_regex: Optional[bool] | Omit = omit,
|
||||
name: Optional[str] | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> ImpersonationRegistryEditResponse:
|
||||
"""
|
||||
Update an entry in impersonation registry
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._patch(
|
||||
f"/accounts/{account_id}/email-security/settings/impersonation_registry/{display_name_id}",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"email": email,
|
||||
"is_email_regex": is_email_regex,
|
||||
"name": name,
|
||||
},
|
||||
impersonation_registry_edit_params.ImpersonationRegistryEditParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[ImpersonationRegistryEditResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[ImpersonationRegistryEditResponse], ResultWrapper[ImpersonationRegistryEditResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
display_name_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> ImpersonationRegistryGetResponse:
|
||||
"""
|
||||
Get an entry in impersonation registry
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/email-security/settings/impersonation_registry/{display_name_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[ImpersonationRegistryGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[ImpersonationRegistryGetResponse], ResultWrapper[ImpersonationRegistryGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncImpersonationRegistryResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncImpersonationRegistryResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncImpersonationRegistryResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncImpersonationRegistryResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncImpersonationRegistryResourceWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
email: str,
|
||||
is_email_regex: bool,
|
||||
name: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> ImpersonationRegistryCreateResponse:
|
||||
"""
|
||||
Create an entry in impersonation registry
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_id}/email-security/settings/impersonation_registry",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"email": email,
|
||||
"is_email_regex": is_email_regex,
|
||||
"name": name,
|
||||
},
|
||||
impersonation_registry_create_params.ImpersonationRegistryCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[ImpersonationRegistryCreateResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[ImpersonationRegistryCreateResponse], ResultWrapper[ImpersonationRegistryCreateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
direction: Literal["asc", "desc"] | Omit = omit,
|
||||
order: Literal["name", "email", "created_at"] | Omit = omit,
|
||||
page: int | Omit = omit,
|
||||
per_page: int | Omit = omit,
|
||||
provenance: Literal["A1S_INTERNAL", "SNOOPY-CASB_OFFICE_365", "SNOOPY-OFFICE_365", "SNOOPY-GOOGLE_DIRECTORY"]
|
||||
| Omit = omit,
|
||||
search: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AsyncPaginator[
|
||||
ImpersonationRegistryListResponse, AsyncV4PagePaginationArray[ImpersonationRegistryListResponse]
|
||||
]:
|
||||
"""
|
||||
Lists, searches, and sorts entries in the impersonation registry.
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
direction: The sorting direction.
|
||||
|
||||
order: The field to sort by.
|
||||
|
||||
page: The page number of paginated results.
|
||||
|
||||
per_page: The number of results per page.
|
||||
|
||||
search: Allows searching in multiple properties of a record simultaneously. This
|
||||
parameter is intended for human users, not automation. Its exact behavior is
|
||||
intentionally left unspecified and is subject to change in the future.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/settings/impersonation_registry",
|
||||
page=AsyncV4PagePaginationArray[ImpersonationRegistryListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"direction": direction,
|
||||
"order": order,
|
||||
"page": page,
|
||||
"per_page": per_page,
|
||||
"provenance": provenance,
|
||||
"search": search,
|
||||
},
|
||||
impersonation_registry_list_params.ImpersonationRegistryListParams,
|
||||
),
|
||||
),
|
||||
model=ImpersonationRegistryListResponse,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
display_name_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> ImpersonationRegistryDeleteResponse:
|
||||
"""
|
||||
Delete an entry from impersonation registry
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._delete(
|
||||
f"/accounts/{account_id}/email-security/settings/impersonation_registry/{display_name_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[ImpersonationRegistryDeleteResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[ImpersonationRegistryDeleteResponse], ResultWrapper[ImpersonationRegistryDeleteResponse]),
|
||||
)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
display_name_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
email: Optional[str] | Omit = omit,
|
||||
is_email_regex: Optional[bool] | Omit = omit,
|
||||
name: Optional[str] | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> ImpersonationRegistryEditResponse:
|
||||
"""
|
||||
Update an entry in impersonation registry
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._patch(
|
||||
f"/accounts/{account_id}/email-security/settings/impersonation_registry/{display_name_id}",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"email": email,
|
||||
"is_email_regex": is_email_regex,
|
||||
"name": name,
|
||||
},
|
||||
impersonation_registry_edit_params.ImpersonationRegistryEditParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[ImpersonationRegistryEditResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[ImpersonationRegistryEditResponse], ResultWrapper[ImpersonationRegistryEditResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
display_name_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> ImpersonationRegistryGetResponse:
|
||||
"""
|
||||
Get an entry in impersonation registry
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/email-security/settings/impersonation_registry/{display_name_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[ImpersonationRegistryGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[ImpersonationRegistryGetResponse], ResultWrapper[ImpersonationRegistryGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class ImpersonationRegistryResourceWithRawResponse:
|
||||
def __init__(self, impersonation_registry: ImpersonationRegistryResource) -> None:
|
||||
self._impersonation_registry = impersonation_registry
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
impersonation_registry.create,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
impersonation_registry.list,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
impersonation_registry.delete,
|
||||
)
|
||||
self.edit = to_raw_response_wrapper(
|
||||
impersonation_registry.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
impersonation_registry.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncImpersonationRegistryResourceWithRawResponse:
|
||||
def __init__(self, impersonation_registry: AsyncImpersonationRegistryResource) -> None:
|
||||
self._impersonation_registry = impersonation_registry
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
impersonation_registry.create,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
impersonation_registry.list,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
impersonation_registry.delete,
|
||||
)
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
impersonation_registry.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
impersonation_registry.get,
|
||||
)
|
||||
|
||||
|
||||
class ImpersonationRegistryResourceWithStreamingResponse:
|
||||
def __init__(self, impersonation_registry: ImpersonationRegistryResource) -> None:
|
||||
self._impersonation_registry = impersonation_registry
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
impersonation_registry.create,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
impersonation_registry.list,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
impersonation_registry.delete,
|
||||
)
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
impersonation_registry.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
impersonation_registry.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncImpersonationRegistryResourceWithStreamingResponse:
|
||||
def __init__(self, impersonation_registry: AsyncImpersonationRegistryResource) -> None:
|
||||
self._impersonation_registry = impersonation_registry
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
impersonation_registry.create,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
impersonation_registry.list,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
impersonation_registry.delete,
|
||||
)
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
impersonation_registry.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
impersonation_registry.get,
|
||||
)
|
||||
|
|
@ -1,230 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .domains import (
|
||||
DomainsResource,
|
||||
AsyncDomainsResource,
|
||||
DomainsResourceWithRawResponse,
|
||||
AsyncDomainsResourceWithRawResponse,
|
||||
DomainsResourceWithStreamingResponse,
|
||||
AsyncDomainsResourceWithStreamingResponse,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from .block_senders import (
|
||||
BlockSendersResource,
|
||||
AsyncBlockSendersResource,
|
||||
BlockSendersResourceWithRawResponse,
|
||||
AsyncBlockSendersResourceWithRawResponse,
|
||||
BlockSendersResourceWithStreamingResponse,
|
||||
AsyncBlockSendersResourceWithStreamingResponse,
|
||||
)
|
||||
from .allow_policies import (
|
||||
AllowPoliciesResource,
|
||||
AsyncAllowPoliciesResource,
|
||||
AllowPoliciesResourceWithRawResponse,
|
||||
AsyncAllowPoliciesResourceWithRawResponse,
|
||||
AllowPoliciesResourceWithStreamingResponse,
|
||||
AsyncAllowPoliciesResourceWithStreamingResponse,
|
||||
)
|
||||
from .trusted_domains import (
|
||||
TrustedDomainsResource,
|
||||
AsyncTrustedDomainsResource,
|
||||
TrustedDomainsResourceWithRawResponse,
|
||||
AsyncTrustedDomainsResourceWithRawResponse,
|
||||
TrustedDomainsResourceWithStreamingResponse,
|
||||
AsyncTrustedDomainsResourceWithStreamingResponse,
|
||||
)
|
||||
from .impersonation_registry import (
|
||||
ImpersonationRegistryResource,
|
||||
AsyncImpersonationRegistryResource,
|
||||
ImpersonationRegistryResourceWithRawResponse,
|
||||
AsyncImpersonationRegistryResourceWithRawResponse,
|
||||
ImpersonationRegistryResourceWithStreamingResponse,
|
||||
AsyncImpersonationRegistryResourceWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = ["SettingsResource", "AsyncSettingsResource"]
|
||||
|
||||
|
||||
class SettingsResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def allow_policies(self) -> AllowPoliciesResource:
|
||||
return AllowPoliciesResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def block_senders(self) -> BlockSendersResource:
|
||||
return BlockSendersResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def domains(self) -> DomainsResource:
|
||||
return DomainsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def impersonation_registry(self) -> ImpersonationRegistryResource:
|
||||
return ImpersonationRegistryResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def trusted_domains(self) -> TrustedDomainsResource:
|
||||
return TrustedDomainsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> SettingsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return SettingsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> SettingsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return SettingsResourceWithStreamingResponse(self)
|
||||
|
||||
|
||||
class AsyncSettingsResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def allow_policies(self) -> AsyncAllowPoliciesResource:
|
||||
return AsyncAllowPoliciesResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def block_senders(self) -> AsyncBlockSendersResource:
|
||||
return AsyncBlockSendersResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def domains(self) -> AsyncDomainsResource:
|
||||
return AsyncDomainsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def impersonation_registry(self) -> AsyncImpersonationRegistryResource:
|
||||
return AsyncImpersonationRegistryResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def trusted_domains(self) -> AsyncTrustedDomainsResource:
|
||||
return AsyncTrustedDomainsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncSettingsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncSettingsResourceWithStreamingResponse(self)
|
||||
|
||||
|
||||
class SettingsResourceWithRawResponse:
|
||||
def __init__(self, settings: SettingsResource) -> None:
|
||||
self._settings = settings
|
||||
|
||||
@cached_property
|
||||
def allow_policies(self) -> AllowPoliciesResourceWithRawResponse:
|
||||
return AllowPoliciesResourceWithRawResponse(self._settings.allow_policies)
|
||||
|
||||
@cached_property
|
||||
def block_senders(self) -> BlockSendersResourceWithRawResponse:
|
||||
return BlockSendersResourceWithRawResponse(self._settings.block_senders)
|
||||
|
||||
@cached_property
|
||||
def domains(self) -> DomainsResourceWithRawResponse:
|
||||
return DomainsResourceWithRawResponse(self._settings.domains)
|
||||
|
||||
@cached_property
|
||||
def impersonation_registry(self) -> ImpersonationRegistryResourceWithRawResponse:
|
||||
return ImpersonationRegistryResourceWithRawResponse(self._settings.impersonation_registry)
|
||||
|
||||
@cached_property
|
||||
def trusted_domains(self) -> TrustedDomainsResourceWithRawResponse:
|
||||
return TrustedDomainsResourceWithRawResponse(self._settings.trusted_domains)
|
||||
|
||||
|
||||
class AsyncSettingsResourceWithRawResponse:
|
||||
def __init__(self, settings: AsyncSettingsResource) -> None:
|
||||
self._settings = settings
|
||||
|
||||
@cached_property
|
||||
def allow_policies(self) -> AsyncAllowPoliciesResourceWithRawResponse:
|
||||
return AsyncAllowPoliciesResourceWithRawResponse(self._settings.allow_policies)
|
||||
|
||||
@cached_property
|
||||
def block_senders(self) -> AsyncBlockSendersResourceWithRawResponse:
|
||||
return AsyncBlockSendersResourceWithRawResponse(self._settings.block_senders)
|
||||
|
||||
@cached_property
|
||||
def domains(self) -> AsyncDomainsResourceWithRawResponse:
|
||||
return AsyncDomainsResourceWithRawResponse(self._settings.domains)
|
||||
|
||||
@cached_property
|
||||
def impersonation_registry(self) -> AsyncImpersonationRegistryResourceWithRawResponse:
|
||||
return AsyncImpersonationRegistryResourceWithRawResponse(self._settings.impersonation_registry)
|
||||
|
||||
@cached_property
|
||||
def trusted_domains(self) -> AsyncTrustedDomainsResourceWithRawResponse:
|
||||
return AsyncTrustedDomainsResourceWithRawResponse(self._settings.trusted_domains)
|
||||
|
||||
|
||||
class SettingsResourceWithStreamingResponse:
|
||||
def __init__(self, settings: SettingsResource) -> None:
|
||||
self._settings = settings
|
||||
|
||||
@cached_property
|
||||
def allow_policies(self) -> AllowPoliciesResourceWithStreamingResponse:
|
||||
return AllowPoliciesResourceWithStreamingResponse(self._settings.allow_policies)
|
||||
|
||||
@cached_property
|
||||
def block_senders(self) -> BlockSendersResourceWithStreamingResponse:
|
||||
return BlockSendersResourceWithStreamingResponse(self._settings.block_senders)
|
||||
|
||||
@cached_property
|
||||
def domains(self) -> DomainsResourceWithStreamingResponse:
|
||||
return DomainsResourceWithStreamingResponse(self._settings.domains)
|
||||
|
||||
@cached_property
|
||||
def impersonation_registry(self) -> ImpersonationRegistryResourceWithStreamingResponse:
|
||||
return ImpersonationRegistryResourceWithStreamingResponse(self._settings.impersonation_registry)
|
||||
|
||||
@cached_property
|
||||
def trusted_domains(self) -> TrustedDomainsResourceWithStreamingResponse:
|
||||
return TrustedDomainsResourceWithStreamingResponse(self._settings.trusted_domains)
|
||||
|
||||
|
||||
class AsyncSettingsResourceWithStreamingResponse:
|
||||
def __init__(self, settings: AsyncSettingsResource) -> None:
|
||||
self._settings = settings
|
||||
|
||||
@cached_property
|
||||
def allow_policies(self) -> AsyncAllowPoliciesResourceWithStreamingResponse:
|
||||
return AsyncAllowPoliciesResourceWithStreamingResponse(self._settings.allow_policies)
|
||||
|
||||
@cached_property
|
||||
def block_senders(self) -> AsyncBlockSendersResourceWithStreamingResponse:
|
||||
return AsyncBlockSendersResourceWithStreamingResponse(self._settings.block_senders)
|
||||
|
||||
@cached_property
|
||||
def domains(self) -> AsyncDomainsResourceWithStreamingResponse:
|
||||
return AsyncDomainsResourceWithStreamingResponse(self._settings.domains)
|
||||
|
||||
@cached_property
|
||||
def impersonation_registry(self) -> AsyncImpersonationRegistryResourceWithStreamingResponse:
|
||||
return AsyncImpersonationRegistryResourceWithStreamingResponse(self._settings.impersonation_registry)
|
||||
|
||||
@cached_property
|
||||
def trusted_domains(self) -> AsyncTrustedDomainsResourceWithStreamingResponse:
|
||||
return AsyncTrustedDomainsResourceWithStreamingResponse(self._settings.trusted_domains)
|
||||
|
|
@ -1,830 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Type, Iterable, Optional, cast
|
||||
from typing_extensions import Literal, overload
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
||||
from ...._utils import required_args, maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.email_security.settings import (
|
||||
trusted_domain_edit_params,
|
||||
trusted_domain_list_params,
|
||||
trusted_domain_create_params,
|
||||
)
|
||||
from ....types.email_security.settings.trusted_domain_get_response import TrustedDomainGetResponse
|
||||
from ....types.email_security.settings.trusted_domain_edit_response import TrustedDomainEditResponse
|
||||
from ....types.email_security.settings.trusted_domain_list_response import TrustedDomainListResponse
|
||||
from ....types.email_security.settings.trusted_domain_create_response import TrustedDomainCreateResponse
|
||||
from ....types.email_security.settings.trusted_domain_delete_response import TrustedDomainDeleteResponse
|
||||
|
||||
__all__ = ["TrustedDomainsResource", "AsyncTrustedDomainsResource"]
|
||||
|
||||
|
||||
class TrustedDomainsResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> TrustedDomainsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return TrustedDomainsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> TrustedDomainsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return TrustedDomainsResourceWithStreamingResponse(self)
|
||||
|
||||
@overload
|
||||
def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
is_recent: bool,
|
||||
is_regex: bool,
|
||||
is_similarity: bool,
|
||||
pattern: str,
|
||||
comments: Optional[str] | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> TrustedDomainCreateResponse:
|
||||
"""
|
||||
Create a trusted email domain
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
is_recent: Select to prevent recently registered domains from triggering a Suspicious or
|
||||
Malicious disposition.
|
||||
|
||||
is_similarity: Select for partner or other approved domains that have similar spelling to your
|
||||
connected domains. Prevents listed domains from triggering a Spoof disposition.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
...
|
||||
|
||||
@overload
|
||||
def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
body: Iterable[trusted_domain_create_params.Variant1Body],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> TrustedDomainCreateResponse:
|
||||
"""
|
||||
Create a trusted email domain
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
...
|
||||
|
||||
@required_args(["account_id", "is_recent", "is_regex", "is_similarity", "pattern"], ["account_id", "body"])
|
||||
def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
is_recent: bool | Omit = omit,
|
||||
is_regex: bool | Omit = omit,
|
||||
is_similarity: bool | Omit = omit,
|
||||
pattern: str | Omit = omit,
|
||||
comments: Optional[str] | Omit = omit,
|
||||
body: Iterable[trusted_domain_create_params.Variant1Body] | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> TrustedDomainCreateResponse:
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return cast(
|
||||
TrustedDomainCreateResponse,
|
||||
self._post(
|
||||
f"/accounts/{account_id}/email-security/settings/trusted_domains",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"is_recent": is_recent,
|
||||
"is_regex": is_regex,
|
||||
"is_similarity": is_similarity,
|
||||
"pattern": pattern,
|
||||
"comments": comments,
|
||||
"body": body,
|
||||
},
|
||||
trusted_domain_create_params.TrustedDomainCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[TrustedDomainCreateResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[TrustedDomainCreateResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
direction: Literal["asc", "desc"] | Omit = omit,
|
||||
is_recent: bool | Omit = omit,
|
||||
is_similarity: bool | Omit = omit,
|
||||
order: Literal["pattern", "created_at"] | Omit = omit,
|
||||
page: int | Omit = omit,
|
||||
pattern: str | Omit = omit,
|
||||
per_page: int | Omit = omit,
|
||||
search: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> SyncV4PagePaginationArray[TrustedDomainListResponse]:
|
||||
"""
|
||||
Lists, searches, and sorts an account’s trusted email domains.
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
direction: The sorting direction.
|
||||
|
||||
order: The field to sort by.
|
||||
|
||||
page: The page number of paginated results.
|
||||
|
||||
per_page: The number of results per page.
|
||||
|
||||
search: Allows searching in multiple properties of a record simultaneously. This
|
||||
parameter is intended for human users, not automation. Its exact behavior is
|
||||
intentionally left unspecified and is subject to change in the future.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/settings/trusted_domains",
|
||||
page=SyncV4PagePaginationArray[TrustedDomainListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"direction": direction,
|
||||
"is_recent": is_recent,
|
||||
"is_similarity": is_similarity,
|
||||
"order": order,
|
||||
"page": page,
|
||||
"pattern": pattern,
|
||||
"per_page": per_page,
|
||||
"search": search,
|
||||
},
|
||||
trusted_domain_list_params.TrustedDomainListParams,
|
||||
),
|
||||
),
|
||||
model=TrustedDomainListResponse,
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
trusted_domain_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> TrustedDomainDeleteResponse:
|
||||
"""
|
||||
Delete a trusted email domain
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
trusted_domain_id: The unique identifier for the trusted domain.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._delete(
|
||||
f"/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[TrustedDomainDeleteResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[TrustedDomainDeleteResponse], ResultWrapper[TrustedDomainDeleteResponse]),
|
||||
)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
trusted_domain_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
comments: str | Omit = omit,
|
||||
is_recent: bool | Omit = omit,
|
||||
is_regex: bool | Omit = omit,
|
||||
is_similarity: bool | Omit = omit,
|
||||
pattern: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> TrustedDomainEditResponse:
|
||||
"""
|
||||
Update a trusted email domain
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
trusted_domain_id: The unique identifier for the trusted domain.
|
||||
|
||||
is_recent: Select to prevent recently registered domains from triggering a Suspicious or
|
||||
Malicious disposition.
|
||||
|
||||
is_similarity: Select for partner or other approved domains that have similar spelling to your
|
||||
connected domains. Prevents listed domains from triggering a Spoof disposition.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._patch(
|
||||
f"/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"comments": comments,
|
||||
"is_recent": is_recent,
|
||||
"is_regex": is_regex,
|
||||
"is_similarity": is_similarity,
|
||||
"pattern": pattern,
|
||||
},
|
||||
trusted_domain_edit_params.TrustedDomainEditParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[TrustedDomainEditResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[TrustedDomainEditResponse], ResultWrapper[TrustedDomainEditResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
trusted_domain_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> TrustedDomainGetResponse:
|
||||
"""
|
||||
Get a trusted email domain
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
trusted_domain_id: The unique identifier for the trusted domain.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[TrustedDomainGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[TrustedDomainGetResponse], ResultWrapper[TrustedDomainGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncTrustedDomainsResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncTrustedDomainsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncTrustedDomainsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncTrustedDomainsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncTrustedDomainsResourceWithStreamingResponse(self)
|
||||
|
||||
@overload
|
||||
async def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
is_recent: bool,
|
||||
is_regex: bool,
|
||||
is_similarity: bool,
|
||||
pattern: str,
|
||||
comments: Optional[str] | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> TrustedDomainCreateResponse:
|
||||
"""
|
||||
Create a trusted email domain
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
is_recent: Select to prevent recently registered domains from triggering a Suspicious or
|
||||
Malicious disposition.
|
||||
|
||||
is_similarity: Select for partner or other approved domains that have similar spelling to your
|
||||
connected domains. Prevents listed domains from triggering a Spoof disposition.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
...
|
||||
|
||||
@overload
|
||||
async def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
body: Iterable[trusted_domain_create_params.Variant1Body],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> TrustedDomainCreateResponse:
|
||||
"""
|
||||
Create a trusted email domain
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
...
|
||||
|
||||
@required_args(["account_id", "is_recent", "is_regex", "is_similarity", "pattern"], ["account_id", "body"])
|
||||
async def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
is_recent: bool | Omit = omit,
|
||||
is_regex: bool | Omit = omit,
|
||||
is_similarity: bool | Omit = omit,
|
||||
pattern: str | Omit = omit,
|
||||
comments: Optional[str] | Omit = omit,
|
||||
body: Iterable[trusted_domain_create_params.Variant1Body] | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> TrustedDomainCreateResponse:
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return cast(
|
||||
TrustedDomainCreateResponse,
|
||||
await self._post(
|
||||
f"/accounts/{account_id}/email-security/settings/trusted_domains",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"is_recent": is_recent,
|
||||
"is_regex": is_regex,
|
||||
"is_similarity": is_similarity,
|
||||
"pattern": pattern,
|
||||
"comments": comments,
|
||||
"body": body,
|
||||
},
|
||||
trusted_domain_create_params.TrustedDomainCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[TrustedDomainCreateResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[TrustedDomainCreateResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
direction: Literal["asc", "desc"] | Omit = omit,
|
||||
is_recent: bool | Omit = omit,
|
||||
is_similarity: bool | Omit = omit,
|
||||
order: Literal["pattern", "created_at"] | Omit = omit,
|
||||
page: int | Omit = omit,
|
||||
pattern: str | Omit = omit,
|
||||
per_page: int | Omit = omit,
|
||||
search: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AsyncPaginator[TrustedDomainListResponse, AsyncV4PagePaginationArray[TrustedDomainListResponse]]:
|
||||
"""
|
||||
Lists, searches, and sorts an account’s trusted email domains.
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
direction: The sorting direction.
|
||||
|
||||
order: The field to sort by.
|
||||
|
||||
page: The page number of paginated results.
|
||||
|
||||
per_page: The number of results per page.
|
||||
|
||||
search: Allows searching in multiple properties of a record simultaneously. This
|
||||
parameter is intended for human users, not automation. Its exact behavior is
|
||||
intentionally left unspecified and is subject to change in the future.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/settings/trusted_domains",
|
||||
page=AsyncV4PagePaginationArray[TrustedDomainListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"direction": direction,
|
||||
"is_recent": is_recent,
|
||||
"is_similarity": is_similarity,
|
||||
"order": order,
|
||||
"page": page,
|
||||
"pattern": pattern,
|
||||
"per_page": per_page,
|
||||
"search": search,
|
||||
},
|
||||
trusted_domain_list_params.TrustedDomainListParams,
|
||||
),
|
||||
),
|
||||
model=TrustedDomainListResponse,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
trusted_domain_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> TrustedDomainDeleteResponse:
|
||||
"""
|
||||
Delete a trusted email domain
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
trusted_domain_id: The unique identifier for the trusted domain.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._delete(
|
||||
f"/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[TrustedDomainDeleteResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[TrustedDomainDeleteResponse], ResultWrapper[TrustedDomainDeleteResponse]),
|
||||
)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
trusted_domain_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
comments: str | Omit = omit,
|
||||
is_recent: bool | Omit = omit,
|
||||
is_regex: bool | Omit = omit,
|
||||
is_similarity: bool | Omit = omit,
|
||||
pattern: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> TrustedDomainEditResponse:
|
||||
"""
|
||||
Update a trusted email domain
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
trusted_domain_id: The unique identifier for the trusted domain.
|
||||
|
||||
is_recent: Select to prevent recently registered domains from triggering a Suspicious or
|
||||
Malicious disposition.
|
||||
|
||||
is_similarity: Select for partner or other approved domains that have similar spelling to your
|
||||
connected domains. Prevents listed domains from triggering a Spoof disposition.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._patch(
|
||||
f"/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"comments": comments,
|
||||
"is_recent": is_recent,
|
||||
"is_regex": is_regex,
|
||||
"is_similarity": is_similarity,
|
||||
"pattern": pattern,
|
||||
},
|
||||
trusted_domain_edit_params.TrustedDomainEditParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[TrustedDomainEditResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[TrustedDomainEditResponse], ResultWrapper[TrustedDomainEditResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
trusted_domain_id: int,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> TrustedDomainGetResponse:
|
||||
"""
|
||||
Get a trusted email domain
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
trusted_domain_id: The unique identifier for the trusted domain.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[TrustedDomainGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[TrustedDomainGetResponse], ResultWrapper[TrustedDomainGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class TrustedDomainsResourceWithRawResponse:
|
||||
def __init__(self, trusted_domains: TrustedDomainsResource) -> None:
|
||||
self._trusted_domains = trusted_domains
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
trusted_domains.create,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
trusted_domains.list,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
trusted_domains.delete,
|
||||
)
|
||||
self.edit = to_raw_response_wrapper(
|
||||
trusted_domains.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
trusted_domains.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncTrustedDomainsResourceWithRawResponse:
|
||||
def __init__(self, trusted_domains: AsyncTrustedDomainsResource) -> None:
|
||||
self._trusted_domains = trusted_domains
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
trusted_domains.create,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
trusted_domains.list,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
trusted_domains.delete,
|
||||
)
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
trusted_domains.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
trusted_domains.get,
|
||||
)
|
||||
|
||||
|
||||
class TrustedDomainsResourceWithStreamingResponse:
|
||||
def __init__(self, trusted_domains: TrustedDomainsResource) -> None:
|
||||
self._trusted_domains = trusted_domains
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
trusted_domains.create,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
trusted_domains.list,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
trusted_domains.delete,
|
||||
)
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
trusted_domains.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
trusted_domains.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncTrustedDomainsResourceWithStreamingResponse:
|
||||
def __init__(self, trusted_domains: AsyncTrustedDomainsResource) -> None:
|
||||
self._trusted_domains = trusted_domains
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
trusted_domains.create,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
trusted_domains.list,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
trusted_domains.delete,
|
||||
)
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
trusted_domains.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
trusted_domains.get,
|
||||
)
|
||||
|
|
@ -1,252 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Union, Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
||||
from ..._utils import maybe_transform
|
||||
from ..._compat import cached_property
|
||||
from ..._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ..._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
|
||||
from ..._base_client import AsyncPaginator, make_request_options
|
||||
from ...types.email_security import submission_list_params
|
||||
from ...types.email_security.submission_list_response import SubmissionListResponse
|
||||
|
||||
__all__ = ["SubmissionsResource", "AsyncSubmissionsResource"]
|
||||
|
||||
|
||||
class SubmissionsResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> SubmissionsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return SubmissionsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> SubmissionsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return SubmissionsResourceWithStreamingResponse(self)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
end: Union[str, datetime] | Omit = omit,
|
||||
original_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit,
|
||||
outcome_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit,
|
||||
page: int | Omit = omit,
|
||||
per_page: int | Omit = omit,
|
||||
query: Optional[str] | Omit = omit,
|
||||
requested_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit,
|
||||
start: Union[str, datetime] | Omit = omit,
|
||||
status: str | Omit = omit,
|
||||
submission_id: str | Omit = omit,
|
||||
type: Literal["TEAM", "USER"] | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> SyncV4PagePaginationArray[SubmissionListResponse]:
|
||||
"""
|
||||
This endpoint returns information for submissions to made to reclassify emails.
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
end: The end of the search date range. Defaults to `now`.
|
||||
|
||||
page: The page number of paginated results.
|
||||
|
||||
per_page: The number of results per page.
|
||||
|
||||
start: The beginning of the search date range. Defaults to `now - 30 days`.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/submissions",
|
||||
page=SyncV4PagePaginationArray[SubmissionListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"end": end,
|
||||
"original_disposition": original_disposition,
|
||||
"outcome_disposition": outcome_disposition,
|
||||
"page": page,
|
||||
"per_page": per_page,
|
||||
"query": query,
|
||||
"requested_disposition": requested_disposition,
|
||||
"start": start,
|
||||
"status": status,
|
||||
"submission_id": submission_id,
|
||||
"type": type,
|
||||
},
|
||||
submission_list_params.SubmissionListParams,
|
||||
),
|
||||
),
|
||||
model=SubmissionListResponse,
|
||||
)
|
||||
|
||||
|
||||
class AsyncSubmissionsResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncSubmissionsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncSubmissionsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncSubmissionsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncSubmissionsResourceWithStreamingResponse(self)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
end: Union[str, datetime] | Omit = omit,
|
||||
original_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit,
|
||||
outcome_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit,
|
||||
page: int | Omit = omit,
|
||||
per_page: int | Omit = omit,
|
||||
query: Optional[str] | Omit = omit,
|
||||
requested_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit,
|
||||
start: Union[str, datetime] | Omit = omit,
|
||||
status: str | Omit = omit,
|
||||
submission_id: str | Omit = omit,
|
||||
type: Literal["TEAM", "USER"] | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AsyncPaginator[SubmissionListResponse, AsyncV4PagePaginationArray[SubmissionListResponse]]:
|
||||
"""
|
||||
This endpoint returns information for submissions to made to reclassify emails.
|
||||
|
||||
Args:
|
||||
account_id: Account Identifier
|
||||
|
||||
end: The end of the search date range. Defaults to `now`.
|
||||
|
||||
page: The page number of paginated results.
|
||||
|
||||
per_page: The number of results per page.
|
||||
|
||||
start: The beginning of the search date range. Defaults to `now - 30 days`.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/email-security/submissions",
|
||||
page=AsyncV4PagePaginationArray[SubmissionListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"end": end,
|
||||
"original_disposition": original_disposition,
|
||||
"outcome_disposition": outcome_disposition,
|
||||
"page": page,
|
||||
"per_page": per_page,
|
||||
"query": query,
|
||||
"requested_disposition": requested_disposition,
|
||||
"start": start,
|
||||
"status": status,
|
||||
"submission_id": submission_id,
|
||||
"type": type,
|
||||
},
|
||||
submission_list_params.SubmissionListParams,
|
||||
),
|
||||
),
|
||||
model=SubmissionListResponse,
|
||||
)
|
||||
|
||||
|
||||
class SubmissionsResourceWithRawResponse:
|
||||
def __init__(self, submissions: SubmissionsResource) -> None:
|
||||
self._submissions = submissions
|
||||
|
||||
self.list = to_raw_response_wrapper(
|
||||
submissions.list,
|
||||
)
|
||||
|
||||
|
||||
class AsyncSubmissionsResourceWithRawResponse:
|
||||
def __init__(self, submissions: AsyncSubmissionsResource) -> None:
|
||||
self._submissions = submissions
|
||||
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
submissions.list,
|
||||
)
|
||||
|
||||
|
||||
class SubmissionsResourceWithStreamingResponse:
|
||||
def __init__(self, submissions: SubmissionsResource) -> None:
|
||||
self._submissions = submissions
|
||||
|
||||
self.list = to_streamed_response_wrapper(
|
||||
submissions.list,
|
||||
)
|
||||
|
||||
|
||||
class AsyncSubmissionsResourceWithStreamingResponse:
|
||||
def __init__(self, submissions: AsyncSubmissionsResource) -> None:
|
||||
self._submissions = submissions
|
||||
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
submissions.list,
|
||||
)
|
||||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
||||
|
|
@ -14,6 +16,7 @@ from ..._response import (
|
|||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ..._wrappers import ResultWrapper
|
||||
from ...types.iam import permission_group_list_params
|
||||
from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
|
||||
from ..._base_client import AsyncPaginator, make_request_options
|
||||
|
|
@ -118,7 +121,7 @@ class PermissionGroupsResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> PermissionGroupGetResponse:
|
||||
) -> Optional[PermissionGroupGetResponse]:
|
||||
"""
|
||||
Get information about a specific permission group in an account.
|
||||
|
||||
|
|
@ -144,9 +147,13 @@ class PermissionGroupsResource(SyncAPIResource):
|
|||
return self._get(
|
||||
f"/accounts/{account_id}/iam/permission_groups/{permission_group_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[PermissionGroupGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=PermissionGroupGetResponse,
|
||||
cast_to=cast(Type[Optional[PermissionGroupGetResponse]], ResultWrapper[PermissionGroupGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -245,7 +252,7 @@ class AsyncPermissionGroupsResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> PermissionGroupGetResponse:
|
||||
) -> Optional[PermissionGroupGetResponse]:
|
||||
"""
|
||||
Get information about a specific permission group in an account.
|
||||
|
||||
|
|
@ -271,9 +278,13 @@ class AsyncPermissionGroupsResource(AsyncAPIResource):
|
|||
return await self._get(
|
||||
f"/accounts/{account_id}/iam/permission_groups/{permission_group_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[PermissionGroupGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=PermissionGroupGetResponse,
|
||||
cast_to=cast(Type[Optional[PermissionGroupGetResponse]], ResultWrapper[PermissionGroupGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,13 +28,12 @@ from .history.history import (
|
|||
AsyncHistoryResourceWithStreamingResponse,
|
||||
)
|
||||
from ....._base_client import AsyncPaginator, make_request_options
|
||||
from .....types.pages.projects import (
|
||||
deployment_list_params,
|
||||
deployment_retry_params,
|
||||
deployment_create_params,
|
||||
deployment_rollback_params,
|
||||
)
|
||||
from .....types.pages.deployment import Deployment
|
||||
from .....types.pages.projects import deployment_list_params, deployment_create_params
|
||||
from .....types.pages.projects.deployment_get_response import DeploymentGetResponse
|
||||
from .....types.pages.projects.deployment_list_response import DeploymentListResponse
|
||||
from .....types.pages.projects.deployment_retry_response import DeploymentRetryResponse
|
||||
from .....types.pages.projects.deployment_create_response import DeploymentCreateResponse
|
||||
from .....types.pages.projects.deployment_rollback_response import DeploymentRollbackResponse
|
||||
|
||||
__all__ = ["DeploymentsResource", "AsyncDeploymentsResource"]
|
||||
|
||||
|
|
@ -87,14 +86,14 @@ class DeploymentsResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Deployment:
|
||||
) -> DeploymentCreateResponse:
|
||||
"""Start a new deployment from production.
|
||||
|
||||
The repository and account must have
|
||||
already been authorized on the Cloudflare Pages dashboard.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
|
|
@ -182,9 +181,9 @@ class DeploymentsResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Deployment]._unwrapper,
|
||||
post_parser=ResultWrapper[DeploymentCreateResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Deployment], ResultWrapper[Deployment]),
|
||||
cast_to=cast(Type[DeploymentCreateResponse], ResultWrapper[DeploymentCreateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
|
|
@ -201,12 +200,12 @@ class DeploymentsResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> SyncV4PagePaginationArray[Deployment]:
|
||||
) -> SyncV4PagePaginationArray[DeploymentListResponse]:
|
||||
"""
|
||||
Fetch a list of project deployments.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
|
|
@ -230,7 +229,7 @@ class DeploymentsResource(SyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/pages/projects/{project_name}/deployments",
|
||||
page=SyncV4PagePaginationArray[Deployment],
|
||||
page=SyncV4PagePaginationArray[DeploymentListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
|
|
@ -245,7 +244,7 @@ class DeploymentsResource(SyncAPIResource):
|
|||
deployment_list_params.DeploymentListParams,
|
||||
),
|
||||
),
|
||||
model=Deployment,
|
||||
model=DeploymentListResponse,
|
||||
)
|
||||
|
||||
def delete(
|
||||
|
|
@ -265,11 +264,11 @@ class DeploymentsResource(SyncAPIResource):
|
|||
Delete a deployment.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
deployment_id: Identifier
|
||||
deployment_id: Identifier.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -309,16 +308,16 @@ class DeploymentsResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Deployment:
|
||||
) -> DeploymentGetResponse:
|
||||
"""
|
||||
Fetch information about a deployment.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
deployment_id: Identifier
|
||||
deployment_id: Identifier.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -341,9 +340,9 @@ class DeploymentsResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Deployment]._unwrapper,
|
||||
post_parser=ResultWrapper[DeploymentGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Deployment], ResultWrapper[Deployment]),
|
||||
cast_to=cast(Type[DeploymentGetResponse], ResultWrapper[DeploymentGetResponse]),
|
||||
)
|
||||
|
||||
def retry(
|
||||
|
|
@ -352,23 +351,22 @@ class DeploymentsResource(SyncAPIResource):
|
|||
*,
|
||||
account_id: str,
|
||||
project_name: str,
|
||||
body: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Deployment:
|
||||
) -> DeploymentRetryResponse:
|
||||
"""
|
||||
Retry a previous deployment.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
deployment_id: Identifier
|
||||
deployment_id: Identifier.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -386,15 +384,14 @@ class DeploymentsResource(SyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/retry",
|
||||
body=maybe_transform(body, deployment_retry_params.DeploymentRetryParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Deployment]._unwrapper,
|
||||
post_parser=ResultWrapper[DeploymentRetryResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Deployment], ResultWrapper[Deployment]),
|
||||
cast_to=cast(Type[DeploymentRetryResponse], ResultWrapper[DeploymentRetryResponse]),
|
||||
)
|
||||
|
||||
def rollback(
|
||||
|
|
@ -403,25 +400,24 @@ class DeploymentsResource(SyncAPIResource):
|
|||
*,
|
||||
account_id: str,
|
||||
project_name: str,
|
||||
body: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Deployment:
|
||||
) -> DeploymentRollbackResponse:
|
||||
"""Rollback the production deployment to a previous deployment.
|
||||
|
||||
You can only
|
||||
rollback to succesful builds on production.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
deployment_id: Identifier
|
||||
deployment_id: Identifier.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -439,15 +435,14 @@ class DeploymentsResource(SyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/rollback",
|
||||
body=maybe_transform(body, deployment_rollback_params.DeploymentRollbackParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Deployment]._unwrapper,
|
||||
post_parser=ResultWrapper[DeploymentRollbackResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Deployment], ResultWrapper[Deployment]),
|
||||
cast_to=cast(Type[DeploymentRollbackResponse], ResultWrapper[DeploymentRollbackResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -499,14 +494,14 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Deployment:
|
||||
) -> DeploymentCreateResponse:
|
||||
"""Start a new deployment from production.
|
||||
|
||||
The repository and account must have
|
||||
already been authorized on the Cloudflare Pages dashboard.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
|
|
@ -594,9 +589,9 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Deployment]._unwrapper,
|
||||
post_parser=ResultWrapper[DeploymentCreateResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Deployment], ResultWrapper[Deployment]),
|
||||
cast_to=cast(Type[DeploymentCreateResponse], ResultWrapper[DeploymentCreateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
|
|
@ -613,12 +608,12 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AsyncPaginator[Deployment, AsyncV4PagePaginationArray[Deployment]]:
|
||||
) -> AsyncPaginator[DeploymentListResponse, AsyncV4PagePaginationArray[DeploymentListResponse]]:
|
||||
"""
|
||||
Fetch a list of project deployments.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
|
|
@ -642,7 +637,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/pages/projects/{project_name}/deployments",
|
||||
page=AsyncV4PagePaginationArray[Deployment],
|
||||
page=AsyncV4PagePaginationArray[DeploymentListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
|
|
@ -657,7 +652,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|||
deployment_list_params.DeploymentListParams,
|
||||
),
|
||||
),
|
||||
model=Deployment,
|
||||
model=DeploymentListResponse,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
|
|
@ -677,11 +672,11 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|||
Delete a deployment.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
deployment_id: Identifier
|
||||
deployment_id: Identifier.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -721,16 +716,16 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Deployment:
|
||||
) -> DeploymentGetResponse:
|
||||
"""
|
||||
Fetch information about a deployment.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
deployment_id: Identifier
|
||||
deployment_id: Identifier.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -753,9 +748,9 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Deployment]._unwrapper,
|
||||
post_parser=ResultWrapper[DeploymentGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Deployment], ResultWrapper[Deployment]),
|
||||
cast_to=cast(Type[DeploymentGetResponse], ResultWrapper[DeploymentGetResponse]),
|
||||
)
|
||||
|
||||
async def retry(
|
||||
|
|
@ -764,23 +759,22 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|||
*,
|
||||
account_id: str,
|
||||
project_name: str,
|
||||
body: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Deployment:
|
||||
) -> DeploymentRetryResponse:
|
||||
"""
|
||||
Retry a previous deployment.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
deployment_id: Identifier
|
||||
deployment_id: Identifier.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -798,15 +792,14 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/retry",
|
||||
body=await async_maybe_transform(body, deployment_retry_params.DeploymentRetryParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Deployment]._unwrapper,
|
||||
post_parser=ResultWrapper[DeploymentRetryResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Deployment], ResultWrapper[Deployment]),
|
||||
cast_to=cast(Type[DeploymentRetryResponse], ResultWrapper[DeploymentRetryResponse]),
|
||||
)
|
||||
|
||||
async def rollback(
|
||||
|
|
@ -815,25 +808,24 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|||
*,
|
||||
account_id: str,
|
||||
project_name: str,
|
||||
body: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Deployment:
|
||||
) -> DeploymentRollbackResponse:
|
||||
"""Rollback the production deployment to a previous deployment.
|
||||
|
||||
You can only
|
||||
rollback to succesful builds on production.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
deployment_id: Identifier
|
||||
deployment_id: Identifier.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -851,15 +843,14 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/rollback",
|
||||
body=await async_maybe_transform(body, deployment_rollback_params.DeploymentRollbackParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Deployment]._unwrapper,
|
||||
post_parser=ResultWrapper[DeploymentRollbackResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Deployment], ResultWrapper[Deployment]),
|
||||
cast_to=cast(Type[DeploymentRollbackResponse], ResultWrapper[DeploymentRollbackResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -59,11 +59,11 @@ class LogsResource(SyncAPIResource):
|
|||
Fetch deployment logs for a project.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
deployment_id: Identifier
|
||||
deployment_id: Identifier.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -129,11 +129,11 @@ class AsyncLogsResource(AsyncAPIResource):
|
|||
Fetch deployment logs for a project.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
deployment_id: Identifier
|
||||
deployment_id: Identifier.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from typing import Type, Optional, cast
|
|||
|
||||
import httpx
|
||||
|
||||
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
||||
from ...._types import Body, Query, Headers, NotGiven, not_given
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
|
|
@ -19,7 +19,7 @@ from ...._response import (
|
|||
from ...._wrappers import ResultWrapper
|
||||
from ....pagination import SyncSinglePage, AsyncSinglePage
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.pages.projects import domain_edit_params, domain_create_params
|
||||
from ....types.pages.projects import domain_create_params
|
||||
from ....types.pages.projects.domain_get_response import DomainGetResponse
|
||||
from ....types.pages.projects.domain_edit_response import DomainEditResponse
|
||||
from ....types.pages.projects.domain_list_response import DomainListResponse
|
||||
|
|
@ -53,22 +53,24 @@ class DomainsResource(SyncAPIResource):
|
|||
project_name: str,
|
||||
*,
|
||||
account_id: str,
|
||||
name: str | Omit = omit,
|
||||
name: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[DomainCreateResponse]:
|
||||
) -> DomainCreateResponse:
|
||||
"""
|
||||
Add a new domain for the Pages project.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
name: The domain name.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -89,9 +91,9 @@ class DomainsResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[DomainCreateResponse]]._unwrapper,
|
||||
post_parser=ResultWrapper[DomainCreateResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[DomainCreateResponse]], ResultWrapper[DomainCreateResponse]),
|
||||
cast_to=cast(Type[DomainCreateResponse], ResultWrapper[DomainCreateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
|
|
@ -110,7 +112,7 @@ class DomainsResource(SyncAPIResource):
|
|||
Fetch a list of all domains associated with a Pages project.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
|
|
@ -152,11 +154,11 @@ class DomainsResource(SyncAPIResource):
|
|||
Delete a Pages project's domain.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
domain_name: Name of the domain.
|
||||
domain_name: The domain name.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -190,23 +192,22 @@ class DomainsResource(SyncAPIResource):
|
|||
*,
|
||||
account_id: str,
|
||||
project_name: str,
|
||||
body: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[DomainEditResponse]:
|
||||
) -> DomainEditResponse:
|
||||
"""
|
||||
Retry the validation status of a single domain.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
domain_name: Name of the domain.
|
||||
domain_name: The domain name.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -224,15 +225,14 @@ class DomainsResource(SyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `domain_name` but received {domain_name!r}")
|
||||
return self._patch(
|
||||
f"/accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}",
|
||||
body=maybe_transform(body, domain_edit_params.DomainEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[DomainEditResponse]]._unwrapper,
|
||||
post_parser=ResultWrapper[DomainEditResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[DomainEditResponse]], ResultWrapper[DomainEditResponse]),
|
||||
cast_to=cast(Type[DomainEditResponse], ResultWrapper[DomainEditResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
|
|
@ -247,16 +247,16 @@ class DomainsResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[DomainGetResponse]:
|
||||
) -> DomainGetResponse:
|
||||
"""
|
||||
Fetch a single domain.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
domain_name: Name of the domain.
|
||||
domain_name: The domain name.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -279,9 +279,9 @@ class DomainsResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[DomainGetResponse]]._unwrapper,
|
||||
post_parser=ResultWrapper[DomainGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[DomainGetResponse]], ResultWrapper[DomainGetResponse]),
|
||||
cast_to=cast(Type[DomainGetResponse], ResultWrapper[DomainGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -310,22 +310,24 @@ class AsyncDomainsResource(AsyncAPIResource):
|
|||
project_name: str,
|
||||
*,
|
||||
account_id: str,
|
||||
name: str | Omit = omit,
|
||||
name: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[DomainCreateResponse]:
|
||||
) -> DomainCreateResponse:
|
||||
"""
|
||||
Add a new domain for the Pages project.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
name: The domain name.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -346,9 +348,9 @@ class AsyncDomainsResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[DomainCreateResponse]]._unwrapper,
|
||||
post_parser=ResultWrapper[DomainCreateResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[DomainCreateResponse]], ResultWrapper[DomainCreateResponse]),
|
||||
cast_to=cast(Type[DomainCreateResponse], ResultWrapper[DomainCreateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
|
|
@ -367,7 +369,7 @@ class AsyncDomainsResource(AsyncAPIResource):
|
|||
Fetch a list of all domains associated with a Pages project.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
|
|
@ -409,11 +411,11 @@ class AsyncDomainsResource(AsyncAPIResource):
|
|||
Delete a Pages project's domain.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
domain_name: Name of the domain.
|
||||
domain_name: The domain name.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -447,23 +449,22 @@ class AsyncDomainsResource(AsyncAPIResource):
|
|||
*,
|
||||
account_id: str,
|
||||
project_name: str,
|
||||
body: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[DomainEditResponse]:
|
||||
) -> DomainEditResponse:
|
||||
"""
|
||||
Retry the validation status of a single domain.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
domain_name: Name of the domain.
|
||||
domain_name: The domain name.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -481,15 +482,14 @@ class AsyncDomainsResource(AsyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `domain_name` but received {domain_name!r}")
|
||||
return await self._patch(
|
||||
f"/accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}",
|
||||
body=await async_maybe_transform(body, domain_edit_params.DomainEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[DomainEditResponse]]._unwrapper,
|
||||
post_parser=ResultWrapper[DomainEditResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[DomainEditResponse]], ResultWrapper[DomainEditResponse]),
|
||||
cast_to=cast(Type[DomainEditResponse], ResultWrapper[DomainEditResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
|
|
@ -504,16 +504,16 @@ class AsyncDomainsResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[DomainGetResponse]:
|
||||
) -> DomainGetResponse:
|
||||
"""
|
||||
Fetch a single domain.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
domain_name: Name of the domain.
|
||||
domain_name: The domain name.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -536,9 +536,9 @@ class AsyncDomainsResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[DomainGetResponse]]._unwrapper,
|
||||
post_parser=ResultWrapper[DomainGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[DomainGetResponse]], ResultWrapper[DomainGetResponse]),
|
||||
cast_to=cast(Type[DomainGetResponse], ResultWrapper[DomainGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ from ...._wrappers import ResultWrapper
|
|||
from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
|
||||
from ....types.pages import project_edit_params, project_list_params, project_create_params
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.pages.project import Project
|
||||
from .deployments.deployments import (
|
||||
DeploymentsResource,
|
||||
AsyncDeploymentsResource,
|
||||
|
|
@ -37,7 +36,10 @@ from .deployments.deployments import (
|
|||
DeploymentsResourceWithStreamingResponse,
|
||||
AsyncDeploymentsResourceWithStreamingResponse,
|
||||
)
|
||||
from ....types.pages.deployment import Deployment
|
||||
from ....types.pages.project_get_response import ProjectGetResponse
|
||||
from ....types.pages.project_edit_response import ProjectEditResponse
|
||||
from ....types.pages.project_list_response import ProjectListResponse
|
||||
from ....types.pages.project_create_response import ProjectCreateResponse
|
||||
|
||||
__all__ = ["ProjectsResource", "AsyncProjectsResource"]
|
||||
|
||||
|
|
@ -76,8 +78,8 @@ class ProjectsResource(SyncAPIResource):
|
|||
account_id: str,
|
||||
name: str,
|
||||
production_branch: str,
|
||||
build_config: Optional[project_create_params.BuildConfig] | Omit = omit,
|
||||
deployment_configs: Optional[project_create_params.DeploymentConfigs] | Omit = omit,
|
||||
build_config: project_create_params.BuildConfig | Omit = omit,
|
||||
deployment_configs: project_create_params.DeploymentConfigs | Omit = omit,
|
||||
source: project_create_params.Source | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
|
|
@ -85,12 +87,12 @@ class ProjectsResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Project:
|
||||
) -> ProjectCreateResponse:
|
||||
"""
|
||||
Create a new project.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
name: Name of the project.
|
||||
|
||||
|
|
@ -100,6 +102,8 @@ class ProjectsResource(SyncAPIResource):
|
|||
|
||||
deployment_configs: Configs for deployments in a project.
|
||||
|
||||
source: Configs for the project source control.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -127,9 +131,9 @@ class ProjectsResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Project]._unwrapper,
|
||||
post_parser=ResultWrapper[ProjectCreateResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Project], ResultWrapper[Project]),
|
||||
cast_to=cast(Type[ProjectCreateResponse], ResultWrapper[ProjectCreateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
|
|
@ -144,16 +148,16 @@ class ProjectsResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> SyncV4PagePaginationArray[Deployment]:
|
||||
) -> SyncV4PagePaginationArray[ProjectListResponse]:
|
||||
"""
|
||||
Fetch a list of all user projects.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
page: Which page of projects to fetch.
|
||||
|
||||
per_page: How many project to return per page.
|
||||
per_page: How many projects to return per page.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -167,7 +171,7 @@ class ProjectsResource(SyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/pages/projects",
|
||||
page=SyncV4PagePaginationArray[Deployment],
|
||||
page=SyncV4PagePaginationArray[ProjectListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
|
|
@ -181,7 +185,7 @@ class ProjectsResource(SyncAPIResource):
|
|||
project_list_params.ProjectListParams,
|
||||
),
|
||||
),
|
||||
model=Deployment,
|
||||
model=ProjectListResponse,
|
||||
)
|
||||
|
||||
def delete(
|
||||
|
|
@ -200,7 +204,7 @@ class ProjectsResource(SyncAPIResource):
|
|||
Delete a project by name.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
|
|
@ -233,10 +237,10 @@ class ProjectsResource(SyncAPIResource):
|
|||
project_name: str,
|
||||
*,
|
||||
account_id: str,
|
||||
name: str,
|
||||
production_branch: str,
|
||||
build_config: Optional[project_edit_params.BuildConfig] | Omit = omit,
|
||||
deployment_configs: Optional[project_edit_params.DeploymentConfigs] | Omit = omit,
|
||||
build_config: project_edit_params.BuildConfig | Omit = omit,
|
||||
deployment_configs: project_edit_params.DeploymentConfigs | Omit = omit,
|
||||
name: str | Omit = omit,
|
||||
production_branch: str | Omit = omit,
|
||||
source: project_edit_params.Source | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
|
|
@ -244,24 +248,26 @@ class ProjectsResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Project:
|
||||
) -> ProjectEditResponse:
|
||||
"""Set new attributes for an existing project.
|
||||
|
||||
Modify environment variables. To
|
||||
delete an environment variable, set the key to null.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
build_config: Configs for the project build process.
|
||||
|
||||
deployment_configs: Configs for deployments in a project.
|
||||
|
||||
name: Name of the project.
|
||||
|
||||
production_branch: Production branch of the project. Used to identify production deployments.
|
||||
|
||||
build_config: Configs for the project build process.
|
||||
|
||||
deployment_configs: Configs for deployments in a project.
|
||||
source: Configs for the project source control.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -279,10 +285,10 @@ class ProjectsResource(SyncAPIResource):
|
|||
f"/accounts/{account_id}/pages/projects/{project_name}",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"name": name,
|
||||
"production_branch": production_branch,
|
||||
"build_config": build_config,
|
||||
"deployment_configs": deployment_configs,
|
||||
"name": name,
|
||||
"production_branch": production_branch,
|
||||
"source": source,
|
||||
},
|
||||
project_edit_params.ProjectEditParams,
|
||||
|
|
@ -292,9 +298,9 @@ class ProjectsResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Project]._unwrapper,
|
||||
post_parser=ResultWrapper[ProjectEditResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Project], ResultWrapper[Project]),
|
||||
cast_to=cast(Type[ProjectEditResponse], ResultWrapper[ProjectEditResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
|
|
@ -308,12 +314,12 @@ class ProjectsResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Project:
|
||||
) -> ProjectGetResponse:
|
||||
"""
|
||||
Fetch a project by name.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
|
|
@ -336,9 +342,9 @@ class ProjectsResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Project]._unwrapper,
|
||||
post_parser=ResultWrapper[ProjectGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Project], ResultWrapper[Project]),
|
||||
cast_to=cast(Type[ProjectGetResponse], ResultWrapper[ProjectGetResponse]),
|
||||
)
|
||||
|
||||
def purge_build_cache(
|
||||
|
|
@ -357,7 +363,7 @@ class ProjectsResource(SyncAPIResource):
|
|||
Purge all cached build artifacts for a Pages project
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
|
|
@ -420,8 +426,8 @@ class AsyncProjectsResource(AsyncAPIResource):
|
|||
account_id: str,
|
||||
name: str,
|
||||
production_branch: str,
|
||||
build_config: Optional[project_create_params.BuildConfig] | Omit = omit,
|
||||
deployment_configs: Optional[project_create_params.DeploymentConfigs] | Omit = omit,
|
||||
build_config: project_create_params.BuildConfig | Omit = omit,
|
||||
deployment_configs: project_create_params.DeploymentConfigs | Omit = omit,
|
||||
source: project_create_params.Source | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
|
|
@ -429,12 +435,12 @@ class AsyncProjectsResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Project:
|
||||
) -> ProjectCreateResponse:
|
||||
"""
|
||||
Create a new project.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
name: Name of the project.
|
||||
|
||||
|
|
@ -444,6 +450,8 @@ class AsyncProjectsResource(AsyncAPIResource):
|
|||
|
||||
deployment_configs: Configs for deployments in a project.
|
||||
|
||||
source: Configs for the project source control.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -471,9 +479,9 @@ class AsyncProjectsResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Project]._unwrapper,
|
||||
post_parser=ResultWrapper[ProjectCreateResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Project], ResultWrapper[Project]),
|
||||
cast_to=cast(Type[ProjectCreateResponse], ResultWrapper[ProjectCreateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
|
|
@ -488,16 +496,16 @@ class AsyncProjectsResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AsyncPaginator[Deployment, AsyncV4PagePaginationArray[Deployment]]:
|
||||
) -> AsyncPaginator[ProjectListResponse, AsyncV4PagePaginationArray[ProjectListResponse]]:
|
||||
"""
|
||||
Fetch a list of all user projects.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
page: Which page of projects to fetch.
|
||||
|
||||
per_page: How many project to return per page.
|
||||
per_page: How many projects to return per page.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -511,7 +519,7 @@ class AsyncProjectsResource(AsyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/pages/projects",
|
||||
page=AsyncV4PagePaginationArray[Deployment],
|
||||
page=AsyncV4PagePaginationArray[ProjectListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
|
|
@ -525,7 +533,7 @@ class AsyncProjectsResource(AsyncAPIResource):
|
|||
project_list_params.ProjectListParams,
|
||||
),
|
||||
),
|
||||
model=Deployment,
|
||||
model=ProjectListResponse,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
|
|
@ -544,7 +552,7 @@ class AsyncProjectsResource(AsyncAPIResource):
|
|||
Delete a project by name.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
|
|
@ -577,10 +585,10 @@ class AsyncProjectsResource(AsyncAPIResource):
|
|||
project_name: str,
|
||||
*,
|
||||
account_id: str,
|
||||
name: str,
|
||||
production_branch: str,
|
||||
build_config: Optional[project_edit_params.BuildConfig] | Omit = omit,
|
||||
deployment_configs: Optional[project_edit_params.DeploymentConfigs] | Omit = omit,
|
||||
build_config: project_edit_params.BuildConfig | Omit = omit,
|
||||
deployment_configs: project_edit_params.DeploymentConfigs | Omit = omit,
|
||||
name: str | Omit = omit,
|
||||
production_branch: str | Omit = omit,
|
||||
source: project_edit_params.Source | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
|
|
@ -588,24 +596,26 @@ class AsyncProjectsResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Project:
|
||||
) -> ProjectEditResponse:
|
||||
"""Set new attributes for an existing project.
|
||||
|
||||
Modify environment variables. To
|
||||
delete an environment variable, set the key to null.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
build_config: Configs for the project build process.
|
||||
|
||||
deployment_configs: Configs for deployments in a project.
|
||||
|
||||
name: Name of the project.
|
||||
|
||||
production_branch: Production branch of the project. Used to identify production deployments.
|
||||
|
||||
build_config: Configs for the project build process.
|
||||
|
||||
deployment_configs: Configs for deployments in a project.
|
||||
source: Configs for the project source control.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -623,10 +633,10 @@ class AsyncProjectsResource(AsyncAPIResource):
|
|||
f"/accounts/{account_id}/pages/projects/{project_name}",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"name": name,
|
||||
"production_branch": production_branch,
|
||||
"build_config": build_config,
|
||||
"deployment_configs": deployment_configs,
|
||||
"name": name,
|
||||
"production_branch": production_branch,
|
||||
"source": source,
|
||||
},
|
||||
project_edit_params.ProjectEditParams,
|
||||
|
|
@ -636,9 +646,9 @@ class AsyncProjectsResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Project]._unwrapper,
|
||||
post_parser=ResultWrapper[ProjectEditResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Project], ResultWrapper[Project]),
|
||||
cast_to=cast(Type[ProjectEditResponse], ResultWrapper[ProjectEditResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
|
|
@ -652,12 +662,12 @@ class AsyncProjectsResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Project:
|
||||
) -> ProjectGetResponse:
|
||||
"""
|
||||
Fetch a project by name.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
|
|
@ -680,9 +690,9 @@ class AsyncProjectsResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Project]._unwrapper,
|
||||
post_parser=ResultWrapper[ProjectGetResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Project], ResultWrapper[Project]),
|
||||
cast_to=cast(Type[ProjectGetResponse], ResultWrapper[ProjectGetResponse]),
|
||||
)
|
||||
|
||||
async def purge_build_cache(
|
||||
|
|
@ -701,7 +711,7 @@ class AsyncProjectsResource(AsyncAPIResource):
|
|||
Purge all cached build artifacts for a Pages project
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier.
|
||||
|
||||
project_name: Name of the project.
|
||||
|
||||
|
|
|
|||
|
|
@ -62,13 +62,44 @@ class AnnotationsResource(SyncAPIResource):
|
|||
self,
|
||||
*,
|
||||
asn: int | Omit = omit,
|
||||
data_source: Literal[
|
||||
"ALL",
|
||||
"AI_BOTS",
|
||||
"AI_GATEWAY",
|
||||
"BGP",
|
||||
"BOTS",
|
||||
"CONNECTION_ANOMALY",
|
||||
"CT",
|
||||
"DNS",
|
||||
"DNS_MAGNITUDE",
|
||||
"DNS_AS112",
|
||||
"DOS",
|
||||
"EMAIL_ROUTING",
|
||||
"EMAIL_SECURITY",
|
||||
"FW",
|
||||
"FW_PG",
|
||||
"HTTP",
|
||||
"HTTP_CONTROL",
|
||||
"HTTP_CRAWLER_REFERER",
|
||||
"HTTP_ORIGINS",
|
||||
"IQI",
|
||||
"LEAKED_CREDENTIALS",
|
||||
"NET",
|
||||
"ROBOTS_TXT",
|
||||
"SPEED",
|
||||
"WORKERS_AI",
|
||||
]
|
||||
| Omit = omit,
|
||||
date_end: Union[str, datetime] | Omit = omit,
|
||||
date_range: str | Omit = omit,
|
||||
date_start: Union[str, datetime] | Omit = omit,
|
||||
event_type: Literal["EVENT", "GENERAL", "OUTAGE", "PARTIAL_PROJECTION", "PIPELINE", "TRAFFIC_ANOMALY"]
|
||||
| Omit = omit,
|
||||
format: Literal["JSON", "CSV"] | Omit = omit,
|
||||
limit: int | Omit = omit,
|
||||
location: str | Omit = omit,
|
||||
offset: int | Omit = omit,
|
||||
origin: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
|
|
@ -83,12 +114,16 @@ class AnnotationsResource(SyncAPIResource):
|
|||
asn: Filters results by Autonomous System. Specify a single Autonomous System Number
|
||||
(ASN) as integer.
|
||||
|
||||
data_source: Filters results by data source.
|
||||
|
||||
date_end: End of the date range (inclusive).
|
||||
|
||||
date_range: Filters results by date range.
|
||||
|
||||
date_start: Start of the date range (inclusive).
|
||||
|
||||
event_type: Filters results by event type.
|
||||
|
||||
format: Format in which results will be returned.
|
||||
|
||||
limit: Limits the number of objects returned in the response.
|
||||
|
|
@ -97,6 +132,8 @@ class AnnotationsResource(SyncAPIResource):
|
|||
|
||||
offset: Skips the specified number of objects before fetching the results.
|
||||
|
||||
origin: Filters results by origin.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -115,13 +152,16 @@ class AnnotationsResource(SyncAPIResource):
|
|||
query=maybe_transform(
|
||||
{
|
||||
"asn": asn,
|
||||
"data_source": data_source,
|
||||
"date_end": date_end,
|
||||
"date_range": date_range,
|
||||
"date_start": date_start,
|
||||
"event_type": event_type,
|
||||
"format": format,
|
||||
"limit": limit,
|
||||
"location": location,
|
||||
"offset": offset,
|
||||
"origin": origin,
|
||||
},
|
||||
annotation_list_params.AnnotationListParams,
|
||||
),
|
||||
|
|
@ -159,13 +199,44 @@ class AsyncAnnotationsResource(AsyncAPIResource):
|
|||
self,
|
||||
*,
|
||||
asn: int | Omit = omit,
|
||||
data_source: Literal[
|
||||
"ALL",
|
||||
"AI_BOTS",
|
||||
"AI_GATEWAY",
|
||||
"BGP",
|
||||
"BOTS",
|
||||
"CONNECTION_ANOMALY",
|
||||
"CT",
|
||||
"DNS",
|
||||
"DNS_MAGNITUDE",
|
||||
"DNS_AS112",
|
||||
"DOS",
|
||||
"EMAIL_ROUTING",
|
||||
"EMAIL_SECURITY",
|
||||
"FW",
|
||||
"FW_PG",
|
||||
"HTTP",
|
||||
"HTTP_CONTROL",
|
||||
"HTTP_CRAWLER_REFERER",
|
||||
"HTTP_ORIGINS",
|
||||
"IQI",
|
||||
"LEAKED_CREDENTIALS",
|
||||
"NET",
|
||||
"ROBOTS_TXT",
|
||||
"SPEED",
|
||||
"WORKERS_AI",
|
||||
]
|
||||
| Omit = omit,
|
||||
date_end: Union[str, datetime] | Omit = omit,
|
||||
date_range: str | Omit = omit,
|
||||
date_start: Union[str, datetime] | Omit = omit,
|
||||
event_type: Literal["EVENT", "GENERAL", "OUTAGE", "PARTIAL_PROJECTION", "PIPELINE", "TRAFFIC_ANOMALY"]
|
||||
| Omit = omit,
|
||||
format: Literal["JSON", "CSV"] | Omit = omit,
|
||||
limit: int | Omit = omit,
|
||||
location: str | Omit = omit,
|
||||
offset: int | Omit = omit,
|
||||
origin: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
|
|
@ -180,12 +251,16 @@ class AsyncAnnotationsResource(AsyncAPIResource):
|
|||
asn: Filters results by Autonomous System. Specify a single Autonomous System Number
|
||||
(ASN) as integer.
|
||||
|
||||
data_source: Filters results by data source.
|
||||
|
||||
date_end: End of the date range (inclusive).
|
||||
|
||||
date_range: Filters results by date range.
|
||||
|
||||
date_start: Start of the date range (inclusive).
|
||||
|
||||
event_type: Filters results by event type.
|
||||
|
||||
format: Format in which results will be returned.
|
||||
|
||||
limit: Limits the number of objects returned in the response.
|
||||
|
|
@ -194,6 +269,8 @@ class AsyncAnnotationsResource(AsyncAPIResource):
|
|||
|
||||
offset: Skips the specified number of objects before fetching the results.
|
||||
|
||||
origin: Filters results by origin.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -212,13 +289,16 @@ class AsyncAnnotationsResource(AsyncAPIResource):
|
|||
query=await async_maybe_transform(
|
||||
{
|
||||
"asn": asn,
|
||||
"data_source": data_source,
|
||||
"date_end": date_end,
|
||||
"date_range": date_range,
|
||||
"date_start": date_start,
|
||||
"event_type": event_type,
|
||||
"format": format,
|
||||
"limit": limit,
|
||||
"location": location,
|
||||
"offset": offset,
|
||||
"origin": origin,
|
||||
},
|
||||
annotation_list_params.AnnotationListParams,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ class OutagesResource(SyncAPIResource):
|
|||
limit: int | Omit = omit,
|
||||
location: str | Omit = omit,
|
||||
offset: int | Omit = omit,
|
||||
origin: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
|
|
@ -86,6 +87,8 @@ class OutagesResource(SyncAPIResource):
|
|||
|
||||
offset: Skips the specified number of objects before fetching the results.
|
||||
|
||||
origin: Filters results by origin.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -111,6 +114,7 @@ class OutagesResource(SyncAPIResource):
|
|||
"limit": limit,
|
||||
"location": location,
|
||||
"offset": offset,
|
||||
"origin": origin,
|
||||
},
|
||||
outage_get_params.OutageGetParams,
|
||||
),
|
||||
|
|
@ -210,6 +214,7 @@ class AsyncOutagesResource(AsyncAPIResource):
|
|||
limit: int | Omit = omit,
|
||||
location: str | Omit = omit,
|
||||
offset: int | Omit = omit,
|
||||
origin: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
|
|
@ -238,6 +243,8 @@ class AsyncOutagesResource(AsyncAPIResource):
|
|||
|
||||
offset: Skips the specified number of objects before fetching the results.
|
||||
|
||||
origin: Filters results by origin.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -263,6 +270,7 @@ class AsyncOutagesResource(AsyncAPIResource):
|
|||
"limit": limit,
|
||||
"location": location,
|
||||
"offset": offset,
|
||||
"origin": origin,
|
||||
},
|
||||
outage_get_params.OutageGetParams,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@ class SearchResource(SyncAPIResource):
|
|||
"BOTS",
|
||||
"CERTIFICATE_AUTHORITIES",
|
||||
"CERTIFICATE_LOGS",
|
||||
"ORIGINS",
|
||||
"ORIGIN_REGIONS",
|
||||
"INDUSTRIES",
|
||||
"LOCATIONS",
|
||||
"NOTEBOOKS",
|
||||
|
|
@ -72,6 +74,8 @@ class SearchResource(SyncAPIResource):
|
|||
"BOTS",
|
||||
"CERTIFICATE_AUTHORITIES",
|
||||
"CERTIFICATE_LOGS",
|
||||
"ORIGINS",
|
||||
"ORIGIN_REGIONS",
|
||||
"INDUSTRIES",
|
||||
"LOCATIONS",
|
||||
"NOTEBOOKS",
|
||||
|
|
@ -169,6 +173,8 @@ class AsyncSearchResource(AsyncAPIResource):
|
|||
"BOTS",
|
||||
"CERTIFICATE_AUTHORITIES",
|
||||
"CERTIFICATE_LOGS",
|
||||
"ORIGINS",
|
||||
"ORIGIN_REGIONS",
|
||||
"INDUSTRIES",
|
||||
"LOCATIONS",
|
||||
"NOTEBOOKS",
|
||||
|
|
@ -185,6 +191,8 @@ class AsyncSearchResource(AsyncAPIResource):
|
|||
"BOTS",
|
||||
"CERTIFICATE_AUTHORITIES",
|
||||
"CERTIFICATE_LOGS",
|
||||
"ORIGINS",
|
||||
"ORIGIN_REGIONS",
|
||||
"INDUSTRIES",
|
||||
"LOCATIONS",
|
||||
"NOTEBOOKS",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Union, cast
|
||||
from typing import List, Type, Union, cast
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
|
|
@ -69,7 +69,9 @@ class TrafficAnomaliesResource(SyncAPIResource):
|
|||
limit: int | Omit = omit,
|
||||
location: str | Omit = omit,
|
||||
offset: int | Omit = omit,
|
||||
origin: str | Omit = omit,
|
||||
status: Literal["VERIFIED", "UNVERIFIED"] | Omit = omit,
|
||||
type: List[Literal["LOCATION", "AS", "ORIGIN"]] | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
|
|
@ -100,6 +102,10 @@ class TrafficAnomaliesResource(SyncAPIResource):
|
|||
|
||||
offset: Skips the specified number of objects before fetching the results.
|
||||
|
||||
origin: Filters results by origin.
|
||||
|
||||
type: Filters results by entity type (LOCATION, AS, or ORIGIN).
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -125,7 +131,9 @@ class TrafficAnomaliesResource(SyncAPIResource):
|
|||
"limit": limit,
|
||||
"location": location,
|
||||
"offset": offset,
|
||||
"origin": origin,
|
||||
"status": status,
|
||||
"type": type,
|
||||
},
|
||||
traffic_anomaly_get_params.TrafficAnomalyGetParams,
|
||||
),
|
||||
|
|
@ -170,7 +178,9 @@ class AsyncTrafficAnomaliesResource(AsyncAPIResource):
|
|||
limit: int | Omit = omit,
|
||||
location: str | Omit = omit,
|
||||
offset: int | Omit = omit,
|
||||
origin: str | Omit = omit,
|
||||
status: Literal["VERIFIED", "UNVERIFIED"] | Omit = omit,
|
||||
type: List[Literal["LOCATION", "AS", "ORIGIN"]] | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
|
|
@ -201,6 +211,10 @@ class AsyncTrafficAnomaliesResource(AsyncAPIResource):
|
|||
|
||||
offset: Skips the specified number of objects before fetching the results.
|
||||
|
||||
origin: Filters results by origin.
|
||||
|
||||
type: Filters results by entity type (LOCATION, AS, or ORIGIN).
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -226,7 +240,9 @@ class AsyncTrafficAnomaliesResource(AsyncAPIResource):
|
|||
"limit": limit,
|
||||
"location": location,
|
||||
"offset": offset,
|
||||
"origin": origin,
|
||||
"status": status,
|
||||
"type": type,
|
||||
},
|
||||
traffic_anomaly_get_params.TrafficAnomalyGetParams,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -30,7 +30,9 @@ from ....types.ssl import certificate_pack_edit_params, certificate_pack_list_pa
|
|||
from ....pagination import SyncSinglePage, AsyncSinglePage
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.ssl.host import Host
|
||||
from ....types.ssl.certificate_pack_get_response import CertificatePackGetResponse
|
||||
from ....types.ssl.certificate_pack_edit_response import CertificatePackEditResponse
|
||||
from ....types.ssl.certificate_pack_list_response import CertificatePackListResponse
|
||||
from ....types.ssl.certificate_pack_create_response import CertificatePackCreateResponse
|
||||
from ....types.ssl.certificate_pack_delete_response import CertificatePackDeleteResponse
|
||||
|
||||
|
|
@ -144,7 +146,7 @@ class CertificatePacksResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> SyncSinglePage[object]:
|
||||
) -> SyncSinglePage[CertificatePackListResponse]:
|
||||
"""
|
||||
For a given zone, list all active certificate packs.
|
||||
|
||||
|
|
@ -165,7 +167,7 @@ class CertificatePacksResource(SyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/zones/{zone_id}/ssl/certificate_packs",
|
||||
page=SyncSinglePage[object],
|
||||
page=SyncSinglePage[CertificatePackListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
|
|
@ -173,7 +175,7 @@ class CertificatePacksResource(SyncAPIResource):
|
|||
timeout=timeout,
|
||||
query=maybe_transform({"status": status}, certificate_pack_list_params.CertificatePackListParams),
|
||||
),
|
||||
model=object,
|
||||
model=CertificatePackListResponse,
|
||||
)
|
||||
|
||||
def delete(
|
||||
|
|
@ -288,7 +290,7 @@ class CertificatePacksResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> object:
|
||||
) -> Optional[CertificatePackGetResponse]:
|
||||
"""
|
||||
For a given zone, get a certificate pack.
|
||||
|
||||
|
|
@ -318,9 +320,9 @@ class CertificatePacksResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[object]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[CertificatePackGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[object], ResultWrapper[object]),
|
||||
cast_to=cast(Type[Optional[CertificatePackGetResponse]], ResultWrapper[CertificatePackGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -431,7 +433,7 @@ class AsyncCertificatePacksResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> AsyncPaginator[object, AsyncSinglePage[object]]:
|
||||
) -> AsyncPaginator[CertificatePackListResponse, AsyncSinglePage[CertificatePackListResponse]]:
|
||||
"""
|
||||
For a given zone, list all active certificate packs.
|
||||
|
||||
|
|
@ -452,7 +454,7 @@ class AsyncCertificatePacksResource(AsyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/zones/{zone_id}/ssl/certificate_packs",
|
||||
page=AsyncSinglePage[object],
|
||||
page=AsyncSinglePage[CertificatePackListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
|
|
@ -460,7 +462,7 @@ class AsyncCertificatePacksResource(AsyncAPIResource):
|
|||
timeout=timeout,
|
||||
query=maybe_transform({"status": status}, certificate_pack_list_params.CertificatePackListParams),
|
||||
),
|
||||
model=object,
|
||||
model=CertificatePackListResponse,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
|
|
@ -575,7 +577,7 @@ class AsyncCertificatePacksResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> object:
|
||||
) -> Optional[CertificatePackGetResponse]:
|
||||
"""
|
||||
For a given zone, get a certificate pack.
|
||||
|
||||
|
|
@ -605,9 +607,9 @@ class AsyncCertificatePacksResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[object]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[CertificatePackGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[object], ResultWrapper[object]),
|
||||
cast_to=cast(Type[Optional[CertificatePackGetResponse]], ResultWrapper[CertificatePackGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -49,10 +49,10 @@ class DomainsResource(SyncAPIResource):
|
|||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
environment: str,
|
||||
hostname: str,
|
||||
service: str,
|
||||
zone_id: str,
|
||||
environment: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
|
|
@ -66,14 +66,14 @@ class DomainsResource(SyncAPIResource):
|
|||
Args:
|
||||
account_id: Identifer of the account.
|
||||
|
||||
environment: Worker environment associated with the zone and hostname.
|
||||
|
||||
hostname: Hostname of the Worker Domain.
|
||||
|
||||
service: Worker service associated with the zone and hostname.
|
||||
|
||||
zone_id: Identifier of the zone.
|
||||
|
||||
environment: Worker environment associated with the zone and hostname.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -88,10 +88,10 @@ class DomainsResource(SyncAPIResource):
|
|||
f"/accounts/{account_id}/workers/domains",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"environment": environment,
|
||||
"hostname": hostname,
|
||||
"service": service,
|
||||
"zone_id": zone_id,
|
||||
"environment": environment,
|
||||
},
|
||||
domain_update_params.DomainUpdateParams,
|
||||
),
|
||||
|
|
@ -279,10 +279,10 @@ class AsyncDomainsResource(AsyncAPIResource):
|
|||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
environment: str,
|
||||
hostname: str,
|
||||
service: str,
|
||||
zone_id: str,
|
||||
environment: str | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
|
|
@ -296,14 +296,14 @@ class AsyncDomainsResource(AsyncAPIResource):
|
|||
Args:
|
||||
account_id: Identifer of the account.
|
||||
|
||||
environment: Worker environment associated with the zone and hostname.
|
||||
|
||||
hostname: Hostname of the Worker Domain.
|
||||
|
||||
service: Worker service associated with the zone and hostname.
|
||||
|
||||
zone_id: Identifier of the zone.
|
||||
|
||||
environment: Worker environment associated with the zone and hostname.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -318,10 +318,10 @@ class AsyncDomainsResource(AsyncAPIResource):
|
|||
f"/accounts/{account_id}/workers/domains",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"environment": environment,
|
||||
"hostname": hostname,
|
||||
"service": service,
|
||||
"zone_id": zone_id,
|
||||
"environment": environment,
|
||||
},
|
||||
domain_update_params.DomainUpdateParams,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -54,10 +54,11 @@ class TelemetryResource(SyncAPIResource):
|
|||
account_id: str,
|
||||
datasets: SequenceNotStr[str] | Omit = omit,
|
||||
filters: Iterable[telemetry_keys_params.Filter] | Omit = omit,
|
||||
from_: float | Omit = omit,
|
||||
key_needle: telemetry_keys_params.KeyNeedle | Omit = omit,
|
||||
limit: float | Omit = omit,
|
||||
needle: telemetry_keys_params.Needle | Omit = omit,
|
||||
timeframe: telemetry_keys_params.Timeframe | Omit = omit,
|
||||
to: float | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
|
|
@ -71,7 +72,7 @@ class TelemetryResource(SyncAPIResource):
|
|||
Args:
|
||||
key_needle: Search for a specific substring in the keys.
|
||||
|
||||
needle: Search for a specific substring in the event.
|
||||
needle: Search for a specific substring in any of the events
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -90,10 +91,11 @@ class TelemetryResource(SyncAPIResource):
|
|||
{
|
||||
"datasets": datasets,
|
||||
"filters": filters,
|
||||
"from_": from_,
|
||||
"key_needle": key_needle,
|
||||
"limit": limit,
|
||||
"needle": needle,
|
||||
"timeframe": timeframe,
|
||||
"to": to,
|
||||
},
|
||||
telemetry_keys_params.TelemetryKeysParams,
|
||||
),
|
||||
|
|
@ -133,6 +135,37 @@ class TelemetryResource(SyncAPIResource):
|
|||
Runs a temporary or saved query
|
||||
|
||||
Args:
|
||||
query_id: Unique identifier for the query to execute
|
||||
|
||||
timeframe: Time range for the query execution
|
||||
|
||||
chart: Whether to include timeseties data in the response
|
||||
|
||||
compare: Whether to include comparison data with previous time periods
|
||||
|
||||
dry: Whether to perform a dry run without saving the results of the query. Useful for
|
||||
validation
|
||||
|
||||
granularity: Time granularity for aggregating results (in milliseconds). Controls the
|
||||
bucketing of time-series data
|
||||
|
||||
ignore_series: Whether to ignore time-series data in the results and return only aggregated
|
||||
values
|
||||
|
||||
limit: Maximum number of events to return.
|
||||
|
||||
offset: Cursor for pagination to retrieve the next set of results
|
||||
|
||||
offset_by: Number of events to skip for pagination. Used in conjunction with offset
|
||||
|
||||
offset_direction: Direction for offset-based pagination (e.g., 'next', 'prev')
|
||||
|
||||
parameters: Optional parameters to pass to the query execution
|
||||
|
||||
pattern_type: Type of pattern to search for when using pattern-based views
|
||||
|
||||
view: View type for presenting the query results.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -257,10 +290,11 @@ class AsyncTelemetryResource(AsyncAPIResource):
|
|||
account_id: str,
|
||||
datasets: SequenceNotStr[str] | Omit = omit,
|
||||
filters: Iterable[telemetry_keys_params.Filter] | Omit = omit,
|
||||
from_: float | Omit = omit,
|
||||
key_needle: telemetry_keys_params.KeyNeedle | Omit = omit,
|
||||
limit: float | Omit = omit,
|
||||
needle: telemetry_keys_params.Needle | Omit = omit,
|
||||
timeframe: telemetry_keys_params.Timeframe | Omit = omit,
|
||||
to: float | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
|
|
@ -274,7 +308,7 @@ class AsyncTelemetryResource(AsyncAPIResource):
|
|||
Args:
|
||||
key_needle: Search for a specific substring in the keys.
|
||||
|
||||
needle: Search for a specific substring in the event.
|
||||
needle: Search for a specific substring in any of the events
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -293,10 +327,11 @@ class AsyncTelemetryResource(AsyncAPIResource):
|
|||
{
|
||||
"datasets": datasets,
|
||||
"filters": filters,
|
||||
"from_": from_,
|
||||
"key_needle": key_needle,
|
||||
"limit": limit,
|
||||
"needle": needle,
|
||||
"timeframe": timeframe,
|
||||
"to": to,
|
||||
},
|
||||
telemetry_keys_params.TelemetryKeysParams,
|
||||
),
|
||||
|
|
@ -336,6 +371,37 @@ class AsyncTelemetryResource(AsyncAPIResource):
|
|||
Runs a temporary or saved query
|
||||
|
||||
Args:
|
||||
query_id: Unique identifier for the query to execute
|
||||
|
||||
timeframe: Time range for the query execution
|
||||
|
||||
chart: Whether to include timeseties data in the response
|
||||
|
||||
compare: Whether to include comparison data with previous time periods
|
||||
|
||||
dry: Whether to perform a dry run without saving the results of the query. Useful for
|
||||
validation
|
||||
|
||||
granularity: Time granularity for aggregating results (in milliseconds). Controls the
|
||||
bucketing of time-series data
|
||||
|
||||
ignore_series: Whether to ignore time-series data in the results and return only aggregated
|
||||
values
|
||||
|
||||
limit: Maximum number of events to return.
|
||||
|
||||
offset: Cursor for pagination to retrieve the next set of results
|
||||
|
||||
offset_by: Number of events to skip for pagination. Used in conjunction with offset
|
||||
|
||||
offset_direction: Direction for offset-based pagination (e.g., 'next', 'prev')
|
||||
|
||||
parameters: Optional parameters to pass to the query execution
|
||||
|
||||
pattern_type: Type of pattern to search for when using pattern-based views
|
||||
|
||||
view: View type for presenting the query results.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ class PostureResource(SyncAPIResource):
|
|||
"domain_joined",
|
||||
"client_certificate",
|
||||
"client_certificate_v2",
|
||||
"antivirus",
|
||||
"unique_client_id",
|
||||
"kolide",
|
||||
"tanium_s2s",
|
||||
|
|
@ -177,6 +178,7 @@ class PostureResource(SyncAPIResource):
|
|||
"domain_joined",
|
||||
"client_certificate",
|
||||
"client_certificate_v2",
|
||||
"antivirus",
|
||||
"unique_client_id",
|
||||
"kolide",
|
||||
"tanium_s2s",
|
||||
|
|
@ -419,6 +421,7 @@ class AsyncPostureResource(AsyncAPIResource):
|
|||
"domain_joined",
|
||||
"client_certificate",
|
||||
"client_certificate_v2",
|
||||
"antivirus",
|
||||
"unique_client_id",
|
||||
"kolide",
|
||||
"tanium_s2s",
|
||||
|
|
@ -515,6 +518,7 @@ class AsyncPostureResource(AsyncAPIResource):
|
|||
"domain_joined",
|
||||
"client_certificate",
|
||||
"client_certificate_v2",
|
||||
"antivirus",
|
||||
"unique_client_id",
|
||||
"kolide",
|
||||
"tanium_s2s",
|
||||
|
|
|
|||
|
|
@ -49,6 +49,10 @@ class SettingsResource(SyncAPIResource):
|
|||
*,
|
||||
account_id: str,
|
||||
disable_for_time: float | Omit = omit,
|
||||
external_emergency_signal_enabled: bool | Omit = omit,
|
||||
external_emergency_signal_fingerprint: str | Omit = omit,
|
||||
external_emergency_signal_interval: str | Omit = omit,
|
||||
external_emergency_signal_url: str | Omit = omit,
|
||||
gateway_proxy_enabled: bool | Omit = omit,
|
||||
gateway_udp_proxy_enabled: bool | Omit = omit,
|
||||
root_certificate_installation_enabled: bool | Omit = omit,
|
||||
|
|
@ -67,6 +71,20 @@ class SettingsResource(SyncAPIResource):
|
|||
disable_for_time: Sets the time limit, in seconds, that a user can use an override code to bypass
|
||||
WARP.
|
||||
|
||||
external_emergency_signal_enabled: Controls whether the external emergency disconnect feature is enabled.
|
||||
|
||||
external_emergency_signal_fingerprint: The SHA256 fingerprint (64 hexadecimal characters) of the HTTPS server
|
||||
certificate for the external_emergency_signal_url. If provided, the WARP client
|
||||
will use this value to verify the server's identity. The device will ignore any
|
||||
response if the server's certificate fingerprint does not exactly match this
|
||||
value.
|
||||
|
||||
external_emergency_signal_interval: The interval at which the WARP client fetches the emergency disconnect signal,
|
||||
formatted as a duration string (e.g., "5m", "2m30s", "1h"). Minimum 30 seconds.
|
||||
|
||||
external_emergency_signal_url: The HTTPS URL from which to fetch the emergency disconnect signal. Must use
|
||||
HTTPS and have an IPv4 or IPv6 address as the host.
|
||||
|
||||
gateway_proxy_enabled: Enable gateway proxy filtering on TCP.
|
||||
|
||||
gateway_udp_proxy_enabled: Enable gateway proxy filtering on UDP.
|
||||
|
|
@ -90,6 +108,10 @@ class SettingsResource(SyncAPIResource):
|
|||
body=maybe_transform(
|
||||
{
|
||||
"disable_for_time": disable_for_time,
|
||||
"external_emergency_signal_enabled": external_emergency_signal_enabled,
|
||||
"external_emergency_signal_fingerprint": external_emergency_signal_fingerprint,
|
||||
"external_emergency_signal_interval": external_emergency_signal_interval,
|
||||
"external_emergency_signal_url": external_emergency_signal_url,
|
||||
"gateway_proxy_enabled": gateway_proxy_enabled,
|
||||
"gateway_udp_proxy_enabled": gateway_udp_proxy_enabled,
|
||||
"root_certificate_installation_enabled": root_certificate_installation_enabled,
|
||||
|
|
@ -149,6 +171,10 @@ class SettingsResource(SyncAPIResource):
|
|||
*,
|
||||
account_id: str,
|
||||
disable_for_time: float | Omit = omit,
|
||||
external_emergency_signal_enabled: bool | Omit = omit,
|
||||
external_emergency_signal_fingerprint: str | Omit = omit,
|
||||
external_emergency_signal_interval: str | Omit = omit,
|
||||
external_emergency_signal_url: str | Omit = omit,
|
||||
gateway_proxy_enabled: bool | Omit = omit,
|
||||
gateway_udp_proxy_enabled: bool | Omit = omit,
|
||||
root_certificate_installation_enabled: bool | Omit = omit,
|
||||
|
|
@ -167,6 +193,20 @@ class SettingsResource(SyncAPIResource):
|
|||
disable_for_time: Sets the time limit, in seconds, that a user can use an override code to bypass
|
||||
WARP.
|
||||
|
||||
external_emergency_signal_enabled: Controls whether the external emergency disconnect feature is enabled.
|
||||
|
||||
external_emergency_signal_fingerprint: The SHA256 fingerprint (64 hexadecimal characters) of the HTTPS server
|
||||
certificate for the external_emergency_signal_url. If provided, the WARP client
|
||||
will use this value to verify the server's identity. The device will ignore any
|
||||
response if the server's certificate fingerprint does not exactly match this
|
||||
value.
|
||||
|
||||
external_emergency_signal_interval: The interval at which the WARP client fetches the emergency disconnect signal,
|
||||
formatted as a duration string (e.g., "5m", "2m30s", "1h"). Minimum 30 seconds.
|
||||
|
||||
external_emergency_signal_url: The HTTPS URL from which to fetch the emergency disconnect signal. Must use
|
||||
HTTPS and have an IPv4 or IPv6 address as the host.
|
||||
|
||||
gateway_proxy_enabled: Enable gateway proxy filtering on TCP.
|
||||
|
||||
gateway_udp_proxy_enabled: Enable gateway proxy filtering on UDP.
|
||||
|
|
@ -190,6 +230,10 @@ class SettingsResource(SyncAPIResource):
|
|||
body=maybe_transform(
|
||||
{
|
||||
"disable_for_time": disable_for_time,
|
||||
"external_emergency_signal_enabled": external_emergency_signal_enabled,
|
||||
"external_emergency_signal_fingerprint": external_emergency_signal_fingerprint,
|
||||
"external_emergency_signal_interval": external_emergency_signal_interval,
|
||||
"external_emergency_signal_url": external_emergency_signal_url,
|
||||
"gateway_proxy_enabled": gateway_proxy_enabled,
|
||||
"gateway_udp_proxy_enabled": gateway_udp_proxy_enabled,
|
||||
"root_certificate_installation_enabled": root_certificate_installation_enabled,
|
||||
|
|
@ -270,6 +314,10 @@ class AsyncSettingsResource(AsyncAPIResource):
|
|||
*,
|
||||
account_id: str,
|
||||
disable_for_time: float | Omit = omit,
|
||||
external_emergency_signal_enabled: bool | Omit = omit,
|
||||
external_emergency_signal_fingerprint: str | Omit = omit,
|
||||
external_emergency_signal_interval: str | Omit = omit,
|
||||
external_emergency_signal_url: str | Omit = omit,
|
||||
gateway_proxy_enabled: bool | Omit = omit,
|
||||
gateway_udp_proxy_enabled: bool | Omit = omit,
|
||||
root_certificate_installation_enabled: bool | Omit = omit,
|
||||
|
|
@ -288,6 +336,20 @@ class AsyncSettingsResource(AsyncAPIResource):
|
|||
disable_for_time: Sets the time limit, in seconds, that a user can use an override code to bypass
|
||||
WARP.
|
||||
|
||||
external_emergency_signal_enabled: Controls whether the external emergency disconnect feature is enabled.
|
||||
|
||||
external_emergency_signal_fingerprint: The SHA256 fingerprint (64 hexadecimal characters) of the HTTPS server
|
||||
certificate for the external_emergency_signal_url. If provided, the WARP client
|
||||
will use this value to verify the server's identity. The device will ignore any
|
||||
response if the server's certificate fingerprint does not exactly match this
|
||||
value.
|
||||
|
||||
external_emergency_signal_interval: The interval at which the WARP client fetches the emergency disconnect signal,
|
||||
formatted as a duration string (e.g., "5m", "2m30s", "1h"). Minimum 30 seconds.
|
||||
|
||||
external_emergency_signal_url: The HTTPS URL from which to fetch the emergency disconnect signal. Must use
|
||||
HTTPS and have an IPv4 or IPv6 address as the host.
|
||||
|
||||
gateway_proxy_enabled: Enable gateway proxy filtering on TCP.
|
||||
|
||||
gateway_udp_proxy_enabled: Enable gateway proxy filtering on UDP.
|
||||
|
|
@ -311,6 +373,10 @@ class AsyncSettingsResource(AsyncAPIResource):
|
|||
body=await async_maybe_transform(
|
||||
{
|
||||
"disable_for_time": disable_for_time,
|
||||
"external_emergency_signal_enabled": external_emergency_signal_enabled,
|
||||
"external_emergency_signal_fingerprint": external_emergency_signal_fingerprint,
|
||||
"external_emergency_signal_interval": external_emergency_signal_interval,
|
||||
"external_emergency_signal_url": external_emergency_signal_url,
|
||||
"gateway_proxy_enabled": gateway_proxy_enabled,
|
||||
"gateway_udp_proxy_enabled": gateway_udp_proxy_enabled,
|
||||
"root_certificate_installation_enabled": root_certificate_installation_enabled,
|
||||
|
|
@ -370,6 +436,10 @@ class AsyncSettingsResource(AsyncAPIResource):
|
|||
*,
|
||||
account_id: str,
|
||||
disable_for_time: float | Omit = omit,
|
||||
external_emergency_signal_enabled: bool | Omit = omit,
|
||||
external_emergency_signal_fingerprint: str | Omit = omit,
|
||||
external_emergency_signal_interval: str | Omit = omit,
|
||||
external_emergency_signal_url: str | Omit = omit,
|
||||
gateway_proxy_enabled: bool | Omit = omit,
|
||||
gateway_udp_proxy_enabled: bool | Omit = omit,
|
||||
root_certificate_installation_enabled: bool | Omit = omit,
|
||||
|
|
@ -388,6 +458,20 @@ class AsyncSettingsResource(AsyncAPIResource):
|
|||
disable_for_time: Sets the time limit, in seconds, that a user can use an override code to bypass
|
||||
WARP.
|
||||
|
||||
external_emergency_signal_enabled: Controls whether the external emergency disconnect feature is enabled.
|
||||
|
||||
external_emergency_signal_fingerprint: The SHA256 fingerprint (64 hexadecimal characters) of the HTTPS server
|
||||
certificate for the external_emergency_signal_url. If provided, the WARP client
|
||||
will use this value to verify the server's identity. The device will ignore any
|
||||
response if the server's certificate fingerprint does not exactly match this
|
||||
value.
|
||||
|
||||
external_emergency_signal_interval: The interval at which the WARP client fetches the emergency disconnect signal,
|
||||
formatted as a duration string (e.g., "5m", "2m30s", "1h"). Minimum 30 seconds.
|
||||
|
||||
external_emergency_signal_url: The HTTPS URL from which to fetch the emergency disconnect signal. Must use
|
||||
HTTPS and have an IPv4 or IPv6 address as the host.
|
||||
|
||||
gateway_proxy_enabled: Enable gateway proxy filtering on TCP.
|
||||
|
||||
gateway_udp_proxy_enabled: Enable gateway proxy filtering on UDP.
|
||||
|
|
@ -411,6 +495,10 @@ class AsyncSettingsResource(AsyncAPIResource):
|
|||
body=await async_maybe_transform(
|
||||
{
|
||||
"disable_for_time": disable_for_time,
|
||||
"external_emergency_signal_enabled": external_emergency_signal_enabled,
|
||||
"external_emergency_signal_fingerprint": external_emergency_signal_fingerprint,
|
||||
"external_emergency_signal_interval": external_emergency_signal_interval,
|
||||
"external_emergency_signal_url": external_emergency_signal_url,
|
||||
"gateway_proxy_enabled": gateway_proxy_enabled,
|
||||
"gateway_udp_proxy_enabled": gateway_udp_proxy_enabled,
|
||||
"root_certificate_installation_enabled": root_certificate_installation_enabled,
|
||||
|
|
|
|||
|
|
@ -37,7 +37,9 @@ from .versions.versions import (
|
|||
)
|
||||
from .....types.zero_trust.dlp import dataset_create_params, dataset_update_params
|
||||
from .....types.zero_trust.dlp.dataset import Dataset
|
||||
from .....types.zero_trust.dlp.dataset_creation import DatasetCreation
|
||||
from .....types.zero_trust.dlp.dataset_get_response import DatasetGetResponse
|
||||
from .....types.zero_trust.dlp.dataset_create_response import DatasetCreateResponse
|
||||
from .....types.zero_trust.dlp.dataset_update_response import DatasetUpdateResponse
|
||||
|
||||
__all__ = ["DatasetsResource", "AsyncDatasetsResource"]
|
||||
|
||||
|
|
@ -85,7 +87,7 @@ class DatasetsResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[DatasetCreation]:
|
||||
) -> Optional[DatasetCreateResponse]:
|
||||
"""Create a new dataset
|
||||
|
||||
Args:
|
||||
|
|
@ -135,9 +137,9 @@ class DatasetsResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[DatasetCreation]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[DatasetCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[DatasetCreation]], ResultWrapper[DatasetCreation]),
|
||||
cast_to=cast(Type[Optional[DatasetCreateResponse]], ResultWrapper[DatasetCreateResponse]),
|
||||
)
|
||||
|
||||
def update(
|
||||
|
|
@ -154,7 +156,7 @@ class DatasetsResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[Dataset]:
|
||||
) -> Optional[DatasetUpdateResponse]:
|
||||
"""
|
||||
Update details about a dataset
|
||||
|
||||
|
|
@ -194,9 +196,9 @@ class DatasetsResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Dataset]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[DatasetUpdateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Dataset]], ResultWrapper[Dataset]),
|
||||
cast_to=cast(Type[Optional[DatasetUpdateResponse]], ResultWrapper[DatasetUpdateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
|
|
@ -281,7 +283,7 @@ class DatasetsResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[Dataset]:
|
||||
) -> Optional[DatasetGetResponse]:
|
||||
"""
|
||||
Fetch a specific dataset
|
||||
|
||||
|
|
@ -305,9 +307,9 @@ class DatasetsResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Dataset]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[DatasetGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Dataset]], ResultWrapper[Dataset]),
|
||||
cast_to=cast(Type[Optional[DatasetGetResponse]], ResultWrapper[DatasetGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -354,7 +356,7 @@ class AsyncDatasetsResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[DatasetCreation]:
|
||||
) -> Optional[DatasetCreateResponse]:
|
||||
"""Create a new dataset
|
||||
|
||||
Args:
|
||||
|
|
@ -404,9 +406,9 @@ class AsyncDatasetsResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[DatasetCreation]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[DatasetCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[DatasetCreation]], ResultWrapper[DatasetCreation]),
|
||||
cast_to=cast(Type[Optional[DatasetCreateResponse]], ResultWrapper[DatasetCreateResponse]),
|
||||
)
|
||||
|
||||
async def update(
|
||||
|
|
@ -423,7 +425,7 @@ class AsyncDatasetsResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[Dataset]:
|
||||
) -> Optional[DatasetUpdateResponse]:
|
||||
"""
|
||||
Update details about a dataset
|
||||
|
||||
|
|
@ -463,9 +465,9 @@ class AsyncDatasetsResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Dataset]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[DatasetUpdateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Dataset]], ResultWrapper[Dataset]),
|
||||
cast_to=cast(Type[Optional[DatasetUpdateResponse]], ResultWrapper[DatasetUpdateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
|
|
@ -550,7 +552,7 @@ class AsyncDatasetsResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[Dataset]:
|
||||
) -> Optional[DatasetGetResponse]:
|
||||
"""
|
||||
Fetch a specific dataset
|
||||
|
||||
|
|
@ -574,9 +576,9 @@ class AsyncDatasetsResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Dataset]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[DatasetGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Dataset]], ResultWrapper[Dataset]),
|
||||
cast_to=cast(Type[Optional[DatasetGetResponse]], ResultWrapper[DatasetGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ from ....._response import (
|
|||
)
|
||||
from ....._wrappers import ResultWrapper
|
||||
from ....._base_client import make_request_options
|
||||
from .....types.zero_trust.dlp.dataset import Dataset
|
||||
from .....types.zero_trust.dlp.datasets.new_version import NewVersion
|
||||
from .....types.zero_trust.dlp.datasets.upload_edit_response import UploadEditResponse
|
||||
from .....types.zero_trust.dlp.datasets.upload_create_response import UploadCreateResponse
|
||||
|
||||
__all__ = ["UploadResource", "AsyncUploadResource"]
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ class UploadResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[NewVersion]:
|
||||
) -> Optional[UploadCreateResponse]:
|
||||
"""
|
||||
Prepare to upload a new version of a dataset
|
||||
|
||||
|
|
@ -79,9 +79,9 @@ class UploadResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[NewVersion]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[UploadCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[NewVersion]], ResultWrapper[NewVersion]),
|
||||
cast_to=cast(Type[Optional[UploadCreateResponse]], ResultWrapper[UploadCreateResponse]),
|
||||
)
|
||||
|
||||
def edit(
|
||||
|
|
@ -97,7 +97,7 @@ class UploadResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[Dataset]:
|
||||
) -> Optional[UploadEditResponse]:
|
||||
"""This is used for single-column EDMv1 and Custom Word Lists.
|
||||
|
||||
The EDM format can
|
||||
|
|
@ -127,9 +127,9 @@ class UploadResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Dataset]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[UploadEditResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Dataset]], ResultWrapper[Dataset]),
|
||||
cast_to=cast(Type[Optional[UploadEditResponse]], ResultWrapper[UploadEditResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ class AsyncUploadResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[NewVersion]:
|
||||
) -> Optional[UploadCreateResponse]:
|
||||
"""
|
||||
Prepare to upload a new version of a dataset
|
||||
|
||||
|
|
@ -188,9 +188,9 @@ class AsyncUploadResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[NewVersion]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[UploadCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[NewVersion]], ResultWrapper[NewVersion]),
|
||||
cast_to=cast(Type[Optional[UploadCreateResponse]], ResultWrapper[UploadCreateResponse]),
|
||||
)
|
||||
|
||||
async def edit(
|
||||
|
|
@ -206,7 +206,7 @@ class AsyncUploadResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[Dataset]:
|
||||
) -> Optional[UploadEditResponse]:
|
||||
"""This is used for single-column EDMv1 and Custom Word Lists.
|
||||
|
||||
The EDM format can
|
||||
|
|
@ -236,9 +236,9 @@ class AsyncUploadResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Dataset]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[UploadEditResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Dataset]], ResultWrapper[Dataset]),
|
||||
cast_to=cast(Type[Optional[UploadEditResponse]], ResultWrapper[UploadEditResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class RulesResource(SyncAPIResource):
|
|||
Create email scanner rule
|
||||
|
||||
Args:
|
||||
conditions: Rule is triggered if all conditions match.
|
||||
conditions: Triggered if all conditions match.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -125,7 +125,7 @@ class RulesResource(SyncAPIResource):
|
|||
Update email scanner rule
|
||||
|
||||
Args:
|
||||
conditions: Rule is triggered if all conditions match.
|
||||
conditions: Triggered if all conditions match.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -355,7 +355,7 @@ class AsyncRulesResource(AsyncAPIResource):
|
|||
Create email scanner rule
|
||||
|
||||
Args:
|
||||
conditions: Rule is triggered if all conditions match.
|
||||
conditions: Triggered if all conditions match.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -410,7 +410,7 @@ class AsyncRulesResource(AsyncAPIResource):
|
|||
Update email scanner rule
|
||||
|
||||
Args:
|
||||
conditions: Rule is triggered if all conditions match.
|
||||
conditions: Triggered if all conditions match.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
|
|||
|
|
@ -64,11 +64,11 @@ class IntegrationResource(SyncAPIResource):
|
|||
) -> Optional[IntegrationCreateResponse]:
|
||||
"""
|
||||
Integration entries can't be created, this will update an existing integration
|
||||
entry This is needed for our generated terraform API
|
||||
entry. This is needed for our generated terraform API.
|
||||
|
||||
Args:
|
||||
profile_id: This field is not actually used as the owning profile for a predefined entry is
|
||||
already set to a predefined profile
|
||||
profile_id: This field is not used as the owning profile. For predefined entries it is
|
||||
already set to a predefined profile.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -190,7 +190,7 @@ class IntegrationResource(SyncAPIResource):
|
|||
) -> object:
|
||||
"""
|
||||
This is a no-op as integration entires can't be deleted but is needed for our
|
||||
generated terraform API
|
||||
generated terraform API.
|
||||
|
||||
Args:
|
||||
extra_headers: Send extra headers
|
||||
|
|
@ -299,11 +299,11 @@ class AsyncIntegrationResource(AsyncAPIResource):
|
|||
) -> Optional[IntegrationCreateResponse]:
|
||||
"""
|
||||
Integration entries can't be created, this will update an existing integration
|
||||
entry This is needed for our generated terraform API
|
||||
entry. This is needed for our generated terraform API.
|
||||
|
||||
Args:
|
||||
profile_id: This field is not actually used as the owning profile for a predefined entry is
|
||||
already set to a predefined profile
|
||||
profile_id: This field is not used as the owning profile. For predefined entries it is
|
||||
already set to a predefined profile.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -425,7 +425,7 @@ class AsyncIntegrationResource(AsyncAPIResource):
|
|||
) -> object:
|
||||
"""
|
||||
This is a no-op as integration entires can't be deleted but is needed for our
|
||||
generated terraform API
|
||||
generated terraform API.
|
||||
|
||||
Args:
|
||||
extra_headers: Send extra headers
|
||||
|
|
|
|||
|
|
@ -64,11 +64,11 @@ class PredefinedResource(SyncAPIResource):
|
|||
) -> Optional[PredefinedCreateResponse]:
|
||||
"""
|
||||
Predefined entries can't be created, this will update an existing predefined
|
||||
entry This is needed for our generated terraform API
|
||||
entry. This is needed for our generated terraform API.
|
||||
|
||||
Args:
|
||||
profile_id: This field is not actually used as the owning profile for a predefined entry is
|
||||
already set to a predefined profile
|
||||
profile_id: This field is not used as the owning profile. For predefined entries it is
|
||||
already set to a predefined profile.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -190,7 +190,7 @@ class PredefinedResource(SyncAPIResource):
|
|||
) -> object:
|
||||
"""
|
||||
This is a no-op as predefined entires can't be deleted but is needed for our
|
||||
generated terraform API
|
||||
generated terraform API.
|
||||
|
||||
Args:
|
||||
extra_headers: Send extra headers
|
||||
|
|
@ -299,11 +299,11 @@ class AsyncPredefinedResource(AsyncAPIResource):
|
|||
) -> Optional[PredefinedCreateResponse]:
|
||||
"""
|
||||
Predefined entries can't be created, this will update an existing predefined
|
||||
entry This is needed for our generated terraform API
|
||||
entry. This is needed for our generated terraform API.
|
||||
|
||||
Args:
|
||||
profile_id: This field is not actually used as the owning profile for a predefined entry is
|
||||
already set to a predefined profile
|
||||
profile_id: This field is not used as the owning profile. For predefined entries it is
|
||||
already set to a predefined profile.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -425,7 +425,7 @@ class AsyncPredefinedResource(AsyncAPIResource):
|
|||
) -> object:
|
||||
"""
|
||||
This is a no-op as predefined entires can't be deleted but is needed for our
|
||||
generated terraform API
|
||||
generated terraform API.
|
||||
|
||||
Args:
|
||||
extra_headers: Send extra headers
|
||||
|
|
|
|||
|
|
@ -18,9 +18,11 @@ from ....._response import (
|
|||
)
|
||||
from ....._wrappers import ResultWrapper
|
||||
from ....._base_client import make_request_options
|
||||
from .....types.zero_trust.dlp.profile import Profile
|
||||
from .....types.zero_trust.dlp.profiles import custom_create_params, custom_update_params
|
||||
from .....types.zero_trust.dlp.context_awareness_param import ContextAwarenessParam
|
||||
from .....types.zero_trust.dlp.profiles.custom_get_response import CustomGetResponse
|
||||
from .....types.zero_trust.dlp.profiles.custom_create_response import CustomCreateResponse
|
||||
from .....types.zero_trust.dlp.profiles.custom_update_response import CustomUpdateResponse
|
||||
|
||||
__all__ = ["CustomResource", "AsyncCustomResource"]
|
||||
|
||||
|
|
@ -64,7 +66,7 @@ class CustomResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[Profile]:
|
||||
) -> Optional[CustomCreateResponse]:
|
||||
"""
|
||||
Creates a DLP custom profile.
|
||||
|
||||
|
|
@ -90,7 +92,7 @@ class CustomResource(SyncAPIResource):
|
|||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return cast(
|
||||
Optional[Profile],
|
||||
Optional[CustomCreateResponse],
|
||||
self._post(
|
||||
f"/accounts/{account_id}/dlp/profiles/custom",
|
||||
body=maybe_transform(
|
||||
|
|
@ -112,10 +114,10 @@ class CustomResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Profile]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[CustomCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[Profile]
|
||||
Any, ResultWrapper[CustomCreateResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
),
|
||||
)
|
||||
|
|
@ -140,7 +142,7 @@ class CustomResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[Profile]:
|
||||
) -> Optional[CustomUpdateResponse]:
|
||||
"""
|
||||
Updates a DLP custom profile.
|
||||
|
||||
|
|
@ -168,7 +170,7 @@ class CustomResource(SyncAPIResource):
|
|||
if not profile_id:
|
||||
raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}")
|
||||
return cast(
|
||||
Optional[Profile],
|
||||
Optional[CustomUpdateResponse],
|
||||
self._put(
|
||||
f"/accounts/{account_id}/dlp/profiles/custom/{profile_id}",
|
||||
body=maybe_transform(
|
||||
|
|
@ -190,10 +192,10 @@ class CustomResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Profile]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[CustomUpdateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[Profile]
|
||||
Any, ResultWrapper[CustomUpdateResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
),
|
||||
)
|
||||
|
|
@ -249,7 +251,7 @@ class CustomResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[Profile]:
|
||||
) -> Optional[CustomGetResponse]:
|
||||
"""
|
||||
Fetches a custom DLP profile by id.
|
||||
|
||||
|
|
@ -267,7 +269,7 @@ class CustomResource(SyncAPIResource):
|
|||
if not profile_id:
|
||||
raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}")
|
||||
return cast(
|
||||
Optional[Profile],
|
||||
Optional[CustomGetResponse],
|
||||
self._get(
|
||||
f"/accounts/{account_id}/dlp/profiles/custom/{profile_id}",
|
||||
options=make_request_options(
|
||||
|
|
@ -275,10 +277,10 @@ class CustomResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Profile]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[CustomGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[Profile]
|
||||
Any, ResultWrapper[CustomGetResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
),
|
||||
)
|
||||
|
|
@ -323,7 +325,7 @@ class AsyncCustomResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[Profile]:
|
||||
) -> Optional[CustomCreateResponse]:
|
||||
"""
|
||||
Creates a DLP custom profile.
|
||||
|
||||
|
|
@ -349,7 +351,7 @@ class AsyncCustomResource(AsyncAPIResource):
|
|||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return cast(
|
||||
Optional[Profile],
|
||||
Optional[CustomCreateResponse],
|
||||
await self._post(
|
||||
f"/accounts/{account_id}/dlp/profiles/custom",
|
||||
body=await async_maybe_transform(
|
||||
|
|
@ -371,10 +373,10 @@ class AsyncCustomResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Profile]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[CustomCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[Profile]
|
||||
Any, ResultWrapper[CustomCreateResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
),
|
||||
)
|
||||
|
|
@ -399,7 +401,7 @@ class AsyncCustomResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[Profile]:
|
||||
) -> Optional[CustomUpdateResponse]:
|
||||
"""
|
||||
Updates a DLP custom profile.
|
||||
|
||||
|
|
@ -427,7 +429,7 @@ class AsyncCustomResource(AsyncAPIResource):
|
|||
if not profile_id:
|
||||
raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}")
|
||||
return cast(
|
||||
Optional[Profile],
|
||||
Optional[CustomUpdateResponse],
|
||||
await self._put(
|
||||
f"/accounts/{account_id}/dlp/profiles/custom/{profile_id}",
|
||||
body=await async_maybe_transform(
|
||||
|
|
@ -449,10 +451,10 @@ class AsyncCustomResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Profile]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[CustomUpdateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[Profile]
|
||||
Any, ResultWrapper[CustomUpdateResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
),
|
||||
)
|
||||
|
|
@ -508,7 +510,7 @@ class AsyncCustomResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[Profile]:
|
||||
) -> Optional[CustomGetResponse]:
|
||||
"""
|
||||
Fetches a custom DLP profile by id.
|
||||
|
||||
|
|
@ -526,7 +528,7 @@ class AsyncCustomResource(AsyncAPIResource):
|
|||
if not profile_id:
|
||||
raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}")
|
||||
return cast(
|
||||
Optional[Profile],
|
||||
Optional[CustomGetResponse],
|
||||
await self._get(
|
||||
f"/accounts/{account_id}/dlp/profiles/custom/{profile_id}",
|
||||
options=make_request_options(
|
||||
|
|
@ -534,10 +536,10 @@ class AsyncCustomResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Profile]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[CustomGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[Profile]
|
||||
Any, ResultWrapper[CustomGetResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ from ....._response import (
|
|||
from ....._wrappers import ResultWrapper
|
||||
from ....._base_client import make_request_options
|
||||
from .....types.zero_trust.dlp.profiles import predefined_update_params
|
||||
from .....types.zero_trust.dlp.profiles.predefined_profile import PredefinedProfile
|
||||
from .....types.zero_trust.dlp.profiles.predefined_get_response import PredefinedGetResponse
|
||||
from .....types.zero_trust.dlp.profiles.predefined_update_response import PredefinedUpdateResponse
|
||||
|
||||
__all__ = ["PredefinedResource", "AsyncPredefinedResource"]
|
||||
|
||||
|
|
@ -61,7 +62,7 @@ class PredefinedResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[PredefinedProfile]:
|
||||
) -> Optional[PredefinedUpdateResponse]:
|
||||
"""This is similar to `update_predefined` but only returns entries that are
|
||||
enabled.
|
||||
|
||||
|
|
@ -99,9 +100,9 @@ class PredefinedResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[PredefinedProfile]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[PredefinedUpdateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[PredefinedProfile]], ResultWrapper[PredefinedProfile]),
|
||||
cast_to=cast(Type[Optional[PredefinedUpdateResponse]], ResultWrapper[PredefinedUpdateResponse]),
|
||||
)
|
||||
|
||||
def delete(
|
||||
|
|
@ -118,7 +119,7 @@ class PredefinedResource(SyncAPIResource):
|
|||
) -> object:
|
||||
"""
|
||||
This is a no-op as predefined profiles can't be deleted but is needed for our
|
||||
generated terraform API
|
||||
generated terraform API.
|
||||
|
||||
Args:
|
||||
extra_headers: Send extra headers
|
||||
|
|
@ -156,7 +157,7 @@ class PredefinedResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[PredefinedProfile]:
|
||||
) -> Optional[PredefinedGetResponse]:
|
||||
"""
|
||||
This is similar to `get_predefined` but only returns entries that are enabled.
|
||||
This is needed for our terraform API Fetches a predefined DLP profile by id.
|
||||
|
|
@ -181,9 +182,9 @@ class PredefinedResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[PredefinedProfile]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[PredefinedGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[PredefinedProfile]], ResultWrapper[PredefinedProfile]),
|
||||
cast_to=cast(Type[Optional[PredefinedGetResponse]], ResultWrapper[PredefinedGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -224,7 +225,7 @@ class AsyncPredefinedResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[PredefinedProfile]:
|
||||
) -> Optional[PredefinedUpdateResponse]:
|
||||
"""This is similar to `update_predefined` but only returns entries that are
|
||||
enabled.
|
||||
|
||||
|
|
@ -262,9 +263,9 @@ class AsyncPredefinedResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[PredefinedProfile]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[PredefinedUpdateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[PredefinedProfile]], ResultWrapper[PredefinedProfile]),
|
||||
cast_to=cast(Type[Optional[PredefinedUpdateResponse]], ResultWrapper[PredefinedUpdateResponse]),
|
||||
)
|
||||
|
||||
async def delete(
|
||||
|
|
@ -281,7 +282,7 @@ class AsyncPredefinedResource(AsyncAPIResource):
|
|||
) -> object:
|
||||
"""
|
||||
This is a no-op as predefined profiles can't be deleted but is needed for our
|
||||
generated terraform API
|
||||
generated terraform API.
|
||||
|
||||
Args:
|
||||
extra_headers: Send extra headers
|
||||
|
|
@ -319,7 +320,7 @@ class AsyncPredefinedResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[PredefinedProfile]:
|
||||
) -> Optional[PredefinedGetResponse]:
|
||||
"""
|
||||
This is similar to `get_predefined` but only returns entries that are enabled.
|
||||
This is needed for our terraform API Fetches a predefined DLP profile by id.
|
||||
|
|
@ -344,9 +345,9 @@ class AsyncPredefinedResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[PredefinedProfile]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[PredefinedGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[PredefinedProfile]], ResultWrapper[PredefinedProfile]),
|
||||
cast_to=cast(Type[Optional[PredefinedGetResponse]], ResultWrapper[PredefinedGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ from .....pagination import SyncSinglePage, AsyncSinglePage
|
|||
from ....._base_client import AsyncPaginator, make_request_options
|
||||
from .....types.zero_trust.dlp import profile_list_params
|
||||
from .....types.zero_trust.dlp.profile import Profile
|
||||
from .....types.zero_trust.dlp.profile_get_response import ProfileGetResponse
|
||||
|
||||
__all__ = ["ProfilesResource", "AsyncProfilesResource"]
|
||||
|
||||
|
|
@ -122,7 +123,7 @@ class ProfilesResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[Profile]:
|
||||
) -> Optional[ProfileGetResponse]:
|
||||
"""
|
||||
Fetches a DLP profile by ID.
|
||||
|
||||
|
|
@ -140,7 +141,7 @@ class ProfilesResource(SyncAPIResource):
|
|||
if not profile_id:
|
||||
raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}")
|
||||
return cast(
|
||||
Optional[Profile],
|
||||
Optional[ProfileGetResponse],
|
||||
self._get(
|
||||
f"/accounts/{account_id}/dlp/profiles/{profile_id}",
|
||||
options=make_request_options(
|
||||
|
|
@ -148,10 +149,10 @@ class ProfilesResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Profile]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[ProfileGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[Profile]
|
||||
Any, ResultWrapper[ProfileGetResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
),
|
||||
)
|
||||
|
|
@ -238,7 +239,7 @@ class AsyncProfilesResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> Optional[Profile]:
|
||||
) -> Optional[ProfileGetResponse]:
|
||||
"""
|
||||
Fetches a DLP profile by ID.
|
||||
|
||||
|
|
@ -256,7 +257,7 @@ class AsyncProfilesResource(AsyncAPIResource):
|
|||
if not profile_id:
|
||||
raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}")
|
||||
return cast(
|
||||
Optional[Profile],
|
||||
Optional[ProfileGetResponse],
|
||||
await self._get(
|
||||
f"/accounts/{account_id}/dlp/profiles/{profile_id}",
|
||||
options=make_request_options(
|
||||
|
|
@ -264,10 +265,10 @@ class AsyncProfilesResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Profile]]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[ProfileGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[Profile]
|
||||
Any, ResultWrapper[ProfileGetResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["AbuseReportGetResponse", "MitigationSummary"]
|
||||
__all__ = ["AbuseReportGetResponse", "MitigationSummary", "Submitter"]
|
||||
|
||||
|
||||
class MitigationSummary(BaseModel):
|
||||
|
|
@ -24,6 +25,16 @@ class MitigationSummary(BaseModel):
|
|||
"""How many mitigations are pending their effective date."""
|
||||
|
||||
|
||||
class Submitter(BaseModel):
|
||||
company: Optional[str] = None
|
||||
|
||||
email: Optional[str] = None
|
||||
|
||||
name: Optional[str] = None
|
||||
|
||||
telephone: Optional[str] = None
|
||||
|
||||
|
||||
class AbuseReportGetResponse(BaseModel):
|
||||
id: str
|
||||
"""Public facing ID of abuse report, aka abuse_rand."""
|
||||
|
|
@ -45,3 +56,14 @@ class AbuseReportGetResponse(BaseModel):
|
|||
|
||||
type: Literal["PHISH", "GEN", "THREAT", "DMCA", "EMER", "TM", "REG_WHO", "NCSEI", "NETWORK"]
|
||||
"""The abuse report type"""
|
||||
|
||||
justification: Optional[str] = None
|
||||
"""Justification for the report."""
|
||||
|
||||
original_work: Optional[str] = None
|
||||
"""Original work / Targeted brand in the alleged abuse."""
|
||||
|
||||
submitter: Optional[Submitter] = None
|
||||
"""Information about the submitter of the report."""
|
||||
|
||||
urls: Optional[List[str]] = None
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["AbuseReportListResponse", "Report", "ReportMitigationSummary"]
|
||||
__all__ = ["AbuseReportListResponse", "Report", "ReportMitigationSummary", "ReportSubmitter"]
|
||||
|
||||
|
||||
class ReportMitigationSummary(BaseModel):
|
||||
|
|
@ -25,6 +25,16 @@ class ReportMitigationSummary(BaseModel):
|
|||
"""How many mitigations are pending their effective date."""
|
||||
|
||||
|
||||
class ReportSubmitter(BaseModel):
|
||||
company: Optional[str] = None
|
||||
|
||||
email: Optional[str] = None
|
||||
|
||||
name: Optional[str] = None
|
||||
|
||||
telephone: Optional[str] = None
|
||||
|
||||
|
||||
class Report(BaseModel):
|
||||
id: str
|
||||
"""Public facing ID of abuse report, aka abuse_rand."""
|
||||
|
|
@ -47,6 +57,17 @@ class Report(BaseModel):
|
|||
type: Literal["PHISH", "GEN", "THREAT", "DMCA", "EMER", "TM", "REG_WHO", "NCSEI", "NETWORK"]
|
||||
"""The abuse report type"""
|
||||
|
||||
justification: Optional[str] = None
|
||||
"""Justification for the report."""
|
||||
|
||||
original_work: Optional[str] = None
|
||||
"""Original work / Targeted brand in the alleged abuse."""
|
||||
|
||||
submitter: Optional[ReportSubmitter] = None
|
||||
"""Information about the submitter of the report."""
|
||||
|
||||
urls: Optional[List[str]] = None
|
||||
|
||||
|
||||
class AbuseReportListResponse(BaseModel):
|
||||
reports: List[Report]
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ from ...._utils import PropertyInfo
|
|||
|
||||
__all__ = [
|
||||
"AuditListParams",
|
||||
"ID",
|
||||
"AccountName",
|
||||
"ActionResult",
|
||||
"ActionType",
|
||||
|
|
@ -21,7 +22,6 @@ __all__ = [
|
|||
"ActorTokenID",
|
||||
"ActorTokenName",
|
||||
"ActorType",
|
||||
"AuditLogID",
|
||||
"RawCfRayID",
|
||||
"RawMethod",
|
||||
"RawStatusCode",
|
||||
|
|
@ -53,6 +53,8 @@ class AuditListParams(TypedDict, total=False):
|
|||
timestamp that conforms to RFC3339.
|
||||
"""
|
||||
|
||||
id: ID
|
||||
|
||||
account_name: AccountName
|
||||
|
||||
action_result: ActionResult
|
||||
|
|
@ -73,8 +75,6 @@ class AuditListParams(TypedDict, total=False):
|
|||
|
||||
actor_type: ActorType
|
||||
|
||||
audit_log_id: AuditLogID
|
||||
|
||||
cursor: str
|
||||
"""The cursor is an opaque token used to paginate through large sets of records.
|
||||
|
||||
|
|
@ -114,6 +114,19 @@ class AuditListParams(TypedDict, total=False):
|
|||
zone_name: ZoneName
|
||||
|
||||
|
||||
_IDReservedKeywords = TypedDict(
|
||||
"_IDReservedKeywords",
|
||||
{
|
||||
"not": SequenceNotStr[str],
|
||||
},
|
||||
total=False,
|
||||
)
|
||||
|
||||
|
||||
class ID(_IDReservedKeywords, total=False):
|
||||
pass
|
||||
|
||||
|
||||
_AccountNameReservedKeywords = TypedDict(
|
||||
"_AccountNameReservedKeywords",
|
||||
{
|
||||
|
|
@ -244,19 +257,6 @@ class ActorType(_ActorTypeReservedKeywords, total=False):
|
|||
pass
|
||||
|
||||
|
||||
_AuditLogIDReservedKeywords = TypedDict(
|
||||
"_AuditLogIDReservedKeywords",
|
||||
{
|
||||
"not": SequenceNotStr[str],
|
||||
},
|
||||
total=False,
|
||||
)
|
||||
|
||||
|
||||
class AuditLogID(_AuditLogIDReservedKeywords, total=False):
|
||||
pass
|
||||
|
||||
|
||||
_RawCfRayIDReservedKeywords = TypedDict(
|
||||
"_RawCfRayIDReservedKeywords",
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from typing_extensions import Required, Annotated, TypedDict
|
|||
from ..._types import SequenceNotStr
|
||||
from ..._utils import PropertyInfo
|
||||
|
||||
__all__ = ["ThreatEventBulkCreateParams", "Data", "DataRaw"]
|
||||
__all__ = ["ThreatEventBulkCreateParams", "Data", "DataRaw", "DataIndicator"]
|
||||
|
||||
|
||||
class ThreatEventBulkCreateParams(TypedDict, total=False):
|
||||
|
|
@ -29,6 +29,14 @@ class DataRaw(TypedDict, total=False):
|
|||
tlp: str
|
||||
|
||||
|
||||
class DataIndicator(TypedDict, total=False):
|
||||
indicator_type: Required[Annotated[str, PropertyInfo(alias="indicatorType")]]
|
||||
"""The type of indicator (e.g., DOMAIN, IP, JA3, HASH)"""
|
||||
|
||||
value: Required[str]
|
||||
"""The indicator value (e.g., domain name, IP address, hash)"""
|
||||
|
||||
|
||||
class Data(TypedDict, total=False):
|
||||
category: Required[str]
|
||||
|
||||
|
|
@ -36,8 +44,6 @@ class Data(TypedDict, total=False):
|
|||
|
||||
event: Required[str]
|
||||
|
||||
indicator_type: Required[Annotated[str, PropertyInfo(alias="indicatorType")]]
|
||||
|
||||
raw: Required[DataRaw]
|
||||
|
||||
tlp: Required[str]
|
||||
|
|
@ -52,6 +58,14 @@ class Data(TypedDict, total=False):
|
|||
|
||||
indicator: str
|
||||
|
||||
indicators: Iterable[DataIndicator]
|
||||
"""Array of indicators for this event.
|
||||
|
||||
Supports multiple indicators per event for complex scenarios.
|
||||
"""
|
||||
|
||||
indicator_type: Annotated[str, PropertyInfo(alias="indicatorType")]
|
||||
|
||||
insight: str
|
||||
|
||||
tags: SequenceNotStr[str]
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Dict, Union, Optional
|
||||
from typing import Dict, Union, Iterable, Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Required, Annotated, TypedDict
|
||||
|
||||
from ..._types import SequenceNotStr
|
||||
from ..._utils import PropertyInfo
|
||||
|
||||
__all__ = ["ThreatEventCreateParams", "Raw"]
|
||||
__all__ = ["ThreatEventCreateParams", "Raw", "Indicator"]
|
||||
|
||||
|
||||
class ThreatEventCreateParams(TypedDict, total=False):
|
||||
|
|
@ -22,8 +22,6 @@ class ThreatEventCreateParams(TypedDict, total=False):
|
|||
|
||||
event: Required[str]
|
||||
|
||||
indicator_type: Required[Annotated[str, PropertyInfo(alias="indicatorType")]]
|
||||
|
||||
raw: Required[Raw]
|
||||
|
||||
tlp: Required[str]
|
||||
|
|
@ -38,6 +36,14 @@ class ThreatEventCreateParams(TypedDict, total=False):
|
|||
|
||||
indicator: str
|
||||
|
||||
indicators: Iterable[Indicator]
|
||||
"""Array of indicators for this event.
|
||||
|
||||
Supports multiple indicators per event for complex scenarios.
|
||||
"""
|
||||
|
||||
indicator_type: Annotated[str, PropertyInfo(alias="indicatorType")]
|
||||
|
||||
insight: str
|
||||
|
||||
tags: SequenceNotStr[str]
|
||||
|
|
@ -53,3 +59,11 @@ class Raw(TypedDict, total=False):
|
|||
source: str
|
||||
|
||||
tlp: str
|
||||
|
||||
|
||||
class Indicator(TypedDict, total=False):
|
||||
indicator_type: Required[Annotated[str, PropertyInfo(alias="indicatorType")]]
|
||||
"""The type of indicator (e.g., DOMAIN, IP, JA3, HASH)"""
|
||||
|
||||
value: Required[str]
|
||||
"""The indicator value (e.g., domain name, IP address, hash)"""
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ class ThreatEventCreateResponse(BaseModel):
|
|||
|
||||
event: str
|
||||
|
||||
has_children: bool = FieldInfo(alias="hasChildren")
|
||||
|
||||
indicator: str
|
||||
|
||||
indicator_type: str = FieldInfo(alias="indicatorType")
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ class ThreatEventEditResponse(BaseModel):
|
|||
|
||||
event: str
|
||||
|
||||
has_children: bool = FieldInfo(alias="hasChildren")
|
||||
|
||||
indicator: str
|
||||
|
||||
indicator_type: str = FieldInfo(alias="indicatorType")
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ class ThreatEventGetResponse(BaseModel):
|
|||
|
||||
event: str
|
||||
|
||||
has_children: bool = FieldInfo(alias="hasChildren")
|
||||
|
||||
indicator: str
|
||||
|
||||
indicator_type: str = FieldInfo(alias="indicatorType")
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ class ThreatEventListResponseItem(BaseModel):
|
|||
|
||||
event: str
|
||||
|
||||
has_children: bool = FieldInfo(alias="hasChildren")
|
||||
|
||||
indicator: str
|
||||
|
||||
indicator_type: str = FieldInfo(alias="indicatorType")
|
||||
|
|
|
|||
|
|
@ -1,9 +1,3 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .submission_list_params import SubmissionListParams as SubmissionListParams
|
||||
from .investigate_list_params import InvestigateListParams as InvestigateListParams
|
||||
from .investigate_get_response import InvestigateGetResponse as InvestigateGetResponse
|
||||
from .submission_list_response import SubmissionListResponse as SubmissionListResponse
|
||||
from .investigate_list_response import InvestigateListResponse as InvestigateListResponse
|
||||
|
|
|
|||
|
|
@ -1,17 +1,3 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .move_bulk_params import MoveBulkParams as MoveBulkParams
|
||||
from .raw_get_response import RawGetResponse as RawGetResponse
|
||||
from .move_bulk_response import MoveBulkResponse as MoveBulkResponse
|
||||
from .move_create_params import MoveCreateParams as MoveCreateParams
|
||||
from .trace_get_response import TraceGetResponse as TraceGetResponse
|
||||
from .release_bulk_params import ReleaseBulkParams as ReleaseBulkParams
|
||||
from .move_create_response import MoveCreateResponse as MoveCreateResponse
|
||||
from .preview_get_response import PreviewGetResponse as PreviewGetResponse
|
||||
from .preview_create_params import PreviewCreateParams as PreviewCreateParams
|
||||
from .release_bulk_response import ReleaseBulkResponse as ReleaseBulkResponse
|
||||
from .detection_get_response import DetectionGetResponse as DetectionGetResponse
|
||||
from .preview_create_response import PreviewCreateResponse as PreviewCreateResponse
|
||||
from .reclassify_create_params import ReclassifyCreateParams as ReclassifyCreateParams
|
||||
|
|
|
|||
|
|
@ -1,108 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["DetectionGetResponse", "Attachment", "Header", "Link", "SenderInfo", "ThreatCategory", "Validation"]
|
||||
|
||||
|
||||
class Attachment(BaseModel):
|
||||
size: int
|
||||
|
||||
content_type: Optional[str] = None
|
||||
|
||||
detection: Optional[
|
||||
Literal[
|
||||
"MALICIOUS",
|
||||
"MALICIOUS-BEC",
|
||||
"SUSPICIOUS",
|
||||
"SPOOF",
|
||||
"SPAM",
|
||||
"BULK",
|
||||
"ENCRYPTED",
|
||||
"EXTERNAL",
|
||||
"UNKNOWN",
|
||||
"NONE",
|
||||
]
|
||||
] = None
|
||||
|
||||
encrypted: Optional[bool] = None
|
||||
|
||||
name: Optional[str] = None
|
||||
|
||||
|
||||
class Header(BaseModel):
|
||||
name: str
|
||||
|
||||
value: str
|
||||
|
||||
|
||||
class Link(BaseModel):
|
||||
href: str
|
||||
|
||||
text: Optional[str] = None
|
||||
|
||||
|
||||
class SenderInfo(BaseModel):
|
||||
as_name: Optional[str] = None
|
||||
"""The name of the autonomous system."""
|
||||
|
||||
as_number: Optional[int] = None
|
||||
"""The number of the autonomous system."""
|
||||
|
||||
geo: Optional[str] = None
|
||||
|
||||
ip: Optional[str] = None
|
||||
|
||||
pld: Optional[str] = None
|
||||
|
||||
|
||||
class ThreatCategory(BaseModel):
|
||||
id: int
|
||||
|
||||
description: Optional[str] = None
|
||||
|
||||
name: Optional[str] = None
|
||||
|
||||
|
||||
class Validation(BaseModel):
|
||||
comment: Optional[str] = None
|
||||
|
||||
dkim: Optional[Literal["pass", "neutral", "fail", "error", "none"]] = None
|
||||
|
||||
dmarc: Optional[Literal["pass", "neutral", "fail", "error", "none"]] = None
|
||||
|
||||
spf: Optional[Literal["pass", "neutral", "fail", "error", "none"]] = None
|
||||
|
||||
|
||||
class DetectionGetResponse(BaseModel):
|
||||
action: str
|
||||
|
||||
attachments: List[Attachment]
|
||||
|
||||
headers: List[Header]
|
||||
|
||||
links: List[Link]
|
||||
|
||||
sender_info: SenderInfo
|
||||
|
||||
threat_categories: List[ThreatCategory]
|
||||
|
||||
validation: Validation
|
||||
|
||||
final_disposition: Optional[
|
||||
Literal[
|
||||
"MALICIOUS",
|
||||
"MALICIOUS-BEC",
|
||||
"SUSPICIOUS",
|
||||
"SPOOF",
|
||||
"SPAM",
|
||||
"BULK",
|
||||
"ENCRYPTED",
|
||||
"EXTERNAL",
|
||||
"UNKNOWN",
|
||||
"NONE",
|
||||
]
|
||||
] = None
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
from ...._types import SequenceNotStr
|
||||
|
||||
__all__ = ["MoveBulkParams"]
|
||||
|
||||
|
||||
class MoveBulkParams(TypedDict, total=False):
|
||||
account_id: Required[str]
|
||||
"""Account Identifier"""
|
||||
|
||||
destination: Required[
|
||||
Literal["Inbox", "JunkEmail", "DeletedItems", "RecoverableItemsDeletions", "RecoverableItemsPurges"]
|
||||
]
|
||||
|
||||
postfix_ids: Required[SequenceNotStr[str]]
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["MoveBulkResponse"]
|
||||
|
||||
|
||||
class MoveBulkResponse(BaseModel):
|
||||
completed_timestamp: datetime
|
||||
|
||||
item_count: int
|
||||
|
||||
destination: Optional[str] = None
|
||||
|
||||
message_id: Optional[str] = None
|
||||
|
||||
operation: Optional[str] = None
|
||||
|
||||
recipient: Optional[str] = None
|
||||
|
||||
status: Optional[str] = None
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["MoveCreateParams"]
|
||||
|
||||
|
||||
class MoveCreateParams(TypedDict, total=False):
|
||||
account_id: Required[str]
|
||||
"""Account Identifier"""
|
||||
|
||||
destination: Required[
|
||||
Literal["Inbox", "JunkEmail", "DeletedItems", "RecoverableItemsDeletions", "RecoverableItemsPurges"]
|
||||
]
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["MoveCreateResponse"]
|
||||
|
||||
|
||||
class MoveCreateResponse(BaseModel):
|
||||
completed_timestamp: datetime
|
||||
|
||||
item_count: int
|
||||
|
||||
destination: Optional[str] = None
|
||||
|
||||
message_id: Optional[str] = None
|
||||
|
||||
operation: Optional[str] = None
|
||||
|
||||
recipient: Optional[str] = None
|
||||
|
||||
status: Optional[str] = None
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
__all__ = ["PreviewCreateParams"]
|
||||
|
||||
|
||||
class PreviewCreateParams(TypedDict, total=False):
|
||||
account_id: Required[str]
|
||||
"""Account Identifier"""
|
||||
|
||||
postfix_id: Required[str]
|
||||
"""The identifier of the message."""
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["PreviewCreateResponse"]
|
||||
|
||||
|
||||
class PreviewCreateResponse(BaseModel):
|
||||
screenshot: str
|
||||
"""A base64 encoded PNG image of the email."""
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["PreviewGetResponse"]
|
||||
|
||||
|
||||
class PreviewGetResponse(BaseModel):
|
||||
screenshot: str
|
||||
"""A base64 encoded PNG image of the email."""
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["RawGetResponse"]
|
||||
|
||||
|
||||
class RawGetResponse(BaseModel):
|
||||
raw: str
|
||||
"""A UTF-8 encoded eml file of the email."""
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["ReclassifyCreateParams"]
|
||||
|
||||
|
||||
class ReclassifyCreateParams(TypedDict, total=False):
|
||||
account_id: Required[str]
|
||||
"""Account Identifier"""
|
||||
|
||||
expected_disposition: Required[Literal["NONE", "BULK", "MALICIOUS", "SPAM", "SPOOF", "SUSPICIOUS"]]
|
||||
|
||||
eml_content: str
|
||||
"""Base64 encoded content of the EML file"""
|
||||
|
||||
escalated_submission_id: str
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
from ...._types import SequenceNotStr
|
||||
|
||||
__all__ = ["ReleaseBulkParams"]
|
||||
|
||||
|
||||
class ReleaseBulkParams(TypedDict, total=False):
|
||||
account_id: Required[str]
|
||||
"""Account Identifier"""
|
||||
|
||||
body: Required[SequenceNotStr[str]]
|
||||
"""A list of messages identfied by their `postfix_id`s that should be released."""
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["ReleaseBulkResponse"]
|
||||
|
||||
|
||||
class ReleaseBulkResponse(BaseModel):
|
||||
postfix_id: str
|
||||
"""The identifier of the message."""
|
||||
|
||||
delivered: Optional[List[str]] = None
|
||||
|
||||
failed: Optional[List[str]] = None
|
||||
|
||||
undelivered: Optional[List[str]] = None
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
from datetime import datetime
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["TraceGetResponse", "Inbound", "InboundLine", "Outbound", "OutboundLine"]
|
||||
|
||||
|
||||
class InboundLine(BaseModel):
|
||||
lineno: int
|
||||
|
||||
message: str
|
||||
|
||||
ts: datetime
|
||||
|
||||
|
||||
class Inbound(BaseModel):
|
||||
lines: Optional[List[InboundLine]] = None
|
||||
|
||||
pending: Optional[bool] = None
|
||||
|
||||
|
||||
class OutboundLine(BaseModel):
|
||||
lineno: int
|
||||
|
||||
message: str
|
||||
|
||||
ts: datetime
|
||||
|
||||
|
||||
class Outbound(BaseModel):
|
||||
lines: Optional[List[OutboundLine]] = None
|
||||
|
||||
pending: Optional[bool] = None
|
||||
|
||||
|
||||
class TraceGetResponse(BaseModel):
|
||||
inbound: Inbound
|
||||
|
||||
outbound: Outbound
|
||||
|
|
@ -1,165 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Literal
|
||||
|
||||
from pydantic import Field as FieldInfo
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["InvestigateGetResponse", "Properties", "Finding", "Validation"]
|
||||
|
||||
|
||||
class Properties(BaseModel):
|
||||
allowlisted_pattern: Optional[str] = None
|
||||
|
||||
allowlisted_pattern_type: Optional[
|
||||
Literal[
|
||||
"quarantine_release",
|
||||
"acceptable_sender",
|
||||
"allowed_sender",
|
||||
"allowed_recipient",
|
||||
"domain_similarity",
|
||||
"domain_recency",
|
||||
"managed_acceptable_sender",
|
||||
"outbound_ndr",
|
||||
]
|
||||
] = None
|
||||
|
||||
blocklisted_message: Optional[bool] = None
|
||||
|
||||
blocklisted_pattern: Optional[str] = None
|
||||
|
||||
whitelisted_pattern_type: Optional[
|
||||
Literal[
|
||||
"quarantine_release",
|
||||
"acceptable_sender",
|
||||
"allowed_sender",
|
||||
"allowed_recipient",
|
||||
"domain_similarity",
|
||||
"domain_recency",
|
||||
"managed_acceptable_sender",
|
||||
"outbound_ndr",
|
||||
]
|
||||
] = None
|
||||
|
||||
|
||||
class Finding(BaseModel):
|
||||
attachment: Optional[str] = None
|
||||
|
||||
detail: Optional[str] = None
|
||||
|
||||
detection: Optional[
|
||||
Literal[
|
||||
"MALICIOUS",
|
||||
"MALICIOUS-BEC",
|
||||
"SUSPICIOUS",
|
||||
"SPOOF",
|
||||
"SPAM",
|
||||
"BULK",
|
||||
"ENCRYPTED",
|
||||
"EXTERNAL",
|
||||
"UNKNOWN",
|
||||
"NONE",
|
||||
]
|
||||
] = None
|
||||
|
||||
field: Optional[str] = None
|
||||
|
||||
name: Optional[str] = None
|
||||
|
||||
portion: Optional[str] = None
|
||||
|
||||
reason: Optional[str] = None
|
||||
|
||||
score: Optional[float] = None
|
||||
|
||||
value: Optional[str] = None
|
||||
|
||||
|
||||
class Validation(BaseModel):
|
||||
comment: Optional[str] = None
|
||||
|
||||
dkim: Optional[Literal["pass", "neutral", "fail", "error", "none"]] = None
|
||||
|
||||
dmarc: Optional[Literal["pass", "neutral", "fail", "error", "none"]] = None
|
||||
|
||||
spf: Optional[Literal["pass", "neutral", "fail", "error", "none"]] = None
|
||||
|
||||
|
||||
class InvestigateGetResponse(BaseModel):
|
||||
id: str
|
||||
|
||||
action_log: object
|
||||
|
||||
client_recipients: List[str]
|
||||
|
||||
detection_reasons: List[str]
|
||||
|
||||
is_phish_submission: bool
|
||||
|
||||
is_quarantined: bool
|
||||
|
||||
postfix_id: str
|
||||
"""The identifier of the message."""
|
||||
|
||||
properties: Properties
|
||||
|
||||
ts: str
|
||||
|
||||
alert_id: Optional[str] = None
|
||||
|
||||
delivery_mode: Optional[
|
||||
Literal[
|
||||
"DIRECT",
|
||||
"BCC",
|
||||
"JOURNAL",
|
||||
"REVIEW_SUBMISSION",
|
||||
"DMARC_UNVERIFIED",
|
||||
"DMARC_FAILURE_REPORT",
|
||||
"DMARC_AGGREGATE_REPORT",
|
||||
"THREAT_INTEL_SUBMISSION",
|
||||
"SIMULATION_SUBMISSION",
|
||||
"API",
|
||||
"RETRO_SCAN",
|
||||
]
|
||||
] = None
|
||||
|
||||
edf_hash: Optional[str] = None
|
||||
|
||||
final_disposition: Optional[
|
||||
Literal[
|
||||
"MALICIOUS",
|
||||
"MALICIOUS-BEC",
|
||||
"SUSPICIOUS",
|
||||
"SPOOF",
|
||||
"SPAM",
|
||||
"BULK",
|
||||
"ENCRYPTED",
|
||||
"EXTERNAL",
|
||||
"UNKNOWN",
|
||||
"NONE",
|
||||
]
|
||||
] = None
|
||||
|
||||
findings: Optional[List[Finding]] = None
|
||||
|
||||
from_: Optional[str] = FieldInfo(alias="from", default=None)
|
||||
|
||||
from_name: Optional[str] = None
|
||||
|
||||
htmltext_structure_hash: Optional[str] = None
|
||||
|
||||
message_id: Optional[str] = None
|
||||
|
||||
sent_date: Optional[str] = None
|
||||
|
||||
subject: Optional[str] = None
|
||||
|
||||
threat_categories: Optional[List[str]] = None
|
||||
|
||||
to: Optional[List[str]] = None
|
||||
|
||||
to_name: Optional[List[str]] = None
|
||||
|
||||
validation: Optional[Validation] = None
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Union, Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal, Required, Annotated, TypedDict
|
||||
|
||||
from ..._utils import PropertyInfo
|
||||
|
||||
__all__ = ["InvestigateListParams"]
|
||||
|
||||
|
||||
class InvestigateListParams(TypedDict, total=False):
|
||||
account_id: Required[str]
|
||||
"""Account Identifier"""
|
||||
|
||||
action_log: bool
|
||||
"""Determines if the message action log is included in the response."""
|
||||
|
||||
alert_id: str
|
||||
|
||||
cursor: str
|
||||
|
||||
detections_only: bool
|
||||
"""Determines if the search results will include detections or not."""
|
||||
|
||||
domain: str
|
||||
"""The sender domains the search filters by."""
|
||||
|
||||
end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
|
||||
"""The end of the search date range. Defaults to `now`."""
|
||||
|
||||
final_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"]
|
||||
"""The dispositions the search filters by."""
|
||||
|
||||
message_action: Literal["PREVIEW", "QUARANTINE_RELEASED", "MOVED"]
|
||||
"""The message actions the search filters by."""
|
||||
|
||||
message_id: str
|
||||
|
||||
metric: str
|
||||
|
||||
page: Optional[int]
|
||||
"""Deprecated: Use cursor pagination instead."""
|
||||
|
||||
per_page: int
|
||||
"""The number of results per page."""
|
||||
|
||||
query: str
|
||||
"""The space-delimited term used in the query. The search is case-insensitive.
|
||||
|
||||
The content of the following email metadata fields are searched:
|
||||
|
||||
- alert_id
|
||||
- CC
|
||||
- From (envelope_from)
|
||||
- From Name
|
||||
- final_disposition
|
||||
- md5 hash (of any attachment)
|
||||
- sha1 hash (of any attachment)
|
||||
- sha256 hash (of any attachment)
|
||||
- name (of any attachment)
|
||||
- Reason
|
||||
- Received DateTime (yyyy-mm-ddThh:mm:ss)
|
||||
- Sent DateTime (yyyy-mm-ddThh:mm:ss)
|
||||
- ReplyTo
|
||||
- To (envelope_to)
|
||||
- To Name
|
||||
- Message-ID
|
||||
- smtp_helo_server_ip
|
||||
- smtp_previous_hop_ip
|
||||
- x_originating_ip
|
||||
- Subject
|
||||
"""
|
||||
|
||||
recipient: str
|
||||
|
||||
sender: str
|
||||
|
||||
start: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
|
||||
"""The beginning of the search date range. Defaults to `now - 30 days`."""
|
||||
|
||||
subject: str
|
||||
|
|
@ -1,165 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Literal
|
||||
|
||||
from pydantic import Field as FieldInfo
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["InvestigateListResponse", "Properties", "Finding", "Validation"]
|
||||
|
||||
|
||||
class Properties(BaseModel):
|
||||
allowlisted_pattern: Optional[str] = None
|
||||
|
||||
allowlisted_pattern_type: Optional[
|
||||
Literal[
|
||||
"quarantine_release",
|
||||
"acceptable_sender",
|
||||
"allowed_sender",
|
||||
"allowed_recipient",
|
||||
"domain_similarity",
|
||||
"domain_recency",
|
||||
"managed_acceptable_sender",
|
||||
"outbound_ndr",
|
||||
]
|
||||
] = None
|
||||
|
||||
blocklisted_message: Optional[bool] = None
|
||||
|
||||
blocklisted_pattern: Optional[str] = None
|
||||
|
||||
whitelisted_pattern_type: Optional[
|
||||
Literal[
|
||||
"quarantine_release",
|
||||
"acceptable_sender",
|
||||
"allowed_sender",
|
||||
"allowed_recipient",
|
||||
"domain_similarity",
|
||||
"domain_recency",
|
||||
"managed_acceptable_sender",
|
||||
"outbound_ndr",
|
||||
]
|
||||
] = None
|
||||
|
||||
|
||||
class Finding(BaseModel):
|
||||
attachment: Optional[str] = None
|
||||
|
||||
detail: Optional[str] = None
|
||||
|
||||
detection: Optional[
|
||||
Literal[
|
||||
"MALICIOUS",
|
||||
"MALICIOUS-BEC",
|
||||
"SUSPICIOUS",
|
||||
"SPOOF",
|
||||
"SPAM",
|
||||
"BULK",
|
||||
"ENCRYPTED",
|
||||
"EXTERNAL",
|
||||
"UNKNOWN",
|
||||
"NONE",
|
||||
]
|
||||
] = None
|
||||
|
||||
field: Optional[str] = None
|
||||
|
||||
name: Optional[str] = None
|
||||
|
||||
portion: Optional[str] = None
|
||||
|
||||
reason: Optional[str] = None
|
||||
|
||||
score: Optional[float] = None
|
||||
|
||||
value: Optional[str] = None
|
||||
|
||||
|
||||
class Validation(BaseModel):
|
||||
comment: Optional[str] = None
|
||||
|
||||
dkim: Optional[Literal["pass", "neutral", "fail", "error", "none"]] = None
|
||||
|
||||
dmarc: Optional[Literal["pass", "neutral", "fail", "error", "none"]] = None
|
||||
|
||||
spf: Optional[Literal["pass", "neutral", "fail", "error", "none"]] = None
|
||||
|
||||
|
||||
class InvestigateListResponse(BaseModel):
|
||||
id: str
|
||||
|
||||
action_log: object
|
||||
|
||||
client_recipients: List[str]
|
||||
|
||||
detection_reasons: List[str]
|
||||
|
||||
is_phish_submission: bool
|
||||
|
||||
is_quarantined: bool
|
||||
|
||||
postfix_id: str
|
||||
"""The identifier of the message."""
|
||||
|
||||
properties: Properties
|
||||
|
||||
ts: str
|
||||
|
||||
alert_id: Optional[str] = None
|
||||
|
||||
delivery_mode: Optional[
|
||||
Literal[
|
||||
"DIRECT",
|
||||
"BCC",
|
||||
"JOURNAL",
|
||||
"REVIEW_SUBMISSION",
|
||||
"DMARC_UNVERIFIED",
|
||||
"DMARC_FAILURE_REPORT",
|
||||
"DMARC_AGGREGATE_REPORT",
|
||||
"THREAT_INTEL_SUBMISSION",
|
||||
"SIMULATION_SUBMISSION",
|
||||
"API",
|
||||
"RETRO_SCAN",
|
||||
]
|
||||
] = None
|
||||
|
||||
edf_hash: Optional[str] = None
|
||||
|
||||
final_disposition: Optional[
|
||||
Literal[
|
||||
"MALICIOUS",
|
||||
"MALICIOUS-BEC",
|
||||
"SUSPICIOUS",
|
||||
"SPOOF",
|
||||
"SPAM",
|
||||
"BULK",
|
||||
"ENCRYPTED",
|
||||
"EXTERNAL",
|
||||
"UNKNOWN",
|
||||
"NONE",
|
||||
]
|
||||
] = None
|
||||
|
||||
findings: Optional[List[Finding]] = None
|
||||
|
||||
from_: Optional[str] = FieldInfo(alias="from", default=None)
|
||||
|
||||
from_name: Optional[str] = None
|
||||
|
||||
htmltext_structure_hash: Optional[str] = None
|
||||
|
||||
message_id: Optional[str] = None
|
||||
|
||||
sent_date: Optional[str] = None
|
||||
|
||||
subject: Optional[str] = None
|
||||
|
||||
threat_categories: Optional[List[str]] = None
|
||||
|
||||
to: Optional[List[str]] = None
|
||||
|
||||
to_name: Optional[List[str]] = None
|
||||
|
||||
validation: Optional[Validation] = None
|
||||
|
|
@ -1,47 +1,3 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .domain_edit_params import DomainEditParams as DomainEditParams
|
||||
from .domain_list_params import DomainListParams as DomainListParams
|
||||
from .domain_get_response import DomainGetResponse as DomainGetResponse
|
||||
from .domain_edit_response import DomainEditResponse as DomainEditResponse
|
||||
from .domain_list_response import DomainListResponse as DomainListResponse
|
||||
from .domain_delete_response import DomainDeleteResponse as DomainDeleteResponse
|
||||
from .allow_policy_edit_params import AllowPolicyEditParams as AllowPolicyEditParams
|
||||
from .allow_policy_list_params import AllowPolicyListParams as AllowPolicyListParams
|
||||
from .block_sender_edit_params import BlockSenderEditParams as BlockSenderEditParams
|
||||
from .block_sender_list_params import BlockSenderListParams as BlockSenderListParams
|
||||
from .allow_policy_get_response import AllowPolicyGetResponse as AllowPolicyGetResponse
|
||||
from .block_sender_get_response import BlockSenderGetResponse as BlockSenderGetResponse
|
||||
from .allow_policy_create_params import AllowPolicyCreateParams as AllowPolicyCreateParams
|
||||
from .allow_policy_edit_response import AllowPolicyEditResponse as AllowPolicyEditResponse
|
||||
from .allow_policy_list_response import AllowPolicyListResponse as AllowPolicyListResponse
|
||||
from .block_sender_create_params import BlockSenderCreateParams as BlockSenderCreateParams
|
||||
from .block_sender_edit_response import BlockSenderEditResponse as BlockSenderEditResponse
|
||||
from .block_sender_list_response import BlockSenderListResponse as BlockSenderListResponse
|
||||
from .trusted_domain_edit_params import TrustedDomainEditParams as TrustedDomainEditParams
|
||||
from .trusted_domain_list_params import TrustedDomainListParams as TrustedDomainListParams
|
||||
from .domain_bulk_delete_response import DomainBulkDeleteResponse as DomainBulkDeleteResponse
|
||||
from .trusted_domain_get_response import TrustedDomainGetResponse as TrustedDomainGetResponse
|
||||
from .allow_policy_create_response import AllowPolicyCreateResponse as AllowPolicyCreateResponse
|
||||
from .allow_policy_delete_response import AllowPolicyDeleteResponse as AllowPolicyDeleteResponse
|
||||
from .block_sender_create_response import BlockSenderCreateResponse as BlockSenderCreateResponse
|
||||
from .block_sender_delete_response import BlockSenderDeleteResponse as BlockSenderDeleteResponse
|
||||
from .trusted_domain_create_params import TrustedDomainCreateParams as TrustedDomainCreateParams
|
||||
from .trusted_domain_edit_response import TrustedDomainEditResponse as TrustedDomainEditResponse
|
||||
from .trusted_domain_list_response import TrustedDomainListResponse as TrustedDomainListResponse
|
||||
from .trusted_domain_create_response import TrustedDomainCreateResponse as TrustedDomainCreateResponse
|
||||
from .trusted_domain_delete_response import TrustedDomainDeleteResponse as TrustedDomainDeleteResponse
|
||||
from .impersonation_registry_edit_params import ImpersonationRegistryEditParams as ImpersonationRegistryEditParams
|
||||
from .impersonation_registry_list_params import ImpersonationRegistryListParams as ImpersonationRegistryListParams
|
||||
from .impersonation_registry_get_response import ImpersonationRegistryGetResponse as ImpersonationRegistryGetResponse
|
||||
from .impersonation_registry_create_params import ImpersonationRegistryCreateParams as ImpersonationRegistryCreateParams
|
||||
from .impersonation_registry_edit_response import ImpersonationRegistryEditResponse as ImpersonationRegistryEditResponse
|
||||
from .impersonation_registry_list_response import ImpersonationRegistryListResponse as ImpersonationRegistryListResponse
|
||||
from .impersonation_registry_create_response import (
|
||||
ImpersonationRegistryCreateResponse as ImpersonationRegistryCreateResponse,
|
||||
)
|
||||
from .impersonation_registry_delete_response import (
|
||||
ImpersonationRegistryDeleteResponse as ImpersonationRegistryDeleteResponse,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,46 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["AllowPolicyCreateParams"]
|
||||
|
||||
|
||||
class AllowPolicyCreateParams(TypedDict, total=False):
|
||||
account_id: Required[str]
|
||||
"""Account Identifier"""
|
||||
|
||||
is_acceptable_sender: Required[bool]
|
||||
"""
|
||||
Messages from this sender will be exempted from Spam, Spoof and Bulk
|
||||
dispositions. Note: This will not exempt messages with Malicious or Suspicious
|
||||
dispositions.
|
||||
"""
|
||||
|
||||
is_exempt_recipient: Required[bool]
|
||||
"""Messages to this recipient will bypass all detections."""
|
||||
|
||||
is_regex: Required[bool]
|
||||
|
||||
is_trusted_sender: Required[bool]
|
||||
"""Messages from this sender will bypass all detections and link following."""
|
||||
|
||||
pattern: Required[str]
|
||||
|
||||
pattern_type: Required[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]]
|
||||
|
||||
verify_sender: Required[bool]
|
||||
"""
|
||||
Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
|
||||
policies that pass authentication.
|
||||
"""
|
||||
|
||||
comments: Optional[str]
|
||||
|
||||
is_recipient: bool
|
||||
|
||||
is_sender: bool
|
||||
|
||||
is_spoof: bool
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["AllowPolicyCreateResponse"]
|
||||
|
||||
|
||||
class AllowPolicyCreateResponse(BaseModel):
|
||||
id: int
|
||||
"""The unique identifier for the allow policy."""
|
||||
|
||||
created_at: datetime
|
||||
|
||||
is_acceptable_sender: bool
|
||||
"""
|
||||
Messages from this sender will be exempted from Spam, Spoof and Bulk
|
||||
dispositions. Note: This will not exempt messages with Malicious or Suspicious
|
||||
dispositions.
|
||||
"""
|
||||
|
||||
is_exempt_recipient: bool
|
||||
"""Messages to this recipient will bypass all detections."""
|
||||
|
||||
is_regex: bool
|
||||
|
||||
is_trusted_sender: bool
|
||||
"""Messages from this sender will bypass all detections and link following."""
|
||||
|
||||
last_modified: datetime
|
||||
|
||||
pattern: str
|
||||
|
||||
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
|
||||
|
||||
verify_sender: bool
|
||||
"""
|
||||
Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
|
||||
policies that pass authentication.
|
||||
"""
|
||||
|
||||
comments: Optional[str] = None
|
||||
|
||||
is_recipient: Optional[bool] = None
|
||||
|
||||
is_sender: Optional[bool] = None
|
||||
|
||||
is_spoof: Optional[bool] = None
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["AllowPolicyDeleteResponse"]
|
||||
|
||||
|
||||
class AllowPolicyDeleteResponse(BaseModel):
|
||||
id: int
|
||||
"""The unique identifier for the allow policy."""
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["AllowPolicyEditParams"]
|
||||
|
||||
|
||||
class AllowPolicyEditParams(TypedDict, total=False):
|
||||
account_id: Required[str]
|
||||
"""Account Identifier"""
|
||||
|
||||
comments: Optional[str]
|
||||
|
||||
is_acceptable_sender: Optional[bool]
|
||||
"""
|
||||
Messages from this sender will be exempted from Spam, Spoof and Bulk
|
||||
dispositions. Note: This will not exempt messages with Malicious or Suspicious
|
||||
dispositions.
|
||||
"""
|
||||
|
||||
is_exempt_recipient: Optional[bool]
|
||||
"""Messages to this recipient will bypass all detections."""
|
||||
|
||||
is_regex: Optional[bool]
|
||||
|
||||
is_trusted_sender: Optional[bool]
|
||||
"""Messages from this sender will bypass all detections and link following."""
|
||||
|
||||
pattern: Optional[str]
|
||||
|
||||
pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]]
|
||||
|
||||
verify_sender: Optional[bool]
|
||||
"""
|
||||
Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
|
||||
policies that pass authentication.
|
||||
"""
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["AllowPolicyEditResponse"]
|
||||
|
||||
|
||||
class AllowPolicyEditResponse(BaseModel):
|
||||
id: int
|
||||
"""The unique identifier for the allow policy."""
|
||||
|
||||
created_at: datetime
|
||||
|
||||
is_acceptable_sender: bool
|
||||
"""
|
||||
Messages from this sender will be exempted from Spam, Spoof and Bulk
|
||||
dispositions. Note: This will not exempt messages with Malicious or Suspicious
|
||||
dispositions.
|
||||
"""
|
||||
|
||||
is_exempt_recipient: bool
|
||||
"""Messages to this recipient will bypass all detections."""
|
||||
|
||||
is_regex: bool
|
||||
|
||||
is_trusted_sender: bool
|
||||
"""Messages from this sender will bypass all detections and link following."""
|
||||
|
||||
last_modified: datetime
|
||||
|
||||
pattern: str
|
||||
|
||||
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
|
||||
|
||||
verify_sender: bool
|
||||
"""
|
||||
Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
|
||||
policies that pass authentication.
|
||||
"""
|
||||
|
||||
comments: Optional[str] = None
|
||||
|
||||
is_recipient: Optional[bool] = None
|
||||
|
||||
is_sender: Optional[bool] = None
|
||||
|
||||
is_spoof: Optional[bool] = None
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["AllowPolicyGetResponse"]
|
||||
|
||||
|
||||
class AllowPolicyGetResponse(BaseModel):
|
||||
id: int
|
||||
"""The unique identifier for the allow policy."""
|
||||
|
||||
created_at: datetime
|
||||
|
||||
is_acceptable_sender: bool
|
||||
"""
|
||||
Messages from this sender will be exempted from Spam, Spoof and Bulk
|
||||
dispositions. Note: This will not exempt messages with Malicious or Suspicious
|
||||
dispositions.
|
||||
"""
|
||||
|
||||
is_exempt_recipient: bool
|
||||
"""Messages to this recipient will bypass all detections."""
|
||||
|
||||
is_regex: bool
|
||||
|
||||
is_trusted_sender: bool
|
||||
"""Messages from this sender will bypass all detections and link following."""
|
||||
|
||||
last_modified: datetime
|
||||
|
||||
pattern: str
|
||||
|
||||
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
|
||||
|
||||
verify_sender: bool
|
||||
"""
|
||||
Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
|
||||
policies that pass authentication.
|
||||
"""
|
||||
|
||||
comments: Optional[str] = None
|
||||
|
||||
is_recipient: Optional[bool] = None
|
||||
|
||||
is_sender: Optional[bool] = None
|
||||
|
||||
is_spoof: Optional[bool] = None
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["AllowPolicyListParams"]
|
||||
|
||||
|
||||
class AllowPolicyListParams(TypedDict, total=False):
|
||||
account_id: Required[str]
|
||||
"""Account Identifier"""
|
||||
|
||||
direction: Literal["asc", "desc"]
|
||||
"""The sorting direction."""
|
||||
|
||||
is_acceptable_sender: bool
|
||||
|
||||
is_exempt_recipient: bool
|
||||
|
||||
is_recipient: bool
|
||||
|
||||
is_sender: bool
|
||||
|
||||
is_spoof: bool
|
||||
|
||||
is_trusted_sender: bool
|
||||
|
||||
order: Literal["pattern", "created_at"]
|
||||
"""The field to sort by."""
|
||||
|
||||
page: int
|
||||
"""The page number of paginated results."""
|
||||
|
||||
pattern: str
|
||||
|
||||
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
|
||||
|
||||
per_page: int
|
||||
"""The number of results per page."""
|
||||
|
||||
search: str
|
||||
"""
|
||||
Allows searching in multiple properties of a record simultaneously. This
|
||||
parameter is intended for human users, not automation. Its exact behavior is
|
||||
intentionally left unspecified and is subject to change in the future.
|
||||
"""
|
||||
|
||||
verify_sender: bool
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["AllowPolicyListResponse"]
|
||||
|
||||
|
||||
class AllowPolicyListResponse(BaseModel):
|
||||
id: int
|
||||
"""The unique identifier for the allow policy."""
|
||||
|
||||
created_at: datetime
|
||||
|
||||
is_acceptable_sender: bool
|
||||
"""
|
||||
Messages from this sender will be exempted from Spam, Spoof and Bulk
|
||||
dispositions. Note: This will not exempt messages with Malicious or Suspicious
|
||||
dispositions.
|
||||
"""
|
||||
|
||||
is_exempt_recipient: bool
|
||||
"""Messages to this recipient will bypass all detections."""
|
||||
|
||||
is_regex: bool
|
||||
|
||||
is_trusted_sender: bool
|
||||
"""Messages from this sender will bypass all detections and link following."""
|
||||
|
||||
last_modified: datetime
|
||||
|
||||
pattern: str
|
||||
|
||||
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
|
||||
|
||||
verify_sender: bool
|
||||
"""
|
||||
Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
|
||||
policies that pass authentication.
|
||||
"""
|
||||
|
||||
comments: Optional[str] = None
|
||||
|
||||
is_recipient: Optional[bool] = None
|
||||
|
||||
is_sender: Optional[bool] = None
|
||||
|
||||
is_spoof: Optional[bool] = None
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["BlockSenderCreateParams"]
|
||||
|
||||
|
||||
class BlockSenderCreateParams(TypedDict, total=False):
|
||||
account_id: Required[str]
|
||||
"""Account Identifier"""
|
||||
|
||||
is_regex: Required[bool]
|
||||
|
||||
pattern: Required[str]
|
||||
|
||||
pattern_type: Required[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]]
|
||||
|
||||
comments: Optional[str]
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["BlockSenderCreateResponse"]
|
||||
|
||||
|
||||
class BlockSenderCreateResponse(BaseModel):
|
||||
id: int
|
||||
"""The unique identifier for the allow policy."""
|
||||
|
||||
created_at: datetime
|
||||
|
||||
is_regex: bool
|
||||
|
||||
last_modified: datetime
|
||||
|
||||
pattern: str
|
||||
|
||||
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
|
||||
|
||||
comments: Optional[str] = None
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["BlockSenderDeleteResponse"]
|
||||
|
||||
|
||||
class BlockSenderDeleteResponse(BaseModel):
|
||||
id: int
|
||||
"""The unique identifier for the allow policy."""
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["BlockSenderEditParams"]
|
||||
|
||||
|
||||
class BlockSenderEditParams(TypedDict, total=False):
|
||||
account_id: Required[str]
|
||||
"""Account Identifier"""
|
||||
|
||||
comments: Optional[str]
|
||||
|
||||
is_regex: Optional[bool]
|
||||
|
||||
pattern: Optional[str]
|
||||
|
||||
pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]]
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["BlockSenderEditResponse"]
|
||||
|
||||
|
||||
class BlockSenderEditResponse(BaseModel):
|
||||
id: int
|
||||
"""The unique identifier for the allow policy."""
|
||||
|
||||
created_at: datetime
|
||||
|
||||
is_regex: bool
|
||||
|
||||
last_modified: datetime
|
||||
|
||||
pattern: str
|
||||
|
||||
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
|
||||
|
||||
comments: Optional[str] = None
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["BlockSenderGetResponse"]
|
||||
|
||||
|
||||
class BlockSenderGetResponse(BaseModel):
|
||||
id: int
|
||||
"""The unique identifier for the allow policy."""
|
||||
|
||||
created_at: datetime
|
||||
|
||||
is_regex: bool
|
||||
|
||||
last_modified: datetime
|
||||
|
||||
pattern: str
|
||||
|
||||
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
|
||||
|
||||
comments: Optional[str] = None
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["BlockSenderListParams"]
|
||||
|
||||
|
||||
class BlockSenderListParams(TypedDict, total=False):
|
||||
account_id: Required[str]
|
||||
"""Account Identifier"""
|
||||
|
||||
direction: Literal["asc", "desc"]
|
||||
"""The sorting direction."""
|
||||
|
||||
order: Literal["pattern", "created_at"]
|
||||
"""The field to sort by."""
|
||||
|
||||
page: int
|
||||
"""The page number of paginated results."""
|
||||
|
||||
pattern: str
|
||||
|
||||
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
|
||||
|
||||
per_page: int
|
||||
"""The number of results per page."""
|
||||
|
||||
search: str
|
||||
"""
|
||||
Allows searching in multiple properties of a record simultaneously. This
|
||||
parameter is intended for human users, not automation. Its exact behavior is
|
||||
intentionally left unspecified and is subject to change in the future.
|
||||
"""
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["BlockSenderListResponse"]
|
||||
|
||||
|
||||
class BlockSenderListResponse(BaseModel):
|
||||
id: int
|
||||
"""The unique identifier for the allow policy."""
|
||||
|
||||
created_at: datetime
|
||||
|
||||
is_regex: bool
|
||||
|
||||
last_modified: datetime
|
||||
|
||||
pattern: str
|
||||
|
||||
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
|
||||
|
||||
comments: Optional[str] = None
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["DomainBulkDeleteResponse"]
|
||||
|
||||
|
||||
class DomainBulkDeleteResponse(BaseModel):
|
||||
id: int
|
||||
"""The unique identifier for the domain."""
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["DomainDeleteResponse"]
|
||||
|
||||
|
||||
class DomainDeleteResponse(BaseModel):
|
||||
id: int
|
||||
"""The unique identifier for the domain."""
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import List
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
from ...._types import SequenceNotStr
|
||||
|
||||
__all__ = ["DomainEditParams"]
|
||||
|
||||
|
||||
class DomainEditParams(TypedDict, total=False):
|
||||
account_id: Required[str]
|
||||
"""Account Identifier"""
|
||||
|
||||
ip_restrictions: Required[SequenceNotStr[str]]
|
||||
|
||||
allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]]
|
||||
|
||||
domain: str
|
||||
|
||||
drop_dispositions: List[
|
||||
Literal[
|
||||
"MALICIOUS",
|
||||
"MALICIOUS-BEC",
|
||||
"SUSPICIOUS",
|
||||
"SPOOF",
|
||||
"SPAM",
|
||||
"BULK",
|
||||
"ENCRYPTED",
|
||||
"EXTERNAL",
|
||||
"UNKNOWN",
|
||||
"NONE",
|
||||
]
|
||||
]
|
||||
|
||||
folder: Literal["AllItems", "Inbox"]
|
||||
|
||||
integration_id: str
|
||||
|
||||
lookback_hops: int
|
||||
|
||||
regions: List[Literal["GLOBAL", "AU", "DE", "IN", "US"]]
|
||||
|
||||
require_tls_inbound: bool
|
||||
|
||||
require_tls_outbound: bool
|
||||
|
||||
transport: str
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["DomainEditResponse", "Authorization", "EmailsProcessed"]
|
||||
|
||||
|
||||
class Authorization(BaseModel):
|
||||
authorized: bool
|
||||
|
||||
timestamp: datetime
|
||||
|
||||
status_message: Optional[str] = None
|
||||
|
||||
|
||||
class EmailsProcessed(BaseModel):
|
||||
timestamp: datetime
|
||||
|
||||
total_emails_processed: int
|
||||
|
||||
total_emails_processed_previous: int
|
||||
|
||||
|
||||
class DomainEditResponse(BaseModel):
|
||||
id: int
|
||||
"""The unique identifier for the domain."""
|
||||
|
||||
allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]]
|
||||
|
||||
created_at: datetime
|
||||
|
||||
domain: str
|
||||
|
||||
drop_dispositions: List[
|
||||
Literal[
|
||||
"MALICIOUS",
|
||||
"MALICIOUS-BEC",
|
||||
"SUSPICIOUS",
|
||||
"SPOOF",
|
||||
"SPAM",
|
||||
"BULK",
|
||||
"ENCRYPTED",
|
||||
"EXTERNAL",
|
||||
"UNKNOWN",
|
||||
"NONE",
|
||||
]
|
||||
]
|
||||
|
||||
ip_restrictions: List[str]
|
||||
|
||||
last_modified: datetime
|
||||
|
||||
lookback_hops: int
|
||||
|
||||
regions: List[Literal["GLOBAL", "AU", "DE", "IN", "US"]]
|
||||
|
||||
transport: str
|
||||
|
||||
authorization: Optional[Authorization] = None
|
||||
|
||||
dmarc_status: Optional[Literal["none", "good", "invalid"]] = None
|
||||
|
||||
emails_processed: Optional[EmailsProcessed] = None
|
||||
|
||||
folder: Optional[Literal["AllItems", "Inbox"]] = None
|
||||
|
||||
inbox_provider: Optional[Literal["Microsoft", "Google"]] = None
|
||||
|
||||
integration_id: Optional[str] = None
|
||||
|
||||
o365_tenant_id: Optional[str] = None
|
||||
|
||||
require_tls_inbound: Optional[bool] = None
|
||||
|
||||
require_tls_outbound: Optional[bool] = None
|
||||
|
||||
spf_status: Optional[Literal["none", "good", "neutral", "open", "invalid"]] = None
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["DomainGetResponse", "Authorization", "EmailsProcessed"]
|
||||
|
||||
|
||||
class Authorization(BaseModel):
|
||||
authorized: bool
|
||||
|
||||
timestamp: datetime
|
||||
|
||||
status_message: Optional[str] = None
|
||||
|
||||
|
||||
class EmailsProcessed(BaseModel):
|
||||
timestamp: datetime
|
||||
|
||||
total_emails_processed: int
|
||||
|
||||
total_emails_processed_previous: int
|
||||
|
||||
|
||||
class DomainGetResponse(BaseModel):
|
||||
id: int
|
||||
"""The unique identifier for the domain."""
|
||||
|
||||
allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]]
|
||||
|
||||
created_at: datetime
|
||||
|
||||
domain: str
|
||||
|
||||
drop_dispositions: List[
|
||||
Literal[
|
||||
"MALICIOUS",
|
||||
"MALICIOUS-BEC",
|
||||
"SUSPICIOUS",
|
||||
"SPOOF",
|
||||
"SPAM",
|
||||
"BULK",
|
||||
"ENCRYPTED",
|
||||
"EXTERNAL",
|
||||
"UNKNOWN",
|
||||
"NONE",
|
||||
]
|
||||
]
|
||||
|
||||
ip_restrictions: List[str]
|
||||
|
||||
last_modified: datetime
|
||||
|
||||
lookback_hops: int
|
||||
|
||||
regions: List[Literal["GLOBAL", "AU", "DE", "IN", "US"]]
|
||||
|
||||
transport: str
|
||||
|
||||
authorization: Optional[Authorization] = None
|
||||
|
||||
dmarc_status: Optional[Literal["none", "good", "invalid"]] = None
|
||||
|
||||
emails_processed: Optional[EmailsProcessed] = None
|
||||
|
||||
folder: Optional[Literal["AllItems", "Inbox"]] = None
|
||||
|
||||
inbox_provider: Optional[Literal["Microsoft", "Google"]] = None
|
||||
|
||||
integration_id: Optional[str] = None
|
||||
|
||||
o365_tenant_id: Optional[str] = None
|
||||
|
||||
require_tls_inbound: Optional[bool] = None
|
||||
|
||||
require_tls_outbound: Optional[bool] = None
|
||||
|
||||
spf_status: Optional[Literal["none", "good", "neutral", "open", "invalid"]] = None
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
from ...._types import SequenceNotStr
|
||||
|
||||
__all__ = ["DomainListParams"]
|
||||
|
||||
|
||||
class DomainListParams(TypedDict, total=False):
|
||||
account_id: Required[str]
|
||||
"""Account Identifier"""
|
||||
|
||||
active_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]
|
||||
"""Filters response to domains with the currently active delivery mode."""
|
||||
|
||||
allowed_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]
|
||||
"""Filters response to domains with the provided delivery mode."""
|
||||
|
||||
direction: Literal["asc", "desc"]
|
||||
"""The sorting direction."""
|
||||
|
||||
domain: SequenceNotStr[str]
|
||||
"""Filters results by the provided domains, allowing for multiple occurrences."""
|
||||
|
||||
order: Literal["domain", "created_at"]
|
||||
"""The field to sort by."""
|
||||
|
||||
page: int
|
||||
"""The page number of paginated results."""
|
||||
|
||||
per_page: int
|
||||
"""The number of results per page."""
|
||||
|
||||
search: str
|
||||
"""
|
||||
Allows searching in multiple properties of a record simultaneously. This
|
||||
parameter is intended for human users, not automation. Its exact behavior is
|
||||
intentionally left unspecified and is subject to change in the future.
|
||||
"""
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["DomainListResponse", "Authorization", "EmailsProcessed"]
|
||||
|
||||
|
||||
class Authorization(BaseModel):
|
||||
authorized: bool
|
||||
|
||||
timestamp: datetime
|
||||
|
||||
status_message: Optional[str] = None
|
||||
|
||||
|
||||
class EmailsProcessed(BaseModel):
|
||||
timestamp: datetime
|
||||
|
||||
total_emails_processed: int
|
||||
|
||||
total_emails_processed_previous: int
|
||||
|
||||
|
||||
class DomainListResponse(BaseModel):
|
||||
id: int
|
||||
"""The unique identifier for the domain."""
|
||||
|
||||
allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]]
|
||||
|
||||
created_at: datetime
|
||||
|
||||
domain: str
|
||||
|
||||
drop_dispositions: List[
|
||||
Literal[
|
||||
"MALICIOUS",
|
||||
"MALICIOUS-BEC",
|
||||
"SUSPICIOUS",
|
||||
"SPOOF",
|
||||
"SPAM",
|
||||
"BULK",
|
||||
"ENCRYPTED",
|
||||
"EXTERNAL",
|
||||
"UNKNOWN",
|
||||
"NONE",
|
||||
]
|
||||
]
|
||||
|
||||
ip_restrictions: List[str]
|
||||
|
||||
last_modified: datetime
|
||||
|
||||
lookback_hops: int
|
||||
|
||||
regions: List[Literal["GLOBAL", "AU", "DE", "IN", "US"]]
|
||||
|
||||
transport: str
|
||||
|
||||
authorization: Optional[Authorization] = None
|
||||
|
||||
dmarc_status: Optional[Literal["none", "good", "invalid"]] = None
|
||||
|
||||
emails_processed: Optional[EmailsProcessed] = None
|
||||
|
||||
folder: Optional[Literal["AllItems", "Inbox"]] = None
|
||||
|
||||
inbox_provider: Optional[Literal["Microsoft", "Google"]] = None
|
||||
|
||||
integration_id: Optional[str] = None
|
||||
|
||||
o365_tenant_id: Optional[str] = None
|
||||
|
||||
require_tls_inbound: Optional[bool] = None
|
||||
|
||||
require_tls_outbound: Optional[bool] = None
|
||||
|
||||
spf_status: Optional[Literal["none", "good", "neutral", "open", "invalid"]] = None
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
__all__ = ["ImpersonationRegistryCreateParams"]
|
||||
|
||||
|
||||
class ImpersonationRegistryCreateParams(TypedDict, total=False):
|
||||
account_id: Required[str]
|
||||
"""Account Identifier"""
|
||||
|
||||
email: Required[str]
|
||||
|
||||
is_email_regex: Required[bool]
|
||||
|
||||
name: Required[str]
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["ImpersonationRegistryCreateResponse"]
|
||||
|
||||
|
||||
class ImpersonationRegistryCreateResponse(BaseModel):
|
||||
id: int
|
||||
|
||||
created_at: datetime
|
||||
|
||||
email: str
|
||||
|
||||
is_email_regex: bool
|
||||
|
||||
last_modified: datetime
|
||||
|
||||
name: str
|
||||
|
||||
comments: Optional[str] = None
|
||||
|
||||
directory_id: Optional[int] = None
|
||||
|
||||
directory_node_id: Optional[int] = None
|
||||
|
||||
external_directory_node_id: Optional[str] = None
|
||||
|
||||
provenance: Optional[str] = None
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["ImpersonationRegistryDeleteResponse"]
|
||||
|
||||
|
||||
class ImpersonationRegistryDeleteResponse(BaseModel):
|
||||
id: int
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue