diff --git a/api.md b/api.md
index 57de9eb4b7c..f4b012bce46 100644
--- a/api.md
+++ b/api.md
@@ -1372,10 +1372,10 @@ from cloudflare.types.access.applications import (
Methods:
- client.access.applications.policies.create(uuid, \*, account_id, zone_id, \*\*params) -> PolicyCreateResponse
-- client.access.applications.policies.update(uuid, \*, account_id, zone_id, uuid1, \*\*params) -> PolicyUpdateResponse
+- client.access.applications.policies.update(uuid, \*, uuid1, account_id, zone_id, \*\*params) -> PolicyUpdateResponse
- client.access.applications.policies.list(uuid, \*, account_id, zone_id) -> Optional
-- client.access.applications.policies.delete(uuid, \*, account_id, zone_id, uuid1) -> PolicyDeleteResponse
-- client.access.applications.policies.get(uuid, \*, account_id, zone_id, uuid1) -> PolicyGetResponse
+- client.access.applications.policies.delete(uuid, \*, uuid1, account_id, zone_id) -> PolicyDeleteResponse
+- client.access.applications.policies.get(uuid, \*, uuid1, account_id, zone_id) -> PolicyGetResponse
## Certificates
@@ -3646,7 +3646,7 @@ from cloudflare.types.rulesets.phases import VersionListResponse, VersionGetResp
Methods:
- client.rulesets.phases.versions.list(ruleset_phase, \*, account_id, zone_id) -> VersionListResponse
-- client.rulesets.phases.versions.get(ruleset_version, \*, account_id, zone_id, ruleset_phase) -> VersionGetResponse
+- client.rulesets.phases.versions.get(ruleset_version, \*, ruleset_phase, account_id, zone_id) -> VersionGetResponse
## Rules
@@ -3659,8 +3659,8 @@ from cloudflare.types.rulesets import RuleCreateResponse, RuleDeleteResponse, Ru
Methods:
- client.rulesets.rules.create(ruleset_id, \*, account_id, zone_id, \*\*params) -> RuleCreateResponse
-- client.rulesets.rules.delete(rule_id, \*, account_id, zone_id, ruleset_id) -> RuleDeleteResponse
-- client.rulesets.rules.edit(rule_id, \*, account_id, zone_id, ruleset_id, \*\*params) -> RuleEditResponse
+- client.rulesets.rules.delete(rule_id, \*, ruleset_id, account_id, zone_id) -> RuleDeleteResponse
+- client.rulesets.rules.edit(rule_id, \*, ruleset_id, account_id, zone_id, \*\*params) -> RuleEditResponse
## Versions
@@ -3673,8 +3673,8 @@ from cloudflare.types.rulesets import VersionListResponse, VersionGetResponse
Methods:
- client.rulesets.versions.list(ruleset_id, \*, account_id, zone_id) -> VersionListResponse
-- client.rulesets.versions.delete(ruleset_version, \*, account_id, zone_id, ruleset_id) -> None
-- client.rulesets.versions.get(ruleset_version, \*, account_id, zone_id, ruleset_id) -> VersionGetResponse
+- client.rulesets.versions.delete(ruleset_version, \*, ruleset_id, account_id, zone_id) -> None
+- client.rulesets.versions.get(ruleset_version, \*, ruleset_id, account_id, zone_id) -> VersionGetResponse
### ByTags
diff --git a/src/cloudflare/resources/access/applications/applications.py b/src/cloudflare/resources/access/applications/applications.py
index d898411c6e3..a4fe7a7fc9c 100644
--- a/src/cloudflare/resources/access/applications/applications.py
+++ b/src/cloudflare/resources/access/applications/applications.py
@@ -81,8 +81,8 @@ def with_streaming_response(self) -> ApplicationsWithStreamingResponse:
def create(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN,
allowed_idps: List[str] | NotGiven = NOT_GIVEN,
app_launcher_visible: object | NotGiven = NOT_GIVEN,
@@ -188,10 +188,21 @@ def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
ApplicationCreateResponse,
self._post(
- f"/{account_id}/{zone_id}/access/apps",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps",
body=maybe_transform(
{
"allow_authenticate_via_warp": allow_authenticate_via_warp,
@@ -237,8 +248,8 @@ def update(
self,
app_id: Union[str, str],
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN,
allowed_idps: List[str] | NotGiven = NOT_GIVEN,
app_launcher_visible: object | NotGiven = NOT_GIVEN,
@@ -273,12 +284,12 @@ def update(
Updates an Access application.
Args:
+ app_id: Identifier
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- app_id: Identifier
-
allow_authenticate_via_warp: When set to true, users can authenticate to this application using their WARP
session. When set to false this application will always require direct IdP
authentication. This setting always overrides the organization setting for WARP
@@ -346,10 +357,21 @@ def update(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
ApplicationUpdateResponse,
self._put(
- f"/{account_id}/{zone_id}/access/apps/{app_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}",
body=maybe_transform(
{
"allow_authenticate_via_warp": allow_authenticate_via_warp,
@@ -394,8 +416,8 @@ def update(
def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -423,8 +445,19 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/access/apps",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -439,8 +472,8 @@ def delete(
self,
app_id: Union[str, str],
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -452,12 +485,12 @@ def delete(
Deletes an application from Access.
Args:
+ app_id: Identifier
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- app_id: Identifier
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -470,8 +503,19 @@ def delete(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._delete(
- f"/{account_id}/{zone_id}/access/apps/{app_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -486,8 +530,8 @@ def get(
self,
app_id: Union[str, str],
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -499,12 +543,12 @@ def get(
Fetches information about an Access application.
Args:
+ app_id: Identifier
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- app_id: Identifier
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -517,10 +561,21 @@ def get(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
ApplicationGetResponse,
self._get(
- f"/{account_id}/{zone_id}/access/apps/{app_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -538,8 +593,8 @@ def revoke_tokens(
self,
app_id: Union[str, str],
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -551,12 +606,12 @@ def revoke_tokens(
Revokes all tokens issued for an application.
Args:
+ app_id: Identifier
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- app_id: Identifier
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -569,8 +624,19 @@ def revoke_tokens(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._post(
- f"/{account_id}/{zone_id}/access/apps/{app_id}/revoke_tokens",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}/revoke_tokens",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -606,8 +672,8 @@ def with_streaming_response(self) -> AsyncApplicationsWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN,
allowed_idps: List[str] | NotGiven = NOT_GIVEN,
app_launcher_visible: object | NotGiven = NOT_GIVEN,
@@ -713,10 +779,21 @@ async def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
ApplicationCreateResponse,
await self._post(
- f"/{account_id}/{zone_id}/access/apps",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps",
body=maybe_transform(
{
"allow_authenticate_via_warp": allow_authenticate_via_warp,
@@ -762,8 +839,8 @@ async def update(
self,
app_id: Union[str, str],
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN,
allowed_idps: List[str] | NotGiven = NOT_GIVEN,
app_launcher_visible: object | NotGiven = NOT_GIVEN,
@@ -798,12 +875,12 @@ async def update(
Updates an Access application.
Args:
+ app_id: Identifier
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- app_id: Identifier
-
allow_authenticate_via_warp: When set to true, users can authenticate to this application using their WARP
session. When set to false this application will always require direct IdP
authentication. This setting always overrides the organization setting for WARP
@@ -871,10 +948,21 @@ async def update(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
ApplicationUpdateResponse,
await self._put(
- f"/{account_id}/{zone_id}/access/apps/{app_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}",
body=maybe_transform(
{
"allow_authenticate_via_warp": allow_authenticate_via_warp,
@@ -919,8 +1007,8 @@ async def update(
async def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -948,8 +1036,19 @@ async def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/access/apps",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -964,8 +1063,8 @@ async def delete(
self,
app_id: Union[str, str],
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -977,12 +1076,12 @@ async def delete(
Deletes an application from Access.
Args:
+ app_id: Identifier
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- app_id: Identifier
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -995,8 +1094,19 @@ async def delete(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._delete(
- f"/{account_id}/{zone_id}/access/apps/{app_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -1011,8 +1121,8 @@ async def get(
self,
app_id: Union[str, str],
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -1024,12 +1134,12 @@ async def get(
Fetches information about an Access application.
Args:
+ app_id: Identifier
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- app_id: Identifier
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -1042,10 +1152,21 @@ async def get(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
ApplicationGetResponse,
await self._get(
- f"/{account_id}/{zone_id}/access/apps/{app_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -1063,8 +1184,8 @@ async def revoke_tokens(
self,
app_id: Union[str, str],
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -1076,12 +1197,12 @@ async def revoke_tokens(
Revokes all tokens issued for an application.
Args:
+ app_id: Identifier
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- app_id: Identifier
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -1094,8 +1215,19 @@ async def revoke_tokens(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._post(
- f"/{account_id}/{zone_id}/access/apps/{app_id}/revoke_tokens",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}/revoke_tokens",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/access/applications/cas.py b/src/cloudflare/resources/access/applications/cas.py
index d2838ee1e82..a2dc1fb460c 100644
--- a/src/cloudflare/resources/access/applications/cas.py
+++ b/src/cloudflare/resources/access/applications/cas.py
@@ -37,8 +37,8 @@ def create(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -50,12 +50,12 @@ def create(
Generates a new short-lived certificate CA and public key.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -64,16 +64,27 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
CACreateResponse,
self._post(
- f"/{account_id}/{zone_id}/access/apps/{uuid}/ca",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid}/ca",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -90,8 +101,8 @@ def create(
def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -119,8 +130,19 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/access/apps/ca",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/ca",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -135,8 +157,8 @@ def delete(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -148,12 +170,12 @@ def delete(
Deletes a short-lived certificate CA.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -162,14 +184,25 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._delete(
- f"/{account_id}/{zone_id}/access/apps/{uuid}/ca",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid}/ca",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -184,8 +217,8 @@ def get(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -197,12 +230,12 @@ def get(
Fetches a short-lived certificate CA and its public key.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -211,16 +244,27 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
CAGetResponse,
self._get(
- f"/{account_id}/{zone_id}/access/apps/{uuid}/ca",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid}/ca",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -248,8 +292,8 @@ async def create(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -261,12 +305,12 @@ async def create(
Generates a new short-lived certificate CA and public key.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -275,16 +319,27 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
CACreateResponse,
await self._post(
- f"/{account_id}/{zone_id}/access/apps/{uuid}/ca",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid}/ca",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -301,8 +356,8 @@ async def create(
async def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -330,8 +385,19 @@ async def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/access/apps/ca",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/ca",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -346,8 +412,8 @@ async def delete(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -359,12 +425,12 @@ async def delete(
Deletes a short-lived certificate CA.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -373,14 +439,25 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._delete(
- f"/{account_id}/{zone_id}/access/apps/{uuid}/ca",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid}/ca",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -395,8 +472,8 @@ async def get(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -408,12 +485,12 @@ async def get(
Fetches a short-lived certificate CA and its public key.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -422,16 +499,27 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
CAGetResponse,
await self._get(
- f"/{account_id}/{zone_id}/access/apps/{uuid}/ca",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid}/ca",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/access/applications/policies.py b/src/cloudflare/resources/access/applications/policies.py
index d894d6af37d..b3d3b881932 100644
--- a/src/cloudflare/resources/access/applications/policies.py
+++ b/src/cloudflare/resources/access/applications/policies.py
@@ -47,11 +47,11 @@ def create(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
decision: Literal["allow", "deny", "non_identity", "bypass"],
include: Iterable[policy_create_params.Include],
name: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
approval_groups: Iterable[policy_create_params.ApprovalGroup] | NotGiven = NOT_GIVEN,
approval_required: bool | NotGiven = NOT_GIVEN,
exclude: Iterable[policy_create_params.Exclude] | NotGiven = NOT_GIVEN,
@@ -72,10 +72,6 @@ def create(
Create a new Access policy for an application.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
uuid: UUID
decision: The action Access will take if a user matches this policy.
@@ -85,6 +81,10 @@ def create(
name: The name of the Access policy.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
approval_groups: Administrators who can approve a temporary authentication request.
approval_required: Requires the user to request access from an administrator at the start of each
@@ -118,14 +118,25 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._post(
- f"/{account_id}/{zone_id}/access/apps/{uuid}/policies",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid}/policies",
body=maybe_transform(
{
"decision": decision,
@@ -157,12 +168,12 @@ def update(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
uuid1: str,
decision: Literal["allow", "deny", "non_identity", "bypass"],
include: Iterable[policy_update_params.Include],
name: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
approval_groups: Iterable[policy_update_params.ApprovalGroup] | NotGiven = NOT_GIVEN,
approval_required: bool | NotGiven = NOT_GIVEN,
exclude: Iterable[policy_update_params.Exclude] | NotGiven = NOT_GIVEN,
@@ -183,10 +194,6 @@ def update(
Update a configured Access policy.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
uuid1: UUID
uuid: UUID
@@ -198,6 +205,10 @@ def update(
name: The name of the Access policy.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
approval_groups: Administrators who can approve a temporary authentication request.
approval_required: Requires the user to request access from an administrator at the start of each
@@ -231,16 +242,27 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not account_id:
- raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not uuid1:
raise ValueError(f"Expected a non-empty value for `uuid1` but received {uuid1!r}")
if not uuid:
raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._put(
- f"/{account_id}/{zone_id}/access/apps/{uuid1}/policies/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid1}/policies/{uuid}",
body=maybe_transform(
{
"decision": decision,
@@ -272,8 +294,8 @@ def list(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -285,12 +307,12 @@ def list(
Lists Access policies configured for an application.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -299,14 +321,25 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/access/apps/{uuid}/policies",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid}/policies",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -321,9 +354,9 @@ def delete(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
uuid1: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -335,14 +368,14 @@ def delete(
Delete an Access policy.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
uuid1: UUID
uuid: UUID
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -351,16 +384,27 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not account_id:
- raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not uuid1:
raise ValueError(f"Expected a non-empty value for `uuid1` but received {uuid1!r}")
if not uuid:
raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._delete(
- f"/{account_id}/{zone_id}/access/apps/{uuid1}/policies/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid1}/policies/{uuid}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -375,9 +419,9 @@ def get(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
uuid1: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -389,14 +433,14 @@ def get(
Fetches a single Access policy.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
uuid1: UUID
uuid: UUID
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -405,16 +449,27 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not account_id:
- raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not uuid1:
raise ValueError(f"Expected a non-empty value for `uuid1` but received {uuid1!r}")
if not uuid:
raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/access/apps/{uuid1}/policies/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid1}/policies/{uuid}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -439,11 +494,11 @@ async def create(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
decision: Literal["allow", "deny", "non_identity", "bypass"],
include: Iterable[policy_create_params.Include],
name: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
approval_groups: Iterable[policy_create_params.ApprovalGroup] | NotGiven = NOT_GIVEN,
approval_required: bool | NotGiven = NOT_GIVEN,
exclude: Iterable[policy_create_params.Exclude] | NotGiven = NOT_GIVEN,
@@ -464,10 +519,6 @@ async def create(
Create a new Access policy for an application.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
uuid: UUID
decision: The action Access will take if a user matches this policy.
@@ -477,6 +528,10 @@ async def create(
name: The name of the Access policy.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
approval_groups: Administrators who can approve a temporary authentication request.
approval_required: Requires the user to request access from an administrator at the start of each
@@ -510,14 +565,25 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._post(
- f"/{account_id}/{zone_id}/access/apps/{uuid}/policies",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid}/policies",
body=maybe_transform(
{
"decision": decision,
@@ -549,12 +615,12 @@ async def update(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
uuid1: str,
decision: Literal["allow", "deny", "non_identity", "bypass"],
include: Iterable[policy_update_params.Include],
name: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
approval_groups: Iterable[policy_update_params.ApprovalGroup] | NotGiven = NOT_GIVEN,
approval_required: bool | NotGiven = NOT_GIVEN,
exclude: Iterable[policy_update_params.Exclude] | NotGiven = NOT_GIVEN,
@@ -575,10 +641,6 @@ async def update(
Update a configured Access policy.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
uuid1: UUID
uuid: UUID
@@ -590,6 +652,10 @@ async def update(
name: The name of the Access policy.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
approval_groups: Administrators who can approve a temporary authentication request.
approval_required: Requires the user to request access from an administrator at the start of each
@@ -623,16 +689,27 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not account_id:
- raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not uuid1:
raise ValueError(f"Expected a non-empty value for `uuid1` but received {uuid1!r}")
if not uuid:
raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._put(
- f"/{account_id}/{zone_id}/access/apps/{uuid1}/policies/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid1}/policies/{uuid}",
body=maybe_transform(
{
"decision": decision,
@@ -664,8 +741,8 @@ async def list(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -677,12 +754,12 @@ async def list(
Lists Access policies configured for an application.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -691,14 +768,25 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/access/apps/{uuid}/policies",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid}/policies",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -713,9 +801,9 @@ async def delete(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
uuid1: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -727,14 +815,14 @@ async def delete(
Delete an Access policy.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
uuid1: UUID
uuid: UUID
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -743,16 +831,27 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not account_id:
- raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not uuid1:
raise ValueError(f"Expected a non-empty value for `uuid1` but received {uuid1!r}")
if not uuid:
raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._delete(
- f"/{account_id}/{zone_id}/access/apps/{uuid1}/policies/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid1}/policies/{uuid}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -767,9 +866,9 @@ async def get(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
uuid1: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -781,14 +880,14 @@ async def get(
Fetches a single Access policy.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
uuid1: UUID
uuid: UUID
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -797,16 +896,27 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not account_id:
- raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not uuid1:
raise ValueError(f"Expected a non-empty value for `uuid1` but received {uuid1!r}")
if not uuid:
raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/access/apps/{uuid1}/policies/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid1}/policies/{uuid}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/access/applications/user_policy_checks.py b/src/cloudflare/resources/access/applications/user_policy_checks.py
index 708b9fd0a97..e6054a4a83b 100644
--- a/src/cloudflare/resources/access/applications/user_policy_checks.py
+++ b/src/cloudflare/resources/access/applications/user_policy_checks.py
@@ -37,8 +37,8 @@ def list(
self,
app_id: Union[str, str],
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -50,12 +50,12 @@ def list(
Tests if a specific user has permission to access an application.
Args:
+ app_id: Identifier
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- app_id: Identifier
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -68,8 +68,19 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/access/apps/{app_id}/user_policy_checks",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}/user_policy_checks",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -94,8 +105,8 @@ async def list(
self,
app_id: Union[str, str],
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -107,12 +118,12 @@ async def list(
Tests if a specific user has permission to access an application.
Args:
+ app_id: Identifier
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- app_id: Identifier
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -125,8 +136,19 @@ async def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/access/apps/{app_id}/user_policy_checks",
+ f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}/user_policy_checks",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/access/certificates/certificates.py b/src/cloudflare/resources/access/certificates/certificates.py
index 548a4d6ec55..2d2ebd8feb7 100644
--- a/src/cloudflare/resources/access/certificates/certificates.py
+++ b/src/cloudflare/resources/access/certificates/certificates.py
@@ -57,10 +57,10 @@ def with_streaming_response(self) -> CertificatesWithStreamingResponse:
def create(
self,
*,
- account_id: str,
- zone_id: str,
certificate: str,
name: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
associated_hostnames: List[str] | NotGiven = NOT_GIVEN,
# 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.
@@ -73,14 +73,14 @@ def create(
Adds a new mTLS root certificate to Access.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
certificate: The certificate content.
name: The name of the certificate.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
associated_hostnames: The hostnames of the applications that will use this certificate.
extra_headers: Send extra headers
@@ -95,8 +95,19 @@ def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._post(
- f"/{account_id}/{zone_id}/access/certificates",
+ f"/{account_or_zone}/{account_or_zone_id}/access/certificates",
body=maybe_transform(
{
"certificate": certificate,
@@ -119,9 +130,9 @@ def update(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
associated_hostnames: List[str],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
# 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.
@@ -134,14 +145,14 @@ def update(
Updates a configured mTLS certificate.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
uuid: UUID
associated_hostnames: The hostnames of the applications that will use this certificate.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
name: The name of the certificate.
extra_headers: Send extra headers
@@ -152,14 +163,25 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._put(
- f"/{account_id}/{zone_id}/access/certificates/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/certificates/{uuid}",
body=maybe_transform(
{
"associated_hostnames": associated_hostnames,
@@ -180,8 +202,8 @@ def update(
def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -209,8 +231,19 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/access/certificates",
+ f"/{account_or_zone}/{account_or_zone_id}/access/certificates",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -225,8 +258,8 @@ def delete(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -238,12 +271,12 @@ def delete(
Deletes an mTLS certificate.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -252,14 +285,25 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._delete(
- f"/{account_id}/{zone_id}/access/certificates/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/certificates/{uuid}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -274,8 +318,8 @@ def get(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -287,12 +331,12 @@ def get(
Fetches a single mTLS certificate.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -301,14 +345,25 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/access/certificates/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/certificates/{uuid}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -336,10 +391,10 @@ def with_streaming_response(self) -> AsyncCertificatesWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
- zone_id: str,
certificate: str,
name: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
associated_hostnames: List[str] | NotGiven = NOT_GIVEN,
# 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.
@@ -352,14 +407,14 @@ async def create(
Adds a new mTLS root certificate to Access.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
certificate: The certificate content.
name: The name of the certificate.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
associated_hostnames: The hostnames of the applications that will use this certificate.
extra_headers: Send extra headers
@@ -374,8 +429,19 @@ async def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._post(
- f"/{account_id}/{zone_id}/access/certificates",
+ f"/{account_or_zone}/{account_or_zone_id}/access/certificates",
body=maybe_transform(
{
"certificate": certificate,
@@ -398,9 +464,9 @@ async def update(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
associated_hostnames: List[str],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
# 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.
@@ -413,14 +479,14 @@ async def update(
Updates a configured mTLS certificate.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
uuid: UUID
associated_hostnames: The hostnames of the applications that will use this certificate.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
name: The name of the certificate.
extra_headers: Send extra headers
@@ -431,14 +497,25 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._put(
- f"/{account_id}/{zone_id}/access/certificates/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/certificates/{uuid}",
body=maybe_transform(
{
"associated_hostnames": associated_hostnames,
@@ -459,8 +536,8 @@ async def update(
async def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -488,8 +565,19 @@ async def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/access/certificates",
+ f"/{account_or_zone}/{account_or_zone_id}/access/certificates",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -504,8 +592,8 @@ async def delete(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -517,12 +605,12 @@ async def delete(
Deletes an mTLS certificate.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -531,14 +619,25 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._delete(
- f"/{account_id}/{zone_id}/access/certificates/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/certificates/{uuid}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -553,8 +652,8 @@ async def get(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -566,12 +665,12 @@ async def get(
Fetches a single mTLS certificate.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -580,14 +679,25 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/access/certificates/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/certificates/{uuid}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/access/certificates/settings.py b/src/cloudflare/resources/access/certificates/settings.py
index d047fbb428a..98a2af85322 100644
--- a/src/cloudflare/resources/access/certificates/settings.py
+++ b/src/cloudflare/resources/access/certificates/settings.py
@@ -37,9 +37,9 @@ def with_streaming_response(self) -> SettingsWithStreamingResponse:
def update(
self,
*,
- account_id: str,
- zone_id: str,
settings: Iterable[setting_update_params.Setting],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -67,8 +67,19 @@ def update(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._put(
- f"/{account_id}/{zone_id}/access/certificates/settings",
+ f"/{account_or_zone}/{account_or_zone_id}/access/certificates/settings",
body=maybe_transform({"settings": settings}, setting_update_params.SettingUpdateParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -83,8 +94,8 @@ def update(
def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -112,8 +123,19 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/access/certificates/settings",
+ f"/{account_or_zone}/{account_or_zone_id}/access/certificates/settings",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -137,9 +159,9 @@ def with_streaming_response(self) -> AsyncSettingsWithStreamingResponse:
async def update(
self,
*,
- account_id: str,
- zone_id: str,
settings: Iterable[setting_update_params.Setting],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -167,8 +189,19 @@ async def update(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._put(
- f"/{account_id}/{zone_id}/access/certificates/settings",
+ f"/{account_or_zone}/{account_or_zone_id}/access/certificates/settings",
body=maybe_transform({"settings": settings}, setting_update_params.SettingUpdateParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -183,8 +216,8 @@ async def update(
async def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -212,8 +245,19 @@ async def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/access/certificates/settings",
+ f"/{account_or_zone}/{account_or_zone_id}/access/certificates/settings",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/access/groups.py b/src/cloudflare/resources/access/groups.py
index d6197a314fa..77bc9855c93 100644
--- a/src/cloudflare/resources/access/groups.py
+++ b/src/cloudflare/resources/access/groups.py
@@ -45,10 +45,10 @@ def with_streaming_response(self) -> GroupsWithStreamingResponse:
def create(
self,
*,
- account_id: str,
- zone_id: str,
include: Iterable[group_create_params.Include],
name: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
exclude: Iterable[group_create_params.Exclude] | NotGiven = NOT_GIVEN,
is_default: bool | NotGiven = NOT_GIVEN,
require: Iterable[group_create_params.Require] | NotGiven = NOT_GIVEN,
@@ -63,15 +63,15 @@ def create(
Creates a new Access group.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
include: Rules evaluated with an OR logical operator. A user needs to meet only one of
the Include rules.
name: The name of the Access group.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
exclude: Rules evaluated with a NOT logical operator. To match a policy, a user cannot
meet any of the Exclude rules.
@@ -92,8 +92,19 @@ def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._post(
- f"/{account_id}/{zone_id}/access/groups",
+ f"/{account_or_zone}/{account_or_zone_id}/access/groups",
body=maybe_transform(
{
"include": include,
@@ -118,10 +129,10 @@ def update(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
include: Iterable[group_update_params.Include],
name: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
exclude: Iterable[group_update_params.Exclude] | NotGiven = NOT_GIVEN,
is_default: bool | NotGiven = NOT_GIVEN,
require: Iterable[group_update_params.Require] | NotGiven = NOT_GIVEN,
@@ -136,10 +147,6 @@ def update(
Updates a configured Access group.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
uuid: UUID
include: Rules evaluated with an OR logical operator. A user needs to meet only one of
@@ -147,6 +154,10 @@ def update(
name: The name of the Access group.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
exclude: Rules evaluated with a NOT logical operator. To match a policy, a user cannot
meet any of the Exclude rules.
@@ -163,14 +174,25 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._put(
- f"/{account_id}/{zone_id}/access/groups/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/groups/{uuid}",
body=maybe_transform(
{
"include": include,
@@ -194,8 +216,8 @@ def update(
def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -223,8 +245,19 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/access/groups",
+ f"/{account_or_zone}/{account_or_zone_id}/access/groups",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -239,8 +272,8 @@ def delete(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -252,12 +285,12 @@ def delete(
Deletes an Access group.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -266,14 +299,25 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._delete(
- f"/{account_id}/{zone_id}/access/groups/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/groups/{uuid}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -288,8 +332,8 @@ def get(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -301,12 +345,12 @@ def get(
Fetches a single Access group.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -315,14 +359,25 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/access/groups/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/groups/{uuid}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -346,10 +401,10 @@ def with_streaming_response(self) -> AsyncGroupsWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
- zone_id: str,
include: Iterable[group_create_params.Include],
name: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
exclude: Iterable[group_create_params.Exclude] | NotGiven = NOT_GIVEN,
is_default: bool | NotGiven = NOT_GIVEN,
require: Iterable[group_create_params.Require] | NotGiven = NOT_GIVEN,
@@ -364,15 +419,15 @@ async def create(
Creates a new Access group.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
include: Rules evaluated with an OR logical operator. A user needs to meet only one of
the Include rules.
name: The name of the Access group.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
exclude: Rules evaluated with a NOT logical operator. To match a policy, a user cannot
meet any of the Exclude rules.
@@ -393,8 +448,19 @@ async def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._post(
- f"/{account_id}/{zone_id}/access/groups",
+ f"/{account_or_zone}/{account_or_zone_id}/access/groups",
body=maybe_transform(
{
"include": include,
@@ -419,10 +485,10 @@ async def update(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
include: Iterable[group_update_params.Include],
name: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
exclude: Iterable[group_update_params.Exclude] | NotGiven = NOT_GIVEN,
is_default: bool | NotGiven = NOT_GIVEN,
require: Iterable[group_update_params.Require] | NotGiven = NOT_GIVEN,
@@ -437,10 +503,6 @@ async def update(
Updates a configured Access group.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
uuid: UUID
include: Rules evaluated with an OR logical operator. A user needs to meet only one of
@@ -448,6 +510,10 @@ async def update(
name: The name of the Access group.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
exclude: Rules evaluated with a NOT logical operator. To match a policy, a user cannot
meet any of the Exclude rules.
@@ -464,14 +530,25 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._put(
- f"/{account_id}/{zone_id}/access/groups/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/groups/{uuid}",
body=maybe_transform(
{
"include": include,
@@ -495,8 +572,8 @@ async def update(
async def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -524,8 +601,19 @@ async def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/access/groups",
+ f"/{account_or_zone}/{account_or_zone_id}/access/groups",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -540,8 +628,8 @@ async def delete(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -553,12 +641,12 @@ async def delete(
Deletes an Access group.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -567,14 +655,25 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._delete(
- f"/{account_id}/{zone_id}/access/groups/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/groups/{uuid}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -589,8 +688,8 @@ async def get(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -602,12 +701,12 @@ async def get(
Fetches a single Access group.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -616,14 +715,25 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/access/groups/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/groups/{uuid}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/access/identity_providers.py b/src/cloudflare/resources/access/identity_providers.py
index d8495d2c567..99b5fa8ba33 100644
--- a/src/cloudflare/resources/access/identity_providers.py
+++ b/src/cloudflare/resources/access/identity_providers.py
@@ -46,8 +46,6 @@ def with_streaming_response(self) -> IdentityProvidersWithStreamingResponse:
def create(
self,
*,
- account_id: str,
- zone_id: str,
config: identity_provider_create_params.Config,
name: str,
type: Literal[
@@ -66,6 +64,8 @@ def create(
"pingone",
"yandex",
],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
scim_config: identity_provider_create_params.ScimConfig | NotGiven = NOT_GIVEN,
# 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.
@@ -78,16 +78,16 @@ def create(
Adds a new identity provider to Access.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
name: The name of the identity provider, shown to users on the login page.
type: The type of identity provider. To determine the value for a specific provider,
refer to our
[developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -100,10 +100,21 @@ def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
IdentityProviderCreateResponse,
self._post(
- f"/{account_id}/{zone_id}/access/identity_providers",
+ f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers",
body=maybe_transform(
{
"config": config,
@@ -130,8 +141,6 @@ def update(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
config: identity_provider_update_params.Config,
name: str,
type: Literal[
@@ -150,6 +159,8 @@ def update(
"pingone",
"yandex",
],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
scim_config: identity_provider_update_params.ScimConfig | NotGiven = NOT_GIVEN,
# 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.
@@ -162,10 +173,6 @@ def update(
Updates a configured identity provider.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
uuid: UUID
name: The name of the identity provider, shown to users on the login page.
@@ -174,6 +181,10 @@ def update(
refer to our
[developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -182,16 +193,27 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
IdentityProviderUpdateResponse,
self._put(
- f"/{account_id}/{zone_id}/access/identity_providers/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers/{uuid}",
body=maybe_transform(
{
"config": config,
@@ -217,8 +239,8 @@ def update(
def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -246,8 +268,19 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/access/identity_providers",
+ f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -262,8 +295,8 @@ def delete(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -275,12 +308,12 @@ def delete(
Deletes an identity provider from Access.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -289,14 +322,25 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._delete(
- f"/{account_id}/{zone_id}/access/identity_providers/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers/{uuid}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -311,8 +355,8 @@ def get(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -324,12 +368,12 @@ def get(
Fetches a configured identity provider.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -338,16 +382,27 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
IdentityProviderGetResponse,
self._get(
- f"/{account_id}/{zone_id}/access/identity_providers/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers/{uuid}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -374,8 +429,6 @@ def with_streaming_response(self) -> AsyncIdentityProvidersWithStreamingResponse
async def create(
self,
*,
- account_id: str,
- zone_id: str,
config: identity_provider_create_params.Config,
name: str,
type: Literal[
@@ -394,6 +447,8 @@ async def create(
"pingone",
"yandex",
],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
scim_config: identity_provider_create_params.ScimConfig | NotGiven = NOT_GIVEN,
# 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.
@@ -406,16 +461,16 @@ async def create(
Adds a new identity provider to Access.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
name: The name of the identity provider, shown to users on the login page.
type: The type of identity provider. To determine the value for a specific provider,
refer to our
[developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -428,10 +483,21 @@ async def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
IdentityProviderCreateResponse,
await self._post(
- f"/{account_id}/{zone_id}/access/identity_providers",
+ f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers",
body=maybe_transform(
{
"config": config,
@@ -458,8 +524,6 @@ async def update(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
config: identity_provider_update_params.Config,
name: str,
type: Literal[
@@ -478,6 +542,8 @@ async def update(
"pingone",
"yandex",
],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
scim_config: identity_provider_update_params.ScimConfig | NotGiven = NOT_GIVEN,
# 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.
@@ -490,10 +556,6 @@ async def update(
Updates a configured identity provider.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
uuid: UUID
name: The name of the identity provider, shown to users on the login page.
@@ -502,6 +564,10 @@ async def update(
refer to our
[developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -510,16 +576,27 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
IdentityProviderUpdateResponse,
await self._put(
- f"/{account_id}/{zone_id}/access/identity_providers/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers/{uuid}",
body=maybe_transform(
{
"config": config,
@@ -545,8 +622,8 @@ async def update(
async def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -574,8 +651,19 @@ async def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/access/identity_providers",
+ f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -590,8 +678,8 @@ async def delete(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -603,12 +691,12 @@ async def delete(
Deletes an identity provider from Access.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -617,14 +705,25 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._delete(
- f"/{account_id}/{zone_id}/access/identity_providers/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers/{uuid}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -639,8 +738,8 @@ async def get(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -652,12 +751,12 @@ async def get(
Fetches a configured identity provider.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -666,16 +765,27 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
IdentityProviderGetResponse,
await self._get(
- f"/{account_id}/{zone_id}/access/identity_providers/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers/{uuid}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/access/organizations.py b/src/cloudflare/resources/access/organizations.py
index 0200dac65b5..4c6df6eb2b5 100644
--- a/src/cloudflare/resources/access/organizations.py
+++ b/src/cloudflare/resources/access/organizations.py
@@ -45,10 +45,10 @@ def with_streaming_response(self) -> OrganizationsWithStreamingResponse:
def create(
self,
*,
- account_id: str,
- zone_id: str,
auth_domain: str,
name: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN,
auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN,
is_ui_read_only: bool | NotGiven = NOT_GIVEN,
@@ -68,14 +68,14 @@ def create(
Sets up a Zero Trust organization for your account or zone.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
auth_domain: The unique subdomain assigned to your Zero Trust organization.
name: The name of your Zero Trust organization.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
allow_authenticate_via_warp: When set to true, users can authenticate via WARP for any application in your
organization. Application settings will take precedence over this value.
@@ -111,8 +111,19 @@ def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._post(
- f"/{account_id}/{zone_id}/access/organizations",
+ f"/{account_or_zone}/{account_or_zone_id}/access/organizations",
body=maybe_transform(
{
"auth_domain": auth_domain,
@@ -141,8 +152,8 @@ def create(
def update(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN,
auth_domain: str | NotGiven = NOT_GIVEN,
auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN,
@@ -208,8 +219,19 @@ def update(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._put(
- f"/{account_id}/{zone_id}/access/organizations",
+ f"/{account_or_zone}/{account_or_zone_id}/access/organizations",
body=maybe_transform(
{
"allow_authenticate_via_warp": allow_authenticate_via_warp,
@@ -239,8 +261,8 @@ def update(
def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -268,8 +290,19 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/access/organizations",
+ f"/{account_or_zone}/{account_or_zone_id}/access/organizations",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -283,9 +316,9 @@ def list(
def revoke_users(
self,
*,
- account_id: str,
- zone_id: str,
email: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -297,12 +330,12 @@ def revoke_users(
Revokes a user's access across all applications.
Args:
+ email: The email of the user to revoke.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- email: The email of the user to revoke.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -315,8 +348,19 @@ def revoke_users(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._post(
- f"/{account_id}/{zone_id}/access/organizations/revoke_user",
+ f"/{account_or_zone}/{account_or_zone_id}/access/organizations/revoke_user",
body=maybe_transform({"email": email}, organization_revoke_users_params.OrganizationRevokeUsersParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -343,10 +387,10 @@ def with_streaming_response(self) -> AsyncOrganizationsWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
- zone_id: str,
auth_domain: str,
name: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN,
auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN,
is_ui_read_only: bool | NotGiven = NOT_GIVEN,
@@ -366,14 +410,14 @@ async def create(
Sets up a Zero Trust organization for your account or zone.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
auth_domain: The unique subdomain assigned to your Zero Trust organization.
name: The name of your Zero Trust organization.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
allow_authenticate_via_warp: When set to true, users can authenticate via WARP for any application in your
organization. Application settings will take precedence over this value.
@@ -409,8 +453,19 @@ async def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._post(
- f"/{account_id}/{zone_id}/access/organizations",
+ f"/{account_or_zone}/{account_or_zone_id}/access/organizations",
body=maybe_transform(
{
"auth_domain": auth_domain,
@@ -439,8 +494,8 @@ async def create(
async def update(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN,
auth_domain: str | NotGiven = NOT_GIVEN,
auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN,
@@ -506,8 +561,19 @@ async def update(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._put(
- f"/{account_id}/{zone_id}/access/organizations",
+ f"/{account_or_zone}/{account_or_zone_id}/access/organizations",
body=maybe_transform(
{
"allow_authenticate_via_warp": allow_authenticate_via_warp,
@@ -537,8 +603,8 @@ async def update(
async def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -566,8 +632,19 @@ async def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/access/organizations",
+ f"/{account_or_zone}/{account_or_zone_id}/access/organizations",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -581,9 +658,9 @@ async def list(
async def revoke_users(
self,
*,
- account_id: str,
- zone_id: str,
email: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -595,12 +672,12 @@ async def revoke_users(
Revokes a user's access across all applications.
Args:
+ email: The email of the user to revoke.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- email: The email of the user to revoke.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -613,8 +690,19 @@ async def revoke_users(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._post(
- f"/{account_id}/{zone_id}/access/organizations/revoke_user",
+ f"/{account_or_zone}/{account_or_zone_id}/access/organizations/revoke_user",
body=maybe_transform({"email": email}, organization_revoke_users_params.OrganizationRevokeUsersParams),
options=make_request_options(
extra_headers=extra_headers,
diff --git a/src/cloudflare/resources/access/service_tokens.py b/src/cloudflare/resources/access/service_tokens.py
index 6b2e915e876..76054d46725 100644
--- a/src/cloudflare/resources/access/service_tokens.py
+++ b/src/cloudflare/resources/access/service_tokens.py
@@ -46,9 +46,9 @@ def with_streaming_response(self) -> ServiceTokensWithStreamingResponse:
def create(
self,
*,
- account_id: str,
- zone_id: str,
name: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
duration: str | NotGiven = NOT_GIVEN,
# 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.
@@ -64,12 +64,12 @@ def create(
Secret or create a new service token.
Args:
+ name: The name of the service token.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- name: The name of the service token.
-
duration: The duration for how long the service token will be valid. Must be in the format
`300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The
default is 1 year in hours (8760h).
@@ -86,8 +86,19 @@ def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._post(
- f"/{account_id}/{zone_id}/access/service_tokens",
+ f"/{account_or_zone}/{account_or_zone_id}/access/service_tokens",
body=maybe_transform(
{
"name": name,
@@ -109,8 +120,8 @@ def update(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
duration: str | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -124,12 +135,12 @@ def update(
Updates a configured service token.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
duration: The duration for how long the service token will be valid. Must be in the format
`300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The
default is 1 year in hours (8760h).
@@ -144,14 +155,25 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._put(
- f"/{account_id}/{zone_id}/access/service_tokens/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/service_tokens/{uuid}",
body=maybe_transform(
{
"duration": duration,
@@ -172,8 +194,8 @@ def update(
def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -201,8 +223,19 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/access/service_tokens",
+ f"/{account_or_zone}/{account_or_zone_id}/access/service_tokens",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -217,8 +250,8 @@ def delete(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -230,12 +263,12 @@ def delete(
Deletes a service token.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -244,14 +277,25 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._delete(
- f"/{account_id}/{zone_id}/access/service_tokens/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/service_tokens/{uuid}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -363,9 +407,9 @@ def with_streaming_response(self) -> AsyncServiceTokensWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
- zone_id: str,
name: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
duration: str | NotGiven = NOT_GIVEN,
# 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.
@@ -381,12 +425,12 @@ async def create(
Secret or create a new service token.
Args:
+ name: The name of the service token.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- name: The name of the service token.
-
duration: The duration for how long the service token will be valid. Must be in the format
`300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The
default is 1 year in hours (8760h).
@@ -403,8 +447,19 @@ async def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._post(
- f"/{account_id}/{zone_id}/access/service_tokens",
+ f"/{account_or_zone}/{account_or_zone_id}/access/service_tokens",
body=maybe_transform(
{
"name": name,
@@ -426,8 +481,8 @@ async def update(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
duration: str | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -441,12 +496,12 @@ async def update(
Updates a configured service token.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
duration: The duration for how long the service token will be valid. Must be in the format
`300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The
default is 1 year in hours (8760h).
@@ -461,14 +516,25 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._put(
- f"/{account_id}/{zone_id}/access/service_tokens/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/service_tokens/{uuid}",
body=maybe_transform(
{
"duration": duration,
@@ -489,8 +555,8 @@ async def update(
async def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -518,8 +584,19 @@ async def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/access/service_tokens",
+ f"/{account_or_zone}/{account_or_zone_id}/access/service_tokens",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -534,8 +611,8 @@ async def delete(
self,
uuid: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -547,12 +624,12 @@ async def delete(
Deletes a service token.
Args:
+ uuid: UUID
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- uuid: UUID
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -561,14 +638,25 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not uuid:
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not uuid:
- raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._delete(
- f"/{account_id}/{zone_id}/access/service_tokens/{uuid}",
+ f"/{account_or_zone}/{account_or_zone_id}/access/service_tokens/{uuid}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/addresses/address_maps/accounts.py b/src/cloudflare/resources/addresses/address_maps/accounts.py
index 4ee357c7350..534f6832f6a 100644
--- a/src/cloudflare/resources/addresses/address_maps/accounts.py
+++ b/src/cloudflare/resources/addresses/address_maps/accounts.py
@@ -68,7 +68,7 @@ def update(
return cast(
Optional[AccountUpdateResponse],
self._put(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/:account_id",
+ f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -117,7 +117,7 @@ def delete(
return cast(
Optional[AccountDeleteResponse],
self._delete(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/:account_id",
+ f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -176,7 +176,7 @@ async def update(
return cast(
Optional[AccountUpdateResponse],
await self._put(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/:account_id",
+ f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -225,7 +225,7 @@ async def delete(
return cast(
Optional[AccountDeleteResponse],
await self._delete(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/:account_id",
+ f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/addresses/address_maps/zones.py b/src/cloudflare/resources/addresses/address_maps/zones.py
index b7354dcda59..7dd5473eaa5 100644
--- a/src/cloudflare/resources/addresses/address_maps/zones.py
+++ b/src/cloudflare/resources/addresses/address_maps/zones.py
@@ -70,10 +70,21 @@ def update(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
Optional[ZoneUpdateResponse],
self._put(
- f"/accounts/{zone_id}/addressing/address_maps/{account_id}/zones/{address_map_id}",
+ f"/accounts/{account_or_zone}/addressing/address_maps/{address_map_id}/zones/{account_or_zone_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -124,10 +135,21 @@ def delete(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
Optional[ZoneDeleteResponse],
self._delete(
- f"/accounts/{zone_id}/addressing/address_maps/{account_id}/zones/{address_map_id}",
+ f"/accounts/{account_or_zone}/addressing/address_maps/{address_map_id}/zones/{account_or_zone_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -188,10 +210,21 @@ async def update(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
Optional[ZoneUpdateResponse],
await self._put(
- f"/accounts/{zone_id}/addressing/address_maps/{account_id}/zones/{address_map_id}",
+ f"/accounts/{account_or_zone}/addressing/address_maps/{address_map_id}/zones/{account_or_zone_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -242,10 +275,21 @@ async def delete(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
Optional[ZoneDeleteResponse],
await self._delete(
- f"/accounts/{zone_id}/addressing/address_maps/{account_id}/zones/{address_map_id}",
+ f"/accounts/{account_or_zone}/addressing/address_maps/{address_map_id}/zones/{account_or_zone_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/firewall/access_rules.py b/src/cloudflare/resources/firewall/access_rules.py
index c62f65054f9..fe7c8e85419 100644
--- a/src/cloudflare/resources/firewall/access_rules.py
+++ b/src/cloudflare/resources/firewall/access_rules.py
@@ -48,10 +48,10 @@ def with_streaming_response(self) -> AccessRulesWithStreamingResponse:
def create(
self,
*,
- account_id: str,
- zone_id: str,
configuration: access_rule_create_params.Configuration,
mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
notes: str | NotGiven = NOT_GIVEN,
# 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.
@@ -69,14 +69,14 @@ def create(
[IP Access rules for a zone](#ip-access-rules-for-a-zone) endpoints.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
configuration: The rule configuration.
mode: The action to apply to a matched request.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
notes: An informative summary of the rule, typically used as a reminder or explanation.
extra_headers: Send extra headers
@@ -91,10 +91,21 @@ def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
Optional[AccessRuleCreateResponse],
self._post(
- f"/{account_id}/{zone_id}/firewall/access_rules/rules",
+ f"/{account_or_zone}/{account_or_zone_id}/firewall/access_rules/rules",
body=maybe_transform(
{
"configuration": configuration,
@@ -119,8 +130,8 @@ def create(
def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
egs_pagination: access_rule_list_params.EgsPagination | NotGiven = NOT_GIVEN,
filters: access_rule_list_params.Filters | NotGiven = NOT_GIVEN,
@@ -165,8 +176,19 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get_api_list(
- f"/{account_id}/{zone_id}/firewall/access_rules/rules",
+ f"/{account_or_zone}/{account_or_zone_id}/firewall/access_rules/rules",
page=SyncV4PagePaginationArray[object],
options=make_request_options(
extra_headers=extra_headers,
@@ -192,8 +214,8 @@ def delete(
self,
identifier: object,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -223,8 +245,19 @@ def delete(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._delete(
- f"/{account_id}/{zone_id}/firewall/access_rules/rules/{identifier}",
+ f"/{account_or_zone}/{account_or_zone_id}/firewall/access_rules/rules/{identifier}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -239,10 +272,10 @@ def edit(
self,
identifier: object,
*,
- account_id: str,
- zone_id: str,
configuration: access_rule_edit_params.Configuration,
mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
notes: str | NotGiven = NOT_GIVEN,
# 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.
@@ -257,14 +290,14 @@ def edit(
Note: This operation will affect all zones in the account.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
configuration: The rule configuration.
mode: The action to apply to a matched request.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
notes: An informative summary of the rule, typically used as a reminder or explanation.
extra_headers: Send extra headers
@@ -279,10 +312,21 @@ def edit(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
Optional[AccessRuleEditResponse],
self._patch(
- f"/{account_id}/{zone_id}/firewall/access_rules/rules/{identifier}",
+ f"/{account_or_zone}/{account_or_zone_id}/firewall/access_rules/rules/{identifier}",
body=maybe_transform(
{
"configuration": configuration,
@@ -308,8 +352,8 @@ def get(
self,
identifier: object,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -337,10 +381,21 @@ def get(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
Optional[AccessRuleGetResponse],
self._get(
- f"/{account_id}/{zone_id}/firewall/access_rules/rules/{identifier}",
+ f"/{account_or_zone}/{account_or_zone_id}/firewall/access_rules/rules/{identifier}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -367,10 +422,10 @@ def with_streaming_response(self) -> AsyncAccessRulesWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
- zone_id: str,
configuration: access_rule_create_params.Configuration,
mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
notes: str | NotGiven = NOT_GIVEN,
# 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.
@@ -388,14 +443,14 @@ async def create(
[IP Access rules for a zone](#ip-access-rules-for-a-zone) endpoints.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
configuration: The rule configuration.
mode: The action to apply to a matched request.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
notes: An informative summary of the rule, typically used as a reminder or explanation.
extra_headers: Send extra headers
@@ -410,10 +465,21 @@ async def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
Optional[AccessRuleCreateResponse],
await self._post(
- f"/{account_id}/{zone_id}/firewall/access_rules/rules",
+ f"/{account_or_zone}/{account_or_zone_id}/firewall/access_rules/rules",
body=maybe_transform(
{
"configuration": configuration,
@@ -438,8 +504,8 @@ async def create(
def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
egs_pagination: access_rule_list_params.EgsPagination | NotGiven = NOT_GIVEN,
filters: access_rule_list_params.Filters | NotGiven = NOT_GIVEN,
@@ -484,8 +550,19 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get_api_list(
- f"/{account_id}/{zone_id}/firewall/access_rules/rules",
+ f"/{account_or_zone}/{account_or_zone_id}/firewall/access_rules/rules",
page=AsyncV4PagePaginationArray[object],
options=make_request_options(
extra_headers=extra_headers,
@@ -511,8 +588,8 @@ async def delete(
self,
identifier: object,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -542,8 +619,19 @@ async def delete(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._delete(
- f"/{account_id}/{zone_id}/firewall/access_rules/rules/{identifier}",
+ f"/{account_or_zone}/{account_or_zone_id}/firewall/access_rules/rules/{identifier}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -558,10 +646,10 @@ async def edit(
self,
identifier: object,
*,
- account_id: str,
- zone_id: str,
configuration: access_rule_edit_params.Configuration,
mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
notes: str | NotGiven = NOT_GIVEN,
# 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.
@@ -576,14 +664,14 @@ async def edit(
Note: This operation will affect all zones in the account.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
configuration: The rule configuration.
mode: The action to apply to a matched request.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
notes: An informative summary of the rule, typically used as a reminder or explanation.
extra_headers: Send extra headers
@@ -598,10 +686,21 @@ async def edit(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
Optional[AccessRuleEditResponse],
await self._patch(
- f"/{account_id}/{zone_id}/firewall/access_rules/rules/{identifier}",
+ f"/{account_or_zone}/{account_or_zone_id}/firewall/access_rules/rules/{identifier}",
body=maybe_transform(
{
"configuration": configuration,
@@ -627,8 +726,8 @@ async def get(
self,
identifier: object,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -656,10 +755,21 @@ async def get(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
Optional[AccessRuleGetResponse],
await self._get(
- f"/{account_id}/{zone_id}/firewall/access_rules/rules/{identifier}",
+ f"/{account_or_zone}/{account_or_zone_id}/firewall/access_rules/rules/{identifier}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/logpush/datasets/fields.py b/src/cloudflare/resources/logpush/datasets/fields.py
index d6766069158..6234954c015 100644
--- a/src/cloudflare/resources/logpush/datasets/fields.py
+++ b/src/cloudflare/resources/logpush/datasets/fields.py
@@ -36,8 +36,8 @@ def list(
self,
dataset_id: Optional[str],
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -51,12 +51,12 @@ def list(
key-value pairs, where keys are field names, and values are descriptions.
Args:
+ dataset_id: Name of the dataset.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- dataset_id: Name of the dataset.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -65,14 +65,25 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not dataset_id:
+ raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not dataset_id:
- raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/logpush/datasets/{dataset_id}/fields",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/datasets/{dataset_id}/fields",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -97,8 +108,8 @@ async def list(
self,
dataset_id: Optional[str],
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -112,12 +123,12 @@ async def list(
key-value pairs, where keys are field names, and values are descriptions.
Args:
+ dataset_id: Name of the dataset.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- dataset_id: Name of the dataset.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -126,14 +137,25 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not dataset_id:
+ raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not dataset_id:
- raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/logpush/datasets/{dataset_id}/fields",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/datasets/{dataset_id}/fields",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/logpush/datasets/jobs.py b/src/cloudflare/resources/logpush/datasets/jobs.py
index 6e3a15d74e3..a5f67044e04 100644
--- a/src/cloudflare/resources/logpush/datasets/jobs.py
+++ b/src/cloudflare/resources/logpush/datasets/jobs.py
@@ -37,8 +37,8 @@ def list(
self,
dataset_id: Optional[str],
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -50,12 +50,12 @@ def list(
Lists Logpush jobs for an account or zone for a dataset.
Args:
+ dataset_id: Name of the dataset.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- dataset_id: Name of the dataset.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -64,14 +64,25 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not dataset_id:
+ raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not dataset_id:
- raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/logpush/datasets/{dataset_id}/jobs",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/datasets/{dataset_id}/jobs",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -96,8 +107,8 @@ async def list(
self,
dataset_id: Optional[str],
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -109,12 +120,12 @@ async def list(
Lists Logpush jobs for an account or zone for a dataset.
Args:
+ dataset_id: Name of the dataset.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- dataset_id: Name of the dataset.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -123,14 +134,25 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not dataset_id:
+ raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not dataset_id:
- raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/logpush/datasets/{dataset_id}/jobs",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/datasets/{dataset_id}/jobs",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/logpush/jobs.py b/src/cloudflare/resources/logpush/jobs.py
index 92c1bd90ca6..fb56eeb6462 100644
--- a/src/cloudflare/resources/logpush/jobs.py
+++ b/src/cloudflare/resources/logpush/jobs.py
@@ -46,9 +46,9 @@ def with_streaming_response(self) -> JobsWithStreamingResponse:
def create(
self,
*,
- account_id: str,
- zone_id: str,
destination_conf: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
dataset: Optional[str] | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
frequency: Optional[Literal["high", "low"]] | NotGiven = NOT_GIVEN,
@@ -67,14 +67,14 @@ def create(
Creates a new Logpush job for an account or zone.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
Additional configuration parameters supported by the destination may be
included.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
dataset: Name of the dataset.
enabled: Flag that indicates if the job is enabled.
@@ -110,8 +110,19 @@ def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._post(
- f"/{account_id}/{zone_id}/logpush/jobs",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/jobs",
body=maybe_transform(
{
"destination_conf": destination_conf,
@@ -139,8 +150,8 @@ def update(
self,
job_id: int,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
destination_conf: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
frequency: Optional[Literal["high", "low"]] | NotGiven = NOT_GIVEN,
@@ -158,12 +169,12 @@ def update(
Updates a Logpush job.
Args:
+ job_id: Unique id of the job.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- job_id: Unique id of the job.
-
destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
Additional configuration parameters supported by the destination may be
included.
@@ -197,8 +208,19 @@ def update(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._put(
- f"/{account_id}/{zone_id}/logpush/jobs/{job_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/jobs/{job_id}",
body=maybe_transform(
{
"destination_conf": destination_conf,
@@ -223,8 +245,8 @@ def update(
def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -252,8 +274,19 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/logpush/jobs",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/jobs",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -268,8 +301,8 @@ def delete(
self,
job_id: int,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -281,12 +314,12 @@ def delete(
Deletes a Logpush job.
Args:
+ job_id: Unique id of the job.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- job_id: Unique id of the job.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -299,10 +332,21 @@ def delete(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
Optional[JobDeleteResponse],
self._delete(
- f"/{account_id}/{zone_id}/logpush/jobs/{job_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/jobs/{job_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -320,8 +364,8 @@ def get(
self,
job_id: int,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -333,12 +377,12 @@ def get(
Gets the details of a Logpush job.
Args:
+ job_id: Unique id of the job.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- job_id: Unique id of the job.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -351,8 +395,19 @@ def get(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/logpush/jobs/{job_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/jobs/{job_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -376,9 +431,9 @@ def with_streaming_response(self) -> AsyncJobsWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
- zone_id: str,
destination_conf: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
dataset: Optional[str] | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
frequency: Optional[Literal["high", "low"]] | NotGiven = NOT_GIVEN,
@@ -397,14 +452,14 @@ async def create(
Creates a new Logpush job for an account or zone.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
Additional configuration parameters supported by the destination may be
included.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
dataset: Name of the dataset.
enabled: Flag that indicates if the job is enabled.
@@ -440,8 +495,19 @@ async def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._post(
- f"/{account_id}/{zone_id}/logpush/jobs",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/jobs",
body=maybe_transform(
{
"destination_conf": destination_conf,
@@ -469,8 +535,8 @@ async def update(
self,
job_id: int,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
destination_conf: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
frequency: Optional[Literal["high", "low"]] | NotGiven = NOT_GIVEN,
@@ -488,12 +554,12 @@ async def update(
Updates a Logpush job.
Args:
+ job_id: Unique id of the job.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- job_id: Unique id of the job.
-
destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
Additional configuration parameters supported by the destination may be
included.
@@ -527,8 +593,19 @@ async def update(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._put(
- f"/{account_id}/{zone_id}/logpush/jobs/{job_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/jobs/{job_id}",
body=maybe_transform(
{
"destination_conf": destination_conf,
@@ -553,8 +630,8 @@ async def update(
async def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -582,8 +659,19 @@ async def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/logpush/jobs",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/jobs",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -598,8 +686,8 @@ async def delete(
self,
job_id: int,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -611,12 +699,12 @@ async def delete(
Deletes a Logpush job.
Args:
+ job_id: Unique id of the job.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- job_id: Unique id of the job.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -629,10 +717,21 @@ async def delete(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return cast(
Optional[JobDeleteResponse],
await self._delete(
- f"/{account_id}/{zone_id}/logpush/jobs/{job_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/jobs/{job_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -650,8 +749,8 @@ async def get(
self,
job_id: int,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -663,12 +762,12 @@ async def get(
Gets the details of a Logpush job.
Args:
+ job_id: Unique id of the job.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- job_id: Unique id of the job.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -681,8 +780,19 @@ async def get(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/logpush/jobs/{job_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/jobs/{job_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/logpush/ownership.py b/src/cloudflare/resources/logpush/ownership.py
index 8f5cbd66e8f..b7e66348a92 100644
--- a/src/cloudflare/resources/logpush/ownership.py
+++ b/src/cloudflare/resources/logpush/ownership.py
@@ -42,9 +42,9 @@ def with_streaming_response(self) -> OwnershipWithStreamingResponse:
def create(
self,
*,
- account_id: str,
- zone_id: str,
destination_conf: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -56,14 +56,14 @@ def create(
Gets a new ownership challenge sent to your destination.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
Additional configuration parameters supported by the destination may be
included.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -76,8 +76,19 @@ def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._post(
- f"/{account_id}/{zone_id}/logpush/ownership",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/ownership",
body=maybe_transform({"destination_conf": destination_conf}, ownership_create_params.OwnershipCreateParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -92,10 +103,10 @@ def create(
def validate(
self,
*,
- account_id: str,
- zone_id: str,
destination_conf: str,
ownership_challenge: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -107,16 +118,16 @@ def validate(
Validates ownership challenge of the destination.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
Additional configuration parameters supported by the destination may be
included.
ownership_challenge: Ownership challenge token to prove destination ownership.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -129,8 +140,19 @@ def validate(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._post(
- f"/{account_id}/{zone_id}/logpush/ownership/validate",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/ownership/validate",
body=maybe_transform(
{
"destination_conf": destination_conf,
@@ -161,9 +183,9 @@ def with_streaming_response(self) -> AsyncOwnershipWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
- zone_id: str,
destination_conf: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -175,14 +197,14 @@ async def create(
Gets a new ownership challenge sent to your destination.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
Additional configuration parameters supported by the destination may be
included.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -195,8 +217,19 @@ async def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._post(
- f"/{account_id}/{zone_id}/logpush/ownership",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/ownership",
body=maybe_transform({"destination_conf": destination_conf}, ownership_create_params.OwnershipCreateParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -211,10 +244,10 @@ async def create(
async def validate(
self,
*,
- account_id: str,
- zone_id: str,
destination_conf: str,
ownership_challenge: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -226,16 +259,16 @@ async def validate(
Validates ownership challenge of the destination.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
Additional configuration parameters supported by the destination may be
included.
ownership_challenge: Ownership challenge token to prove destination ownership.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -248,8 +281,19 @@ async def validate(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._post(
- f"/{account_id}/{zone_id}/logpush/ownership/validate",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/ownership/validate",
body=maybe_transform(
{
"destination_conf": destination_conf,
diff --git a/src/cloudflare/resources/logpush/validate.py b/src/cloudflare/resources/logpush/validate.py
index 4e1695ec908..d9699fa1041 100644
--- a/src/cloudflare/resources/logpush/validate.py
+++ b/src/cloudflare/resources/logpush/validate.py
@@ -42,9 +42,9 @@ def with_streaming_response(self) -> ValidateWithStreamingResponse:
def destination(
self,
*,
- account_id: str,
- zone_id: str,
destination_conf: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -56,14 +56,14 @@ def destination(
Checks if there is an existing job with a destination.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
Additional configuration parameters supported by the destination may be
included.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -76,8 +76,19 @@ def destination(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._post(
- f"/{account_id}/{zone_id}/logpush/validate/destination/exists",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/validate/destination/exists",
body=maybe_transform(
{"destination_conf": destination_conf}, validate_destination_params.ValidateDestinationParams
),
@@ -94,9 +105,9 @@ def destination(
def origin(
self,
*,
- account_id: str,
- zone_id: str,
logpull_options: Optional[str],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -108,16 +119,16 @@ def origin(
Validates logpull origin with logpull_options.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
logpull_options: This field is deprecated. Use `output_options` instead. Configuration string. It
specifies things like requested fields and timestamp formats. If migrating from
the logpull api, copy the url (full url or just the query string) of your call
here, and logpush will keep on making this call for you, setting start and end
times appropriately.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -130,8 +141,19 @@ def origin(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._post(
- f"/{account_id}/{zone_id}/logpush/validate/origin",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/validate/origin",
body=maybe_transform({"logpull_options": logpull_options}, validate_origin_params.ValidateOriginParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -156,9 +178,9 @@ def with_streaming_response(self) -> AsyncValidateWithStreamingResponse:
async def destination(
self,
*,
- account_id: str,
- zone_id: str,
destination_conf: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -170,14 +192,14 @@ async def destination(
Checks if there is an existing job with a destination.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
Additional configuration parameters supported by the destination may be
included.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -190,8 +212,19 @@ async def destination(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._post(
- f"/{account_id}/{zone_id}/logpush/validate/destination/exists",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/validate/destination/exists",
body=maybe_transform(
{"destination_conf": destination_conf}, validate_destination_params.ValidateDestinationParams
),
@@ -208,9 +241,9 @@ async def destination(
async def origin(
self,
*,
- account_id: str,
- zone_id: str,
logpull_options: Optional[str],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -222,16 +255,16 @@ async def origin(
Validates logpull origin with logpull_options.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
logpull_options: This field is deprecated. Use `output_options` instead. Configuration string. It
specifies things like requested fields and timestamp formats. If migrating from
the logpull api, copy the url (full url or just the query string) of your call
here, and logpush will keep on making this call for you, setting start and end
times appropriately.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -244,8 +277,19 @@ async def origin(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._post(
- f"/{account_id}/{zone_id}/logpush/validate/origin",
+ f"/{account_or_zone}/{account_or_zone_id}/logpush/validate/origin",
body=maybe_transform({"logpull_options": logpull_options}, validate_origin_params.ValidateOriginParams),
options=make_request_options(
extra_headers=extra_headers,
diff --git a/src/cloudflare/resources/rulesets/phases/phases.py b/src/cloudflare/resources/rulesets/phases/phases.py
index b22f6aef4a2..f9523e716e6 100644
--- a/src/cloudflare/resources/rulesets/phases/phases.py
+++ b/src/cloudflare/resources/rulesets/phases/phases.py
@@ -75,10 +75,10 @@ def update(
"magic_transit_managed",
],
*,
- account_id: str,
- zone_id: str,
id: str,
rules: Iterable[phase_update_params.Rule],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
kind: Literal["managed", "custom", "root", "zone"] | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
@@ -119,16 +119,16 @@ def update(
Updates an account or zone entry point ruleset, creating a new version.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
ruleset_phase: The phase of the ruleset.
id: The unique ID of the ruleset.
rules: The list of rules in the ruleset.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
description: An informative description of the ruleset.
kind: The kind of the ruleset.
@@ -145,14 +145,25 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not ruleset_phase:
+ raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not ruleset_phase:
- raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._put(
- f"/{account_id}/{zone_id}/rulesets/phases/{ruleset_phase}/entrypoint",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint",
body=maybe_transform(
{
"id": id,
@@ -202,8 +213,8 @@ def get(
"magic_transit_managed",
],
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -216,12 +227,12 @@ def get(
given phase.
Args:
+ ruleset_phase: The phase of the ruleset.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ruleset_phase: The phase of the ruleset.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -230,14 +241,25 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not ruleset_phase:
+ raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not ruleset_phase:
- raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/rulesets/phases/{ruleset_phase}/entrypoint",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -290,10 +312,10 @@ async def update(
"magic_transit_managed",
],
*,
- account_id: str,
- zone_id: str,
id: str,
rules: Iterable[phase_update_params.Rule],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
kind: Literal["managed", "custom", "root", "zone"] | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
@@ -334,16 +356,16 @@ async def update(
Updates an account or zone entry point ruleset, creating a new version.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
ruleset_phase: The phase of the ruleset.
id: The unique ID of the ruleset.
rules: The list of rules in the ruleset.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
description: An informative description of the ruleset.
kind: The kind of the ruleset.
@@ -360,14 +382,25 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not ruleset_phase:
+ raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not ruleset_phase:
- raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._put(
- f"/{account_id}/{zone_id}/rulesets/phases/{ruleset_phase}/entrypoint",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint",
body=maybe_transform(
{
"id": id,
@@ -417,8 +450,8 @@ async def get(
"magic_transit_managed",
],
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -431,12 +464,12 @@ async def get(
given phase.
Args:
+ ruleset_phase: The phase of the ruleset.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ruleset_phase: The phase of the ruleset.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -445,14 +478,25 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not ruleset_phase:
+ raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not ruleset_phase:
- raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/rulesets/phases/{ruleset_phase}/entrypoint",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/rulesets/phases/versions.py b/src/cloudflare/resources/rulesets/phases/versions.py
index 9fbedfa8d4d..c24dc718301 100644
--- a/src/cloudflare/resources/rulesets/phases/versions.py
+++ b/src/cloudflare/resources/rulesets/phases/versions.py
@@ -62,8 +62,8 @@ def list(
"magic_transit_managed",
],
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -75,12 +75,12 @@ def list(
Fetches the versions of an account or zone entry point ruleset.
Args:
+ ruleset_phase: The phase of the ruleset.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ruleset_phase: The phase of the ruleset.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -89,14 +89,25 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not ruleset_phase:
+ raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not ruleset_phase:
- raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/rulesets/phases/{ruleset_phase}/entrypoint/versions",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint/versions",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -111,8 +122,6 @@ def get(
self,
ruleset_version: str,
*,
- account_id: str,
- zone_id: str,
ruleset_phase: Literal[
"ddos_l4",
"ddos_l7",
@@ -138,6 +147,8 @@ def get(
"magic_transit_ids_managed",
"magic_transit_managed",
],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -149,14 +160,14 @@ def get(
Fetches a specific version of an account or zone entry point ruleset.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
ruleset_phase: The phase of the ruleset.
ruleset_version: The version of the ruleset.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -165,16 +176,27 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not account_id:
- raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not ruleset_phase:
raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}")
if not ruleset_version:
raise ValueError(f"Expected a non-empty value for `ruleset_version` but received {ruleset_version!r}")
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/rulesets/phases/{ruleset_phase}/entrypoint/versions/{ruleset_version}",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint/versions/{ruleset_version}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -223,8 +245,8 @@ async def list(
"magic_transit_managed",
],
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -236,12 +258,12 @@ async def list(
Fetches the versions of an account or zone entry point ruleset.
Args:
+ ruleset_phase: The phase of the ruleset.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ruleset_phase: The phase of the ruleset.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -250,14 +272,25 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not ruleset_phase:
+ raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not ruleset_phase:
- raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/rulesets/phases/{ruleset_phase}/entrypoint/versions",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint/versions",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -272,8 +305,6 @@ async def get(
self,
ruleset_version: str,
*,
- account_id: str,
- zone_id: str,
ruleset_phase: Literal[
"ddos_l4",
"ddos_l7",
@@ -299,6 +330,8 @@ async def get(
"magic_transit_ids_managed",
"magic_transit_managed",
],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -310,14 +343,14 @@ async def get(
Fetches a specific version of an account or zone entry point ruleset.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
ruleset_phase: The phase of the ruleset.
ruleset_version: The version of the ruleset.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -326,16 +359,27 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not account_id:
- raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not ruleset_phase:
raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}")
if not ruleset_version:
raise ValueError(f"Expected a non-empty value for `ruleset_version` but received {ruleset_version!r}")
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/rulesets/phases/{ruleset_phase}/entrypoint/versions/{ruleset_version}",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint/versions/{ruleset_version}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/rulesets/rules.py b/src/cloudflare/resources/rulesets/rules.py
index cf1f9a038cd..7fe4528fbdd 100644
--- a/src/cloudflare/resources/rulesets/rules.py
+++ b/src/cloudflare/resources/rulesets/rules.py
@@ -44,8 +44,8 @@ def create(
self,
ruleset_id: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
position: rule_create_params.Position | NotGiven = NOT_GIVEN,
# 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.
@@ -60,12 +60,12 @@ def create(
of the existing list of rules in the ruleset by default.
Args:
+ ruleset_id: The unique ID of the ruleset.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ruleset_id: The unique ID of the ruleset.
-
position: An object configuring where the rule will be placed.
extra_headers: Send extra headers
@@ -76,14 +76,25 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not ruleset_id:
+ raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not ruleset_id:
- raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._post(
- f"/{account_id}/{zone_id}/rulesets/{ruleset_id}/rules",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/rules",
body=maybe_transform({"position": position}, rule_create_params.RuleCreateParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -99,9 +110,9 @@ def delete(
self,
rule_id: str,
*,
- account_id: str,
- zone_id: str,
ruleset_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -113,14 +124,14 @@ def delete(
Deletes an existing rule from an account or zone ruleset.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
ruleset_id: The unique ID of the ruleset.
rule_id: The unique ID of the rule.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -129,16 +140,27 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not account_id:
- raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not ruleset_id:
raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
if not rule_id:
raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}")
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._delete(
- f"/{account_id}/{zone_id}/rulesets/{ruleset_id}/rules/{rule_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/rules/{rule_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -153,9 +175,9 @@ def edit(
self,
rule_id: str,
*,
- account_id: str,
- zone_id: str,
ruleset_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
position: rule_edit_params.Position | NotGiven = NOT_GIVEN,
# 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.
@@ -168,14 +190,14 @@ def edit(
Updates an existing rule in an account ruleset.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
ruleset_id: The unique ID of the ruleset.
rule_id: The unique ID of the rule.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
position: An object configuring where the rule will be placed.
extra_headers: Send extra headers
@@ -186,16 +208,27 @@ def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not account_id:
- raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not ruleset_id:
raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
if not rule_id:
raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}")
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._patch(
- f"/{account_id}/{zone_id}/rulesets/{ruleset_id}/rules/{rule_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/rules/{rule_id}",
body=maybe_transform({"position": position}, rule_edit_params.RuleEditParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -221,8 +254,8 @@ async def create(
self,
ruleset_id: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
position: rule_create_params.Position | NotGiven = NOT_GIVEN,
# 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.
@@ -237,12 +270,12 @@ async def create(
of the existing list of rules in the ruleset by default.
Args:
+ ruleset_id: The unique ID of the ruleset.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ruleset_id: The unique ID of the ruleset.
-
position: An object configuring where the rule will be placed.
extra_headers: Send extra headers
@@ -253,14 +286,25 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not ruleset_id:
+ raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not ruleset_id:
- raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._post(
- f"/{account_id}/{zone_id}/rulesets/{ruleset_id}/rules",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/rules",
body=maybe_transform({"position": position}, rule_create_params.RuleCreateParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -276,9 +320,9 @@ async def delete(
self,
rule_id: str,
*,
- account_id: str,
- zone_id: str,
ruleset_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -290,14 +334,14 @@ async def delete(
Deletes an existing rule from an account or zone ruleset.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
ruleset_id: The unique ID of the ruleset.
rule_id: The unique ID of the rule.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -306,16 +350,27 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not account_id:
- raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not ruleset_id:
raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
if not rule_id:
raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}")
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._delete(
- f"/{account_id}/{zone_id}/rulesets/{ruleset_id}/rules/{rule_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/rules/{rule_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -330,9 +385,9 @@ async def edit(
self,
rule_id: str,
*,
- account_id: str,
- zone_id: str,
ruleset_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
position: rule_edit_params.Position | NotGiven = NOT_GIVEN,
# 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.
@@ -345,14 +400,14 @@ async def edit(
Updates an existing rule in an account ruleset.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
ruleset_id: The unique ID of the ruleset.
rule_id: The unique ID of the rule.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
position: An object configuring where the rule will be placed.
extra_headers: Send extra headers
@@ -363,16 +418,27 @@ async def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not account_id:
- raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not ruleset_id:
raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
if not rule_id:
raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}")
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._patch(
- f"/{account_id}/{zone_id}/rulesets/{ruleset_id}/rules/{rule_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/rules/{rule_id}",
body=maybe_transform({"position": position}, rule_edit_params.RuleEditParams),
options=make_request_options(
extra_headers=extra_headers,
diff --git a/src/cloudflare/resources/rulesets/rulesets.py b/src/cloudflare/resources/rulesets/rulesets.py
index 59ef676e81a..4fd261a9e11 100644
--- a/src/cloudflare/resources/rulesets/rulesets.py
+++ b/src/cloudflare/resources/rulesets/rulesets.py
@@ -83,8 +83,6 @@ def with_streaming_response(self) -> RulesetsWithStreamingResponse:
def create(
self,
*,
- account_id: str,
- zone_id: str,
kind: Literal["managed", "custom", "root", "zone"],
name: str,
phase: Literal[
@@ -113,6 +111,8 @@ def create(
"magic_transit_managed",
],
rules: Iterable[ruleset_create_params.Rule],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
# 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.
@@ -121,15 +121,10 @@ def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> RulesetCreateResponse:
- """Creates a ruleset.
+ """
+ Creates a ruleset.
Args:
- account_id: The Account ID to use for this endpoint.
-
- Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
kind: The kind of the ruleset.
name: The human-readable name of the ruleset.
@@ -138,6 +133,10 @@ def create(
rules: The list of rules in the ruleset.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
description: An informative description of the ruleset.
extra_headers: Send extra headers
@@ -152,8 +151,19 @@ def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._post(
- f"/{account_id}/{zone_id}/rulesets",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets",
body=maybe_transform(
{
"kind": kind,
@@ -178,10 +188,10 @@ def update(
self,
ruleset_id: str,
*,
- account_id: str,
- zone_id: str,
id: str,
rules: Iterable[ruleset_update_params.Rule],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
kind: Literal["managed", "custom", "root", "zone"] | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
@@ -222,16 +232,16 @@ def update(
Updates an account or zone ruleset, creating a new version.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
ruleset_id: The unique ID of the ruleset.
id: The unique ID of the ruleset.
rules: The list of rules in the ruleset.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
description: An informative description of the ruleset.
kind: The kind of the ruleset.
@@ -248,14 +258,25 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not ruleset_id:
+ raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not ruleset_id:
- raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._put(
- f"/{account_id}/{zone_id}/rulesets/{ruleset_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}",
body=maybe_transform(
{
"id": id,
@@ -280,8 +301,8 @@ def update(
def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -309,8 +330,19 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/rulesets",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -325,8 +357,8 @@ def delete(
self,
ruleset_id: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -338,12 +370,12 @@ def delete(
Deletes all versions of an existing account or zone ruleset.
Args:
+ ruleset_id: The unique ID of the ruleset.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ruleset_id: The unique ID of the ruleset.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -352,15 +384,26 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not ruleset_id:
+ raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not ruleset_id:
- raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return self._delete(
- f"/{account_id}/{zone_id}/rulesets/{ruleset_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -371,8 +414,8 @@ def get(
self,
ruleset_id: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -384,12 +427,12 @@ def get(
Fetches the latest version of an account or zone ruleset.
Args:
+ ruleset_id: The unique ID of the ruleset.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ruleset_id: The unique ID of the ruleset.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -398,14 +441,25 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not ruleset_id:
+ raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not ruleset_id:
- raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/rulesets/{ruleset_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -441,8 +495,6 @@ def with_streaming_response(self) -> AsyncRulesetsWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
- zone_id: str,
kind: Literal["managed", "custom", "root", "zone"],
name: str,
phase: Literal[
@@ -471,6 +523,8 @@ async def create(
"magic_transit_managed",
],
rules: Iterable[ruleset_create_params.Rule],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
# 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.
@@ -479,15 +533,10 @@ async def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> RulesetCreateResponse:
- """Creates a ruleset.
+ """
+ Creates a ruleset.
Args:
- account_id: The Account ID to use for this endpoint.
-
- Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
kind: The kind of the ruleset.
name: The human-readable name of the ruleset.
@@ -496,6 +545,10 @@ async def create(
rules: The list of rules in the ruleset.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
description: An informative description of the ruleset.
extra_headers: Send extra headers
@@ -510,8 +563,19 @@ async def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._post(
- f"/{account_id}/{zone_id}/rulesets",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets",
body=maybe_transform(
{
"kind": kind,
@@ -536,10 +600,10 @@ async def update(
self,
ruleset_id: str,
*,
- account_id: str,
- zone_id: str,
id: str,
rules: Iterable[ruleset_update_params.Rule],
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
kind: Literal["managed", "custom", "root", "zone"] | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
@@ -580,16 +644,16 @@ async def update(
Updates an account or zone ruleset, creating a new version.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
ruleset_id: The unique ID of the ruleset.
id: The unique ID of the ruleset.
rules: The list of rules in the ruleset.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
description: An informative description of the ruleset.
kind: The kind of the ruleset.
@@ -606,14 +670,25 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not ruleset_id:
+ raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not ruleset_id:
- raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._put(
- f"/{account_id}/{zone_id}/rulesets/{ruleset_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}",
body=maybe_transform(
{
"id": id,
@@ -638,8 +713,8 @@ async def update(
async def list(
self,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -667,8 +742,19 @@ async def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/rulesets",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -683,8 +769,8 @@ async def delete(
self,
ruleset_id: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -696,12 +782,12 @@ async def delete(
Deletes all versions of an existing account or zone ruleset.
Args:
+ ruleset_id: The unique ID of the ruleset.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ruleset_id: The unique ID of the ruleset.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -710,15 +796,26 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not ruleset_id:
+ raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not ruleset_id:
- raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return await self._delete(
- f"/{account_id}/{zone_id}/rulesets/{ruleset_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -729,8 +826,8 @@ async def get(
self,
ruleset_id: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -742,12 +839,12 @@ async def get(
Fetches the latest version of an account or zone ruleset.
Args:
+ ruleset_id: The unique ID of the ruleset.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ruleset_id: The unique ID of the ruleset.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -756,14 +853,25 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not ruleset_id:
+ raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not ruleset_id:
- raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/rulesets/{ruleset_id}",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/rulesets/versions/versions.py b/src/cloudflare/resources/rulesets/versions/versions.py
index 0d1498b8595..f2ed9e233b8 100644
--- a/src/cloudflare/resources/rulesets/versions/versions.py
+++ b/src/cloudflare/resources/rulesets/versions/versions.py
@@ -49,8 +49,8 @@ def list(
self,
ruleset_id: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -62,12 +62,12 @@ def list(
Fetches the versions of an account or zone ruleset.
Args:
+ ruleset_id: The unique ID of the ruleset.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ruleset_id: The unique ID of the ruleset.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -76,14 +76,25 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not ruleset_id:
+ raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not ruleset_id:
- raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/rulesets/{ruleset_id}/versions",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/versions",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -98,9 +109,9 @@ def delete(
self,
ruleset_version: str,
*,
- account_id: str,
- zone_id: str,
ruleset_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -112,14 +123,14 @@ def delete(
Deletes an existing version of an account or zone ruleset.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
ruleset_id: The unique ID of the ruleset.
ruleset_version: The version of the ruleset.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -128,17 +139,28 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not account_id:
- raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not ruleset_id:
raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
if not ruleset_version:
raise ValueError(f"Expected a non-empty value for `ruleset_version` but received {ruleset_version!r}")
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return self._delete(
- f"/{account_id}/{zone_id}/rulesets/{ruleset_id}/versions/{ruleset_version}",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/versions/{ruleset_version}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -149,9 +171,9 @@ def get(
self,
ruleset_version: str,
*,
- account_id: str,
- zone_id: str,
ruleset_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -163,14 +185,14 @@ def get(
Fetches a specific version of an account or zone ruleset.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
ruleset_id: The unique ID of the ruleset.
ruleset_version: The version of the ruleset.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -179,16 +201,27 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not account_id:
- raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not ruleset_id:
raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
if not ruleset_version:
raise ValueError(f"Expected a non-empty value for `ruleset_version` but received {ruleset_version!r}")
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return self._get(
- f"/{account_id}/{zone_id}/rulesets/{ruleset_id}/versions/{ruleset_version}",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/versions/{ruleset_version}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -217,8 +250,8 @@ async def list(
self,
ruleset_id: str,
*,
- account_id: str,
- zone_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -230,12 +263,12 @@ async def list(
Fetches the versions of an account or zone ruleset.
Args:
+ ruleset_id: The unique ID of the ruleset.
+
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ruleset_id: The unique ID of the ruleset.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -244,14 +277,25 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if not ruleset_id:
+ raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not ruleset_id:
- raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/rulesets/{ruleset_id}/versions",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/versions",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -266,9 +310,9 @@ async def delete(
self,
ruleset_version: str,
*,
- account_id: str,
- zone_id: str,
ruleset_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -280,14 +324,14 @@ async def delete(
Deletes an existing version of an account or zone ruleset.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
ruleset_id: The unique ID of the ruleset.
ruleset_version: The version of the ruleset.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -296,17 +340,28 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not account_id:
- raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not ruleset_id:
raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
if not ruleset_version:
raise ValueError(f"Expected a non-empty value for `ruleset_version` but received {ruleset_version!r}")
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return await self._delete(
- f"/{account_id}/{zone_id}/rulesets/{ruleset_id}/versions/{ruleset_version}",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/versions/{ruleset_version}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -317,9 +372,9 @@ async def get(
self,
ruleset_version: str,
*,
- account_id: str,
- zone_id: str,
ruleset_id: str,
+ account_id: str | NotGiven = NOT_GIVEN,
+ zone_id: str | NotGiven = NOT_GIVEN,
# 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,
@@ -331,14 +386,14 @@ async def get(
Fetches a specific version of an account or zone ruleset.
Args:
- account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
-
- zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
-
ruleset_id: The unique ID of the ruleset.
ruleset_version: The version of the ruleset.
+ account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+
+ zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -347,16 +402,27 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not account_id:
- raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not ruleset_id:
raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}")
if not ruleset_version:
raise ValueError(f"Expected a non-empty value for `ruleset_version` but received {ruleset_version!r}")
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not account_id and not zone_id:
+ raise ValueError("You must provide either account_id or zone_id")
+ if account_id and zone_id:
+ raise ValueError("You cannot provide both account_id and zone_id")
+
+ if account_id:
+ account_or_zone = "accounts"
+ account_or_zone_id = account_id
+ else:
+ account_or_zone = "zones"
+ account_or_zone_id = zone_id
return await self._get(
- f"/{account_id}/{zone_id}/rulesets/{ruleset_id}/versions/{ruleset_version}",
+ f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/versions/{ruleset_version}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/types/access/application_create_params.py b/src/cloudflare/types/access/application_create_params.py
index a7c680a94e0..41e60b17452 100644
--- a/src/cloudflare/types/access/application_create_params.py
+++ b/src/cloudflare/types/access/application_create_params.py
@@ -3,7 +3,7 @@
from __future__ import annotations
from typing import List, Union, Iterable
-from typing_extensions import Literal, Required, TypedDict
+from typing_extensions import Literal, TypedDict
__all__ = [
"ApplicationCreateParams",
@@ -17,10 +17,10 @@
class ApplicationCreateParams(TypedDict, total=False):
- account_id: Required[str]
+ account_id: str
"""The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
- zone_id: Required[str]
+ zone_id: str
"""The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
allow_authenticate_via_warp: bool
diff --git a/src/cloudflare/types/access/application_update_params.py b/src/cloudflare/types/access/application_update_params.py
index e440db2dbf5..4c670113154 100644
--- a/src/cloudflare/types/access/application_update_params.py
+++ b/src/cloudflare/types/access/application_update_params.py
@@ -3,7 +3,7 @@
from __future__ import annotations
from typing import List, Union, Iterable
-from typing_extensions import Literal, Required, TypedDict
+from typing_extensions import Literal, TypedDict
__all__ = [
"ApplicationUpdateParams",
@@ -17,10 +17,10 @@
class ApplicationUpdateParams(TypedDict, total=False):
- account_id: Required[str]
+ account_id: str
"""The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
- zone_id: Required[str]
+ zone_id: str
"""The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
allow_authenticate_via_warp: bool
diff --git a/src/cloudflare/types/access/applications/policy_create_params.py b/src/cloudflare/types/access/applications/policy_create_params.py
index 64089f53710..134b7d6db25 100644
--- a/src/cloudflare/types/access/applications/policy_create_params.py
+++ b/src/cloudflare/types/access/applications/policy_create_params.py
@@ -122,12 +122,6 @@
class PolicyCreateParams(TypedDict, total=False):
- account_id: Required[str]
- """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
-
- zone_id: Required[str]
- """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
decision: Required[Literal["allow", "deny", "non_identity", "bypass"]]
"""The action Access will take if a user matches this policy."""
@@ -140,6 +134,12 @@ class PolicyCreateParams(TypedDict, total=False):
name: Required[str]
"""The name of the Access policy."""
+ account_id: str
+ """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
+
+ zone_id: str
+ """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
+
approval_groups: Iterable[ApprovalGroup]
"""Administrators who can approve a temporary authentication request."""
diff --git a/src/cloudflare/types/access/applications/policy_update_params.py b/src/cloudflare/types/access/applications/policy_update_params.py
index f6f89fc7973..4d79b72254d 100644
--- a/src/cloudflare/types/access/applications/policy_update_params.py
+++ b/src/cloudflare/types/access/applications/policy_update_params.py
@@ -122,12 +122,6 @@
class PolicyUpdateParams(TypedDict, total=False):
- account_id: Required[str]
- """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
-
- zone_id: Required[str]
- """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
uuid1: Required[str]
"""UUID"""
@@ -143,6 +137,12 @@ class PolicyUpdateParams(TypedDict, total=False):
name: Required[str]
"""The name of the Access policy."""
+ account_id: str
+ """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
+
+ zone_id: str
+ """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
+
approval_groups: Iterable[ApprovalGroup]
"""Administrators who can approve a temporary authentication request."""
diff --git a/src/cloudflare/types/access/certificate_create_params.py b/src/cloudflare/types/access/certificate_create_params.py
index b11f56399c5..1983d639a53 100644
--- a/src/cloudflare/types/access/certificate_create_params.py
+++ b/src/cloudflare/types/access/certificate_create_params.py
@@ -9,17 +9,17 @@
class CertificateCreateParams(TypedDict, total=False):
- account_id: Required[str]
- """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
-
- zone_id: Required[str]
- """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
certificate: Required[str]
"""The certificate content."""
name: Required[str]
"""The name of the certificate."""
+ account_id: str
+ """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
+
+ zone_id: str
+ """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
+
associated_hostnames: List[str]
"""The hostnames of the applications that will use this certificate."""
diff --git a/src/cloudflare/types/access/certificate_update_params.py b/src/cloudflare/types/access/certificate_update_params.py
index cd066ae96e5..64f237046f6 100644
--- a/src/cloudflare/types/access/certificate_update_params.py
+++ b/src/cloudflare/types/access/certificate_update_params.py
@@ -9,14 +9,14 @@
class CertificateUpdateParams(TypedDict, total=False):
- account_id: Required[str]
+ associated_hostnames: Required[List[str]]
+ """The hostnames of the applications that will use this certificate."""
+
+ account_id: str
"""The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
- zone_id: Required[str]
+ zone_id: str
"""The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
- associated_hostnames: Required[List[str]]
- """The hostnames of the applications that will use this certificate."""
-
name: str
"""The name of the certificate."""
diff --git a/src/cloudflare/types/access/certificates/setting_update_params.py b/src/cloudflare/types/access/certificates/setting_update_params.py
index e9b803a33b9..847fc4e0fa1 100644
--- a/src/cloudflare/types/access/certificates/setting_update_params.py
+++ b/src/cloudflare/types/access/certificates/setting_update_params.py
@@ -9,14 +9,14 @@
class SettingUpdateParams(TypedDict, total=False):
- account_id: Required[str]
+ settings: Required[Iterable[Setting]]
+
+ account_id: str
"""The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
- zone_id: Required[str]
+ zone_id: str
"""The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
- settings: Required[Iterable[Setting]]
-
class Setting(TypedDict, total=False):
china_network: Required[bool]
diff --git a/src/cloudflare/types/access/group_create_params.py b/src/cloudflare/types/access/group_create_params.py
index 1d1c83b6c14..8501a4a8470 100644
--- a/src/cloudflare/types/access/group_create_params.py
+++ b/src/cloudflare/types/access/group_create_params.py
@@ -121,12 +121,6 @@
class GroupCreateParams(TypedDict, total=False):
- account_id: Required[str]
- """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
-
- zone_id: Required[str]
- """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
include: Required[Iterable[Include]]
"""Rules evaluated with an OR logical operator.
@@ -136,6 +130,12 @@ class GroupCreateParams(TypedDict, total=False):
name: Required[str]
"""The name of the Access group."""
+ account_id: str
+ """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
+
+ zone_id: str
+ """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
+
exclude: Iterable[Exclude]
"""Rules evaluated with a NOT logical operator.
diff --git a/src/cloudflare/types/access/group_update_params.py b/src/cloudflare/types/access/group_update_params.py
index 53bc0c35baa..8f6867941e6 100644
--- a/src/cloudflare/types/access/group_update_params.py
+++ b/src/cloudflare/types/access/group_update_params.py
@@ -121,12 +121,6 @@
class GroupUpdateParams(TypedDict, total=False):
- account_id: Required[str]
- """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
-
- zone_id: Required[str]
- """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
include: Required[Iterable[Include]]
"""Rules evaluated with an OR logical operator.
@@ -136,6 +130,12 @@ class GroupUpdateParams(TypedDict, total=False):
name: Required[str]
"""The name of the Access group."""
+ account_id: str
+ """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
+
+ zone_id: str
+ """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
+
exclude: Iterable[Exclude]
"""Rules evaluated with a NOT logical operator.
diff --git a/src/cloudflare/types/access/identity_provider_create_params.py b/src/cloudflare/types/access/identity_provider_create_params.py
index 1c0d5d6ddb9..04c6ad3ed09 100644
--- a/src/cloudflare/types/access/identity_provider_create_params.py
+++ b/src/cloudflare/types/access/identity_provider_create_params.py
@@ -9,12 +9,6 @@
class IdentityProviderCreateParams(TypedDict, total=False):
- account_id: Required[str]
- """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
-
- zone_id: Required[str]
- """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
config: Required[Config]
name: Required[str]
@@ -44,6 +38,12 @@ class IdentityProviderCreateParams(TypedDict, total=False):
[developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).
"""
+ account_id: str
+ """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
+
+ zone_id: str
+ """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
+
scim_config: ScimConfig
diff --git a/src/cloudflare/types/access/identity_provider_update_params.py b/src/cloudflare/types/access/identity_provider_update_params.py
index 628821cfa44..14890be0714 100644
--- a/src/cloudflare/types/access/identity_provider_update_params.py
+++ b/src/cloudflare/types/access/identity_provider_update_params.py
@@ -9,12 +9,6 @@
class IdentityProviderUpdateParams(TypedDict, total=False):
- account_id: Required[str]
- """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
-
- zone_id: Required[str]
- """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
config: Required[Config]
name: Required[str]
@@ -44,6 +38,12 @@ class IdentityProviderUpdateParams(TypedDict, total=False):
[developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).
"""
+ account_id: str
+ """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
+
+ zone_id: str
+ """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
+
scim_config: ScimConfig
diff --git a/src/cloudflare/types/access/organization_create_params.py b/src/cloudflare/types/access/organization_create_params.py
index 6c4584d2acc..2a61ff455ed 100644
--- a/src/cloudflare/types/access/organization_create_params.py
+++ b/src/cloudflare/types/access/organization_create_params.py
@@ -8,18 +8,18 @@
class OrganizationCreateParams(TypedDict, total=False):
- account_id: Required[str]
- """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
-
- zone_id: Required[str]
- """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
auth_domain: Required[str]
"""The unique subdomain assigned to your Zero Trust organization."""
name: Required[str]
"""The name of your Zero Trust organization."""
+ account_id: str
+ """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
+
+ zone_id: str
+ """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
+
allow_authenticate_via_warp: bool
"""
When set to true, users can authenticate via WARP for any application in your
diff --git a/src/cloudflare/types/access/organization_revoke_users_params.py b/src/cloudflare/types/access/organization_revoke_users_params.py
index 20c7935ef4b..2d436d8b1ee 100644
--- a/src/cloudflare/types/access/organization_revoke_users_params.py
+++ b/src/cloudflare/types/access/organization_revoke_users_params.py
@@ -8,11 +8,11 @@
class OrganizationRevokeUsersParams(TypedDict, total=False):
- account_id: Required[str]
+ email: Required[str]
+ """The email of the user to revoke."""
+
+ account_id: str
"""The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
- zone_id: Required[str]
+ zone_id: str
"""The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
- email: Required[str]
- """The email of the user to revoke."""
diff --git a/src/cloudflare/types/access/organization_update_params.py b/src/cloudflare/types/access/organization_update_params.py
index fd6efd03e3e..659c970dc98 100644
--- a/src/cloudflare/types/access/organization_update_params.py
+++ b/src/cloudflare/types/access/organization_update_params.py
@@ -2,16 +2,16 @@
from __future__ import annotations
-from typing_extensions import Required, TypedDict
+from typing_extensions import TypedDict
__all__ = ["OrganizationUpdateParams", "CustomPages", "LoginDesign"]
class OrganizationUpdateParams(TypedDict, total=False):
- account_id: Required[str]
+ account_id: str
"""The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
- zone_id: Required[str]
+ zone_id: str
"""The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
allow_authenticate_via_warp: bool
diff --git a/src/cloudflare/types/access/service_token_create_params.py b/src/cloudflare/types/access/service_token_create_params.py
index c410778e8d0..4f5d9d588a8 100644
--- a/src/cloudflare/types/access/service_token_create_params.py
+++ b/src/cloudflare/types/access/service_token_create_params.py
@@ -8,15 +8,15 @@
class ServiceTokenCreateParams(TypedDict, total=False):
- account_id: Required[str]
+ name: Required[str]
+ """The name of the service token."""
+
+ account_id: str
"""The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
- zone_id: Required[str]
+ zone_id: str
"""The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
- name: Required[str]
- """The name of the service token."""
-
duration: str
"""The duration for how long the service token will be valid.
diff --git a/src/cloudflare/types/access/service_token_update_params.py b/src/cloudflare/types/access/service_token_update_params.py
index 6f59a928745..b2d9a70bdc2 100644
--- a/src/cloudflare/types/access/service_token_update_params.py
+++ b/src/cloudflare/types/access/service_token_update_params.py
@@ -2,16 +2,16 @@
from __future__ import annotations
-from typing_extensions import Required, TypedDict
+from typing_extensions import TypedDict
__all__ = ["ServiceTokenUpdateParams"]
class ServiceTokenUpdateParams(TypedDict, total=False):
- account_id: Required[str]
+ account_id: str
"""The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
- zone_id: Required[str]
+ zone_id: str
"""The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
duration: str
diff --git a/src/cloudflare/types/firewall/access_rule_create_params.py b/src/cloudflare/types/firewall/access_rule_create_params.py
index 63f002be254..c37442dfd44 100644
--- a/src/cloudflare/types/firewall/access_rule_create_params.py
+++ b/src/cloudflare/types/firewall/access_rule_create_params.py
@@ -17,18 +17,18 @@
class AccessRuleCreateParams(TypedDict, total=False):
- account_id: Required[str]
- """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
-
- zone_id: Required[str]
- """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
configuration: Required[Configuration]
"""The rule configuration."""
mode: Required[Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"]]
"""The action to apply to a matched request."""
+ account_id: str
+ """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
+
+ zone_id: str
+ """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
+
notes: str
"""
An informative summary of the rule, typically used as a reminder or explanation.
diff --git a/src/cloudflare/types/firewall/access_rule_edit_params.py b/src/cloudflare/types/firewall/access_rule_edit_params.py
index 9ae46f2e15d..5e1dec82554 100644
--- a/src/cloudflare/types/firewall/access_rule_edit_params.py
+++ b/src/cloudflare/types/firewall/access_rule_edit_params.py
@@ -17,18 +17,18 @@
class AccessRuleEditParams(TypedDict, total=False):
- account_id: Required[str]
- """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
-
- zone_id: Required[str]
- """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
configuration: Required[Configuration]
"""The rule configuration."""
mode: Required[Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"]]
"""The action to apply to a matched request."""
+ account_id: str
+ """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
+
+ zone_id: str
+ """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
+
notes: str
"""
An informative summary of the rule, typically used as a reminder or explanation.
diff --git a/src/cloudflare/types/firewall/access_rule_list_params.py b/src/cloudflare/types/firewall/access_rule_list_params.py
index 389861136e7..14df38314e5 100644
--- a/src/cloudflare/types/firewall/access_rule_list_params.py
+++ b/src/cloudflare/types/firewall/access_rule_list_params.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing_extensions import Literal, Required, Annotated, TypedDict
+from typing_extensions import Literal, Annotated, TypedDict
from ..._utils import PropertyInfo
@@ -10,10 +10,10 @@
class AccessRuleListParams(TypedDict, total=False):
- account_id: Required[str]
+ account_id: str
"""The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
- zone_id: Required[str]
+ zone_id: str
"""The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
direction: Literal["asc", "desc"]
diff --git a/src/cloudflare/types/logpush/job_create_params.py b/src/cloudflare/types/logpush/job_create_params.py
index 845f033957e..3f4f2abf18a 100644
--- a/src/cloudflare/types/logpush/job_create_params.py
+++ b/src/cloudflare/types/logpush/job_create_params.py
@@ -11,12 +11,6 @@
class JobCreateParams(TypedDict, total=False):
- account_id: Required[str]
- """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
-
- zone_id: Required[str]
- """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
destination_conf: Required[str]
"""Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
@@ -24,6 +18,12 @@ class JobCreateParams(TypedDict, total=False):
included.
"""
+ account_id: str
+ """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
+
+ zone_id: str
+ """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
+
dataset: Optional[str]
"""Name of the dataset."""
diff --git a/src/cloudflare/types/logpush/job_update_params.py b/src/cloudflare/types/logpush/job_update_params.py
index 9d29486890c..e0fb06468c3 100644
--- a/src/cloudflare/types/logpush/job_update_params.py
+++ b/src/cloudflare/types/logpush/job_update_params.py
@@ -3,7 +3,7 @@
from __future__ import annotations
from typing import List, Optional
-from typing_extensions import Literal, Required, Annotated, TypedDict
+from typing_extensions import Literal, Annotated, TypedDict
from ..._utils import PropertyInfo
@@ -11,10 +11,10 @@
class JobUpdateParams(TypedDict, total=False):
- account_id: Required[str]
+ account_id: str
"""The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
- zone_id: Required[str]
+ zone_id: str
"""The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
destination_conf: str
diff --git a/src/cloudflare/types/logpush/ownership_create_params.py b/src/cloudflare/types/logpush/ownership_create_params.py
index 58f3e98073f..f1d75590ac8 100644
--- a/src/cloudflare/types/logpush/ownership_create_params.py
+++ b/src/cloudflare/types/logpush/ownership_create_params.py
@@ -8,15 +8,15 @@
class OwnershipCreateParams(TypedDict, total=False):
- account_id: Required[str]
- """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
-
- zone_id: Required[str]
- """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
destination_conf: Required[str]
"""Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
Additional configuration parameters supported by the destination may be
included.
"""
+
+ account_id: str
+ """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
+
+ zone_id: str
+ """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
diff --git a/src/cloudflare/types/logpush/ownership_validate_params.py b/src/cloudflare/types/logpush/ownership_validate_params.py
index d2bee3c2c86..de3341af1d7 100644
--- a/src/cloudflare/types/logpush/ownership_validate_params.py
+++ b/src/cloudflare/types/logpush/ownership_validate_params.py
@@ -8,12 +8,6 @@
class OwnershipValidateParams(TypedDict, total=False):
- account_id: Required[str]
- """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
-
- zone_id: Required[str]
- """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
destination_conf: Required[str]
"""Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
@@ -23,3 +17,9 @@ class OwnershipValidateParams(TypedDict, total=False):
ownership_challenge: Required[str]
"""Ownership challenge token to prove destination ownership."""
+
+ account_id: str
+ """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
+
+ zone_id: str
+ """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
diff --git a/src/cloudflare/types/logpush/validate_destination_params.py b/src/cloudflare/types/logpush/validate_destination_params.py
index 355e40584a4..9dd9eacb964 100644
--- a/src/cloudflare/types/logpush/validate_destination_params.py
+++ b/src/cloudflare/types/logpush/validate_destination_params.py
@@ -8,15 +8,15 @@
class ValidateDestinationParams(TypedDict, total=False):
- account_id: Required[str]
- """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
-
- zone_id: Required[str]
- """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
destination_conf: Required[str]
"""Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
Additional configuration parameters supported by the destination may be
included.
"""
+
+ account_id: str
+ """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
+
+ zone_id: str
+ """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
diff --git a/src/cloudflare/types/logpush/validate_origin_params.py b/src/cloudflare/types/logpush/validate_origin_params.py
index 86b1f7dd67e..e5fbcfc4d3e 100644
--- a/src/cloudflare/types/logpush/validate_origin_params.py
+++ b/src/cloudflare/types/logpush/validate_origin_params.py
@@ -9,12 +9,6 @@
class ValidateOriginParams(TypedDict, total=False):
- account_id: Required[str]
- """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
-
- zone_id: Required[str]
- """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
logpull_options: Required[Optional[str]]
"""This field is deprecated.
@@ -23,3 +17,9 @@ class ValidateOriginParams(TypedDict, total=False):
the url (full url or just the query string) of your call here, and logpush will
keep on making this call for you, setting start and end times appropriately.
"""
+
+ account_id: str
+ """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
+
+ zone_id: str
+ """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
diff --git a/src/cloudflare/types/ruleset_create_params.py b/src/cloudflare/types/ruleset_create_params.py
index 68ae0264536..b7769f67675 100644
--- a/src/cloudflare/types/ruleset_create_params.py
+++ b/src/cloudflare/types/ruleset_create_params.py
@@ -28,12 +28,6 @@
class RulesetCreateParams(TypedDict, total=False):
- account_id: Required[str]
- """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
-
- zone_id: Required[str]
- """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
kind: Required[Literal["managed", "custom", "root", "zone"]]
"""The kind of the ruleset."""
@@ -72,6 +66,12 @@ class RulesetCreateParams(TypedDict, total=False):
rules: Required[Iterable[Rule]]
"""The list of rules in the ruleset."""
+ account_id: str
+ """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
+
+ zone_id: str
+ """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
+
description: str
"""An informative description of the ruleset."""
diff --git a/src/cloudflare/types/ruleset_update_params.py b/src/cloudflare/types/ruleset_update_params.py
index 03c4a3e2d55..ce3e38a79fb 100644
--- a/src/cloudflare/types/ruleset_update_params.py
+++ b/src/cloudflare/types/ruleset_update_params.py
@@ -28,18 +28,18 @@
class RulesetUpdateParams(TypedDict, total=False):
- account_id: Required[str]
- """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
-
- zone_id: Required[str]
- """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
id: Required[str]
"""The unique ID of the ruleset."""
rules: Required[Iterable[Rule]]
"""The list of rules in the ruleset."""
+ account_id: str
+ """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
+
+ zone_id: str
+ """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
+
description: str
"""An informative description of the ruleset."""
diff --git a/src/cloudflare/types/rulesets/phase_update_params.py b/src/cloudflare/types/rulesets/phase_update_params.py
index 8ca481cea23..344e75a1aaf 100644
--- a/src/cloudflare/types/rulesets/phase_update_params.py
+++ b/src/cloudflare/types/rulesets/phase_update_params.py
@@ -28,18 +28,18 @@
class PhaseUpdateParams(TypedDict, total=False):
- account_id: Required[str]
- """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
-
- zone_id: Required[str]
- """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
-
id: Required[str]
"""The unique ID of the ruleset."""
rules: Required[Iterable[Rule]]
"""The list of rules in the ruleset."""
+ account_id: str
+ """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
+
+ zone_id: str
+ """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
+
description: str
"""An informative description of the ruleset."""
diff --git a/src/cloudflare/types/rulesets/rule_create_params.py b/src/cloudflare/types/rulesets/rule_create_params.py
index a41c9ac891b..4617b9b5fc3 100644
--- a/src/cloudflare/types/rulesets/rule_create_params.py
+++ b/src/cloudflare/types/rulesets/rule_create_params.py
@@ -3,16 +3,16 @@
from __future__ import annotations
from typing import Union
-from typing_extensions import Required, TypedDict
+from typing_extensions import TypedDict
__all__ = ["RuleCreateParams", "Position", "PositionPosition"]
class RuleCreateParams(TypedDict, total=False):
- account_id: Required[str]
+ account_id: str
"""The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
- zone_id: Required[str]
+ zone_id: str
"""The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
position: Position
diff --git a/src/cloudflare/types/rulesets/rule_edit_params.py b/src/cloudflare/types/rulesets/rule_edit_params.py
index b6cd109b06a..a98ef0d478e 100644
--- a/src/cloudflare/types/rulesets/rule_edit_params.py
+++ b/src/cloudflare/types/rulesets/rule_edit_params.py
@@ -9,15 +9,15 @@
class RuleEditParams(TypedDict, total=False):
- account_id: Required[str]
+ ruleset_id: Required[str]
+ """The unique ID of the ruleset."""
+
+ account_id: str
"""The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
- zone_id: Required[str]
+ zone_id: str
"""The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
- ruleset_id: Required[str]
- """The unique ID of the ruleset."""
-
position: Position
"""An object configuring where the rule will be placed."""
diff --git a/tests/api_resources/access/applications/test_cas.py b/tests/api_resources/access/applications/test_cas.py
index c42306854fa..52fb2f79a6c 100644
--- a/tests/api_resources/access/applications/test_cas.py
+++ b/tests/api_resources/access/applications/test_cas.py
@@ -27,6 +27,16 @@ def test_method_create(self, client: Cloudflare) -> None:
)
assert_matches_type(CACreateResponse, ca, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
+ ca = client.access.applications.cas.create(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(CACreateResponse, ca, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_create(self, client: Cloudflare) -> None:
@@ -60,6 +70,13 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_create(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ client.access.applications.cas.with_raw_response.create(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.applications.cas.with_raw_response.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -74,13 +91,6 @@ def test_path_params_create(self, client: Cloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- client.access.applications.cas.with_raw_response.create(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
def test_method_list(self, client: Cloudflare) -> None:
@@ -90,6 +100,15 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(Optional[CAListResponse], ca, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
+ ca = client.access.applications.cas.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[CAListResponse], ca, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -143,6 +162,16 @@ def test_method_delete(self, client: Cloudflare) -> None:
)
assert_matches_type(CADeleteResponse, ca, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_delete_with_all_params(self, client: Cloudflare) -> None:
+ ca = client.access.applications.cas.delete(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(CADeleteResponse, ca, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_delete(self, client: Cloudflare) -> None:
@@ -176,6 +205,13 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_delete(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ client.access.applications.cas.with_raw_response.delete(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.applications.cas.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -190,13 +226,6 @@ def test_path_params_delete(self, client: Cloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- client.access.applications.cas.with_raw_response.delete(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
def test_method_get(self, client: Cloudflare) -> None:
@@ -207,6 +236,16 @@ def test_method_get(self, client: Cloudflare) -> None:
)
assert_matches_type(CAGetResponse, ca, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
+ ca = client.access.applications.cas.get(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(CAGetResponse, ca, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_get(self, client: Cloudflare) -> None:
@@ -240,6 +279,13 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_get(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ client.access.applications.cas.with_raw_response.get(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.applications.cas.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -254,13 +300,6 @@ def test_path_params_get(self, client: Cloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- client.access.applications.cas.with_raw_response.get(
- "",
- account_id="string",
- zone_id="string",
- )
-
class TestAsyncCAs:
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
@@ -275,6 +314,16 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(CACreateResponse, ca, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ ca = await async_client.access.applications.cas.create(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(CACreateResponse, ca, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
@@ -308,6 +357,13 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip()
@parametrize
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ await async_client.access.applications.cas.with_raw_response.create(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.applications.cas.with_raw_response.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -322,13 +378,6 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- await async_client.access.applications.cas.with_raw_response.create(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
@@ -338,6 +387,15 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(Optional[CAListResponse], ca, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ ca = await async_client.access.applications.cas.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[CAListResponse], ca, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -391,6 +449,16 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(CADeleteResponse, ca, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ ca = await async_client.access.applications.cas.delete(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(CADeleteResponse, ca, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
@@ -424,6 +492,13 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip()
@parametrize
async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ await async_client.access.applications.cas.with_raw_response.delete(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.applications.cas.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -438,13 +513,6 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- await async_client.access.applications.cas.with_raw_response.delete(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
@@ -455,6 +523,16 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(CAGetResponse, ca, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ ca = await async_client.access.applications.cas.get(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(CAGetResponse, ca, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
@@ -488,6 +566,13 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
@pytest.mark.skip()
@parametrize
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ await async_client.access.applications.cas.with_raw_response.get(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.applications.cas.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -501,10 +586,3 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
account_id="string",
zone_id="",
)
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- await async_client.access.applications.cas.with_raw_response.get(
- "",
- account_id="string",
- zone_id="string",
- )
diff --git a/tests/api_resources/access/applications/test_policies.py b/tests/api_resources/access/applications/test_policies.py
index 7c6e1e56e45..ebbddb16db8 100644
--- a/tests/api_resources/access/applications/test_policies.py
+++ b/tests/api_resources/access/applications/test_policies.py
@@ -28,8 +28,6 @@ class TestPolicies:
def test_method_create(self, client: Cloudflare) -> None:
policy = client.access.applications.policies.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
decision="allow",
include=[
{"email": {"email": "test@example.com"}},
@@ -37,6 +35,8 @@ def test_method_create(self, client: Cloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(PolicyCreateResponse, policy, path=["response"])
@@ -45,8 +45,6 @@ def test_method_create(self, client: Cloudflare) -> None:
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
policy = client.access.applications.policies.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
decision="allow",
include=[
{"email": {"email": "test@example.com"}},
@@ -54,6 +52,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
approval_groups=[
{
"approvals_needed": 1,
@@ -90,8 +90,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
def test_raw_response_create(self, client: Cloudflare) -> None:
response = client.access.applications.policies.with_raw_response.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
decision="allow",
include=[
{"email": {"email": "test@example.com"}},
@@ -99,6 +97,8 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -111,8 +111,6 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
def test_streaming_response_create(self, client: Cloudflare) -> None:
with client.access.applications.policies.with_streaming_response.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
decision="allow",
include=[
{"email": {"email": "test@example.com"}},
@@ -120,6 +118,8 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -132,11 +132,9 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_create(self, client: Cloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
client.access.applications.policies.with_raw_response.create(
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="",
- zone_id="string",
+ "",
decision="allow",
include=[
{"email": {"email": "test@example.com"}},
@@ -144,13 +142,13 @@ def test_path_params_create(self, client: Cloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.applications.policies.with_raw_response.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="",
decision="allow",
include=[
{"email": {"email": "test@example.com"}},
@@ -158,13 +156,13 @@ def test_path_params_create(self, client: Cloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.access.applications.policies.with_raw_response.create(
- "",
- account_id="string",
- zone_id="string",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
decision="allow",
include=[
{"email": {"email": "test@example.com"}},
@@ -172,6 +170,8 @@ def test_path_params_create(self, client: Cloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -179,8 +179,6 @@ def test_path_params_create(self, client: Cloudflare) -> None:
def test_method_update(self, client: Cloudflare) -> None:
policy = client.access.applications.policies.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
decision="allow",
include=[
@@ -189,6 +187,8 @@ def test_method_update(self, client: Cloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(PolicyUpdateResponse, policy, path=["response"])
@@ -197,8 +197,6 @@ def test_method_update(self, client: Cloudflare) -> None:
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
policy = client.access.applications.policies.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
decision="allow",
include=[
@@ -207,6 +205,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
approval_groups=[
{
"approvals_needed": 1,
@@ -243,8 +243,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
def test_raw_response_update(self, client: Cloudflare) -> None:
response = client.access.applications.policies.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
decision="allow",
include=[
@@ -253,6 +251,8 @@ def test_raw_response_update(self, client: Cloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -265,8 +265,6 @@ def test_raw_response_update(self, client: Cloudflare) -> None:
def test_streaming_response_update(self, client: Cloudflare) -> None:
with client.access.applications.policies.with_streaming_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
decision="allow",
include=[
@@ -275,6 +273,8 @@ def test_streaming_response_update(self, client: Cloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -287,12 +287,10 @@ def test_streaming_response_update(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_update(self, client: Cloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid1` but received ''"):
client.access.applications.policies.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="",
- zone_id="string",
- uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ uuid1="",
decision="allow",
include=[
{"email": {"email": "test@example.com"}},
@@ -300,13 +298,13 @@ def test_path_params_update(self, client: Cloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
client.access.applications.policies.with_raw_response.update(
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="",
+ "",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
decision="allow",
include=[
@@ -315,14 +313,14 @@ def test_path_params_update(self, client: Cloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid1` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.applications.policies.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
- uuid1="",
+ uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
decision="allow",
include=[
{"email": {"email": "test@example.com"}},
@@ -330,13 +328,13 @@ def test_path_params_update(self, client: Cloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.access.applications.policies.with_raw_response.update(
- "",
- account_id="string",
- zone_id="string",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
decision="allow",
include=[
@@ -345,6 +343,8 @@ def test_path_params_update(self, client: Cloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -357,6 +357,16 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(Optional[PolicyListResponse], policy, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
+ policy = client.access.applications.policies.list(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[PolicyListResponse], policy, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -390,6 +400,13 @@ def test_streaming_response_list(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_list(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ client.access.applications.policies.with_raw_response.list(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.applications.policies.with_raw_response.list(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -404,21 +421,25 @@ def test_path_params_list(self, client: Cloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- client.access.applications.policies.with_raw_response.list(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
def test_method_delete(self, client: Cloudflare) -> None:
policy = client.access.applications.policies.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(PolicyDeleteResponse, policy, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_delete_with_all_params(self, client: Cloudflare) -> None:
+ policy = client.access.applications.policies.delete(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(PolicyDeleteResponse, policy, path=["response"])
@@ -427,9 +448,9 @@ def test_method_delete(self, client: Cloudflare) -> None:
def test_raw_response_delete(self, client: Cloudflare) -> None:
response = client.access.applications.policies.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
- uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
)
assert response.is_closed is True
@@ -442,9 +463,9 @@ def test_raw_response_delete(self, client: Cloudflare) -> None:
def test_streaming_response_delete(self, client: Cloudflare) -> None:
with client.access.applications.policies.with_streaming_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
- uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -457,36 +478,36 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_delete(self, client: Cloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid1` but received ''"):
client.access.applications.policies.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="",
+ uuid1="",
+ account_id="string",
zone_id="string",
- uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
client.access.applications.policies.with_raw_response.delete(
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="",
+ "",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid1` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.applications.policies.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
+ uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="",
zone_id="string",
- uuid1="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.access.applications.policies.with_raw_response.delete(
- "",
- account_id="string",
- zone_id="string",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -494,9 +515,20 @@ def test_path_params_delete(self, client: Cloudflare) -> None:
def test_method_get(self, client: Cloudflare) -> None:
policy = client.access.applications.policies.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(PolicyGetResponse, policy, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
+ policy = client.access.applications.policies.get(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(PolicyGetResponse, policy, path=["response"])
@@ -505,9 +537,9 @@ def test_method_get(self, client: Cloudflare) -> None:
def test_raw_response_get(self, client: Cloudflare) -> None:
response = client.access.applications.policies.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
- uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
)
assert response.is_closed is True
@@ -520,9 +552,9 @@ def test_raw_response_get(self, client: Cloudflare) -> None:
def test_streaming_response_get(self, client: Cloudflare) -> None:
with client.access.applications.policies.with_streaming_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
- uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -535,36 +567,36 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_get(self, client: Cloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid1` but received ''"):
client.access.applications.policies.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="",
+ uuid1="",
+ account_id="string",
zone_id="string",
- uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
client.access.applications.policies.with_raw_response.get(
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="",
+ "",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid1` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.applications.policies.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
+ uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="",
zone_id="string",
- uuid1="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.access.applications.policies.with_raw_response.get(
- "",
- account_id="string",
- zone_id="string",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="",
)
@@ -576,8 +608,6 @@ class TestAsyncPolicies:
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
policy = await async_client.access.applications.policies.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
decision="allow",
include=[
{"email": {"email": "test@example.com"}},
@@ -585,6 +615,8 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(PolicyCreateResponse, policy, path=["response"])
@@ -593,8 +625,6 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
policy = await async_client.access.applications.policies.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
decision="allow",
include=[
{"email": {"email": "test@example.com"}},
@@ -602,6 +632,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
approval_groups=[
{
"approvals_needed": 1,
@@ -638,8 +670,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
response = await async_client.access.applications.policies.with_raw_response.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
decision="allow",
include=[
{"email": {"email": "test@example.com"}},
@@ -647,6 +677,8 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -659,8 +691,6 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
async with async_client.access.applications.policies.with_streaming_response.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
decision="allow",
include=[
{"email": {"email": "test@example.com"}},
@@ -668,6 +698,8 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -680,11 +712,9 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip()
@parametrize
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
await async_client.access.applications.policies.with_raw_response.create(
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="",
- zone_id="string",
+ "",
decision="allow",
include=[
{"email": {"email": "test@example.com"}},
@@ -692,13 +722,13 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.applications.policies.with_raw_response.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="",
decision="allow",
include=[
{"email": {"email": "test@example.com"}},
@@ -706,13 +736,13 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.access.applications.policies.with_raw_response.create(
- "",
- account_id="string",
- zone_id="string",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
decision="allow",
include=[
{"email": {"email": "test@example.com"}},
@@ -720,6 +750,8 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -727,8 +759,6 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
policy = await async_client.access.applications.policies.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
decision="allow",
include=[
@@ -737,6 +767,8 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(PolicyUpdateResponse, policy, path=["response"])
@@ -745,8 +777,6 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None:
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
policy = await async_client.access.applications.policies.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
decision="allow",
include=[
@@ -755,6 +785,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
approval_groups=[
{
"approvals_needed": 1,
@@ -791,8 +823,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
response = await async_client.access.applications.policies.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
decision="allow",
include=[
@@ -801,6 +831,8 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -813,8 +845,6 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
async with async_client.access.applications.policies.with_streaming_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
decision="allow",
include=[
@@ -823,6 +853,8 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) ->
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -835,12 +867,10 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip()
@parametrize
async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid1` but received ''"):
await async_client.access.applications.policies.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="",
- zone_id="string",
- uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ uuid1="",
decision="allow",
include=[
{"email": {"email": "test@example.com"}},
@@ -848,13 +878,13 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
await async_client.access.applications.policies.with_raw_response.update(
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="",
+ "",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
decision="allow",
include=[
@@ -863,14 +893,14 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid1` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.applications.policies.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
- uuid1="",
+ uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
decision="allow",
include=[
{"email": {"email": "test@example.com"}},
@@ -878,13 +908,13 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.access.applications.policies.with_raw_response.update(
- "",
- account_id="string",
- zone_id="string",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
decision="allow",
include=[
@@ -893,6 +923,8 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -905,6 +937,16 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(Optional[PolicyListResponse], policy, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ policy = await async_client.access.applications.policies.list(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[PolicyListResponse], policy, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -938,6 +980,13 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N
@pytest.mark.skip()
@parametrize
async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ await async_client.access.applications.policies.with_raw_response.list(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.applications.policies.with_raw_response.list(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -952,21 +1001,25 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- await async_client.access.applications.policies.with_raw_response.list(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
policy = await async_client.access.applications.policies.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(PolicyDeleteResponse, policy, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ policy = await async_client.access.applications.policies.delete(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(PolicyDeleteResponse, policy, path=["response"])
@@ -975,9 +1028,9 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
response = await async_client.access.applications.policies.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
- uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
)
assert response.is_closed is True
@@ -990,9 +1043,9 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None:
async with async_client.access.applications.policies.with_streaming_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
- uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -1005,36 +1058,36 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip()
@parametrize
async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid1` but received ''"):
await async_client.access.applications.policies.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="",
+ uuid1="",
+ account_id="string",
zone_id="string",
- uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
await async_client.access.applications.policies.with_raw_response.delete(
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="",
+ "",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid1` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.applications.policies.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
+ uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="",
zone_id="string",
- uuid1="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.access.applications.policies.with_raw_response.delete(
- "",
- account_id="string",
- zone_id="string",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -1042,9 +1095,20 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
policy = await async_client.access.applications.policies.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(PolicyGetResponse, policy, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ policy = await async_client.access.applications.policies.get(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(PolicyGetResponse, policy, path=["response"])
@@ -1053,9 +1117,9 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
response = await async_client.access.applications.policies.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
- uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
)
assert response.is_closed is True
@@ -1068,9 +1132,9 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
async with async_client.access.applications.policies.with_streaming_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
- uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -1083,34 +1147,34 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
@pytest.mark.skip()
@parametrize
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid1` but received ''"):
await async_client.access.applications.policies.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="",
+ uuid1="",
+ account_id="string",
zone_id="string",
- uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
await async_client.access.applications.policies.with_raw_response.get(
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="",
+ "",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid1` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.applications.policies.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
+ uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="",
zone_id="string",
- uuid1="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.access.applications.policies.with_raw_response.get(
- "",
- account_id="string",
- zone_id="string",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="",
)
diff --git a/tests/api_resources/access/applications/test_user_policy_checks.py b/tests/api_resources/access/applications/test_user_policy_checks.py
index b5bb7439e0e..76f6a96806b 100644
--- a/tests/api_resources/access/applications/test_user_policy_checks.py
+++ b/tests/api_resources/access/applications/test_user_policy_checks.py
@@ -27,6 +27,16 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(UserPolicyCheckListResponse, user_policy_check, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
+ user_policy_check = client.access.applications.user_policy_checks.list(
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(UserPolicyCheckListResponse, user_policy_check, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -88,6 +98,16 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(UserPolicyCheckListResponse, user_policy_check, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ user_policy_check = await async_client.access.applications.user_policy_checks.list(
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(UserPolicyCheckListResponse, user_policy_check, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
diff --git a/tests/api_resources/access/certificates/test_settings.py b/tests/api_resources/access/certificates/test_settings.py
index 2fa3144cdf5..c5e96568e60 100644
--- a/tests/api_resources/access/certificates/test_settings.py
+++ b/tests/api_resources/access/certificates/test_settings.py
@@ -21,8 +21,32 @@ class TestSettings:
@parametrize
def test_method_update(self, client: Cloudflare) -> None:
setting = client.access.certificates.settings.update(
+ settings=[
+ {
+ "china_network": False,
+ "client_certificate_forwarding": True,
+ "hostname": "admin.example.com",
+ },
+ {
+ "china_network": False,
+ "client_certificate_forwarding": True,
+ "hostname": "admin.example.com",
+ },
+ {
+ "china_network": False,
+ "client_certificate_forwarding": True,
+ "hostname": "admin.example.com",
+ },
+ ],
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
+ setting = client.access.certificates.settings.update(
settings=[
{
"china_network": False,
@@ -40,6 +64,8 @@ def test_method_update(self, client: Cloudflare) -> None:
"hostname": "admin.example.com",
},
],
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"])
@@ -47,8 +73,6 @@ def test_method_update(self, client: Cloudflare) -> None:
@parametrize
def test_raw_response_update(self, client: Cloudflare) -> None:
response = client.access.certificates.settings.with_raw_response.update(
- account_id="string",
- zone_id="string",
settings=[
{
"china_network": False,
@@ -66,6 +90,8 @@ def test_raw_response_update(self, client: Cloudflare) -> None:
"hostname": "admin.example.com",
},
],
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -77,8 +103,6 @@ def test_raw_response_update(self, client: Cloudflare) -> None:
@parametrize
def test_streaming_response_update(self, client: Cloudflare) -> None:
with client.access.certificates.settings.with_streaming_response.update(
- account_id="string",
- zone_id="string",
settings=[
{
"china_network": False,
@@ -96,6 +120,8 @@ def test_streaming_response_update(self, client: Cloudflare) -> None:
"hostname": "admin.example.com",
},
],
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -110,8 +136,6 @@ def test_streaming_response_update(self, client: Cloudflare) -> None:
def test_path_params_update(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.certificates.settings.with_raw_response.update(
- account_id="",
- zone_id="string",
settings=[
{
"china_network": False,
@@ -129,12 +153,12 @@ def test_path_params_update(self, client: Cloudflare) -> None:
"hostname": "admin.example.com",
},
],
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.access.certificates.settings.with_raw_response.update(
- account_id="string",
- zone_id="",
settings=[
{
"china_network": False,
@@ -152,6 +176,8 @@ def test_path_params_update(self, client: Cloudflare) -> None:
"hostname": "admin.example.com",
},
],
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -163,6 +189,15 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(Optional[SettingListResponse], setting, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
+ setting = client.access.certificates.settings.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[SettingListResponse], setting, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -214,8 +249,32 @@ class TestAsyncSettings:
@parametrize
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
setting = await async_client.access.certificates.settings.update(
+ settings=[
+ {
+ "china_network": False,
+ "client_certificate_forwarding": True,
+ "hostname": "admin.example.com",
+ },
+ {
+ "china_network": False,
+ "client_certificate_forwarding": True,
+ "hostname": "admin.example.com",
+ },
+ {
+ "china_network": False,
+ "client_certificate_forwarding": True,
+ "hostname": "admin.example.com",
+ },
+ ],
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.access.certificates.settings.update(
settings=[
{
"china_network": False,
@@ -233,6 +292,8 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None:
"hostname": "admin.example.com",
},
],
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"])
@@ -240,8 +301,6 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
response = await async_client.access.certificates.settings.with_raw_response.update(
- account_id="string",
- zone_id="string",
settings=[
{
"china_network": False,
@@ -259,6 +318,8 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
"hostname": "admin.example.com",
},
],
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -270,8 +331,6 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
async with async_client.access.certificates.settings.with_streaming_response.update(
- account_id="string",
- zone_id="string",
settings=[
{
"china_network": False,
@@ -289,6 +348,8 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) ->
"hostname": "admin.example.com",
},
],
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -303,8 +364,6 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) ->
async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.certificates.settings.with_raw_response.update(
- account_id="",
- zone_id="string",
settings=[
{
"china_network": False,
@@ -322,12 +381,12 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
"hostname": "admin.example.com",
},
],
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.access.certificates.settings.with_raw_response.update(
- account_id="string",
- zone_id="",
settings=[
{
"china_network": False,
@@ -345,6 +404,8 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
"hostname": "admin.example.com",
},
],
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -356,6 +417,15 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(Optional[SettingListResponse], setting, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.access.certificates.settings.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[SettingListResponse], setting, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
diff --git a/tests/api_resources/access/test_applications.py b/tests/api_resources/access/test_applications.py
index 3dcf61ac447..92dcbfc1e2f 100644
--- a/tests/api_resources/access/test_applications.py
+++ b/tests/api_resources/access/test_applications.py
@@ -270,6 +270,15 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(Optional[ApplicationListResponse], application, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
+ application = client.access.applications.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[ApplicationListResponse], application, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -323,6 +332,16 @@ def test_method_delete(self, client: Cloudflare) -> None:
)
assert_matches_type(ApplicationDeleteResponse, application, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_delete_with_all_params(self, client: Cloudflare) -> None:
+ application = client.access.applications.delete(
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(ApplicationDeleteResponse, application, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_delete(self, client: Cloudflare) -> None:
@@ -380,6 +399,16 @@ def test_method_get(self, client: Cloudflare) -> None:
)
assert_matches_type(ApplicationGetResponse, application, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
+ application = client.access.applications.get(
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(ApplicationGetResponse, application, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_get(self, client: Cloudflare) -> None:
@@ -437,6 +466,16 @@ def test_method_revoke_tokens(self, client: Cloudflare) -> None:
)
assert_matches_type(object, application, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_revoke_tokens_with_all_params(self, client: Cloudflare) -> None:
+ application = client.access.applications.revoke_tokens(
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(object, application, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_revoke_tokens(self, client: Cloudflare) -> None:
@@ -735,6 +774,15 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(Optional[ApplicationListResponse], application, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ application = await async_client.access.applications.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[ApplicationListResponse], application, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -788,6 +836,16 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(ApplicationDeleteResponse, application, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ application = await async_client.access.applications.delete(
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(ApplicationDeleteResponse, application, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
@@ -845,6 +903,16 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(ApplicationGetResponse, application, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ application = await async_client.access.applications.get(
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(ApplicationGetResponse, application, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
@@ -902,6 +970,16 @@ async def test_method_revoke_tokens(self, async_client: AsyncCloudflare) -> None
)
assert_matches_type(object, application, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_revoke_tokens_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ application = await async_client.access.applications.revoke_tokens(
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(object, application, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_revoke_tokens(self, async_client: AsyncCloudflare) -> None:
diff --git a/tests/api_resources/access/test_certificates.py b/tests/api_resources/access/test_certificates.py
index 2f75084daa2..316ad80b120 100644
--- a/tests/api_resources/access/test_certificates.py
+++ b/tests/api_resources/access/test_certificates.py
@@ -27,10 +27,10 @@ class TestCertificates:
@parametrize
def test_method_create(self, client: Cloudflare) -> None:
certificate = client.access.certificates.create(
- account_id="string",
- zone_id="string",
certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----",
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(CertificateCreateResponse, certificate, path=["response"])
@@ -38,10 +38,10 @@ def test_method_create(self, client: Cloudflare) -> None:
@parametrize
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
certificate = client.access.certificates.create(
- account_id="string",
- zone_id="string",
certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----",
name="Allow devs",
+ account_id="string",
+ zone_id="string",
associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
)
assert_matches_type(CertificateCreateResponse, certificate, path=["response"])
@@ -50,10 +50,10 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
@parametrize
def test_raw_response_create(self, client: Cloudflare) -> None:
response = client.access.certificates.with_raw_response.create(
- account_id="string",
- zone_id="string",
certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----",
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -65,10 +65,10 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
@parametrize
def test_streaming_response_create(self, client: Cloudflare) -> None:
with client.access.certificates.with_streaming_response.create(
- account_id="string",
- zone_id="string",
certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----",
name="Allow devs",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -83,18 +83,18 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:
def test_path_params_create(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.certificates.with_raw_response.create(
- account_id="",
- zone_id="string",
certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----",
name="Allow devs",
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.access.certificates.with_raw_response.create(
- account_id="string",
- zone_id="",
certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----",
name="Allow devs",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -102,9 +102,9 @@ def test_path_params_create(self, client: Cloudflare) -> None:
def test_method_update(self, client: Cloudflare) -> None:
certificate = client.access.certificates.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="string",
zone_id="string",
- associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
)
assert_matches_type(CertificateUpdateResponse, certificate, path=["response"])
@@ -113,9 +113,9 @@ def test_method_update(self, client: Cloudflare) -> None:
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
certificate = client.access.certificates.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="string",
zone_id="string",
- associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
name="Allow devs",
)
assert_matches_type(CertificateUpdateResponse, certificate, path=["response"])
@@ -125,9 +125,9 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
def test_raw_response_update(self, client: Cloudflare) -> None:
response = client.access.certificates.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="string",
zone_id="string",
- associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
)
assert response.is_closed is True
@@ -140,9 +140,9 @@ def test_raw_response_update(self, client: Cloudflare) -> None:
def test_streaming_response_update(self, client: Cloudflare) -> None:
with client.access.certificates.with_streaming_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="string",
zone_id="string",
- associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -155,28 +155,28 @@ def test_streaming_response_update(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_update(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ client.access.certificates.with_raw_response.update(
+ "",
+ associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.certificates.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="",
zone_id="string",
- associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.access.certificates.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="",
associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
- )
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- client.access.certificates.with_raw_response.update(
- "",
account_id="string",
- zone_id="string",
- associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
+ zone_id="",
)
@pytest.mark.skip()
@@ -188,6 +188,15 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(Optional[CertificateListResponse], certificate, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
+ certificate = client.access.certificates.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[CertificateListResponse], certificate, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -241,6 +250,16 @@ def test_method_delete(self, client: Cloudflare) -> None:
)
assert_matches_type(CertificateDeleteResponse, certificate, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_delete_with_all_params(self, client: Cloudflare) -> None:
+ certificate = client.access.certificates.delete(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(CertificateDeleteResponse, certificate, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_delete(self, client: Cloudflare) -> None:
@@ -274,6 +293,13 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_delete(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ client.access.certificates.with_raw_response.delete(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.certificates.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -288,13 +314,6 @@ def test_path_params_delete(self, client: Cloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- client.access.certificates.with_raw_response.delete(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
def test_method_get(self, client: Cloudflare) -> None:
@@ -305,6 +324,16 @@ def test_method_get(self, client: Cloudflare) -> None:
)
assert_matches_type(CertificateGetResponse, certificate, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
+ certificate = client.access.certificates.get(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(CertificateGetResponse, certificate, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_get(self, client: Cloudflare) -> None:
@@ -338,6 +367,13 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_get(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ client.access.certificates.with_raw_response.get(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.certificates.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -352,13 +388,6 @@ def test_path_params_get(self, client: Cloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- client.access.certificates.with_raw_response.get(
- "",
- account_id="string",
- zone_id="string",
- )
-
class TestAsyncCertificates:
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
@@ -367,10 +396,10 @@ class TestAsyncCertificates:
@parametrize
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
certificate = await async_client.access.certificates.create(
- account_id="string",
- zone_id="string",
certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----",
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(CertificateCreateResponse, certificate, path=["response"])
@@ -378,10 +407,10 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
certificate = await async_client.access.certificates.create(
- account_id="string",
- zone_id="string",
certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----",
name="Allow devs",
+ account_id="string",
+ zone_id="string",
associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
)
assert_matches_type(CertificateCreateResponse, certificate, path=["response"])
@@ -390,10 +419,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
@parametrize
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
response = await async_client.access.certificates.with_raw_response.create(
- account_id="string",
- zone_id="string",
certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----",
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -405,10 +434,10 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
async with async_client.access.certificates.with_streaming_response.create(
- account_id="string",
- zone_id="string",
certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----",
name="Allow devs",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -423,18 +452,18 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.certificates.with_raw_response.create(
- account_id="",
- zone_id="string",
certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----",
name="Allow devs",
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.access.certificates.with_raw_response.create(
- account_id="string",
- zone_id="",
certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----",
name="Allow devs",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -442,9 +471,9 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
certificate = await async_client.access.certificates.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="string",
zone_id="string",
- associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
)
assert_matches_type(CertificateUpdateResponse, certificate, path=["response"])
@@ -453,9 +482,9 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None:
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
certificate = await async_client.access.certificates.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="string",
zone_id="string",
- associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
name="Allow devs",
)
assert_matches_type(CertificateUpdateResponse, certificate, path=["response"])
@@ -465,9 +494,9 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
response = await async_client.access.certificates.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="string",
zone_id="string",
- associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
)
assert response.is_closed is True
@@ -480,9 +509,9 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
async with async_client.access.certificates.with_streaming_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="string",
zone_id="string",
- associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -495,28 +524,28 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip()
@parametrize
async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ await async_client.access.certificates.with_raw_response.update(
+ "",
+ associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.certificates.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="",
zone_id="string",
- associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.access.certificates.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="",
associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
- )
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- await async_client.access.certificates.with_raw_response.update(
- "",
account_id="string",
- zone_id="string",
- associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
+ zone_id="",
)
@pytest.mark.skip()
@@ -528,6 +557,15 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(Optional[CertificateListResponse], certificate, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ certificate = await async_client.access.certificates.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[CertificateListResponse], certificate, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -581,6 +619,16 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(CertificateDeleteResponse, certificate, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ certificate = await async_client.access.certificates.delete(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(CertificateDeleteResponse, certificate, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
@@ -614,6 +662,13 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip()
@parametrize
async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ await async_client.access.certificates.with_raw_response.delete(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.certificates.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -628,13 +683,6 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- await async_client.access.certificates.with_raw_response.delete(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
@@ -645,6 +693,16 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(CertificateGetResponse, certificate, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ certificate = await async_client.access.certificates.get(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(CertificateGetResponse, certificate, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
@@ -678,6 +736,13 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
@pytest.mark.skip()
@parametrize
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ await async_client.access.certificates.with_raw_response.get(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.certificates.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -691,10 +756,3 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
account_id="string",
zone_id="",
)
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- await async_client.access.certificates.with_raw_response.get(
- "",
- account_id="string",
- zone_id="string",
- )
diff --git a/tests/api_resources/access/test_groups.py b/tests/api_resources/access/test_groups.py
index ef1d1e30c2e..3a5c5321478 100644
--- a/tests/api_resources/access/test_groups.py
+++ b/tests/api_resources/access/test_groups.py
@@ -27,14 +27,14 @@ class TestGroups:
@parametrize
def test_method_create(self, client: Cloudflare) -> None:
group = client.access.groups.create(
- account_id="string",
- zone_id="string",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(GroupCreateResponse, group, path=["response"])
@@ -42,14 +42,14 @@ def test_method_create(self, client: Cloudflare) -> None:
@parametrize
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
group = client.access.groups.create(
- account_id="string",
- zone_id="string",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
exclude=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
@@ -68,14 +68,14 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
@parametrize
def test_raw_response_create(self, client: Cloudflare) -> None:
response = client.access.groups.with_raw_response.create(
- account_id="string",
- zone_id="string",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -87,14 +87,14 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
@parametrize
def test_streaming_response_create(self, client: Cloudflare) -> None:
with client.access.groups.with_streaming_response.create(
- account_id="string",
- zone_id="string",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -109,26 +109,26 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:
def test_path_params_create(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.groups.with_raw_response.create(
- account_id="",
- zone_id="string",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.access.groups.with_raw_response.create(
- account_id="string",
- zone_id="",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -136,14 +136,14 @@ def test_path_params_create(self, client: Cloudflare) -> None:
def test_method_update(self, client: Cloudflare) -> None:
group = client.access.groups.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(GroupUpdateResponse, group, path=["response"])
@@ -152,14 +152,14 @@ def test_method_update(self, client: Cloudflare) -> None:
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
group = client.access.groups.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
exclude=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
@@ -179,14 +179,14 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
def test_raw_response_update(self, client: Cloudflare) -> None:
response = client.access.groups.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -199,14 +199,14 @@ def test_raw_response_update(self, client: Cloudflare) -> None:
def test_streaming_response_update(self, client: Cloudflare) -> None:
with client.access.groups.with_streaming_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -219,43 +219,43 @@ def test_streaming_response_update(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_update(self, client: Cloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
client.access.groups.with_raw_response.update(
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="",
- zone_id="string",
+ "",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.groups.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.access.groups.with_raw_response.update(
- "",
- account_id="string",
- zone_id="string",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -267,6 +267,15 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(Optional[GroupListResponse], group, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
+ group = client.access.groups.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[GroupListResponse], group, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -320,6 +329,16 @@ def test_method_delete(self, client: Cloudflare) -> None:
)
assert_matches_type(GroupDeleteResponse, group, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_delete_with_all_params(self, client: Cloudflare) -> None:
+ group = client.access.groups.delete(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(GroupDeleteResponse, group, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_delete(self, client: Cloudflare) -> None:
@@ -353,6 +372,13 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_delete(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ client.access.groups.with_raw_response.delete(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.groups.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -367,13 +393,6 @@ def test_path_params_delete(self, client: Cloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- client.access.groups.with_raw_response.delete(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
def test_method_get(self, client: Cloudflare) -> None:
@@ -384,6 +403,16 @@ def test_method_get(self, client: Cloudflare) -> None:
)
assert_matches_type(GroupGetResponse, group, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
+ group = client.access.groups.get(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(GroupGetResponse, group, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_get(self, client: Cloudflare) -> None:
@@ -417,6 +446,13 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_get(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ client.access.groups.with_raw_response.get(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.groups.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -431,13 +467,6 @@ def test_path_params_get(self, client: Cloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- client.access.groups.with_raw_response.get(
- "",
- account_id="string",
- zone_id="string",
- )
-
class TestAsyncGroups:
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
@@ -446,14 +475,14 @@ class TestAsyncGroups:
@parametrize
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
group = await async_client.access.groups.create(
- account_id="string",
- zone_id="string",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(GroupCreateResponse, group, path=["response"])
@@ -461,14 +490,14 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
group = await async_client.access.groups.create(
- account_id="string",
- zone_id="string",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
exclude=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
@@ -487,14 +516,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
@parametrize
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
response = await async_client.access.groups.with_raw_response.create(
- account_id="string",
- zone_id="string",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -506,14 +535,14 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
async with async_client.access.groups.with_streaming_response.create(
- account_id="string",
- zone_id="string",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -528,26 +557,26 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.groups.with_raw_response.create(
- account_id="",
- zone_id="string",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.access.groups.with_raw_response.create(
- account_id="string",
- zone_id="",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -555,14 +584,14 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
group = await async_client.access.groups.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(GroupUpdateResponse, group, path=["response"])
@@ -571,14 +600,14 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None:
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
group = await async_client.access.groups.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
exclude=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
@@ -598,14 +627,14 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
response = await async_client.access.groups.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -618,14 +647,14 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
async with async_client.access.groups.with_streaming_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -638,43 +667,43 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip()
@parametrize
async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
await async_client.access.groups.with_raw_response.update(
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="",
- zone_id="string",
+ "",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.groups.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.access.groups.with_raw_response.update(
- "",
- account_id="string",
- zone_id="string",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
include=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
],
name="Allow devs",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -686,6 +715,15 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(Optional[GroupListResponse], group, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ group = await async_client.access.groups.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[GroupListResponse], group, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -739,6 +777,16 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(GroupDeleteResponse, group, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ group = await async_client.access.groups.delete(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(GroupDeleteResponse, group, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
@@ -772,6 +820,13 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip()
@parametrize
async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ await async_client.access.groups.with_raw_response.delete(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.groups.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -786,13 +841,6 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- await async_client.access.groups.with_raw_response.delete(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
@@ -803,6 +851,16 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(GroupGetResponse, group, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ group = await async_client.access.groups.get(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(GroupGetResponse, group, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
@@ -836,6 +894,13 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
@pytest.mark.skip()
@parametrize
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ await async_client.access.groups.with_raw_response.get(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.groups.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -849,10 +914,3 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
account_id="string",
zone_id="",
)
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- await async_client.access.groups.with_raw_response.get(
- "",
- account_id="string",
- zone_id="string",
- )
diff --git a/tests/api_resources/access/test_identity_providers.py b/tests/api_resources/access/test_identity_providers.py
index 76cd743d798..e3f25f637c0 100644
--- a/tests/api_resources/access/test_identity_providers.py
+++ b/tests/api_resources/access/test_identity_providers.py
@@ -27,11 +27,11 @@ class TestIdentityProviders:
@parametrize
def test_method_create(self, client: Cloudflare) -> None:
identity_provider = client.access.identity_providers.create(
- account_id="string",
- zone_id="string",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(IdentityProviderCreateResponse, identity_provider, path=["response"])
@@ -39,8 +39,6 @@ def test_method_create(self, client: Cloudflare) -> None:
@parametrize
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
identity_provider = client.access.identity_providers.create(
- account_id="string",
- zone_id="string",
config={
"client_id": "",
"client_secret": "",
@@ -83,6 +81,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="string",
scim_config={
"enabled": True,
"group_member_deprovision": True,
@@ -97,11 +97,11 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
@parametrize
def test_raw_response_create(self, client: Cloudflare) -> None:
response = client.access.identity_providers.with_raw_response.create(
- account_id="string",
- zone_id="string",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -113,11 +113,11 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
@parametrize
def test_streaming_response_create(self, client: Cloudflare) -> None:
with client.access.identity_providers.with_streaming_response.create(
- account_id="string",
- zone_id="string",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -132,20 +132,20 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:
def test_path_params_create(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.identity_providers.with_raw_response.create(
- account_id="",
- zone_id="string",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.access.identity_providers.with_raw_response.create(
- account_id="string",
- zone_id="",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -153,11 +153,11 @@ def test_path_params_create(self, client: Cloudflare) -> None:
def test_method_update(self, client: Cloudflare) -> None:
identity_provider = client.access.identity_providers.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(IdentityProviderUpdateResponse, identity_provider, path=["response"])
@@ -166,8 +166,6 @@ def test_method_update(self, client: Cloudflare) -> None:
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
identity_provider = client.access.identity_providers.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
config={
"client_id": "",
"client_secret": "",
@@ -210,6 +208,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="string",
scim_config={
"enabled": True,
"group_member_deprovision": True,
@@ -225,11 +225,11 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
def test_raw_response_update(self, client: Cloudflare) -> None:
response = client.access.identity_providers.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -242,11 +242,11 @@ def test_raw_response_update(self, client: Cloudflare) -> None:
def test_streaming_response_update(self, client: Cloudflare) -> None:
with client.access.identity_providers.with_streaming_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -259,34 +259,34 @@ def test_streaming_response_update(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_update(self, client: Cloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
client.access.identity_providers.with_raw_response.update(
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="",
- zone_id="string",
+ "",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.identity_providers.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.access.identity_providers.with_raw_response.update(
- "",
- account_id="string",
- zone_id="string",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -298,6 +298,15 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(Optional[IdentityProviderListResponse], identity_provider, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
+ identity_provider = client.access.identity_providers.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[IdentityProviderListResponse], identity_provider, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -351,6 +360,16 @@ def test_method_delete(self, client: Cloudflare) -> None:
)
assert_matches_type(IdentityProviderDeleteResponse, identity_provider, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_delete_with_all_params(self, client: Cloudflare) -> None:
+ identity_provider = client.access.identity_providers.delete(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(IdentityProviderDeleteResponse, identity_provider, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_delete(self, client: Cloudflare) -> None:
@@ -384,6 +403,13 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_delete(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ client.access.identity_providers.with_raw_response.delete(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.identity_providers.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -398,13 +424,6 @@ def test_path_params_delete(self, client: Cloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- client.access.identity_providers.with_raw_response.delete(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
def test_method_get(self, client: Cloudflare) -> None:
@@ -415,6 +434,16 @@ def test_method_get(self, client: Cloudflare) -> None:
)
assert_matches_type(IdentityProviderGetResponse, identity_provider, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
+ identity_provider = client.access.identity_providers.get(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(IdentityProviderGetResponse, identity_provider, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_get(self, client: Cloudflare) -> None:
@@ -448,6 +477,13 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_get(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ client.access.identity_providers.with_raw_response.get(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.identity_providers.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -462,13 +498,6 @@ def test_path_params_get(self, client: Cloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- client.access.identity_providers.with_raw_response.get(
- "",
- account_id="string",
- zone_id="string",
- )
-
class TestAsyncIdentityProviders:
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
@@ -477,11 +506,11 @@ class TestAsyncIdentityProviders:
@parametrize
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
identity_provider = await async_client.access.identity_providers.create(
- account_id="string",
- zone_id="string",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(IdentityProviderCreateResponse, identity_provider, path=["response"])
@@ -489,8 +518,6 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
identity_provider = await async_client.access.identity_providers.create(
- account_id="string",
- zone_id="string",
config={
"client_id": "",
"client_secret": "",
@@ -533,6 +560,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="string",
scim_config={
"enabled": True,
"group_member_deprovision": True,
@@ -547,11 +576,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
@parametrize
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
response = await async_client.access.identity_providers.with_raw_response.create(
- account_id="string",
- zone_id="string",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -563,11 +592,11 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
async with async_client.access.identity_providers.with_streaming_response.create(
- account_id="string",
- zone_id="string",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -582,20 +611,20 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.identity_providers.with_raw_response.create(
- account_id="",
- zone_id="string",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.access.identity_providers.with_raw_response.create(
- account_id="string",
- zone_id="",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -603,11 +632,11 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
identity_provider = await async_client.access.identity_providers.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(IdentityProviderUpdateResponse, identity_provider, path=["response"])
@@ -616,8 +645,6 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None:
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
identity_provider = await async_client.access.identity_providers.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
config={
"client_id": "",
"client_secret": "",
@@ -660,6 +687,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="string",
scim_config={
"enabled": True,
"group_member_deprovision": True,
@@ -675,11 +704,11 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
response = await async_client.access.identity_providers.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -692,11 +721,11 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
async with async_client.access.identity_providers.with_streaming_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="string",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -709,34 +738,34 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip()
@parametrize
async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
await async_client.access.identity_providers.with_raw_response.update(
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="",
- zone_id="string",
+ "",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.identity_providers.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- account_id="string",
- zone_id="",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.access.identity_providers.with_raw_response.update(
- "",
- account_id="string",
- zone_id="string",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
config={},
name="Widget Corps IDP",
type="onetimepin",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -748,6 +777,15 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(Optional[IdentityProviderListResponse], identity_provider, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ identity_provider = await async_client.access.identity_providers.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[IdentityProviderListResponse], identity_provider, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -801,6 +839,16 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(IdentityProviderDeleteResponse, identity_provider, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ identity_provider = await async_client.access.identity_providers.delete(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(IdentityProviderDeleteResponse, identity_provider, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
@@ -834,6 +882,13 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip()
@parametrize
async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ await async_client.access.identity_providers.with_raw_response.delete(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.identity_providers.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -848,13 +903,6 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- await async_client.access.identity_providers.with_raw_response.delete(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
@@ -865,6 +913,16 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(IdentityProviderGetResponse, identity_provider, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ identity_provider = await async_client.access.identity_providers.get(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(IdentityProviderGetResponse, identity_provider, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
@@ -898,6 +956,13 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
@pytest.mark.skip()
@parametrize
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ await async_client.access.identity_providers.with_raw_response.get(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.identity_providers.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -911,10 +976,3 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
account_id="string",
zone_id="",
)
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- await async_client.access.identity_providers.with_raw_response.get(
- "",
- account_id="string",
- zone_id="string",
- )
diff --git a/tests/api_resources/access/test_organizations.py b/tests/api_resources/access/test_organizations.py
index 9367cba851a..0116efb37fb 100644
--- a/tests/api_resources/access/test_organizations.py
+++ b/tests/api_resources/access/test_organizations.py
@@ -26,10 +26,10 @@ class TestOrganizations:
@parametrize
def test_method_create(self, client: Cloudflare) -> None:
organization = client.access.organizations.create(
- account_id="string",
- zone_id="string",
auth_domain="test.cloudflareaccess.com",
name="Widget Corps Internal Applications",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(OrganizationCreateResponse, organization, path=["response"])
@@ -37,10 +37,10 @@ def test_method_create(self, client: Cloudflare) -> None:
@parametrize
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
organization = client.access.organizations.create(
- account_id="string",
- zone_id="string",
auth_domain="test.cloudflareaccess.com",
name="Widget Corps Internal Applications",
+ account_id="string",
+ zone_id="string",
allow_authenticate_via_warp=True,
auto_redirect_to_identity=True,
is_ui_read_only=True,
@@ -62,10 +62,10 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
@parametrize
def test_raw_response_create(self, client: Cloudflare) -> None:
response = client.access.organizations.with_raw_response.create(
- account_id="string",
- zone_id="string",
auth_domain="test.cloudflareaccess.com",
name="Widget Corps Internal Applications",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -77,10 +77,10 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
@parametrize
def test_streaming_response_create(self, client: Cloudflare) -> None:
with client.access.organizations.with_streaming_response.create(
- account_id="string",
- zone_id="string",
auth_domain="test.cloudflareaccess.com",
name="Widget Corps Internal Applications",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -95,18 +95,18 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:
def test_path_params_create(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.organizations.with_raw_response.create(
- account_id="",
- zone_id="string",
auth_domain="test.cloudflareaccess.com",
name="Widget Corps Internal Applications",
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.access.organizations.with_raw_response.create(
- account_id="string",
- zone_id="",
auth_domain="test.cloudflareaccess.com",
name="Widget Corps Internal Applications",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -199,6 +199,15 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(OrganizationListResponse, organization, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
+ organization = client.access.organizations.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(OrganizationListResponse, organization, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -246,9 +255,19 @@ def test_path_params_list(self, client: Cloudflare) -> None:
@parametrize
def test_method_revoke_users(self, client: Cloudflare) -> None:
organization = client.access.organizations.revoke_users(
+ email="test@example.com",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(Optional[OrganizationRevokeUsersResponse], organization, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_revoke_users_with_all_params(self, client: Cloudflare) -> None:
+ organization = client.access.organizations.revoke_users(
email="test@example.com",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(Optional[OrganizationRevokeUsersResponse], organization, path=["response"])
@@ -256,9 +275,9 @@ def test_method_revoke_users(self, client: Cloudflare) -> None:
@parametrize
def test_raw_response_revoke_users(self, client: Cloudflare) -> None:
response = client.access.organizations.with_raw_response.revoke_users(
+ email="test@example.com",
account_id="string",
zone_id="string",
- email="test@example.com",
)
assert response.is_closed is True
@@ -270,9 +289,9 @@ def test_raw_response_revoke_users(self, client: Cloudflare) -> None:
@parametrize
def test_streaming_response_revoke_users(self, client: Cloudflare) -> None:
with client.access.organizations.with_streaming_response.revoke_users(
+ email="test@example.com",
account_id="string",
zone_id="string",
- email="test@example.com",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -287,16 +306,16 @@ def test_streaming_response_revoke_users(self, client: Cloudflare) -> None:
def test_path_params_revoke_users(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.organizations.with_raw_response.revoke_users(
+ email="test@example.com",
account_id="",
zone_id="string",
- email="test@example.com",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.access.organizations.with_raw_response.revoke_users(
+ email="test@example.com",
account_id="string",
zone_id="",
- email="test@example.com",
)
@@ -307,10 +326,10 @@ class TestAsyncOrganizations:
@parametrize
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
organization = await async_client.access.organizations.create(
- account_id="string",
- zone_id="string",
auth_domain="test.cloudflareaccess.com",
name="Widget Corps Internal Applications",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(OrganizationCreateResponse, organization, path=["response"])
@@ -318,10 +337,10 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
organization = await async_client.access.organizations.create(
- account_id="string",
- zone_id="string",
auth_domain="test.cloudflareaccess.com",
name="Widget Corps Internal Applications",
+ account_id="string",
+ zone_id="string",
allow_authenticate_via_warp=True,
auto_redirect_to_identity=True,
is_ui_read_only=True,
@@ -343,10 +362,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
@parametrize
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
response = await async_client.access.organizations.with_raw_response.create(
- account_id="string",
- zone_id="string",
auth_domain="test.cloudflareaccess.com",
name="Widget Corps Internal Applications",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -358,10 +377,10 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
async with async_client.access.organizations.with_streaming_response.create(
- account_id="string",
- zone_id="string",
auth_domain="test.cloudflareaccess.com",
name="Widget Corps Internal Applications",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -376,18 +395,18 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.organizations.with_raw_response.create(
- account_id="",
- zone_id="string",
auth_domain="test.cloudflareaccess.com",
name="Widget Corps Internal Applications",
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.access.organizations.with_raw_response.create(
- account_id="string",
- zone_id="",
auth_domain="test.cloudflareaccess.com",
name="Widget Corps Internal Applications",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -480,6 +499,15 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(OrganizationListResponse, organization, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ organization = await async_client.access.organizations.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(OrganizationListResponse, organization, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -527,9 +555,19 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_method_revoke_users(self, async_client: AsyncCloudflare) -> None:
organization = await async_client.access.organizations.revoke_users(
+ email="test@example.com",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(Optional[OrganizationRevokeUsersResponse], organization, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_revoke_users_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ organization = await async_client.access.organizations.revoke_users(
email="test@example.com",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(Optional[OrganizationRevokeUsersResponse], organization, path=["response"])
@@ -537,9 +575,9 @@ async def test_method_revoke_users(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_raw_response_revoke_users(self, async_client: AsyncCloudflare) -> None:
response = await async_client.access.organizations.with_raw_response.revoke_users(
+ email="test@example.com",
account_id="string",
zone_id="string",
- email="test@example.com",
)
assert response.is_closed is True
@@ -551,9 +589,9 @@ async def test_raw_response_revoke_users(self, async_client: AsyncCloudflare) ->
@parametrize
async def test_streaming_response_revoke_users(self, async_client: AsyncCloudflare) -> None:
async with async_client.access.organizations.with_streaming_response.revoke_users(
+ email="test@example.com",
account_id="string",
zone_id="string",
- email="test@example.com",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -568,14 +606,14 @@ async def test_streaming_response_revoke_users(self, async_client: AsyncCloudfla
async def test_path_params_revoke_users(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.organizations.with_raw_response.revoke_users(
+ email="test@example.com",
account_id="",
zone_id="string",
- email="test@example.com",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.access.organizations.with_raw_response.revoke_users(
+ email="test@example.com",
account_id="string",
zone_id="",
- email="test@example.com",
)
diff --git a/tests/api_resources/access/test_service_tokens.py b/tests/api_resources/access/test_service_tokens.py
index d37c69805dd..7c230a15735 100644
--- a/tests/api_resources/access/test_service_tokens.py
+++ b/tests/api_resources/access/test_service_tokens.py
@@ -28,9 +28,9 @@ class TestServiceTokens:
@parametrize
def test_method_create(self, client: Cloudflare) -> None:
service_token = client.access.service_tokens.create(
+ name="CI/CD token",
account_id="string",
zone_id="string",
- name="CI/CD token",
)
assert_matches_type(ServiceTokenCreateResponse, service_token, path=["response"])
@@ -38,9 +38,9 @@ def test_method_create(self, client: Cloudflare) -> None:
@parametrize
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
service_token = client.access.service_tokens.create(
+ name="CI/CD token",
account_id="string",
zone_id="string",
- name="CI/CD token",
duration="60m",
)
assert_matches_type(ServiceTokenCreateResponse, service_token, path=["response"])
@@ -49,9 +49,9 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
@parametrize
def test_raw_response_create(self, client: Cloudflare) -> None:
response = client.access.service_tokens.with_raw_response.create(
+ name="CI/CD token",
account_id="string",
zone_id="string",
- name="CI/CD token",
)
assert response.is_closed is True
@@ -63,9 +63,9 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
@parametrize
def test_streaming_response_create(self, client: Cloudflare) -> None:
with client.access.service_tokens.with_streaming_response.create(
+ name="CI/CD token",
account_id="string",
zone_id="string",
- name="CI/CD token",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -80,16 +80,16 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:
def test_path_params_create(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.service_tokens.with_raw_response.create(
+ name="CI/CD token",
account_id="",
zone_id="string",
- name="CI/CD token",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.access.service_tokens.with_raw_response.create(
+ name="CI/CD token",
account_id="string",
zone_id="",
- name="CI/CD token",
)
@pytest.mark.skip()
@@ -147,6 +147,13 @@ def test_streaming_response_update(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_update(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ client.access.service_tokens.with_raw_response.update(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.service_tokens.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -161,13 +168,6 @@ def test_path_params_update(self, client: Cloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- client.access.service_tokens.with_raw_response.update(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
def test_method_list(self, client: Cloudflare) -> None:
@@ -177,6 +177,15 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(Optional[ServiceTokenListResponse], service_token, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
+ service_token = client.access.service_tokens.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[ServiceTokenListResponse], service_token, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -230,6 +239,16 @@ def test_method_delete(self, client: Cloudflare) -> None:
)
assert_matches_type(ServiceTokenDeleteResponse, service_token, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_delete_with_all_params(self, client: Cloudflare) -> None:
+ service_token = client.access.service_tokens.delete(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(ServiceTokenDeleteResponse, service_token, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_delete(self, client: Cloudflare) -> None:
@@ -263,6 +282,13 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_delete(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ client.access.service_tokens.with_raw_response.delete(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.access.service_tokens.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -277,13 +303,6 @@ def test_path_params_delete(self, client: Cloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- client.access.service_tokens.with_raw_response.delete(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
def test_method_refresh(self, client: Cloudflare) -> None:
@@ -396,9 +415,9 @@ class TestAsyncServiceTokens:
@parametrize
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
service_token = await async_client.access.service_tokens.create(
+ name="CI/CD token",
account_id="string",
zone_id="string",
- name="CI/CD token",
)
assert_matches_type(ServiceTokenCreateResponse, service_token, path=["response"])
@@ -406,9 +425,9 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
service_token = await async_client.access.service_tokens.create(
+ name="CI/CD token",
account_id="string",
zone_id="string",
- name="CI/CD token",
duration="60m",
)
assert_matches_type(ServiceTokenCreateResponse, service_token, path=["response"])
@@ -417,9 +436,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
@parametrize
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
response = await async_client.access.service_tokens.with_raw_response.create(
+ name="CI/CD token",
account_id="string",
zone_id="string",
- name="CI/CD token",
)
assert response.is_closed is True
@@ -431,9 +450,9 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
async with async_client.access.service_tokens.with_streaming_response.create(
+ name="CI/CD token",
account_id="string",
zone_id="string",
- name="CI/CD token",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -448,16 +467,16 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.service_tokens.with_raw_response.create(
+ name="CI/CD token",
account_id="",
zone_id="string",
- name="CI/CD token",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.access.service_tokens.with_raw_response.create(
+ name="CI/CD token",
account_id="string",
zone_id="",
- name="CI/CD token",
)
@pytest.mark.skip()
@@ -515,6 +534,13 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip()
@parametrize
async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ await async_client.access.service_tokens.with_raw_response.update(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.service_tokens.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -529,13 +555,6 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- await async_client.access.service_tokens.with_raw_response.update(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
@@ -545,6 +564,15 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(Optional[ServiceTokenListResponse], service_token, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ service_token = await async_client.access.service_tokens.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[ServiceTokenListResponse], service_token, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -598,6 +626,16 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(ServiceTokenDeleteResponse, service_token, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ service_token = await async_client.access.service_tokens.delete(
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(ServiceTokenDeleteResponse, service_token, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
@@ -631,6 +669,13 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip()
@parametrize
async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
+ await async_client.access.service_tokens.with_raw_response.delete(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.access.service_tokens.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
@@ -645,13 +690,6 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
- await async_client.access.service_tokens.with_raw_response.delete(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
async def test_method_refresh(self, async_client: AsyncCloudflare) -> None:
diff --git a/tests/api_resources/firewall/test_access_rules.py b/tests/api_resources/firewall/test_access_rules.py
index fdbb3675922..9e136969985 100644
--- a/tests/api_resources/firewall/test_access_rules.py
+++ b/tests/api_resources/firewall/test_access_rules.py
@@ -27,10 +27,10 @@ class TestAccessRules:
@parametrize
def test_method_create(self, client: Cloudflare) -> None:
access_rule = client.firewall.access_rules.create(
- account_id="string",
- zone_id="string",
configuration={},
mode="challenge",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(Optional[AccessRuleCreateResponse], access_rule, path=["response"])
@@ -38,13 +38,13 @@ def test_method_create(self, client: Cloudflare) -> None:
@parametrize
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
access_rule = client.firewall.access_rules.create(
- account_id="string",
- zone_id="string",
configuration={
"target": "ip",
"value": "198.51.100.4",
},
mode="challenge",
+ account_id="string",
+ zone_id="string",
notes="This rule is enabled because of an event that occurred on date X.",
)
assert_matches_type(Optional[AccessRuleCreateResponse], access_rule, path=["response"])
@@ -53,10 +53,10 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
@parametrize
def test_raw_response_create(self, client: Cloudflare) -> None:
response = client.firewall.access_rules.with_raw_response.create(
- account_id="string",
- zone_id="string",
configuration={},
mode="challenge",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -68,10 +68,10 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
@parametrize
def test_streaming_response_create(self, client: Cloudflare) -> None:
with client.firewall.access_rules.with_streaming_response.create(
- account_id="string",
- zone_id="string",
configuration={},
mode="challenge",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -86,18 +86,18 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:
def test_path_params_create(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.firewall.access_rules.with_raw_response.create(
- account_id="",
- zone_id="string",
configuration={},
mode="challenge",
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.firewall.access_rules.with_raw_response.create(
- account_id="string",
- zone_id="",
configuration={},
mode="challenge",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -188,6 +188,16 @@ def test_method_delete(self, client: Cloudflare) -> None:
)
assert_matches_type(Optional[AccessRuleDeleteResponse], access_rule, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_delete_with_all_params(self, client: Cloudflare) -> None:
+ access_rule = client.firewall.access_rules.delete(
+ {},
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[AccessRuleDeleteResponse], access_rule, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_delete(self, client: Cloudflare) -> None:
@@ -240,10 +250,10 @@ def test_path_params_delete(self, client: Cloudflare) -> None:
def test_method_edit(self, client: Cloudflare) -> None:
access_rule = client.firewall.access_rules.edit(
{},
- account_id="string",
- zone_id="string",
configuration={},
mode="challenge",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(Optional[AccessRuleEditResponse], access_rule, path=["response"])
@@ -252,13 +262,13 @@ def test_method_edit(self, client: Cloudflare) -> None:
def test_method_edit_with_all_params(self, client: Cloudflare) -> None:
access_rule = client.firewall.access_rules.edit(
{},
- account_id="string",
- zone_id="string",
configuration={
"target": "ip",
"value": "198.51.100.4",
},
mode="challenge",
+ account_id="string",
+ zone_id="string",
notes="This rule is enabled because of an event that occurred on date X.",
)
assert_matches_type(Optional[AccessRuleEditResponse], access_rule, path=["response"])
@@ -268,10 +278,10 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None:
def test_raw_response_edit(self, client: Cloudflare) -> None:
response = client.firewall.access_rules.with_raw_response.edit(
{},
- account_id="string",
- zone_id="string",
configuration={},
mode="challenge",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -284,10 +294,10 @@ def test_raw_response_edit(self, client: Cloudflare) -> None:
def test_streaming_response_edit(self, client: Cloudflare) -> None:
with client.firewall.access_rules.with_streaming_response.edit(
{},
- account_id="string",
- zone_id="string",
configuration={},
mode="challenge",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -303,19 +313,19 @@ def test_path_params_edit(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.firewall.access_rules.with_raw_response.edit(
{},
- account_id="",
- zone_id="string",
configuration={},
mode="challenge",
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.firewall.access_rules.with_raw_response.edit(
{},
- account_id="string",
- zone_id="",
configuration={},
mode="challenge",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -328,6 +338,16 @@ def test_method_get(self, client: Cloudflare) -> None:
)
assert_matches_type(Optional[AccessRuleGetResponse], access_rule, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
+ access_rule = client.firewall.access_rules.get(
+ {},
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[AccessRuleGetResponse], access_rule, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_get(self, client: Cloudflare) -> None:
@@ -383,10 +403,10 @@ class TestAsyncAccessRules:
@parametrize
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
access_rule = await async_client.firewall.access_rules.create(
- account_id="string",
- zone_id="string",
configuration={},
mode="challenge",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(Optional[AccessRuleCreateResponse], access_rule, path=["response"])
@@ -394,13 +414,13 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
access_rule = await async_client.firewall.access_rules.create(
- account_id="string",
- zone_id="string",
configuration={
"target": "ip",
"value": "198.51.100.4",
},
mode="challenge",
+ account_id="string",
+ zone_id="string",
notes="This rule is enabled because of an event that occurred on date X.",
)
assert_matches_type(Optional[AccessRuleCreateResponse], access_rule, path=["response"])
@@ -409,10 +429,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
@parametrize
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
response = await async_client.firewall.access_rules.with_raw_response.create(
- account_id="string",
- zone_id="string",
configuration={},
mode="challenge",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -424,10 +444,10 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
async with async_client.firewall.access_rules.with_streaming_response.create(
- account_id="string",
- zone_id="string",
configuration={},
mode="challenge",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -442,18 +462,18 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.firewall.access_rules.with_raw_response.create(
- account_id="",
- zone_id="string",
configuration={},
mode="challenge",
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.firewall.access_rules.with_raw_response.create(
- account_id="string",
- zone_id="",
configuration={},
mode="challenge",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -544,6 +564,16 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(Optional[AccessRuleDeleteResponse], access_rule, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ access_rule = await async_client.firewall.access_rules.delete(
+ {},
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[AccessRuleDeleteResponse], access_rule, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
@@ -596,10 +626,10 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
access_rule = await async_client.firewall.access_rules.edit(
{},
- account_id="string",
- zone_id="string",
configuration={},
mode="challenge",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(Optional[AccessRuleEditResponse], access_rule, path=["response"])
@@ -608,13 +638,13 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None:
access_rule = await async_client.firewall.access_rules.edit(
{},
- account_id="string",
- zone_id="string",
configuration={
"target": "ip",
"value": "198.51.100.4",
},
mode="challenge",
+ account_id="string",
+ zone_id="string",
notes="This rule is enabled because of an event that occurred on date X.",
)
assert_matches_type(Optional[AccessRuleEditResponse], access_rule, path=["response"])
@@ -624,10 +654,10 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare)
async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None:
response = await async_client.firewall.access_rules.with_raw_response.edit(
{},
- account_id="string",
- zone_id="string",
configuration={},
mode="challenge",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -640,10 +670,10 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None:
async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None:
async with async_client.firewall.access_rules.with_streaming_response.edit(
{},
- account_id="string",
- zone_id="string",
configuration={},
mode="challenge",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -659,19 +689,19 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.firewall.access_rules.with_raw_response.edit(
{},
- account_id="",
- zone_id="string",
configuration={},
mode="challenge",
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.firewall.access_rules.with_raw_response.edit(
{},
- account_id="string",
- zone_id="",
configuration={},
mode="challenge",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -684,6 +714,16 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(Optional[AccessRuleGetResponse], access_rule, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ access_rule = await async_client.firewall.access_rules.get(
+ {},
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[AccessRuleGetResponse], access_rule, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
diff --git a/tests/api_resources/logpush/datasets/test_fields.py b/tests/api_resources/logpush/datasets/test_fields.py
index ec234ef4321..860d06732ce 100644
--- a/tests/api_resources/logpush/datasets/test_fields.py
+++ b/tests/api_resources/logpush/datasets/test_fields.py
@@ -26,6 +26,16 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(object, field, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
+ field = client.logpush.datasets.fields.list(
+ "http_requests",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(object, field, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -59,6 +69,13 @@ def test_streaming_response_list(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_list(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"):
+ client.logpush.datasets.fields.with_raw_response.list(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.logpush.datasets.fields.with_raw_response.list(
"http_requests",
@@ -73,13 +90,6 @@ def test_path_params_list(self, client: Cloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"):
- client.logpush.datasets.fields.with_raw_response.list(
- "",
- account_id="string",
- zone_id="string",
- )
-
class TestAsyncFields:
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
@@ -94,6 +104,16 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(object, field, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ field = await async_client.logpush.datasets.fields.list(
+ "http_requests",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(object, field, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -127,6 +147,13 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N
@pytest.mark.skip()
@parametrize
async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"):
+ await async_client.logpush.datasets.fields.with_raw_response.list(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.logpush.datasets.fields.with_raw_response.list(
"http_requests",
@@ -140,10 +167,3 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
account_id="string",
zone_id="",
)
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"):
- await async_client.logpush.datasets.fields.with_raw_response.list(
- "",
- account_id="string",
- zone_id="string",
- )
diff --git a/tests/api_resources/logpush/datasets/test_jobs.py b/tests/api_resources/logpush/datasets/test_jobs.py
index 21e42475db5..c3add1728a0 100644
--- a/tests/api_resources/logpush/datasets/test_jobs.py
+++ b/tests/api_resources/logpush/datasets/test_jobs.py
@@ -27,6 +27,16 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(JobListResponse, job, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
+ job = client.logpush.datasets.jobs.list(
+ "http_requests",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(JobListResponse, job, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -60,6 +70,13 @@ def test_streaming_response_list(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_list(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"):
+ client.logpush.datasets.jobs.with_raw_response.list(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.logpush.datasets.jobs.with_raw_response.list(
"http_requests",
@@ -74,13 +91,6 @@ def test_path_params_list(self, client: Cloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"):
- client.logpush.datasets.jobs.with_raw_response.list(
- "",
- account_id="string",
- zone_id="string",
- )
-
class TestAsyncJobs:
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
@@ -95,6 +105,16 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(JobListResponse, job, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ job = await async_client.logpush.datasets.jobs.list(
+ "http_requests",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(JobListResponse, job, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -128,6 +148,13 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N
@pytest.mark.skip()
@parametrize
async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"):
+ await async_client.logpush.datasets.jobs.with_raw_response.list(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.logpush.datasets.jobs.with_raw_response.list(
"http_requests",
@@ -141,10 +168,3 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
account_id="string",
zone_id="",
)
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"):
- await async_client.logpush.datasets.jobs.with_raw_response.list(
- "",
- account_id="string",
- zone_id="string",
- )
diff --git a/tests/api_resources/logpush/test_jobs.py b/tests/api_resources/logpush/test_jobs.py
index 24a1d4809f8..e8c7252f28b 100644
--- a/tests/api_resources/logpush/test_jobs.py
+++ b/tests/api_resources/logpush/test_jobs.py
@@ -27,9 +27,9 @@ class TestJobs:
@parametrize
def test_method_create(self, client: Cloudflare) -> None:
job = client.logpush.jobs.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
assert_matches_type(Optional[JobCreateResponse], job, path=["response"])
@@ -37,9 +37,9 @@ def test_method_create(self, client: Cloudflare) -> None:
@parametrize
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
job = client.logpush.jobs.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
dataset="http_requests",
enabled=False,
frequency="high",
@@ -67,9 +67,9 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
@parametrize
def test_raw_response_create(self, client: Cloudflare) -> None:
response = client.logpush.jobs.with_raw_response.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
assert response.is_closed is True
@@ -81,9 +81,9 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
@parametrize
def test_streaming_response_create(self, client: Cloudflare) -> None:
with client.logpush.jobs.with_streaming_response.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -98,16 +98,16 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:
def test_path_params_create(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.logpush.jobs.with_raw_response.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.logpush.jobs.with_raw_response.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
@pytest.mark.skip()
@@ -205,6 +205,15 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(JobListResponse, job, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
+ job = client.logpush.jobs.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(JobListResponse, job, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -258,6 +267,16 @@ def test_method_delete(self, client: Cloudflare) -> None:
)
assert_matches_type(Optional[JobDeleteResponse], job, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_delete_with_all_params(self, client: Cloudflare) -> None:
+ job = client.logpush.jobs.delete(
+ 1,
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[JobDeleteResponse], job, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_delete(self, client: Cloudflare) -> None:
@@ -315,6 +334,16 @@ def test_method_get(self, client: Cloudflare) -> None:
)
assert_matches_type(Optional[JobGetResponse], job, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
+ job = client.logpush.jobs.get(
+ 1,
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[JobGetResponse], job, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_get(self, client: Cloudflare) -> None:
@@ -370,9 +399,9 @@ class TestAsyncJobs:
@parametrize
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
job = await async_client.logpush.jobs.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
assert_matches_type(Optional[JobCreateResponse], job, path=["response"])
@@ -380,9 +409,9 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
job = await async_client.logpush.jobs.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
dataset="http_requests",
enabled=False,
frequency="high",
@@ -410,9 +439,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
@parametrize
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
response = await async_client.logpush.jobs.with_raw_response.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
assert response.is_closed is True
@@ -424,9 +453,9 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
async with async_client.logpush.jobs.with_streaming_response.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -441,16 +470,16 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.logpush.jobs.with_raw_response.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.logpush.jobs.with_raw_response.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
@pytest.mark.skip()
@@ -548,6 +577,15 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(JobListResponse, job, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ job = await async_client.logpush.jobs.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(JobListResponse, job, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -601,6 +639,16 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(Optional[JobDeleteResponse], job, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ job = await async_client.logpush.jobs.delete(
+ 1,
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[JobDeleteResponse], job, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
@@ -658,6 +706,16 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(Optional[JobGetResponse], job, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ job = await async_client.logpush.jobs.get(
+ 1,
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(Optional[JobGetResponse], job, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
diff --git a/tests/api_resources/logpush/test_ownership.py b/tests/api_resources/logpush/test_ownership.py
index 19e6587db22..eb29f1c648d 100644
--- a/tests/api_resources/logpush/test_ownership.py
+++ b/tests/api_resources/logpush/test_ownership.py
@@ -24,9 +24,19 @@ class TestOwnership:
@parametrize
def test_method_create(self, client: Cloudflare) -> None:
ownership = client.logpush.ownership.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(Optional[OwnershipCreateResponse], ownership, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
+ ownership = client.logpush.ownership.create(
destination_conf="s3://mybucket/logs?region=us-west-2",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(Optional[OwnershipCreateResponse], ownership, path=["response"])
@@ -34,9 +44,9 @@ def test_method_create(self, client: Cloudflare) -> None:
@parametrize
def test_raw_response_create(self, client: Cloudflare) -> None:
response = client.logpush.ownership.with_raw_response.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
assert response.is_closed is True
@@ -48,9 +58,9 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
@parametrize
def test_streaming_response_create(self, client: Cloudflare) -> None:
with client.logpush.ownership.with_streaming_response.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -65,26 +75,37 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:
def test_path_params_create(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.logpush.ownership.with_raw_response.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.logpush.ownership.with_raw_response.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
@pytest.mark.skip()
@parametrize
def test_method_validate(self, client: Cloudflare) -> None:
ownership = client.logpush.ownership.validate(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
+ ownership_challenge="00000000000000000000",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(Optional[OwnershipValidateResponse], ownership, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_validate_with_all_params(self, client: Cloudflare) -> None:
+ ownership = client.logpush.ownership.validate(
destination_conf="s3://mybucket/logs?region=us-west-2",
ownership_challenge="00000000000000000000",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(Optional[OwnershipValidateResponse], ownership, path=["response"])
@@ -92,10 +113,10 @@ def test_method_validate(self, client: Cloudflare) -> None:
@parametrize
def test_raw_response_validate(self, client: Cloudflare) -> None:
response = client.logpush.ownership.with_raw_response.validate(
- account_id="string",
- zone_id="string",
destination_conf="s3://mybucket/logs?region=us-west-2",
ownership_challenge="00000000000000000000",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -107,10 +128,10 @@ def test_raw_response_validate(self, client: Cloudflare) -> None:
@parametrize
def test_streaming_response_validate(self, client: Cloudflare) -> None:
with client.logpush.ownership.with_streaming_response.validate(
- account_id="string",
- zone_id="string",
destination_conf="s3://mybucket/logs?region=us-west-2",
ownership_challenge="00000000000000000000",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -125,18 +146,18 @@ def test_streaming_response_validate(self, client: Cloudflare) -> None:
def test_path_params_validate(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.logpush.ownership.with_raw_response.validate(
- account_id="",
- zone_id="string",
destination_conf="s3://mybucket/logs?region=us-west-2",
ownership_challenge="00000000000000000000",
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.logpush.ownership.with_raw_response.validate(
- account_id="string",
- zone_id="",
destination_conf="s3://mybucket/logs?region=us-west-2",
ownership_challenge="00000000000000000000",
+ account_id="string",
+ zone_id="",
)
@@ -147,9 +168,19 @@ class TestAsyncOwnership:
@parametrize
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
ownership = await async_client.logpush.ownership.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(Optional[OwnershipCreateResponse], ownership, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ ownership = await async_client.logpush.ownership.create(
destination_conf="s3://mybucket/logs?region=us-west-2",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(Optional[OwnershipCreateResponse], ownership, path=["response"])
@@ -157,9 +188,9 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
response = await async_client.logpush.ownership.with_raw_response.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
assert response.is_closed is True
@@ -171,9 +202,9 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
async with async_client.logpush.ownership.with_streaming_response.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -188,26 +219,37 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.logpush.ownership.with_raw_response.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.logpush.ownership.with_raw_response.create(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
@pytest.mark.skip()
@parametrize
async def test_method_validate(self, async_client: AsyncCloudflare) -> None:
ownership = await async_client.logpush.ownership.validate(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
+ ownership_challenge="00000000000000000000",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(Optional[OwnershipValidateResponse], ownership, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_validate_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ ownership = await async_client.logpush.ownership.validate(
destination_conf="s3://mybucket/logs?region=us-west-2",
ownership_challenge="00000000000000000000",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(Optional[OwnershipValidateResponse], ownership, path=["response"])
@@ -215,10 +257,10 @@ async def test_method_validate(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_raw_response_validate(self, async_client: AsyncCloudflare) -> None:
response = await async_client.logpush.ownership.with_raw_response.validate(
- account_id="string",
- zone_id="string",
destination_conf="s3://mybucket/logs?region=us-west-2",
ownership_challenge="00000000000000000000",
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -230,10 +272,10 @@ async def test_raw_response_validate(self, async_client: AsyncCloudflare) -> Non
@parametrize
async def test_streaming_response_validate(self, async_client: AsyncCloudflare) -> None:
async with async_client.logpush.ownership.with_streaming_response.validate(
- account_id="string",
- zone_id="string",
destination_conf="s3://mybucket/logs?region=us-west-2",
ownership_challenge="00000000000000000000",
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -248,16 +290,16 @@ async def test_streaming_response_validate(self, async_client: AsyncCloudflare)
async def test_path_params_validate(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.logpush.ownership.with_raw_response.validate(
- account_id="",
- zone_id="string",
destination_conf="s3://mybucket/logs?region=us-west-2",
ownership_challenge="00000000000000000000",
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.logpush.ownership.with_raw_response.validate(
- account_id="string",
- zone_id="",
destination_conf="s3://mybucket/logs?region=us-west-2",
ownership_challenge="00000000000000000000",
+ account_id="string",
+ zone_id="",
)
diff --git a/tests/api_resources/logpush/test_validate.py b/tests/api_resources/logpush/test_validate.py
index da5e06b9bc9..7d54f297b46 100644
--- a/tests/api_resources/logpush/test_validate.py
+++ b/tests/api_resources/logpush/test_validate.py
@@ -24,9 +24,19 @@ class TestValidate:
@parametrize
def test_method_destination(self, client: Cloudflare) -> None:
validate = client.logpush.validate.destination(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(Optional[ValidateDestinationResponse], validate, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_destination_with_all_params(self, client: Cloudflare) -> None:
+ validate = client.logpush.validate.destination(
destination_conf="s3://mybucket/logs?region=us-west-2",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(Optional[ValidateDestinationResponse], validate, path=["response"])
@@ -34,9 +44,9 @@ def test_method_destination(self, client: Cloudflare) -> None:
@parametrize
def test_raw_response_destination(self, client: Cloudflare) -> None:
response = client.logpush.validate.with_raw_response.destination(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
assert response.is_closed is True
@@ -48,9 +58,9 @@ def test_raw_response_destination(self, client: Cloudflare) -> None:
@parametrize
def test_streaming_response_destination(self, client: Cloudflare) -> None:
with client.logpush.validate.with_streaming_response.destination(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -65,25 +75,35 @@ def test_streaming_response_destination(self, client: Cloudflare) -> None:
def test_path_params_destination(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.logpush.validate.with_raw_response.destination(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.logpush.validate.with_raw_response.destination(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
@pytest.mark.skip()
@parametrize
def test_method_origin(self, client: Cloudflare) -> None:
validate = client.logpush.validate.origin(
+ logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(Optional[ValidateOriginResponse], validate, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_origin_with_all_params(self, client: Cloudflare) -> None:
+ validate = client.logpush.validate.origin(
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(Optional[ValidateOriginResponse], validate, path=["response"])
@@ -91,9 +111,9 @@ def test_method_origin(self, client: Cloudflare) -> None:
@parametrize
def test_raw_response_origin(self, client: Cloudflare) -> None:
response = client.logpush.validate.with_raw_response.origin(
+ logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
account_id="string",
zone_id="string",
- logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
)
assert response.is_closed is True
@@ -105,9 +125,9 @@ def test_raw_response_origin(self, client: Cloudflare) -> None:
@parametrize
def test_streaming_response_origin(self, client: Cloudflare) -> None:
with client.logpush.validate.with_streaming_response.origin(
+ logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
account_id="string",
zone_id="string",
- logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -122,16 +142,16 @@ def test_streaming_response_origin(self, client: Cloudflare) -> None:
def test_path_params_origin(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.logpush.validate.with_raw_response.origin(
+ logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
account_id="",
zone_id="string",
- logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.logpush.validate.with_raw_response.origin(
+ logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
account_id="string",
zone_id="",
- logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
)
@@ -142,9 +162,19 @@ class TestAsyncValidate:
@parametrize
async def test_method_destination(self, async_client: AsyncCloudflare) -> None:
validate = await async_client.logpush.validate.destination(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(Optional[ValidateDestinationResponse], validate, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_destination_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ validate = await async_client.logpush.validate.destination(
destination_conf="s3://mybucket/logs?region=us-west-2",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(Optional[ValidateDestinationResponse], validate, path=["response"])
@@ -152,9 +182,9 @@ async def test_method_destination(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_raw_response_destination(self, async_client: AsyncCloudflare) -> None:
response = await async_client.logpush.validate.with_raw_response.destination(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
assert response.is_closed is True
@@ -166,9 +196,9 @@ async def test_raw_response_destination(self, async_client: AsyncCloudflare) ->
@parametrize
async def test_streaming_response_destination(self, async_client: AsyncCloudflare) -> None:
async with async_client.logpush.validate.with_streaming_response.destination(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -183,25 +213,35 @@ async def test_streaming_response_destination(self, async_client: AsyncCloudflar
async def test_path_params_destination(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.logpush.validate.with_raw_response.destination(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="",
zone_id="string",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.logpush.validate.with_raw_response.destination(
+ destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="",
- destination_conf="s3://mybucket/logs?region=us-west-2",
)
@pytest.mark.skip()
@parametrize
async def test_method_origin(self, async_client: AsyncCloudflare) -> None:
validate = await async_client.logpush.validate.origin(
+ logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(Optional[ValidateOriginResponse], validate, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_origin_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ validate = await async_client.logpush.validate.origin(
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(Optional[ValidateOriginResponse], validate, path=["response"])
@@ -209,9 +249,9 @@ async def test_method_origin(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_raw_response_origin(self, async_client: AsyncCloudflare) -> None:
response = await async_client.logpush.validate.with_raw_response.origin(
+ logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
account_id="string",
zone_id="string",
- logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
)
assert response.is_closed is True
@@ -223,9 +263,9 @@ async def test_raw_response_origin(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_streaming_response_origin(self, async_client: AsyncCloudflare) -> None:
async with async_client.logpush.validate.with_streaming_response.origin(
+ logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
account_id="string",
zone_id="string",
- logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -240,14 +280,14 @@ async def test_streaming_response_origin(self, async_client: AsyncCloudflare) ->
async def test_path_params_origin(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.logpush.validate.with_raw_response.origin(
+ logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
account_id="",
zone_id="string",
- logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.logpush.validate.with_raw_response.origin(
+ logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
account_id="string",
zone_id="",
- logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339",
)
diff --git a/tests/api_resources/rulesets/phases/test_versions.py b/tests/api_resources/rulesets/phases/test_versions.py
index 09170b62a79..1106136468f 100644
--- a/tests/api_resources/rulesets/phases/test_versions.py
+++ b/tests/api_resources/rulesets/phases/test_versions.py
@@ -27,6 +27,16 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(VersionListResponse, version, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
+ version = client.rulesets.phases.versions.list(
+ "http_request_firewall_custom",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(VersionListResponse, version, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -79,9 +89,20 @@ def test_path_params_list(self, client: Cloudflare) -> None:
def test_method_get(self, client: Cloudflare) -> None:
version = client.rulesets.phases.versions.get(
"1",
+ ruleset_phase="http_request_firewall_custom",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(VersionGetResponse, version, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
+ version = client.rulesets.phases.versions.get(
+ "1",
ruleset_phase="http_request_firewall_custom",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(VersionGetResponse, version, path=["response"])
@@ -90,9 +111,9 @@ def test_method_get(self, client: Cloudflare) -> None:
def test_raw_response_get(self, client: Cloudflare) -> None:
response = client.rulesets.phases.versions.with_raw_response.get(
"1",
+ ruleset_phase="http_request_firewall_custom",
account_id="string",
zone_id="string",
- ruleset_phase="http_request_firewall_custom",
)
assert response.is_closed is True
@@ -105,9 +126,9 @@ def test_raw_response_get(self, client: Cloudflare) -> None:
def test_streaming_response_get(self, client: Cloudflare) -> None:
with client.rulesets.phases.versions.with_streaming_response.get(
"1",
+ ruleset_phase="http_request_firewall_custom",
account_id="string",
zone_id="string",
- ruleset_phase="http_request_firewall_custom",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -120,28 +141,28 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_get(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"):
+ client.rulesets.phases.versions.with_raw_response.get(
+ "",
+ ruleset_phase="http_request_firewall_custom",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.rulesets.phases.versions.with_raw_response.get(
"1",
+ ruleset_phase="http_request_firewall_custom",
account_id="",
zone_id="string",
- ruleset_phase="http_request_firewall_custom",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.rulesets.phases.versions.with_raw_response.get(
"1",
- account_id="string",
- zone_id="",
ruleset_phase="http_request_firewall_custom",
- )
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"):
- client.rulesets.phases.versions.with_raw_response.get(
- "",
account_id="string",
- zone_id="string",
- ruleset_phase="http_request_firewall_custom",
+ zone_id="",
)
@@ -158,6 +179,16 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(VersionListResponse, version, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ version = await async_client.rulesets.phases.versions.list(
+ "http_request_firewall_custom",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(VersionListResponse, version, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -210,9 +241,20 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
version = await async_client.rulesets.phases.versions.get(
"1",
+ ruleset_phase="http_request_firewall_custom",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(VersionGetResponse, version, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ version = await async_client.rulesets.phases.versions.get(
+ "1",
ruleset_phase="http_request_firewall_custom",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(VersionGetResponse, version, path=["response"])
@@ -221,9 +263,9 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
response = await async_client.rulesets.phases.versions.with_raw_response.get(
"1",
+ ruleset_phase="http_request_firewall_custom",
account_id="string",
zone_id="string",
- ruleset_phase="http_request_firewall_custom",
)
assert response.is_closed is True
@@ -236,9 +278,9 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
async with async_client.rulesets.phases.versions.with_streaming_response.get(
"1",
+ ruleset_phase="http_request_firewall_custom",
account_id="string",
zone_id="string",
- ruleset_phase="http_request_firewall_custom",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -251,26 +293,26 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
@pytest.mark.skip()
@parametrize
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"):
+ await async_client.rulesets.phases.versions.with_raw_response.get(
+ "",
+ ruleset_phase="http_request_firewall_custom",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.rulesets.phases.versions.with_raw_response.get(
"1",
+ ruleset_phase="http_request_firewall_custom",
account_id="",
zone_id="string",
- ruleset_phase="http_request_firewall_custom",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.rulesets.phases.versions.with_raw_response.get(
"1",
- account_id="string",
- zone_id="",
ruleset_phase="http_request_firewall_custom",
- )
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"):
- await async_client.rulesets.phases.versions.with_raw_response.get(
- "",
account_id="string",
- zone_id="string",
- ruleset_phase="http_request_firewall_custom",
+ zone_id="",
)
diff --git a/tests/api_resources/rulesets/test_phases.py b/tests/api_resources/rulesets/test_phases.py
index 02d3c6e9122..0a213c4468f 100644
--- a/tests/api_resources/rulesets/test_phases.py
+++ b/tests/api_resources/rulesets/test_phases.py
@@ -22,10 +22,10 @@ class TestPhases:
def test_method_update(self, client: Cloudflare) -> None:
phase = client.rulesets.phases.update(
"http_request_firewall_custom",
- account_id="string",
- zone_id="string",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(PhaseUpdateResponse, phase, path=["response"])
@@ -34,8 +34,6 @@ def test_method_update(self, client: Cloudflare) -> None:
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
phase = client.rulesets.phases.update(
"http_request_firewall_custom",
- account_id="string",
- zone_id="string",
id="2f2feab2026849078ba485f918791bdc",
rules=[
{
@@ -87,6 +85,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
"ref": "my_ref",
},
],
+ account_id="string",
+ zone_id="string",
description="My ruleset to execute managed rulesets",
kind="root",
name="My ruleset",
@@ -99,10 +99,10 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
def test_raw_response_update(self, client: Cloudflare) -> None:
response = client.rulesets.phases.with_raw_response.update(
"http_request_firewall_custom",
- account_id="string",
- zone_id="string",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -115,10 +115,10 @@ def test_raw_response_update(self, client: Cloudflare) -> None:
def test_streaming_response_update(self, client: Cloudflare) -> None:
with client.rulesets.phases.with_streaming_response.update(
"http_request_firewall_custom",
- account_id="string",
- zone_id="string",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -134,19 +134,19 @@ def test_path_params_update(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.rulesets.phases.with_raw_response.update(
"http_request_firewall_custom",
- account_id="",
- zone_id="string",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.rulesets.phases.with_raw_response.update(
"http_request_firewall_custom",
- account_id="string",
- zone_id="",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -159,6 +159,16 @@ def test_method_get(self, client: Cloudflare) -> None:
)
assert_matches_type(PhaseGetResponse, phase, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
+ phase = client.rulesets.phases.get(
+ "http_request_firewall_custom",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(PhaseGetResponse, phase, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_get(self, client: Cloudflare) -> None:
@@ -215,10 +225,10 @@ class TestAsyncPhases:
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
phase = await async_client.rulesets.phases.update(
"http_request_firewall_custom",
- account_id="string",
- zone_id="string",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(PhaseUpdateResponse, phase, path=["response"])
@@ -227,8 +237,6 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None:
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
phase = await async_client.rulesets.phases.update(
"http_request_firewall_custom",
- account_id="string",
- zone_id="string",
id="2f2feab2026849078ba485f918791bdc",
rules=[
{
@@ -280,6 +288,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
"ref": "my_ref",
},
],
+ account_id="string",
+ zone_id="string",
description="My ruleset to execute managed rulesets",
kind="root",
name="My ruleset",
@@ -292,10 +302,10 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
response = await async_client.rulesets.phases.with_raw_response.update(
"http_request_firewall_custom",
- account_id="string",
- zone_id="string",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -308,10 +318,10 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
async with async_client.rulesets.phases.with_streaming_response.update(
"http_request_firewall_custom",
- account_id="string",
- zone_id="string",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -327,19 +337,19 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.rulesets.phases.with_raw_response.update(
"http_request_firewall_custom",
- account_id="",
- zone_id="string",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.rulesets.phases.with_raw_response.update(
"http_request_firewall_custom",
- account_id="string",
- zone_id="",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -352,6 +362,16 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(PhaseGetResponse, phase, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ phase = await async_client.rulesets.phases.get(
+ "http_request_firewall_custom",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(PhaseGetResponse, phase, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
diff --git a/tests/api_resources/rulesets/test_rules.py b/tests/api_resources/rulesets/test_rules.py
index b64bad3db3a..e9c82296d56 100644
--- a/tests/api_resources/rulesets/test_rules.py
+++ b/tests/api_resources/rulesets/test_rules.py
@@ -75,6 +75,13 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_create(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
+ client.rulesets.rules.with_raw_response.create(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.rulesets.rules.with_raw_response.create(
"2f2feab2026849078ba485f918791bdc",
@@ -89,21 +96,25 @@ def test_path_params_create(self, client: Cloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
- client.rulesets.rules.with_raw_response.create(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
def test_method_delete(self, client: Cloudflare) -> None:
rule = client.rulesets.rules.delete(
"3a03d665bac047339bb530ecb439a90d",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(RuleDeleteResponse, rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_delete_with_all_params(self, client: Cloudflare) -> None:
+ rule = client.rulesets.rules.delete(
+ "3a03d665bac047339bb530ecb439a90d",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(RuleDeleteResponse, rule, path=["response"])
@@ -112,9 +123,9 @@ def test_method_delete(self, client: Cloudflare) -> None:
def test_raw_response_delete(self, client: Cloudflare) -> None:
response = client.rulesets.rules.with_raw_response.delete(
"3a03d665bac047339bb530ecb439a90d",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
)
assert response.is_closed is True
@@ -127,9 +138,9 @@ def test_raw_response_delete(self, client: Cloudflare) -> None:
def test_streaming_response_delete(self, client: Cloudflare) -> None:
with client.rulesets.rules.with_streaming_response.delete(
"3a03d665bac047339bb530ecb439a90d",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -142,36 +153,36 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_delete(self, client: Cloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
client.rulesets.rules.with_raw_response.delete(
"3a03d665bac047339bb530ecb439a90d",
- account_id="",
+ ruleset_id="",
+ account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"):
client.rulesets.rules.with_raw_response.delete(
- "3a03d665bac047339bb530ecb439a90d",
- account_id="string",
- zone_id="",
+ "",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.rulesets.rules.with_raw_response.delete(
"3a03d665bac047339bb530ecb439a90d",
- account_id="string",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="",
zone_id="string",
- ruleset_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.rulesets.rules.with_raw_response.delete(
- "",
- account_id="string",
- zone_id="string",
+ "3a03d665bac047339bb530ecb439a90d",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -179,9 +190,9 @@ def test_path_params_delete(self, client: Cloudflare) -> None:
def test_method_edit(self, client: Cloudflare) -> None:
rule = client.rulesets.rules.edit(
"3a03d665bac047339bb530ecb439a90d",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
)
assert_matches_type(RuleEditResponse, rule, path=["response"])
@@ -190,9 +201,9 @@ def test_method_edit(self, client: Cloudflare) -> None:
def test_method_edit_with_all_params(self, client: Cloudflare) -> None:
rule = client.rulesets.rules.edit(
"3a03d665bac047339bb530ecb439a90d",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
position={"before": "da5e8e506c8e7877fe06cdf4c41add54"},
)
assert_matches_type(RuleEditResponse, rule, path=["response"])
@@ -202,9 +213,9 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None:
def test_raw_response_edit(self, client: Cloudflare) -> None:
response = client.rulesets.rules.with_raw_response.edit(
"3a03d665bac047339bb530ecb439a90d",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
)
assert response.is_closed is True
@@ -217,9 +228,9 @@ def test_raw_response_edit(self, client: Cloudflare) -> None:
def test_streaming_response_edit(self, client: Cloudflare) -> None:
with client.rulesets.rules.with_streaming_response.edit(
"3a03d665bac047339bb530ecb439a90d",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -232,36 +243,36 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_edit(self, client: Cloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
client.rulesets.rules.with_raw_response.edit(
"3a03d665bac047339bb530ecb439a90d",
- account_id="",
+ ruleset_id="",
+ account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"):
client.rulesets.rules.with_raw_response.edit(
- "3a03d665bac047339bb530ecb439a90d",
- account_id="string",
- zone_id="",
+ "",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.rulesets.rules.with_raw_response.edit(
"3a03d665bac047339bb530ecb439a90d",
- account_id="string",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="",
zone_id="string",
- ruleset_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.rulesets.rules.with_raw_response.edit(
- "",
- account_id="string",
- zone_id="string",
+ "3a03d665bac047339bb530ecb439a90d",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="",
)
@@ -322,6 +333,13 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip()
@parametrize
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
+ await async_client.rulesets.rules.with_raw_response.create(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.rulesets.rules.with_raw_response.create(
"2f2feab2026849078ba485f918791bdc",
@@ -336,21 +354,25 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
- await async_client.rulesets.rules.with_raw_response.create(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
rule = await async_client.rulesets.rules.delete(
"3a03d665bac047339bb530ecb439a90d",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(RuleDeleteResponse, rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ rule = await async_client.rulesets.rules.delete(
+ "3a03d665bac047339bb530ecb439a90d",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(RuleDeleteResponse, rule, path=["response"])
@@ -359,9 +381,9 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
response = await async_client.rulesets.rules.with_raw_response.delete(
"3a03d665bac047339bb530ecb439a90d",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
)
assert response.is_closed is True
@@ -374,9 +396,9 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None:
async with async_client.rulesets.rules.with_streaming_response.delete(
"3a03d665bac047339bb530ecb439a90d",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -389,36 +411,36 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip()
@parametrize
async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
await async_client.rulesets.rules.with_raw_response.delete(
"3a03d665bac047339bb530ecb439a90d",
- account_id="",
+ ruleset_id="",
+ account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"):
await async_client.rulesets.rules.with_raw_response.delete(
- "3a03d665bac047339bb530ecb439a90d",
- account_id="string",
- zone_id="",
+ "",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.rulesets.rules.with_raw_response.delete(
"3a03d665bac047339bb530ecb439a90d",
- account_id="string",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="",
zone_id="string",
- ruleset_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.rulesets.rules.with_raw_response.delete(
- "",
- account_id="string",
- zone_id="string",
+ "3a03d665bac047339bb530ecb439a90d",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -426,9 +448,9 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
rule = await async_client.rulesets.rules.edit(
"3a03d665bac047339bb530ecb439a90d",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
)
assert_matches_type(RuleEditResponse, rule, path=["response"])
@@ -437,9 +459,9 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None:
rule = await async_client.rulesets.rules.edit(
"3a03d665bac047339bb530ecb439a90d",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
position={"before": "da5e8e506c8e7877fe06cdf4c41add54"},
)
assert_matches_type(RuleEditResponse, rule, path=["response"])
@@ -449,9 +471,9 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare)
async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None:
response = await async_client.rulesets.rules.with_raw_response.edit(
"3a03d665bac047339bb530ecb439a90d",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
)
assert response.is_closed is True
@@ -464,9 +486,9 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None:
async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None:
async with async_client.rulesets.rules.with_streaming_response.edit(
"3a03d665bac047339bb530ecb439a90d",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -479,34 +501,34 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N
@pytest.mark.skip()
@parametrize
async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
await async_client.rulesets.rules.with_raw_response.edit(
"3a03d665bac047339bb530ecb439a90d",
- account_id="",
+ ruleset_id="",
+ account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"):
await async_client.rulesets.rules.with_raw_response.edit(
- "3a03d665bac047339bb530ecb439a90d",
- account_id="string",
- zone_id="",
+ "",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.rulesets.rules.with_raw_response.edit(
"3a03d665bac047339bb530ecb439a90d",
- account_id="string",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="",
zone_id="string",
- ruleset_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.rulesets.rules.with_raw_response.edit(
- "",
- account_id="string",
- zone_id="string",
+ "3a03d665bac047339bb530ecb439a90d",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="",
)
diff --git a/tests/api_resources/rulesets/test_versions.py b/tests/api_resources/rulesets/test_versions.py
index 808a982d03c..c925cb1ed0c 100644
--- a/tests/api_resources/rulesets/test_versions.py
+++ b/tests/api_resources/rulesets/test_versions.py
@@ -27,6 +27,16 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(VersionListResponse, version, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
+ version = client.rulesets.versions.list(
+ "2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(VersionListResponse, version, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -60,6 +70,13 @@ def test_streaming_response_list(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_list(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
+ client.rulesets.versions.with_raw_response.list(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.rulesets.versions.with_raw_response.list(
"2f2feab2026849078ba485f918791bdc",
@@ -74,21 +91,25 @@ def test_path_params_list(self, client: Cloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
- client.rulesets.versions.with_raw_response.list(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
def test_method_delete(self, client: Cloudflare) -> None:
version = client.rulesets.versions.delete(
"1",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
+ )
+ assert version is None
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_delete_with_all_params(self, client: Cloudflare) -> None:
+ version = client.rulesets.versions.delete(
+ "1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
)
assert version is None
@@ -97,9 +118,9 @@ def test_method_delete(self, client: Cloudflare) -> None:
def test_raw_response_delete(self, client: Cloudflare) -> None:
response = client.rulesets.versions.with_raw_response.delete(
"1",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
)
assert response.is_closed is True
@@ -112,9 +133,9 @@ def test_raw_response_delete(self, client: Cloudflare) -> None:
def test_streaming_response_delete(self, client: Cloudflare) -> None:
with client.rulesets.versions.with_streaming_response.delete(
"1",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -127,36 +148,36 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_delete(self, client: Cloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
client.rulesets.versions.with_raw_response.delete(
"1",
- account_id="",
+ ruleset_id="",
+ account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"):
client.rulesets.versions.with_raw_response.delete(
- "1",
- account_id="string",
- zone_id="",
+ "",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.rulesets.versions.with_raw_response.delete(
"1",
- account_id="string",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="",
zone_id="string",
- ruleset_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.rulesets.versions.with_raw_response.delete(
- "",
- account_id="string",
- zone_id="string",
+ "1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -164,9 +185,20 @@ def test_path_params_delete(self, client: Cloudflare) -> None:
def test_method_get(self, client: Cloudflare) -> None:
version = client.rulesets.versions.get(
"1",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(VersionGetResponse, version, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
+ version = client.rulesets.versions.get(
+ "1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(VersionGetResponse, version, path=["response"])
@@ -175,9 +207,9 @@ def test_method_get(self, client: Cloudflare) -> None:
def test_raw_response_get(self, client: Cloudflare) -> None:
response = client.rulesets.versions.with_raw_response.get(
"1",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
)
assert response.is_closed is True
@@ -190,9 +222,9 @@ def test_raw_response_get(self, client: Cloudflare) -> None:
def test_streaming_response_get(self, client: Cloudflare) -> None:
with client.rulesets.versions.with_streaming_response.get(
"1",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -205,36 +237,36 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_get(self, client: Cloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
client.rulesets.versions.with_raw_response.get(
"1",
- account_id="",
+ ruleset_id="",
+ account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"):
client.rulesets.versions.with_raw_response.get(
- "1",
- account_id="string",
- zone_id="",
+ "",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.rulesets.versions.with_raw_response.get(
"1",
- account_id="string",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="",
zone_id="string",
- ruleset_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.rulesets.versions.with_raw_response.get(
- "",
- account_id="string",
- zone_id="string",
+ "1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="",
)
@@ -251,6 +283,16 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(VersionListResponse, version, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ version = await async_client.rulesets.versions.list(
+ "2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(VersionListResponse, version, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -284,6 +326,13 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N
@pytest.mark.skip()
@parametrize
async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
+ await async_client.rulesets.versions.with_raw_response.list(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.rulesets.versions.with_raw_response.list(
"2f2feab2026849078ba485f918791bdc",
@@ -298,21 +347,25 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
- await async_client.rulesets.versions.with_raw_response.list(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
version = await async_client.rulesets.versions.delete(
"1",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
+ )
+ assert version is None
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ version = await async_client.rulesets.versions.delete(
+ "1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
)
assert version is None
@@ -321,9 +374,9 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
response = await async_client.rulesets.versions.with_raw_response.delete(
"1",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
)
assert response.is_closed is True
@@ -336,9 +389,9 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None:
async with async_client.rulesets.versions.with_streaming_response.delete(
"1",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -351,36 +404,36 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip()
@parametrize
async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
await async_client.rulesets.versions.with_raw_response.delete(
"1",
- account_id="",
+ ruleset_id="",
+ account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"):
await async_client.rulesets.versions.with_raw_response.delete(
- "1",
- account_id="string",
- zone_id="",
+ "",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.rulesets.versions.with_raw_response.delete(
"1",
- account_id="string",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="",
zone_id="string",
- ruleset_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.rulesets.versions.with_raw_response.delete(
- "",
- account_id="string",
- zone_id="string",
+ "1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -388,9 +441,20 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
version = await async_client.rulesets.versions.get(
"1",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
+ )
+ assert_matches_type(VersionGetResponse, version, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ version = await async_client.rulesets.versions.get(
+ "1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(VersionGetResponse, version, path=["response"])
@@ -399,9 +463,9 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
response = await async_client.rulesets.versions.with_raw_response.get(
"1",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
)
assert response.is_closed is True
@@ -414,9 +478,9 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
async with async_client.rulesets.versions.with_streaming_response.get(
"1",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -429,34 +493,34 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
@pytest.mark.skip()
@parametrize
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
await async_client.rulesets.versions.with_raw_response.get(
"1",
- account_id="",
+ ruleset_id="",
+ account_id="string",
zone_id="string",
- ruleset_id="2f2feab2026849078ba485f918791bdc",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"):
await async_client.rulesets.versions.with_raw_response.get(
- "1",
- account_id="string",
- zone_id="",
+ "",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.rulesets.versions.with_raw_response.get(
"1",
- account_id="string",
+ ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="",
zone_id="string",
- ruleset_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.rulesets.versions.with_raw_response.get(
- "",
- account_id="string",
- zone_id="string",
+ "1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="",
)
diff --git a/tests/api_resources/test_rulesets.py b/tests/api_resources/test_rulesets.py
index a1924b3d0ae..04b4d061c79 100644
--- a/tests/api_resources/test_rulesets.py
+++ b/tests/api_resources/test_rulesets.py
@@ -26,12 +26,12 @@ class TestRulesets:
@parametrize
def test_method_create(self, client: Cloudflare) -> None:
ruleset = client.rulesets.create(
- account_id="string",
- zone_id="string",
kind="root",
name="My ruleset",
phase="http_request_firewall_custom",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(RulesetCreateResponse, ruleset, path=["response"])
@@ -39,8 +39,6 @@ def test_method_create(self, client: Cloudflare) -> None:
@parametrize
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
ruleset = client.rulesets.create(
- account_id="string",
- zone_id="string",
kind="root",
name="My ruleset",
phase="http_request_firewall_custom",
@@ -94,6 +92,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
"ref": "my_ref",
},
],
+ account_id="string",
+ zone_id="string",
description="My ruleset to execute managed rulesets",
)
assert_matches_type(RulesetCreateResponse, ruleset, path=["response"])
@@ -102,12 +102,12 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
@parametrize
def test_raw_response_create(self, client: Cloudflare) -> None:
response = client.rulesets.with_raw_response.create(
- account_id="string",
- zone_id="string",
kind="root",
name="My ruleset",
phase="http_request_firewall_custom",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -119,12 +119,12 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
@parametrize
def test_streaming_response_create(self, client: Cloudflare) -> None:
with client.rulesets.with_streaming_response.create(
- account_id="string",
- zone_id="string",
kind="root",
name="My ruleset",
phase="http_request_firewall_custom",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -139,22 +139,22 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:
def test_path_params_create(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.rulesets.with_raw_response.create(
- account_id="",
- zone_id="string",
kind="root",
name="My ruleset",
phase="http_request_firewall_custom",
rules=[{}, {}, {}],
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.rulesets.with_raw_response.create(
- account_id="string",
- zone_id="",
kind="root",
name="My ruleset",
phase="http_request_firewall_custom",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -162,10 +162,10 @@ def test_path_params_create(self, client: Cloudflare) -> None:
def test_method_update(self, client: Cloudflare) -> None:
ruleset = client.rulesets.update(
"2f2feab2026849078ba485f918791bdc",
- account_id="string",
- zone_id="string",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(RulesetUpdateResponse, ruleset, path=["response"])
@@ -174,8 +174,6 @@ def test_method_update(self, client: Cloudflare) -> None:
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
ruleset = client.rulesets.update(
"2f2feab2026849078ba485f918791bdc",
- account_id="string",
- zone_id="string",
id="2f2feab2026849078ba485f918791bdc",
rules=[
{
@@ -227,6 +225,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
"ref": "my_ref",
},
],
+ account_id="string",
+ zone_id="string",
description="My ruleset to execute managed rulesets",
kind="root",
name="My ruleset",
@@ -239,10 +239,10 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
def test_raw_response_update(self, client: Cloudflare) -> None:
response = client.rulesets.with_raw_response.update(
"2f2feab2026849078ba485f918791bdc",
- account_id="string",
- zone_id="string",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -255,10 +255,10 @@ def test_raw_response_update(self, client: Cloudflare) -> None:
def test_streaming_response_update(self, client: Cloudflare) -> None:
with client.rulesets.with_streaming_response.update(
"2f2feab2026849078ba485f918791bdc",
- account_id="string",
- zone_id="string",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -271,31 +271,31 @@ def test_streaming_response_update(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_update(self, client: Cloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
client.rulesets.with_raw_response.update(
- "2f2feab2026849078ba485f918791bdc",
- account_id="",
- zone_id="string",
+ "",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.rulesets.with_raw_response.update(
"2f2feab2026849078ba485f918791bdc",
- account_id="string",
- zone_id="",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.rulesets.with_raw_response.update(
- "",
- account_id="string",
- zone_id="string",
+ "2f2feab2026849078ba485f918791bdc",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -307,6 +307,15 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(RulesetListResponse, ruleset, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
+ ruleset = client.rulesets.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(RulesetListResponse, ruleset, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -360,6 +369,16 @@ def test_method_delete(self, client: Cloudflare) -> None:
)
assert ruleset is None
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_delete_with_all_params(self, client: Cloudflare) -> None:
+ ruleset = client.rulesets.delete(
+ "2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
+ )
+ assert ruleset is None
+
@pytest.mark.skip()
@parametrize
def test_raw_response_delete(self, client: Cloudflare) -> None:
@@ -393,6 +412,13 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_delete(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
+ client.rulesets.with_raw_response.delete(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.rulesets.with_raw_response.delete(
"2f2feab2026849078ba485f918791bdc",
@@ -407,13 +433,6 @@ def test_path_params_delete(self, client: Cloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
- client.rulesets.with_raw_response.delete(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
def test_method_get(self, client: Cloudflare) -> None:
@@ -424,6 +443,16 @@ def test_method_get(self, client: Cloudflare) -> None:
)
assert_matches_type(RulesetGetResponse, ruleset, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
+ ruleset = client.rulesets.get(
+ "2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(RulesetGetResponse, ruleset, path=["response"])
+
@pytest.mark.skip()
@parametrize
def test_raw_response_get(self, client: Cloudflare) -> None:
@@ -457,6 +486,13 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
@pytest.mark.skip()
@parametrize
def test_path_params_get(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
+ client.rulesets.with_raw_response.get(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.rulesets.with_raw_response.get(
"2f2feab2026849078ba485f918791bdc",
@@ -471,13 +507,6 @@ def test_path_params_get(self, client: Cloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
- client.rulesets.with_raw_response.get(
- "",
- account_id="string",
- zone_id="string",
- )
-
class TestAsyncRulesets:
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
@@ -486,12 +515,12 @@ class TestAsyncRulesets:
@parametrize
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
ruleset = await async_client.rulesets.create(
- account_id="string",
- zone_id="string",
kind="root",
name="My ruleset",
phase="http_request_firewall_custom",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(RulesetCreateResponse, ruleset, path=["response"])
@@ -499,8 +528,6 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
ruleset = await async_client.rulesets.create(
- account_id="string",
- zone_id="string",
kind="root",
name="My ruleset",
phase="http_request_firewall_custom",
@@ -554,6 +581,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
"ref": "my_ref",
},
],
+ account_id="string",
+ zone_id="string",
description="My ruleset to execute managed rulesets",
)
assert_matches_type(RulesetCreateResponse, ruleset, path=["response"])
@@ -562,12 +591,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
@parametrize
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
response = await async_client.rulesets.with_raw_response.create(
- account_id="string",
- zone_id="string",
kind="root",
name="My ruleset",
phase="http_request_firewall_custom",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -579,12 +608,12 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
async with async_client.rulesets.with_streaming_response.create(
- account_id="string",
- zone_id="string",
kind="root",
name="My ruleset",
phase="http_request_firewall_custom",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -599,22 +628,22 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.rulesets.with_raw_response.create(
- account_id="",
- zone_id="string",
kind="root",
name="My ruleset",
phase="http_request_firewall_custom",
rules=[{}, {}, {}],
+ account_id="",
+ zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.rulesets.with_raw_response.create(
- account_id="string",
- zone_id="",
kind="root",
name="My ruleset",
phase="http_request_firewall_custom",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -622,10 +651,10 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
ruleset = await async_client.rulesets.update(
"2f2feab2026849078ba485f918791bdc",
- account_id="string",
- zone_id="string",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
)
assert_matches_type(RulesetUpdateResponse, ruleset, path=["response"])
@@ -634,8 +663,6 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None:
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
ruleset = await async_client.rulesets.update(
"2f2feab2026849078ba485f918791bdc",
- account_id="string",
- zone_id="string",
id="2f2feab2026849078ba485f918791bdc",
rules=[
{
@@ -687,6 +714,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
"ref": "my_ref",
},
],
+ account_id="string",
+ zone_id="string",
description="My ruleset to execute managed rulesets",
kind="root",
name="My ruleset",
@@ -699,10 +728,10 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
response = await async_client.rulesets.with_raw_response.update(
"2f2feab2026849078ba485f918791bdc",
- account_id="string",
- zone_id="string",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
)
assert response.is_closed is True
@@ -715,10 +744,10 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
async with async_client.rulesets.with_streaming_response.update(
"2f2feab2026849078ba485f918791bdc",
- account_id="string",
- zone_id="string",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -731,31 +760,31 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip()
@parametrize
async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
await async_client.rulesets.with_raw_response.update(
- "2f2feab2026849078ba485f918791bdc",
- account_id="",
- zone_id="string",
+ "",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.rulesets.with_raw_response.update(
"2f2feab2026849078ba485f918791bdc",
- account_id="string",
- zone_id="",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="",
+ zone_id="string",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.rulesets.with_raw_response.update(
- "",
- account_id="string",
- zone_id="string",
+ "2f2feab2026849078ba485f918791bdc",
id="2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
+ account_id="string",
+ zone_id="",
)
@pytest.mark.skip()
@@ -767,6 +796,15 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(RulesetListResponse, ruleset, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ ruleset = await async_client.rulesets.list(
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(RulesetListResponse, ruleset, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -820,6 +858,16 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
)
assert ruleset is None
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ ruleset = await async_client.rulesets.delete(
+ "2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
+ )
+ assert ruleset is None
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
@@ -853,6 +901,13 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip()
@parametrize
async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
+ await async_client.rulesets.with_raw_response.delete(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.rulesets.with_raw_response.delete(
"2f2feab2026849078ba485f918791bdc",
@@ -867,13 +922,6 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
zone_id="",
)
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
- await async_client.rulesets.with_raw_response.delete(
- "",
- account_id="string",
- zone_id="string",
- )
-
@pytest.mark.skip()
@parametrize
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
@@ -884,6 +932,16 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(RulesetGetResponse, ruleset, path=["response"])
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ ruleset = await async_client.rulesets.get(
+ "2f2feab2026849078ba485f918791bdc",
+ account_id="string",
+ zone_id="string",
+ )
+ assert_matches_type(RulesetGetResponse, ruleset, path=["response"])
+
@pytest.mark.skip()
@parametrize
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
@@ -917,6 +975,13 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
@pytest.mark.skip()
@parametrize
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
+ await async_client.rulesets.with_raw_response.get(
+ "",
+ account_id="string",
+ zone_id="string",
+ )
+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.rulesets.with_raw_response.get(
"2f2feab2026849078ba485f918791bdc",
@@ -930,10 +995,3 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
account_id="string",
zone_id="",
)
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"):
- await async_client.rulesets.with_raw_response.get(
- "",
- account_id="string",
- zone_id="string",
- )