Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions src/cloudflare/resources/custom_pages/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# CustomPages

Types:

```python
from cloudflare.types.custom_pages import (
CustomPageUpdateResponse,
CustomPageListResponse,
CustomPageGetResponse,
)
```

Methods:

- <code title="put /{accounts_or_zones}/{account_or_zone_id}/custom_pages/{identifier}">client.custom_pages.<a href="./src/cloudflare/resources/custom_pages/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>
- <code title="get /{accounts_or_zones}/{account_or_zone_id}/custom_pages">client.custom_pages.<a href="./src/cloudflare/resources/custom_pages/custom_pages.py">list</a>(\*, account_id, zone_id) -> <a href="./src/cloudflare/types/custom_pages/custom_page_list_response.py">SyncSinglePage[CustomPageListResponse]</a></code>
- <code title="get /{accounts_or_zones}/{account_or_zone_id}/custom_pages/{identifier}">client.custom_pages.<a href="./src/cloudflare/resources/custom_pages/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>

## Assets

Types:

```python
from cloudflare.types.custom_pages import (
AssetCreateResponse,
AssetUpdateResponse,
AssetListResponse,
AssetGetResponse,
)
```

Methods:

- <code title="post /{accounts_or_zones}/{account_or_zone_id}/custom_pages/assets">client.custom_pages.assets.<a href="./src/cloudflare/resources/custom_pages/assets.py">create</a>(\*, account_id, zone_id, \*\*<a href="src/cloudflare/types/custom_pages/asset_create_params.py">params</a>) -> <a href="./src/cloudflare/types/custom_pages/asset_create_response.py">Optional[AssetCreateResponse]</a></code>
- <code title="put /{accounts_or_zones}/{account_or_zone_id}/custom_pages/assets/{asset_name}">client.custom_pages.assets.<a href="./src/cloudflare/resources/custom_pages/assets.py">update</a>(asset_name, \*, account_id, zone_id, \*\*<a href="src/cloudflare/types/custom_pages/asset_update_params.py">params</a>) -> <a href="./src/cloudflare/types/custom_pages/asset_update_response.py">Optional[AssetUpdateResponse]</a></code>
- <code title="get /{accounts_or_zones}/{account_or_zone_id}/custom_pages/assets">client.custom_pages.assets.<a href="./src/cloudflare/resources/custom_pages/assets.py">list</a>(\*, account_id, zone_id, \*\*<a href="src/cloudflare/types/custom_pages/asset_list_params.py">params</a>) -> <a href="./src/cloudflare/types/custom_pages/asset_list_response.py">SyncV4PagePaginationArray[AssetListResponse]</a></code>
- <code title="delete /{accounts_or_zones}/{account_or_zone_id}/custom_pages/assets/{asset_name}">client.custom_pages.assets.<a href="./src/cloudflare/resources/custom_pages/assets.py">delete</a>(asset_name, \*, account_id, zone_id) -> None</code>
- <code title="get /{accounts_or_zones}/{account_or_zone_id}/custom_pages/assets/{asset_name}">client.custom_pages.assets.<a href="./src/cloudflare/resources/custom_pages/assets.py">get</a>(asset_name, \*, account_id, zone_id) -> <a href="./src/cloudflare/types/custom_pages/asset_get_response.py">Optional[AssetGetResponse]</a></code>
148 changes: 117 additions & 31 deletions src/cloudflare/resources/custom_pages/assets.py

Large diffs are not rendered by default.

