Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit aa892cc

Browse files
committedMar 13, 2025·
feat(api): manual updates (#2527)
1 parent f0b7af9 commit aa892cc

File tree

9 files changed

+1004
-1
lines changed

9 files changed

+1004
-1
lines changed
 

‎.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 1607
1+
configured_endpoints: 1610
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0f0082a0942d9f9edb37ef99423f7cdf16d0bfeb57c6ee5728e830b2a9ebff87.yml

‎api.md

+18
Original file line numberDiff line numberDiff line change
@@ -9312,3 +9312,21 @@ from cloudflare.types.browser_rendering import SnapshotCreateResponse
93129312
Methods:
93139313

93149314
- <code title="post /accounts/{account_id}/browser-rendering/snapshot">client.browser_rendering.snapshot.<a href="./src/cloudflare/resources/browser_rendering/snapshot.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/browser_rendering/snapshot_create_params.py">params</a>) -> <a href="./src/cloudflare/types/browser_rendering/snapshot_create_response.py">Optional[SnapshotCreateResponse]</a></code>
9315+
9316+
# CustomPages
9317+
9318+
Types:
9319+
9320+
```python
9321+
from cloudflare.types.custom_pages import (
9322+
CustomPageUpdateResponse,
9323+
CustomPageListResponse,
9324+
CustomPageGetResponse,
9325+
)
9326+
```
9327+
9328+
Methods:
9329+
9330+
- <code title="put /{accounts_or_zones}/{account_or_zone_id}/custom_pages/{identifier}">client.custom_pages.<a href="./src/cloudflare/resources/custom_pages.py">update</a>(identifier, \*, account_id, zone_id, \*\*<a href="src/cloudflare/types/custom_pages/custom_page_update_params.py">params</a>) -> <a href="./src/cloudflare/types/custom_pages/custom_page_update_response.py">Optional[CustomPageUpdateResponse]</a></code>
9331+
- <code title="get /{accounts_or_zones}/{account_or_zone_id}/custom_pages">client.custom_pages.<a href="./src/cloudflare/resources/custom_pages.py">list</a>(\*, account_id, zone_id) -> <a href="./src/cloudflare/types/custom_pages/custom_page_list_response.py">SyncSinglePage[object]</a></code>
9332+
- <code title="get /{accounts_or_zones}/{account_or_zone_id}/custom_pages/{identifier}">client.custom_pages.<a href="./src/cloudflare/resources/custom_pages.py">get</a>(identifier, \*, account_id, zone_id) -> <a href="./src/cloudflare/types/custom_pages/custom_page_get_response.py">Optional[CustomPageGetResponse]</a></code>

‎src/cloudflare/_client.py

+38
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
page_shield,
9191
rate_limits,
9292
url_scanner,
93+
custom_pages,
9394
dns_firewall,
9495
healthchecks,
9596
security_txt,
@@ -155,6 +156,7 @@
155156
from .resources.speed.speed import SpeedResource, AsyncSpeedResource
156157
from .resources.zaraz.zaraz import ZarazResource, AsyncZarazResource
157158
from .resources.zones.zones import ZonesResource, AsyncZonesResource
159+
from .resources.custom_pages import CustomPagesResource, AsyncCustomPagesResource
158160
from .resources.security_txt import SecurityTXTResource, AsyncSecurityTXTResource
159161
from .resources.abuse_reports import AbuseReportsResource, AsyncAbuseReportsResource
160162
from .resources.images.images import ImagesResource, AsyncImagesResource
@@ -867,6 +869,12 @@ def browser_rendering(self) -> BrowserRenderingResource:
867869

868870
return BrowserRenderingResource(self)
869871

872+
@cached_property
873+
def custom_pages(self) -> CustomPagesResource:
874+
from .resources.custom_pages import CustomPagesResource
875+
876+
return CustomPagesResource(self)
877+
870878
@cached_property
871879
def with_raw_response(self) -> CloudflareWithRawResponse:
872880
return CloudflareWithRawResponse(self)
@@ -1662,6 +1670,12 @@ def browser_rendering(self) -> AsyncBrowserRenderingResource:
16621670

16631671
return AsyncBrowserRenderingResource(self)
16641672

