Skip to content

Commit 2cf53e2

Browse files
feat: feat(api): add csam_scanner Stainless resource (TMD-1300, LRSP-1810)
* feat(api): use csam_scanner as top-level resource (TMD-1300) Replaces the original bot-authored structure (csam_scanner parent with third_party subresource pointing at non-existent /settings/csam_scanner paths) with a single top-level csam_scanner resource whose methods point at the real /settings/csam_scanner_third_party endpoint. This matches the structure already on the staging branch (via !922): client.zones.settings.csam_scanner.get(zone_id=...) client.zones.settings.csam_scanner.edit(zone_id=..., ...) Required because the csam_scanner path was removed from the OpenAPI spec in csam-config-service !453 (only csam_scanner_third_party is operational). Keeping the old structure would cause Stainless codegen to reference paths that don't exist in the production aggregate. * feat(api): add csam_scanner to SDK navigation listing Register csam_scanner in the Security section of the resources navigation so it appears in SDK client namespaces and generated docs. Ref: APIX-798 * feat(api): add CSAM scanner settings endpoint mappings Map csam_scanner and csam_scanner_third_party zone settings endpoints to SDK resources with get and edit methods. Ref: APIX-798
1 parent fae1b3c commit 2cf53e2

12 files changed

Lines changed: 767 additions & 3 deletions

File tree

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 2307
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare/cloudflare-774615a3ce44b5eb565859bf51c5943af86fde77b7d12b7d796892d6203dc330.yml
1+
configured_endpoints: 2309
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare/cloudflare-01d10fad10d28bf4cdd77d09cb2144e5622c7ec37a61e9cf631550b951dbbb76.yml
33
openapi_spec_hash: 0a8f757d1f412c1d81fb1ecf4bfba78b
4-
config_hash: aed7aa51410f7a92236320eb8c9040f1
4+
config_hash: 8dfaaa0e720fb13448f4c6f7b22dffab

