Skip to content

Commit ce4789c

Browse files
feat: feat(abuse_reports): add abuse mitigations in Client API
1 parent 6a4f824 commit ce4789c

File tree

13 files changed

+960
-18
lines changed

13 files changed

+960
-18
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 1892
1+
configured_endpoints: 1894
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa2c3728465401b156b0ae35cb80cfef39ae398866f7b44b52dba8dd04d7df0c.yml
33
openapi_spec_hash: afffe386ef9475dfec98d1c26d8225d4
4-
config_hash: 002f3cbea44c410d7ee7e31fa9b0058a
4+
config_hash: c3197a7cf9595a0f252f8810e74954ef

api.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10044,9 +10044,22 @@ from cloudflare.types.abuse_reports import (
1004410044

1004510045
Methods:
1004610046

10047-
- <code title="post /accounts/{account_id}/abuse-reports/{report_param}">client.abuse_reports.<a href="./src/cloudflare/resources/abuse_reports.py">create</a>(report_param, \*, account_id, \*\*<a href="src/cloudflare/types/abuse_reports/abuse_report_create_params.py">params</a>) -> <a href="./src/cloudflare/types/abuse_reports/abuse_report_create_response.py">str</a></code>
10048-
- <code title="get /accounts/{account_id}/abuse-reports">client.abuse_reports.<a href="./src/cloudflare/resources/abuse_reports.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/abuse_reports/abuse_report_list_params.py">params</a>) -> <a href="./src/cloudflare/types/abuse_reports/abuse_report_list_response.py">SyncV4PagePagination[Optional[AbuseReportListResponse]]</a></code>
10049-
- <code title="get /accounts/{account_id}/abuse-reports/{report_param}">client.abuse_reports.<a href="./src/cloudflare/resources/abuse_reports.py">get</a>(report_param, \*, account_id) -> <a href="./src/cloudflare/types/abuse_reports/abuse_report_get_response.py">AbuseReportGetResponse</a></code>
10047+
- <code title="post /accounts/{account_id}/abuse-reports/{report_param}">client.abuse_reports.<a href="./src/cloudflare/resources/abuse_reports/abuse_reports.py">create</a>(report_param, \*, account_id, \*\*<a href="src/cloudflare/types/abuse_reports/abuse_report_create_params.py">params</a>) -> <a href="./src/cloudflare/types/abuse_reports/abuse_report_create_response.py">str</a></code>
10048+
- <code title="get /accounts/{account_id}/abuse-reports">client.abuse_reports.<a href="./src/cloudflare/resources/abuse_reports/abuse_reports.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/abuse_reports/abuse_report_list_params.py">params</a>) -> <a href="./src/cloudflare/types/abuse_reports/abuse_report_list_response.py">SyncV4PagePagination[Optional[AbuseReportListResponse]]</a></code>
10049+
- <code title="get /accounts/{account_id}/abuse-reports/{report_param}">client.abuse_reports.<a href="./src/cloudflare/resources/abuse_reports/abuse_reports.py">get</a>(report_param, \*, account_id) -> <a href="./src/cloudflare/types/abuse_reports/abuse_report_get_response.py">AbuseReportGetResponse</a></code>
10050+
10051+
## Mitigations
10052+
10053+
Types:
10054+
10055+
```python
10056+
from cloudflare.types.abuse_reports import MitigationListResponse, MitigationReviewResponse
10057+
```
10058+
10059+
Methods:
10060+
10061+
- <code title="get /accounts/{account_id}/abuse-reports/{report_id}/mitigations">client.abuse_reports.mitigations.<a href="./src/cloudflare/resources/abuse_reports/mitigations.py">list</a>(report_id, \*, account_id, \*\*<a href="src/cloudflare/types/abuse_reports/mitigation_list_params.py">params</a>) -> <a href="./src/cloudflare/types/abuse_reports/mitigation_list_response.py">SyncV4PagePagination[Optional[MitigationListResponse]]</a></code>
10062+
- <code title="post /accounts/{account_id}/abuse-reports/{report_id}/mitigations/appeal">client.abuse_reports.mitigations.<a href="./src/cloudflare/resources/abuse_reports/mitigations.py">review</a>(report_id, \*, account_id, \*\*<a href="src/cloudflare/types/abuse_reports/mitigation_review_params.py">params</a>) -> <a href="./src/cloudflare/types/abuse_reports/mitigation_review_response.py">SyncSinglePage[MitigationReviewResponse]</a></code>
1005010063