1673+
@cached_property
1674+
def custom_pages(self) -> AsyncCustomPagesResource:
1675+
from .resources.custom_pages import AsyncCustomPagesResource
1676+
1677+
return AsyncCustomPagesResource(self)
1678+
16651679
@cached_property
16661680
def with_raw_response(self) -> AsyncCloudflareWithRawResponse:
16671681
return AsyncCloudflareWithRawResponse(self)
@@ -2392,6 +2406,12 @@ def browser_rendering(self) -> browser_rendering.BrowserRenderingResourceWithRaw
23922406

23932407
return BrowserRenderingResourceWithRawResponse(self._client.browser_rendering)
23942408

2409+
@cached_property
2410+
def custom_pages(self) -> custom_pages.CustomPagesResourceWithRawResponse:
2411+
from .resources.custom_pages import CustomPagesResourceWithRawResponse
2412+
2413+
return CustomPagesResourceWithRawResponse(self._client.custom_pages)
2414+
23952415

23962416
class AsyncCloudflareWithRawResponse:
23972417
_client: AsyncCloudflare
@@ -2941,6 +2961,12 @@ def browser_rendering(self) -> browser_rendering.AsyncBrowserRenderingResourceWi
29412961

29422962
return AsyncBrowserRenderingResourceWithRawResponse(self._client.browser_rendering)
29432963

2964+
@cached_property
2965+
def custom_pages(self) -> custom_pages.AsyncCustomPagesResourceWithRawResponse:
2966+
from .resources.custom_pages import AsyncCustomPagesResourceWithRawResponse
2967+
2968+
return AsyncCustomPagesResourceWithRawResponse(self._client.custom_pages)
2969+
29442970

29452971
class CloudflareWithStreamedResponse:
29462972
_client: Cloudflare
@@ -3490,6 +3516,12 @@ def browser_rendering(self) -> browser_rendering.BrowserRenderingResourceWithStr
34903516

34913517
return BrowserRenderingResourceWithStreamingResponse(self._client.browser_rendering)
34923518

3519+
@cached_property
3520+
def custom_pages(self) -> custom_pages.CustomPagesResourceWithStreamingResponse:
3521+
from .resources.custom_pages import CustomPagesResourceWithStreamingResponse
3522+
3523+
return CustomPagesResourceWithStreamingResponse(self._client.custom_pages)
3524+
34933525

34943526
class AsyncCloudflareWithStreamedResponse:
34953527
_client: AsyncCloudflare
@@ -4049,6 +4081,12 @@ def browser_rendering(self) -> browser_rendering.AsyncBrowserRenderingResourceWi
40494081

40504082
return AsyncBrowserRenderingResourceWithStreamingResponse(self._client.browser_rendering)
40514083

4084+
@cached_property
4085+
def custom_pages(self) -> custom_pages.AsyncCustomPagesResourceWithStreamingResponse:
4086+
from .resources.custom_pages import AsyncCustomPagesResourceWithStreamingResponse
4087+
4088+
return AsyncCustomPagesResourceWithStreamingResponse(self._client.custom_pages)
4089+
40524090

40534091
Client = Cloudflare
40544092

‎src/cloudflare/resources/custom_pages.py

+504
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from .custom_page_get_response import CustomPageGetResponse as CustomPageGetResponse
6+
from .custom_page_update_params import CustomPageUpdateParams as CustomPageUpdateParams
7+
from .custom_page_update_response import CustomPageUpdateResponse as CustomPageUpdateResponse
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Union
4+
from typing_extensions import TypeAlias
5+
6+
__all__ = ["CustomPageGetResponse"]
7+
8+
CustomPageGetResponse: TypeAlias = Union[str, object, None]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Literal, Required, TypedDict
6+
7+
__all__ = ["CustomPageUpdateParams"]
8+
9+
10+
class CustomPageUpdateParams(TypedDict, total=False):
11+
state: Required[Literal["default", "customized"]]
12+
"""The custom page state."""
13+
14+
url: Required[str]
15+
"""The URL associated with the custom page."""
16+
17+
account_id: str
18+
"""The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
19+
20+
zone_id: str
21+
"""The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Union
4+
from typing_extensions import TypeAlias
5+
6+
__all__ = ["CustomPageUpdateResponse"]
7+
8+
CustomPageUpdateResponse: TypeAlias = Union[str, object, None]

‎tests/api_resources/test_custom_pages.py

+399
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.