api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ from cloudflare.types import (
231231

232232
# [AISecurity](src/cloudflare/resources/ai_security/api.md)
233233

234+
# [CsamScanner](src/cloudflare/resources/csam_scanner/api.md)
235+
234236
# [AbuseReports](src/cloudflare/resources/abuse_reports/api.md)
235237

236238
# [AI](src/cloudflare/resources/ai/api.md)

src/cloudflare/_client.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
rate_limits,
100100
url_scanner,
101101
connectivity,
102+
csam_scanner,
102103
custom_pages,
103104
dns_firewall,
104105
healthchecks,
@@ -211,6 +212,7 @@
211212
from .resources.rate_limits.rate_limits import RateLimitsResource, AsyncRateLimitsResource
212213
from .resources.url_scanner.url_scanner import URLScannerResource, AsyncURLScannerResource
213214
from .resources.connectivity.connectivity import ConnectivityResource, AsyncConnectivityResource
215+
from .resources.csam_scanner.csam_scanner import CsamScannerResource, AsyncCsamScannerResource
214216
from .resources.custom_pages.custom_pages import CustomPagesResource, AsyncCustomPagesResource
215217
from .resources.dns_firewall.dns_firewall import DNSFirewallResource, AsyncDNSFirewallResource
216218
from .resources.healthchecks.healthchecks import HealthchecksResource, AsyncHealthchecksResource
@@ -1014,6 +1016,12 @@ def ai_security(self) -> AISecurityResource:
10141016

10151017
return AISecurityResource(self)
10161018

1019+
@cached_property
1020+
def csam_scanner(self) -> CsamScannerResource:
1021+
from .resources.csam_scanner import CsamScannerResource
1022+
1023+
return CsamScannerResource(self)
1024+
10171025
@cached_property
10181026
def abuse_reports(self) -> AbuseReportsResource:
10191027
from .resources.abuse_reports import AbuseReportsResource
@@ -1942,6 +1950,12 @@ def ai_security(self) -> AsyncAISecurityResource:
19421950

19431951
return AsyncAISecurityResource(self)
19441952

1953+
@cached_property
1954+
def csam_scanner(self) -> AsyncCsamScannerResource:
1955+
from .resources.csam_scanner import AsyncCsamScannerResource
1956+
1957+
return AsyncCsamScannerResource(self)
1958+
19451959
@cached_property
19461960
def abuse_reports(self) -> AsyncAbuseReportsResource:
19471961
from .resources.abuse_reports import AsyncAbuseReportsResource
@@ -2792,6 +2806,12 @@ def ai_security(self) -> ai_security.AISecurityResourceWithRawResponse:
27922806

27932807
return AISecurityResourceWithRawResponse(self._client.ai_security)
27942808

2809+
@cached_property
2810+
def csam_scanner(self) -> csam_scanner.CsamScannerResourceWithRawResponse:
2811+
from .resources.csam_scanner import CsamScannerResourceWithRawResponse
2812+
2813+
return CsamScannerResourceWithRawResponse(self._client.csam_scanner)
2814+
27952815
@cached_property
27962816
def abuse_reports(self) -> abuse_reports.AbuseReportsResourceWithRawResponse:
27972817
from .resources.abuse_reports import AbuseReportsResourceWithRawResponse
@@ -3469,6 +3489,12 @@ def ai_security(self) -> ai_security.AsyncAISecurityResourceWithRawResponse:
34693489

34703490
return AsyncAISecurityResourceWithRawResponse(self._client.ai_security)
34713491

3492+
@cached_property
3493+
def csam_scanner(self) -> csam_scanner.AsyncCsamScannerResourceWithRawResponse:
3494+
from .resources.csam_scanner import AsyncCsamScannerResourceWithRawResponse
3495+
3496+
return AsyncCsamScannerResourceWithRawResponse(self._client.csam_scanner)
3497+
34723498
@cached_property
34733499
def abuse_reports(self) -> abuse_reports.AsyncAbuseReportsResourceWithRawResponse:
34743500
from .resources.abuse_reports import AsyncAbuseReportsResourceWithRawResponse
@@ -4146,6 +4172,12 @@ def ai_security(self) -> ai_security.AISecurityResourceWithStreamingResponse:
41464172

41474173
return AISecurityResourceWithStreamingResponse(self._client.ai_security)
41484174

4175+
@cached_property
4176+
def csam_scanner(self) -> csam_scanner.CsamScannerResourceWithStreamingResponse:
4177+
from .resources.csam_scanner import CsamScannerResourceWithStreamingResponse
4178+
4179+
return CsamScannerResourceWithStreamingResponse(self._client.csam_scanner)
4180+
41494181
@cached_property
41504182
def abuse_reports(self) -> abuse_reports.AbuseReportsResourceWithStreamingResponse:
41514183
from .resources.abuse_reports import AbuseReportsResourceWithStreamingResponse
@@ -4833,6 +4865,12 @@ def ai_security(self) -> ai_security.AsyncAISecurityResourceWithStreamingRespons
48334865

48344866
return AsyncAISecurityResourceWithStreamingResponse(self._client.ai_security)
48354867

4868+
@cached_property
4869+
def csam_scanner(self) -> csam_scanner.AsyncCsamScannerResourceWithStreamingResponse:
4870+
from .resources.csam_scanner import AsyncCsamScannerResourceWithStreamingResponse
4871+
4872+
return AsyncCsamScannerResourceWithStreamingResponse(self._client.csam_scanner)
4873+
48364874
@cached_property
48374875
def abuse_reports(self) -> abuse_reports.AsyncAbuseReportsResourceWithStreamingResponse:
48384876
from .resources.abuse_reports import AsyncAbuseReportsResourceWithStreamingResponse
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .csam_scanner import (
4+
CsamScannerResource,
5+
AsyncCsamScannerResource,
6+
CsamScannerResourceWithRawResponse,
7+
AsyncCsamScannerResourceWithRawResponse,
8+
CsamScannerResourceWithStreamingResponse,
9+
AsyncCsamScannerResourceWithStreamingResponse,
10+
)
11+
12+
__all__ = [
13+
"CsamScannerResource",
14+
"AsyncCsamScannerResource",
15+
"CsamScannerResourceWithRawResponse",
16+
"AsyncCsamScannerResourceWithRawResponse",
17+
"CsamScannerResourceWithStreamingResponse",
18+
"AsyncCsamScannerResourceWithStreamingResponse",
19+
]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# CsamScanner
2+
3+
Types:
4+
5+
```python
6+
from cloudflare.types.csam_scanner import CsamScannerEditResponse, CsamScannerGetResponse
7+
```
8+
9+
Methods:
10+
11+
- <code title="patch /zones/{zone_id}/settings/csam_scanner_third_party">client.csam_scanner.<a href="./src/cloudflare/resources/csam_scanner/csam_scanner.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/csam_scanner/csam_scanner_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/csam_scanner/csam_scanner_edit_response.py">Optional[CsamScannerEditResponse]</a></code>
12+
- <code title="get /zones/{zone_id}/settings/csam_scanner_third_party">client.csam_scanner.<a href="./src/cloudflare/resources/csam_scanner/csam_scanner.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/csam_scanner/csam_scanner_get_response.py">Optional[CsamScannerGetResponse]</a></code>

0 commit comments

Comments
 (0)