Skip to content

Commit

Permalink
feat(api): add endpoint mappings (#2408)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Jan 30, 2025
1 parent 1a0cb61 commit c7f7ce3
Show file tree
Hide file tree
Showing 125 changed files with 10,821 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1504
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04299b899e2bbf8ba1b4ad96d5e9f9c3e0c9b6246bfeac3f9ab684b855b0e412.yml
configured_endpoints: 1525
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8973dde42d42a39c8fbc5f3f1eb1328e6ac0c805ca4d3e5920796749ed58eb0a.yml
215 changes: 209 additions & 6 deletions api.md

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions src/cloudflare/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
cloud_connector,
durable_objects,
request_tracers,
security_center,
brand_protection,
content_scanning,
custom_hostnames,
Expand Down Expand Up @@ -203,6 +204,7 @@
from .resources.cloud_connector.cloud_connector import CloudConnectorResource, AsyncCloudConnectorResource
from .resources.durable_objects.durable_objects import DurableObjectsResource, AsyncDurableObjectsResource
from .resources.request_tracers.request_tracers import RequestTracersResource, AsyncRequestTracersResource
from .resources.security_center.security_center import SecurityCenterResource, AsyncSecurityCenterResource
from .resources.content_scanning.content_scanning import ContentScanningResource, AsyncContentScanningResource
from .resources.custom_hostnames.custom_hostnames import CustomHostnamesResource, AsyncCustomHostnamesResource
from .resources.resource_sharing.resource_sharing import ResourceSharingResource, AsyncResourceSharingResource
Expand Down Expand Up @@ -843,6 +845,12 @@ def ai(self) -> AIResource:

return AIResource(self)

@cached_property
def security_center(self) -> SecurityCenterResource:
from .resources.security_center import SecurityCenterResource

return SecurityCenterResource(self)

@cached_property
def with_raw_response(self) -> CloudflareWithRawResponse:
return CloudflareWithRawResponse(self)
Expand Down Expand Up @@ -1620,6 +1628,12 @@ def ai(self) -> AsyncAIResource:

return AsyncAIResource(self)

@cached_property
def security_center(self) -> AsyncSecurityCenterResource:
from .resources.security_center import AsyncSecurityCenterResource

return AsyncSecurityCenterResource(self)

@cached_property
def with_raw_response(self) -> AsyncCloudflareWithRawResponse:
return AsyncCloudflareWithRawResponse(self)
Expand Down Expand Up @@ -2332,6 +2346,12 @@ def ai(self) -> ai.AIResourceWithRawResponse:

return AIResourceWithRawResponse(self._client.ai)

@cached_property
def security_center(self) -> security_center.SecurityCenterResourceWithRawResponse:
from .resources.security_center import SecurityCenterResourceWithRawResponse

return SecurityCenterResourceWithRawResponse(self._client.security_center)


class AsyncCloudflareWithRawResponse:
_client: AsyncCloudflare
Expand Down Expand Up @@ -2863,6 +2883,12 @@ def ai(self) -> ai.AsyncAIResourceWithRawResponse:

return AsyncAIResourceWithRawResponse(self._client.ai)

@cached_property
def security_center(self) -> security_center.AsyncSecurityCenterResourceWithRawResponse:
from .resources.security_center import AsyncSecurityCenterResourceWithRawResponse

return AsyncSecurityCenterResourceWithRawResponse(self._client.security_center)


class CloudflareWithStreamedResponse:
_client: Cloudflare
Expand Down Expand Up @@ -3394,6 +3420,12 @@ def ai(self) -> ai.AIResourceWithStreamingResponse:

return AIResourceWithStreamingResponse(self._client.ai)

@cached_property
def security_center(self) -> security_center.SecurityCenterResourceWithStreamingResponse:
from .resources.security_center import SecurityCenterResourceWithStreamingResponse

return SecurityCenterResourceWithStreamingResponse(self._client.security_center)


class AsyncCloudflareWithStreamedResponse:
_client: AsyncCloudflare
Expand Down Expand Up @@ -3935,6 +3967,12 @@ def ai(self) -> ai.AsyncAIResourceWithStreamingResponse:

return AsyncAIResourceWithStreamingResponse(self._client.ai)

@cached_property
def security_center(self) -> security_center.AsyncSecurityCenterResourceWithStreamingResponse:
from .resources.security_center import AsyncSecurityCenterResourceWithStreamingResponse

return AsyncSecurityCenterResourceWithStreamingResponse(self._client.security_center)


Client = Cloudflare

Expand Down
14 changes: 14 additions & 0 deletions src/cloudflare/resources/custom_hostnames/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
FallbackOriginResourceWithStreamingResponse,
AsyncFallbackOriginResourceWithStreamingResponse,
)
from .certificate_pack import (
CertificatePackResource,
AsyncCertificatePackResource,
CertificatePackResourceWithRawResponse,
AsyncCertificatePackResourceWithRawResponse,
CertificatePackResourceWithStreamingResponse,
AsyncCertificatePackResourceWithStreamingResponse,
)
from .custom_hostnames import (
CustomHostnamesResource,
AsyncCustomHostnamesResource,
Expand All @@ -24,6 +32,12 @@
"AsyncFallbackOriginResourceWithRawResponse",
"FallbackOriginResourceWithStreamingResponse",
"AsyncFallbackOriginResourceWithStreamingResponse",
"CertificatePackResource",
"AsyncCertificatePackResource",
"CertificatePackResourceWithRawResponse",
"AsyncCertificatePackResourceWithRawResponse",
"CertificatePackResourceWithStreamingResponse",
"AsyncCertificatePackResourceWithStreamingResponse",
"CustomHostnamesResource",
"AsyncCustomHostnamesResource",
"CustomHostnamesResourceWithRawResponse",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .certificates import (
CertificatesResource,
AsyncCertificatesResource,
CertificatesResourceWithRawResponse,
AsyncCertificatesResourceWithRawResponse,
CertificatesResourceWithStreamingResponse,
AsyncCertificatesResourceWithStreamingResponse,
)
from .certificate_pack import (
CertificatePackResource,
AsyncCertificatePackResource,
CertificatePackResourceWithRawResponse,
AsyncCertificatePackResourceWithRawResponse,
CertificatePackResourceWithStreamingResponse,
AsyncCertificatePackResourceWithStreamingResponse,
)

__all__ = [
"CertificatesResource",
"AsyncCertificatesResource",
"CertificatesResourceWithRawResponse",
"AsyncCertificatesResourceWithRawResponse",
"CertificatesResourceWithStreamingResponse",
"AsyncCertificatesResourceWithStreamingResponse",
"CertificatePackResource",
"AsyncCertificatePackResource",
"CertificatePackResourceWithRawResponse",
"AsyncCertificatePackResourceWithRawResponse",
"CertificatePackResourceWithStreamingResponse",
"AsyncCertificatePackResourceWithStreamingResponse",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# 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 .certificates import (
CertificatesResource,
AsyncCertificatesResource,
CertificatesResourceWithRawResponse,
AsyncCertificatesResourceWithRawResponse,
CertificatesResourceWithStreamingResponse,
AsyncCertificatesResourceWithStreamingResponse,
)

__all__ = ["CertificatePackResource", "AsyncCertificatePackResource"]


class CertificatePackResource(SyncAPIResource):
@cached_property
def certificates(self) -> CertificatesResource:
return CertificatesResource(self._client)

@cached_property
def with_raw_response(self) -> CertificatePackResourceWithRawResponse:
"""
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 CertificatePackResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> CertificatePackResourceWithStreamingResponse:
"""
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 CertificatePackResourceWithStreamingResponse(self)


class AsyncCertificatePackResource(AsyncAPIResource):
@cached_property
def certificates(self) -> AsyncCertificatesResource:
return AsyncCertificatesResource(self._client)

@cached_property
def with_raw_response(self) -> AsyncCertificatePackResourceWithRawResponse:
"""
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 AsyncCertificatePackResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> AsyncCertificatePackResourceWithStreamingResponse:
"""
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 AsyncCertificatePackResourceWithStreamingResponse(self)


class CertificatePackResourceWithRawResponse:
def __init__(self, certificate_pack: CertificatePackResource) -> None:
self._certificate_pack = certificate_pack

@cached_property
def certificates(self) -> CertificatesResourceWithRawResponse:
return CertificatesResourceWithRawResponse(self._certificate_pack.certificates)


class AsyncCertificatePackResourceWithRawResponse:
def __init__(self, certificate_pack: AsyncCertificatePackResource) -> None:
self._certificate_pack = certificate_pack

@cached_property
def certificates(self) -> AsyncCertificatesResourceWithRawResponse:
return AsyncCertificatesResourceWithRawResponse(self._certificate_pack.certificates)


class CertificatePackResourceWithStreamingResponse:
def __init__(self, certificate_pack: CertificatePackResource) -> None:
self._certificate_pack = certificate_pack

@cached_property
def certificates(self) -> CertificatesResourceWithStreamingResponse:
return CertificatesResourceWithStreamingResponse(self._certificate_pack.certificates)


class AsyncCertificatePackResourceWithStreamingResponse:
def __init__(self, certificate_pack: AsyncCertificatePackResource) -> None:
self._certificate_pack = certificate_pack

@cached_property
def certificates(self) -> AsyncCertificatesResourceWithStreamingResponse:
return AsyncCertificatesResourceWithStreamingResponse(self._certificate_pack.certificates)
Loading

0 comments on commit c7f7ce3

Please sign in to comment.