1005110064
# AI
1005210065

src/cloudflare/_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@
164164
from .resources.zones.zones import ZonesResource, AsyncZonesResource
165165
from .resources.custom_pages import CustomPagesResource, AsyncCustomPagesResource
166166
from .resources.security_txt import SecurityTXTResource, AsyncSecurityTXTResource
167-
from .resources.abuse_reports import AbuseReportsResource, AsyncAbuseReportsResource
168167
from .resources.images.images import ImagesResource, AsyncImagesResource
169168
from .resources.queues.queues import QueuesResource, AsyncQueuesResource
170169
from .resources.stream.stream import StreamResource, AsyncStreamResource
@@ -202,6 +201,7 @@
202201
from .resources.connectivity.connectivity import ConnectivityResource, AsyncConnectivityResource
203202
from .resources.dns_firewall.dns_firewall import DNSFirewallResource, AsyncDNSFirewallResource
204203
from .resources.healthchecks.healthchecks import HealthchecksResource, AsyncHealthchecksResource
204+
from .resources.abuse_reports.abuse_reports import AbuseReportsResource, AsyncAbuseReportsResource
205205
from .resources.email_routing.email_routing import EmailRoutingResource, AsyncEmailRoutingResource
206206
from .resources.magic_transit.magic_transit import MagicTransitResource, AsyncMagicTransitResource
207207
from .resources.organizations.organizations import OrganizationsResource, AsyncOrganizationsResource
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .mitigations import (
4+
MitigationsResource,
5+
AsyncMitigationsResource,
6+
MitigationsResourceWithRawResponse,
7+
AsyncMitigationsResourceWithRawResponse,
8+
MitigationsResourceWithStreamingResponse,
9+
AsyncMitigationsResourceWithStreamingResponse,
10+
)
11+
from .abuse_reports import (
12+
AbuseReportsResource,
13+
AsyncAbuseReportsResource,
14+
AbuseReportsResourceWithRawResponse,
15+
AsyncAbuseReportsResourceWithRawResponse,
16+
AbuseReportsResourceWithStreamingResponse,
17+
AsyncAbuseReportsResourceWithStreamingResponse,
18+
)
19+
20+
__all__ = [
21+
"MitigationsResource",
22+
"AsyncMitigationsResource",
23+
"MitigationsResourceWithRawResponse",
24+
"AsyncMitigationsResourceWithRawResponse",
25+
"MitigationsResourceWithStreamingResponse",
26+
"AsyncMitigationsResourceWithStreamingResponse",
27+
"AbuseReportsResource",
28+
"AsyncAbuseReportsResource",
29+
"AbuseReportsResourceWithRawResponse",
30+
"AsyncAbuseReportsResourceWithRawResponse",
31+
"AbuseReportsResourceWithStreamingResponse",
32+
"AsyncAbuseReportsResourceWithStreamingResponse",
33+
]

src/cloudflare/resources/abuse_reports.py renamed to src/cloudflare/resources/abuse_reports/abuse_reports.py

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

88
import httpx
99