92 changes: 72 additions & 20 deletions src/cloudflare/resources/custom_pages/custom_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
AssetsResourceWithStreamingResponse,
AsyncAssetsResourceWithStreamingResponse,
)
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._types import Body, Query, Headers, NotGiven, not_given
from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
Expand Down Expand Up @@ -77,8 +77,8 @@ def update(
*,
state: Literal["default", "customized"],
url: str,
account_id: str | Omit = omit,
zone_id: str | Omit = omit,
account_id: str | None = None,
zone_id: str | None = None,
# 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,
Expand Down Expand Up @@ -110,6 +110,10 @@ def update(
"""
if not identifier:
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
if account_id is None:
account_id = self._client._get_account_id_path_param()
if zone_id is None:
zone_id = self._client._get_zone_id_path_param()
if account_id and zone_id:
raise ValueError("You cannot provide both account_id and zone_id")

Expand All @@ -123,7 +127,12 @@ def update(
account_or_zone = "zones"
account_or_zone_id = zone_id
return self._put(
f"/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}",
path_template(
"/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}",
identifier=identifier,
account_or_zone=account_or_zone,
account_or_zone_id=account_or_zone_id,
),
body=maybe_transform(
{
"state": state,
Expand All @@ -144,8 +153,8 @@ def update(
def list(
self,
*,
account_id: str | Omit = omit,
zone_id: str | Omit = omit,
account_id: str | None = None,
zone_id: str | None = None,
# 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,
Expand All @@ -169,6 +178,10 @@ def list(

timeout: Override the client-level default timeout for this request, in seconds
"""
if account_id is None:
account_id = self._client._get_account_id_path_param()
if zone_id is None:
zone_id = self._client._get_zone_id_path_param()
if account_id and zone_id:
raise ValueError("You cannot provide both account_id and zone_id")

Expand All @@ -182,7 +195,11 @@ def list(
account_or_zone = "zones"
account_or_zone_id = zone_id
return self._get_api_list(
f"/{account_or_zone}/{account_or_zone_id}/custom_pages",
path_template(
"/{account_or_zone}/{account_or_zone_id}/custom_pages",
account_or_zone=account_or_zone,
account_or_zone_id=account_or_zone_id,
),
page=SyncSinglePage[CustomPageListResponse],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
Expand All @@ -205,8 +222,8 @@ def get(
"waf_challenge",
],
*,
account_id: str | Omit = omit,
zone_id: str | Omit = omit,
account_id: str | None = None,
zone_id: str | None = None,
# 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,
Expand Down Expand Up @@ -234,6 +251,10 @@ def get(
"""
if not identifier:
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
if account_id is None:
account_id = self._client._get_account_id_path_param()
if zone_id is None:
zone_id = self._client._get_zone_id_path_param()
if account_id and zone_id:
raise ValueError("You cannot provide both account_id and zone_id")

Expand All @@ -247,7 +268,12 @@ def get(
account_or_zone = "zones"
account_or_zone_id = zone_id
return self._get(
f"/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}",
path_template(
"/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}",
identifier=identifier,
account_or_zone=account_or_zone,
account_or_zone_id=account_or_zone_id,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down Expand Up @@ -300,8 +326,8 @@ async def update(
*,
state: Literal["default", "customized"],
url: str,
account_id: str | Omit = omit,
zone_id: str | Omit = omit,
account_id: str | None = None,
zone_id: str | None = None,
# 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,
Expand Down Expand Up @@ -333,6 +359,10 @@ async def update(
"""
if not identifier:
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
if account_id is None:
account_id = self._client._get_account_id_path_param()
if zone_id is None:
zone_id = self._client._get_zone_id_path_param()
if account_id and zone_id:
raise ValueError("You cannot provide both account_id and zone_id")

Expand All @@ -346,7 +376,12 @@ async def update(
account_or_zone = "zones"
account_or_zone_id = zone_id
return await self._put(
f"/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}",
path_template(
"/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}",
identifier=identifier,
account_or_zone=account_or_zone,
account_or_zone_id=account_or_zone_id,
),
body=await async_maybe_transform(
{
"state": state,
Expand All @@ -367,8 +402,8 @@ async def update(
def list(
self,
*,
account_id: str | Omit = omit,
zone_id: str | Omit = omit,
account_id: str | None = None,
zone_id: str | None = None,
# 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,
Expand All @@ -392,6 +427,10 @@ def list(

timeout: Override the client-level default timeout for this request, in seconds
"""
if account_id is None:
account_id = self._client._get_account_id_path_param()
if zone_id is None:
zone_id = self._client._get_zone_id_path_param()
if account_id and zone_id:
raise ValueError("You cannot provide both account_id and zone_id")

Expand All @@ -405,7 +444,11 @@ def list(
account_or_zone = "zones"
account_or_zone_id = zone_id
return self._get_api_list(
f"/{account_or_zone}/{account_or_zone_id}/custom_pages",
path_template(
"/{account_or_zone}/{account_or_zone_id}/custom_pages",
account_or_zone=account_or_zone,
account_or_zone_id=account_or_zone_id,
),
page=AsyncSinglePage[CustomPageListResponse],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
Expand All @@ -428,8 +471,8 @@ async def get(
"waf_challenge",
],
*,
account_id: str | Omit = omit,
zone_id: str | Omit = omit,
account_id: str | None = None,
zone_id: str | None = None,
# 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,
Expand Down Expand Up @@ -457,6 +500,10 @@ async def get(
"""
if not identifier:
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
if account_id is None:
account_id = self._client._get_account_id_path_param()
if zone_id is None:
zone_id = self._client._get_zone_id_path_param()
if account_id and zone_id:
raise ValueError("You cannot provide both account_id and zone_id")

Expand All @@ -470,7 +517,12 @@ async def get(
account_or_zone = "zones"
account_or_zone_id = zone_id
return await self._get(
f"/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}",
path_template(
"/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}",
identifier=identifier,
account_or_zone=account_or_zone,
account_or_zone_id=account_or_zone_id,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down
52 changes: 52 additions & 0 deletions src/cloudflare/resources/registrar/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Registrar

Types:

```python
from cloudflare.types.registrar import (
Registration,
WorkflowStatus,
RegistrarCheckResponse,
RegistrarSearchResponse,
)
```

Methods:

- <code title="post /accounts/{account_id}/registrar/domain-check">client.registrar.<a href="./src/cloudflare/resources/registrar/registrar.py">check</a>(\*, account_id, \*\*<a href="src/cloudflare/types/registrar/registrar_check_params.py">params</a>) -> <a href="./src/cloudflare/types/registrar/registrar_check_response.py">RegistrarCheckResponse</a></code>
- <code title="get /accounts/{account_id}/registrar/domain-search">client.registrar.<a href="./src/cloudflare/resources/registrar/registrar.py">search</a>(\*, account_id, \*\*<a href="src/cloudflare/types/registrar/registrar_search_params.py">params</a>) -> <a href="./src/cloudflare/types/registrar/registrar_search_response.py">RegistrarSearchResponse</a></code>

## Domains

Types:

```python
from cloudflare.types.registrar import Domain
```

Methods:

- <code title="put /accounts/{account_id}/registrar/domains/{domain_name}">client.registrar.domains.<a href="./src/cloudflare/resources/registrar/domains.py">update</a>(domain_name, \*, account_id, \*\*<a href="src/cloudflare/types/registrar/domain_update_params.py">params</a>) -> object</code>
- <code title="get /accounts/{account_id}/registrar/domains">client.registrar.domains.<a href="./src/cloudflare/resources/registrar/domains.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/registrar/domain.py">SyncSinglePage[Domain]</a></code>
- <code title="get /accounts/{account_id}/registrar/domains/{domain_name}">client.registrar.domains.<a href="./src/cloudflare/resources/registrar/domains.py">get</a>(domain_name, \*, account_id) -> object</code>

## Registrations

Methods:

- <code title="post /accounts/{account_id}/registrar/registrations">client.registrar.registrations.<a href="./src/cloudflare/resources/registrar/registrations.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/registrar/registration_create_params.py">params</a>) -> <a href="./src/cloudflare/types/registrar/workflow_status.py">WorkflowStatus</a></code>
- <code title="get /accounts/{account_id}/registrar/registrations">client.registrar.registrations.<a href="./src/cloudflare/resources/registrar/registrations.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/registrar/registration_list_params.py">params</a>) -> <a href="./src/cloudflare/types/registrar/registration.py">SyncCursorPagination[Registration]</a></code>
- <code title="patch /accounts/{account_id}/registrar/registrations/{domain_name}">client.registrar.registrations.<a href="./src/cloudflare/resources/registrar/registrations.py">edit</a>(domain_name, \*, account_id, \*\*<a href="src/cloudflare/types/registrar/registration_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/registrar/workflow_status.py">WorkflowStatus</a></code>
- <code title="get /accounts/{account_id}/registrar/registrations/{domain_name}">client.registrar.registrations.<a href="./src/cloudflare/resources/registrar/registrations.py">get</a>(domain_name, \*, account_id) -> <a href="./src/cloudflare/types/registrar/registration.py">Registration</a></code>

## RegistrationStatus

Methods:

- <code title="get /accounts/{account_id}/registrar/registrations/{domain_name}/registration-status">client.registrar.registration_status.<a href="./src/cloudflare/resources/registrar/registration_status.py">get</a>(domain_name, \*, account_id) -> <a href="./src/cloudflare/types/registrar/workflow_status.py">WorkflowStatus</a></code>

## UpdateStatus

Methods:

- <code title="get /accounts/{account_id}/registrar/registrations/{domain_name}/update-status">client.registrar.update_status.<a href="./src/cloudflare/resources/registrar/update_status.py">get</a>(domain_name, \*, account_id) -> <a href="./src/cloudflare/types/registrar/workflow_status.py">WorkflowStatus</a></code>
Loading