10-
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
11-
from .._utils import required_args, maybe_transform, async_maybe_transform
12-
from .._compat import cached_property
13-
from .._resource import SyncAPIResource, AsyncAPIResource
14-
from .._response import (
10+
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
11+
from ..._utils import required_args, maybe_transform, async_maybe_transform
12+
from ..._compat import cached_property
13+
from ..._resource import SyncAPIResource, AsyncAPIResource
14+
from ..._response import (
1515
to_raw_response_wrapper,
1616
to_streamed_response_wrapper,
1717
async_to_raw_response_wrapper,
1818
async_to_streamed_response_wrapper,
1919
)
20-
from .._wrappers import ResultWrapper
21-
from ..pagination import SyncV4PagePagination, AsyncV4PagePagination
22-
from .._base_client import AsyncPaginator, make_request_options
23-
from ..types.abuse_reports import abuse_report_list_params, abuse_report_create_params
24-
from ..types.abuse_reports.abuse_report_get_response import AbuseReportGetResponse
25-
from ..types.abuse_reports.abuse_report_list_response import AbuseReportListResponse
26-
from ..types.abuse_reports.abuse_report_create_response import AbuseReportCreateResponse
20+
from ..._wrappers import ResultWrapper
21+
from .mitigations import (
22+
MitigationsResource,
23+
AsyncMitigationsResource,
24+
MitigationsResourceWithRawResponse,
25+
AsyncMitigationsResourceWithRawResponse,
26+
MitigationsResourceWithStreamingResponse,
27+
AsyncMitigationsResourceWithStreamingResponse,
28+
)
29+
from ...pagination import SyncV4PagePagination, AsyncV4PagePagination
30+
from ..._base_client import AsyncPaginator, make_request_options
31+
from ...types.abuse_reports import abuse_report_list_params, abuse_report_create_params
32+
from ...types.abuse_reports.abuse_report_get_response import AbuseReportGetResponse
33+
from ...types.abuse_reports.abuse_report_list_response import AbuseReportListResponse
34+
from ...types.abuse_reports.abuse_report_create_response import AbuseReportCreateResponse
2735

2836
__all__ = ["AbuseReportsResource", "AsyncAbuseReportsResource"]
2937

3038

3139
class AbuseReportsResource(SyncAPIResource):
40+
@cached_property
41+
def mitigations(self) -> MitigationsResource:
42+
return MitigationsResource(self._client)
43+
3244
@cached_property
3345
def with_raw_response(self) -> AbuseReportsResourceWithRawResponse:
3446
"""
@@ -1051,6 +1063,10 @@ def get(
10511063

10521064

10531065
class AsyncAbuseReportsResource(AsyncAPIResource):
1066+
@cached_property
1067+
def mitigations(self) -> AsyncMitigationsResource:
1068+
return AsyncMitigationsResource(self._client)
1069+
10541070
@cached_property
10551071
def with_raw_response(self) -> AsyncAbuseReportsResourceWithRawResponse:
10561072
"""
@@ -2086,6 +2102,10 @@ def __init__(self, abuse_reports: AbuseReportsResource) -> None:
20862102
abuse_reports.get,
20872103
)
20882104

2105+
@cached_property
2106+
def mitigations(self) -> MitigationsResourceWithRawResponse:
2107+
return MitigationsResourceWithRawResponse(self._abuse_reports.mitigations)
2108+
20892109

20902110
class AsyncAbuseReportsResourceWithRawResponse:
20912111
def __init__(self, abuse_reports: AsyncAbuseReportsResource) -> None:
@@ -2101,6 +2121,10 @@ def __init__(self, abuse_reports: AsyncAbuseReportsResource) -> None:
21012121
abuse_reports.get,
21022122
)
21032123

2124+
@cached_property
2125+
def mitigations(self) -> AsyncMitigationsResourceWithRawResponse:
2126+
return AsyncMitigationsResourceWithRawResponse(self._abuse_reports.mitigations)
2127+
21042128

21052129
class AbuseReportsResourceWithStreamingResponse:
21062130
def __init__(self, abuse_reports: AbuseReportsResource) -> None:
@@ -2116,6 +2140,10 @@ def __init__(self, abuse_reports: AbuseReportsResource) -> None:
21162140
abuse_reports.get,
21172141
)
21182142

2143+
@cached_property
2144+
def mitigations(self) -> MitigationsResourceWithStreamingResponse:
2145+
return MitigationsResourceWithStreamingResponse(self._abuse_reports.mitigations)
2146+
21192147

21202148
class AsyncAbuseReportsResourceWithStreamingResponse:
21212149
def __init__(self, abuse_reports: AsyncAbuseReportsResource) -> None:
@@ -2130,3 +2158,7 @@ def __init__(self, abuse_reports: AsyncAbuseReportsResource) -> None:
21302158
self.get = async_to_streamed_response_wrapper(
21312159
abuse_reports.get,
21322160
)
2161+
2162+
@cached_property
2163+
def mitigations(self) -> AsyncMitigationsResourceWithStreamingResponse:
2164+
return AsyncMitigationsResourceWithStreamingResponse(self._abuse_reports.mitigations)

0 commit comments

Comments
 (0)