feat(api): update via SDK Studio (#365)

This commit is contained in:
stainless-app[bot] 2024-04-25 04:48:10 +00:00 committed by stainless-bot
parent f07a5ed23f
commit 14b7e5f00f
29 changed files with 237 additions and 1936 deletions

View file

@ -47,7 +47,7 @@ class MembersResource(SyncAPIResource):
def create(
self,
*,
account_id: object,
account_id: str,
email: str,
roles: List[str],
status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN,
@ -74,6 +74,8 @@ class MembersResource(SyncAPIResource):
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}")
return self._post(
f"/accounts/{account_id}/members",
body=maybe_transform(
@ -98,7 +100,7 @@ class MembersResource(SyncAPIResource):
self,
member_id: str,
*,
account_id: object,
account_id: str,
roles: Iterable[member_update_params.Role],
# 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.
@ -123,6 +125,8 @@ class MembersResource(SyncAPIResource):
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 member_id:
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
return self._put(
@ -141,7 +145,7 @@ class MembersResource(SyncAPIResource):
def list(
self,
*,
account_id: object,
account_id: str,
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
order: Literal["user.first_name", "user.last_name", "user.email", "status"] | NotGiven = NOT_GIVEN,
page: float | NotGiven = NOT_GIVEN,
@ -176,6 +180,8 @@ class MembersResource(SyncAPIResource):
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}")
return self._get_api_list(
f"/accounts/{account_id}/members",
page=SyncV4PagePaginationArray[MemberListResponse],
@ -202,7 +208,7 @@ class MembersResource(SyncAPIResource):
self,
member_id: str,
*,
account_id: object,
account_id: str,
# 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,
@ -224,6 +230,8 @@ class MembersResource(SyncAPIResource):
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 member_id:
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
return self._delete(
@ -242,7 +250,7 @@ class MembersResource(SyncAPIResource):
self,
member_id: str,
*,
account_id: object,
account_id: str,
# 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,
@ -264,6 +272,8 @@ class MembersResource(SyncAPIResource):
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 member_id:
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
return self._get(
@ -291,7 +301,7 @@ class AsyncMembersResource(AsyncAPIResource):
async def create(
self,
*,
account_id: object,
account_id: str,
email: str,
roles: List[str],
status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN,
@ -318,6 +328,8 @@ class AsyncMembersResource(AsyncAPIResource):
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}")
return await self._post(
f"/accounts/{account_id}/members",
body=await async_maybe_transform(
@ -342,7 +354,7 @@ class AsyncMembersResource(AsyncAPIResource):
self,
member_id: str,
*,
account_id: object,
account_id: str,
roles: Iterable[member_update_params.Role],
# 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.
@ -367,6 +379,8 @@ class AsyncMembersResource(AsyncAPIResource):
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 member_id:
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
return await self._put(
@ -385,7 +399,7 @@ class AsyncMembersResource(AsyncAPIResource):
def list(
self,
*,
account_id: object,
account_id: str,
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
order: Literal["user.first_name", "user.last_name", "user.email", "status"] | NotGiven = NOT_GIVEN,
page: float | NotGiven = NOT_GIVEN,
@ -420,6 +434,8 @@ class AsyncMembersResource(AsyncAPIResource):
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}")
return self._get_api_list(
f"/accounts/{account_id}/members",
page=AsyncV4PagePaginationArray[MemberListResponse],
@ -446,7 +462,7 @@ class AsyncMembersResource(AsyncAPIResource):
self,
member_id: str,
*,
account_id: object,
account_id: str,
# 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,
@ -468,6 +484,8 @@ class AsyncMembersResource(AsyncAPIResource):
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 member_id:
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
return await self._delete(
@ -486,7 +504,7 @@ class AsyncMembersResource(AsyncAPIResource):
self,
member_id: str,
*,
account_id: object,
account_id: str,
# 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,
@ -508,6 +526,8 @@ class AsyncMembersResource(AsyncAPIResource):
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 member_id:
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
return await self._get(

View file

@ -39,7 +39,7 @@ class RolesResource(SyncAPIResource):
def list(
self,
*,
account_id: object,
account_id: str,
# 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,
@ -59,6 +59,8 @@ class RolesResource(SyncAPIResource):
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}")
return self._get_api_list(
f"/accounts/{account_id}/roles",
page=SyncSinglePage[Role],
@ -72,7 +74,7 @@ class RolesResource(SyncAPIResource):
self,
role_id: object,
*,
account_id: object,
account_id: str,
# 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,
@ -92,6 +94,8 @@ class RolesResource(SyncAPIResource):
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}")
return cast(
RoleGetResponse,
self._get(
@ -122,7 +126,7 @@ class AsyncRolesResource(AsyncAPIResource):
def list(
self,
*,
account_id: object,
account_id: str,
# 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,
@ -142,6 +146,8 @@ class AsyncRolesResource(AsyncAPIResource):
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}")
return self._get_api_list(
f"/accounts/{account_id}/roles",
page=AsyncSinglePage[Role],
@ -155,7 +161,7 @@ class AsyncRolesResource(AsyncAPIResource):
self,
role_id: object,
*,
account_id: object,
account_id: str,
# 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,6 +181,8 @@ class AsyncRolesResource(AsyncAPIResource):
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}")
return cast(
RoleGetResponse,
await self._get(

View file

@ -9,7 +9,7 @@ __all__ = ["MemberCreateParams"]
class MemberCreateParams(TypedDict, total=False):
account_id: Required[object]
account_id: Required[str]
email: Required[str]
"""The contact email address of the user."""

View file

@ -8,7 +8,7 @@ __all__ = ["MemberListParams"]
class MemberListParams(TypedDict, total=False):
account_id: Required[object]
account_id: Required[str]
direction: Literal["asc", "desc"]
"""Direction to order results."""

View file

@ -9,7 +9,7 @@ __all__ = ["MemberUpdateParams", "Role"]
class MemberUpdateParams(TypedDict, total=False):
account_id: Required[object]
account_id: Required[str]
roles: Required[Iterable[Role]]
"""Roles assigned to this member."""

View file

@ -25,7 +25,7 @@ class TestMembers:
@parametrize
def test_method_create(self, client: Cloudflare) -> None:
member = client.accounts.members.create(
account_id={},
account_id="string",
email="user@example.com",
roles=[
"3536bcfad5faccb999b47003c79917fb",
@ -39,7 +39,7 @@ class TestMembers:
@parametrize
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
member = client.accounts.members.create(
account_id={},
account_id="string",
email="user@example.com",
roles=[
"3536bcfad5faccb999b47003c79917fb",
@ -54,7 +54,7 @@ class TestMembers:
@parametrize
def test_raw_response_create(self, client: Cloudflare) -> None:
response = client.accounts.members.with_raw_response.create(
account_id={},
account_id="string",
email="user@example.com",
roles=[
"3536bcfad5faccb999b47003c79917fb",
@ -72,7 +72,7 @@ class TestMembers:
@parametrize
def test_streaming_response_create(self, client: Cloudflare) -> None:
with client.accounts.members.with_streaming_response.create(
account_id={},
account_id="string",
email="user@example.com",
roles=[
"3536bcfad5faccb999b47003c79917fb",
@ -88,12 +88,26 @@ class TestMembers:
assert cast(Any, response.is_closed) is True
@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 ''"):
client.accounts.members.with_raw_response.create(
account_id="",
email="user@example.com",
roles=[
"3536bcfad5faccb999b47003c79917fb",
"3536bcfad5faccb999b47003c79917fb",
"3536bcfad5faccb999b47003c79917fb",
],
)
@pytest.mark.skip()
@parametrize
def test_method_update(self, client: Cloudflare) -> None:
member = client.accounts.members.update(
"4536bcfad5faccb111b47003c79917fa",
account_id={},
account_id="string",
roles=[
{"id": "3536bcfad5faccb999b47003c79917fb"},
{"id": "3536bcfad5faccb999b47003c79917fb"},
@ -107,7 +121,7 @@ class TestMembers:
def test_raw_response_update(self, client: Cloudflare) -> None:
response = client.accounts.members.with_raw_response.update(
"4536bcfad5faccb111b47003c79917fa",
account_id={},
account_id="string",
roles=[
{"id": "3536bcfad5faccb999b47003c79917fb"},
{"id": "3536bcfad5faccb999b47003c79917fb"},
@ -125,7 +139,7 @@ class TestMembers:
def test_streaming_response_update(self, client: Cloudflare) -> None:
with client.accounts.members.with_streaming_response.update(
"4536bcfad5faccb111b47003c79917fa",
account_id={},
account_id="string",
roles=[
{"id": "3536bcfad5faccb999b47003c79917fb"},
{"id": "3536bcfad5faccb999b47003c79917fb"},
@ -143,10 +157,21 @@ class TestMembers:
@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 ''"):
client.accounts.members.with_raw_response.update(
"4536bcfad5faccb111b47003c79917fa",
account_id="",
roles=[
{"id": "3536bcfad5faccb999b47003c79917fb"},
{"id": "3536bcfad5faccb999b47003c79917fb"},
{"id": "3536bcfad5faccb999b47003c79917fb"},
],
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `member_id` but received ''"):
client.accounts.members.with_raw_response.update(
"",
account_id={},
account_id="string",
roles=[
{"id": "3536bcfad5faccb999b47003c79917fb"},
{"id": "3536bcfad5faccb999b47003c79917fb"},
@ -158,7 +183,7 @@ class TestMembers:
@parametrize
def test_method_list(self, client: Cloudflare) -> None:
member = client.accounts.members.list(
account_id={},
account_id="string",
)
assert_matches_type(SyncV4PagePaginationArray[MemberListResponse], member, path=["response"])
@ -166,7 +191,7 @@ class TestMembers:
@parametrize
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
member = client.accounts.members.list(
account_id={},
account_id="string",
direction="desc",
order="status",
page=1,
@ -179,7 +204,7 @@ class TestMembers:
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
response = client.accounts.members.with_raw_response.list(
account_id={},
account_id="string",
)
assert response.is_closed is True
@ -191,7 +216,7 @@ class TestMembers:
@parametrize
def test_streaming_response_list(self, client: Cloudflare) -> None:
with client.accounts.members.with_streaming_response.list(
account_id={},
account_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -201,12 +226,20 @@ class TestMembers:
assert cast(Any, response.is_closed) is True
@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 `account_id` but received ''"):
client.accounts.members.with_raw_response.list(
account_id="",
)
@pytest.mark.skip()
@parametrize
def test_method_delete(self, client: Cloudflare) -> None:
member = client.accounts.members.delete(
"4536bcfad5faccb111b47003c79917fa",
account_id={},
account_id="string",
)
assert_matches_type(Optional[MemberDeleteResponse], member, path=["response"])
@ -215,7 +248,7 @@ class TestMembers:
def test_raw_response_delete(self, client: Cloudflare) -> None:
response = client.accounts.members.with_raw_response.delete(
"4536bcfad5faccb111b47003c79917fa",
account_id={},
account_id="string",
)
assert response.is_closed is True
@ -228,7 +261,7 @@ class TestMembers:
def test_streaming_response_delete(self, client: Cloudflare) -> None:
with client.accounts.members.with_streaming_response.delete(
"4536bcfad5faccb111b47003c79917fa",
account_id={},
account_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -241,10 +274,16 @@ class TestMembers:
@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 ''"):
client.accounts.members.with_raw_response.delete(
"4536bcfad5faccb111b47003c79917fa",
account_id="",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `member_id` but received ''"):
client.accounts.members.with_raw_response.delete(
"",
account_id={},
account_id="string",
)
@pytest.mark.skip()
@ -252,7 +291,7 @@ class TestMembers:
def test_method_get(self, client: Cloudflare) -> None:
member = client.accounts.members.get(
"4536bcfad5faccb111b47003c79917fa",
account_id={},
account_id="string",
)
assert_matches_type(Member, member, path=["response"])
@ -261,7 +300,7 @@ class TestMembers:
def test_raw_response_get(self, client: Cloudflare) -> None:
response = client.accounts.members.with_raw_response.get(
"4536bcfad5faccb111b47003c79917fa",
account_id={},
account_id="string",
)
assert response.is_closed is True
@ -274,7 +313,7 @@ class TestMembers:
def test_streaming_response_get(self, client: Cloudflare) -> None:
with client.accounts.members.with_streaming_response.get(
"4536bcfad5faccb111b47003c79917fa",
account_id={},
account_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -287,10 +326,16 @@ class TestMembers:
@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 ''"):
client.accounts.members.with_raw_response.get(
"4536bcfad5faccb111b47003c79917fa",
account_id="",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `member_id` but received ''"):
client.accounts.members.with_raw_response.get(
"",
account_id={},
account_id="string",
)
@ -301,7 +346,7 @@ class TestAsyncMembers:
@parametrize
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
member = await async_client.accounts.members.create(
account_id={},
account_id="string",
email="user@example.com",
roles=[
"3536bcfad5faccb999b47003c79917fb",
@ -315,7 +360,7 @@ class TestAsyncMembers:
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
member = await async_client.accounts.members.create(
account_id={},
account_id="string",
email="user@example.com",
roles=[
"3536bcfad5faccb999b47003c79917fb",
@ -330,7 +375,7 @@ class TestAsyncMembers:
@parametrize
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
response = await async_client.accounts.members.with_raw_response.create(
account_id={},
account_id="string",
email="user@example.com",
roles=[
"3536bcfad5faccb999b47003c79917fb",
@ -348,7 +393,7 @@ class TestAsyncMembers:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
async with async_client.accounts.members.with_streaming_response.create(
account_id={},
account_id="string",
email="user@example.com",
roles=[
"3536bcfad5faccb999b47003c79917fb",
@ -364,12 +409,26 @@ class TestAsyncMembers:
assert cast(Any, response.is_closed) is True
@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 ''"):
await async_client.accounts.members.with_raw_response.create(
account_id="",
email="user@example.com",
roles=[
"3536bcfad5faccb999b47003c79917fb",
"3536bcfad5faccb999b47003c79917fb",
"3536bcfad5faccb999b47003c79917fb",
],
)
@pytest.mark.skip()
@parametrize
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
member = await async_client.accounts.members.update(
"4536bcfad5faccb111b47003c79917fa",
account_id={},
account_id="string",
roles=[
{"id": "3536bcfad5faccb999b47003c79917fb"},
{"id": "3536bcfad5faccb999b47003c79917fb"},
@ -383,7 +442,7 @@ class TestAsyncMembers:
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
response = await async_client.accounts.members.with_raw_response.update(
"4536bcfad5faccb111b47003c79917fa",
account_id={},
account_id="string",
roles=[
{"id": "3536bcfad5faccb999b47003c79917fb"},
{"id": "3536bcfad5faccb999b47003c79917fb"},
@ -401,7 +460,7 @@ class TestAsyncMembers:
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
async with async_client.accounts.members.with_streaming_response.update(
"4536bcfad5faccb111b47003c79917fa",
account_id={},
account_id="string",
roles=[
{"id": "3536bcfad5faccb999b47003c79917fb"},
{"id": "3536bcfad5faccb999b47003c79917fb"},
@ -419,10 +478,21 @@ class TestAsyncMembers:
@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 ''"):
await async_client.accounts.members.with_raw_response.update(
"4536bcfad5faccb111b47003c79917fa",
account_id="",
roles=[
{"id": "3536bcfad5faccb999b47003c79917fb"},
{"id": "3536bcfad5faccb999b47003c79917fb"},
{"id": "3536bcfad5faccb999b47003c79917fb"},
],
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `member_id` but received ''"):
await async_client.accounts.members.with_raw_response.update(
"",
account_id={},
account_id="string",
roles=[
{"id": "3536bcfad5faccb999b47003c79917fb"},
{"id": "3536bcfad5faccb999b47003c79917fb"},
@ -434,7 +504,7 @@ class TestAsyncMembers:
@parametrize
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
member = await async_client.accounts.members.list(
account_id={},
account_id="string",
)
assert_matches_type(AsyncV4PagePaginationArray[MemberListResponse], member, path=["response"])
@ -442,7 +512,7 @@ class TestAsyncMembers:
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
member = await async_client.accounts.members.list(
account_id={},
account_id="string",
direction="desc",
order="status",
page=1,
@ -455,7 +525,7 @@ class TestAsyncMembers:
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
response = await async_client.accounts.members.with_raw_response.list(
account_id={},
account_id="string",
)
assert response.is_closed is True
@ -467,7 +537,7 @@ class TestAsyncMembers:
@parametrize
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
async with async_client.accounts.members.with_streaming_response.list(
account_id={},
account_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -477,12 +547,20 @@ class TestAsyncMembers:
assert cast(Any, response.is_closed) is True
@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 `account_id` but received ''"):
await async_client.accounts.members.with_raw_response.list(
account_id="",
)
@pytest.mark.skip()
@parametrize
async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
member = await async_client.accounts.members.delete(
"4536bcfad5faccb111b47003c79917fa",
account_id={},
account_id="string",
)
assert_matches_type(Optional[MemberDeleteResponse], member, path=["response"])
@ -491,7 +569,7 @@ class TestAsyncMembers:
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
response = await async_client.accounts.members.with_raw_response.delete(
"4536bcfad5faccb111b47003c79917fa",
account_id={},
account_id="string",
)
assert response.is_closed is True
@ -504,7 +582,7 @@ class TestAsyncMembers:
async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None:
async with async_client.accounts.members.with_streaming_response.delete(
"4536bcfad5faccb111b47003c79917fa",
account_id={},
account_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -517,10 +595,16 @@ class TestAsyncMembers:
@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 ''"):
await async_client.accounts.members.with_raw_response.delete(
"4536bcfad5faccb111b47003c79917fa",
account_id="",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `member_id` but received ''"):
await async_client.accounts.members.with_raw_response.delete(
"",
account_id={},
account_id="string",
)
@pytest.mark.skip()
@ -528,7 +612,7 @@ class TestAsyncMembers:
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
member = await async_client.accounts.members.get(
"4536bcfad5faccb111b47003c79917fa",
account_id={},
account_id="string",
)
assert_matches_type(Member, member, path=["response"])
@ -537,7 +621,7 @@ class TestAsyncMembers:
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
response = await async_client.accounts.members.with_raw_response.get(
"4536bcfad5faccb111b47003c79917fa",
account_id={},
account_id="string",
)
assert response.is_closed is True
@ -550,7 +634,7 @@ class TestAsyncMembers:
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
async with async_client.accounts.members.with_streaming_response.get(
"4536bcfad5faccb111b47003c79917fa",
account_id={},
account_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -563,8 +647,14 @@ class TestAsyncMembers:
@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 ''"):
await async_client.accounts.members.with_raw_response.get(
"4536bcfad5faccb111b47003c79917fa",
account_id="",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `member_id` but received ''"):
await async_client.accounts.members.with_raw_response.get(
"",
account_id={},
account_id="string",
)

View file

@ -23,7 +23,7 @@ class TestRoles:
@parametrize
def test_method_list(self, client: Cloudflare) -> None:
role = client.accounts.roles.list(
account_id={},
account_id="string",
)
assert_matches_type(SyncSinglePage[Role], role, path=["response"])
@ -31,7 +31,7 @@ class TestRoles:
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
response = client.accounts.roles.with_raw_response.list(
account_id={},
account_id="string",
)
assert response.is_closed is True
@ -43,7 +43,7 @@ class TestRoles:
@parametrize
def test_streaming_response_list(self, client: Cloudflare) -> None:
with client.accounts.roles.with_streaming_response.list(
account_id={},
account_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -53,12 +53,20 @@ class TestRoles:
assert cast(Any, response.is_closed) is True
@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 `account_id` but received ''"):
client.accounts.roles.with_raw_response.list(
account_id="",
)
@pytest.mark.skip()
@parametrize
def test_method_get(self, client: Cloudflare) -> None:
role = client.accounts.roles.get(
{},
account_id={},
account_id="string",
)
assert_matches_type(RoleGetResponse, role, path=["response"])
@ -67,7 +75,7 @@ class TestRoles:
def test_raw_response_get(self, client: Cloudflare) -> None:
response = client.accounts.roles.with_raw_response.get(
{},
account_id={},
account_id="string",
)
assert response.is_closed is True
@ -80,7 +88,7 @@ class TestRoles:
def test_streaming_response_get(self, client: Cloudflare) -> None:
with client.accounts.roles.with_streaming_response.get(
{},
account_id={},
account_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -90,6 +98,15 @@ class TestRoles:
assert cast(Any, response.is_closed) is True
@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 ''"):
client.accounts.roles.with_raw_response.get(
{},
account_id="",
)
class TestAsyncRoles:
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
@ -98,7 +115,7 @@ class TestAsyncRoles:
@parametrize
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
role = await async_client.accounts.roles.list(
account_id={},
account_id="string",
)
assert_matches_type(AsyncSinglePage[Role], role, path=["response"])
@ -106,7 +123,7 @@ class TestAsyncRoles:
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
response = await async_client.accounts.roles.with_raw_response.list(
account_id={},
account_id="string",
)
assert response.is_closed is True
@ -118,7 +135,7 @@ class TestAsyncRoles:
@parametrize
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
async with async_client.accounts.roles.with_streaming_response.list(
account_id={},
account_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -128,12 +145,20 @@ class TestAsyncRoles:
assert cast(Any, response.is_closed) is True
@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 `account_id` but received ''"):
await async_client.accounts.roles.with_raw_response.list(
account_id="",
)
@pytest.mark.skip()
@parametrize
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
role = await async_client.accounts.roles.get(
{},
account_id={},
account_id="string",
)
assert_matches_type(RoleGetResponse, role, path=["response"])
@ -142,7 +167,7 @@ class TestAsyncRoles:
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
response = await async_client.accounts.roles.with_raw_response.get(
{},
account_id={},
account_id="string",
)
assert response.is_closed is True
@ -155,7 +180,7 @@ class TestAsyncRoles:
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
async with async_client.accounts.roles.with_streaming_response.get(
{},
account_id={},
account_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -164,3 +189,12 @@ class TestAsyncRoles:
assert_matches_type(RoleGetResponse, role, path=["response"])
assert cast(Any, response.is_closed) is True
@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 ''"):
await async_client.accounts.roles.with_raw_response.get(
{},
account_id="",
)

View file

@ -28,7 +28,6 @@ class TestAccessRules:
configuration={},
mode="challenge",
account_id="string",
zone_id="string",
)
assert_matches_type(AccessRuleCreateResponse, access_rule, path=["response"])
@ -42,7 +41,6 @@ class TestAccessRules:
},
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(AccessRuleCreateResponse, access_rule, path=["response"])
@ -54,7 +52,6 @@ class TestAccessRules:
configuration={},
mode="challenge",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -69,7 +66,6 @@ class TestAccessRules:
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"
@ -87,7 +83,6 @@ class TestAccessRules:
configuration={},
mode="challenge",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -95,7 +90,6 @@ class TestAccessRules:
configuration={},
mode="challenge",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -103,7 +97,6 @@ class TestAccessRules:
def test_method_list(self, client: Cloudflare) -> None:
access_rule = client.firewall.access_rules.list(
account_id="string",
zone_id="string",
)
assert_matches_type(SyncV4PagePaginationArray[object], access_rule, path=["response"])
@ -112,7 +105,6 @@ class TestAccessRules:
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
access_rule = client.firewall.access_rules.list(
account_id="string",
zone_id="string",
direction="desc",
egs_pagination={
"json": {
@ -138,7 +130,6 @@ class TestAccessRules:
def test_raw_response_list(self, client: Cloudflare) -> None:
response = client.firewall.access_rules.with_raw_response.list(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -151,7 +142,6 @@ class TestAccessRules:
def test_streaming_response_list(self, client: Cloudflare) -> None:
with client.firewall.access_rules.with_streaming_response.list(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -167,13 +157,11 @@ class TestAccessRules:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.firewall.access_rules.with_raw_response.list(
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.list(
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -182,7 +170,6 @@ class TestAccessRules:
access_rule = client.firewall.access_rules.delete(
{},
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[AccessRuleDeleteResponse], access_rule, path=["response"])
@ -192,7 +179,6 @@ class TestAccessRules:
access_rule = client.firewall.access_rules.delete(
{},
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[AccessRuleDeleteResponse], access_rule, path=["response"])
@ -202,7 +188,6 @@ class TestAccessRules:
response = client.firewall.access_rules.with_raw_response.delete(
{},
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -216,7 +201,6 @@ class TestAccessRules:
with client.firewall.access_rules.with_streaming_response.delete(
{},
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -233,14 +217,12 @@ class TestAccessRules:
client.firewall.access_rules.with_raw_response.delete(
{},
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.delete(
{},
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -251,7 +233,6 @@ class TestAccessRules:
configuration={},
mode="challenge",
account_id="string",
zone_id="string",
)
assert_matches_type(AccessRuleEditResponse, access_rule, path=["response"])
@ -266,7 +247,6 @@ class TestAccessRules:
},
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(AccessRuleEditResponse, access_rule, path=["response"])
@ -279,7 +259,6 @@ class TestAccessRules:
configuration={},
mode="challenge",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -295,7 +274,6 @@ class TestAccessRules:
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"
@ -314,7 +292,6 @@ class TestAccessRules:
configuration={},
mode="challenge",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -323,7 +300,6 @@ class TestAccessRules:
configuration={},
mode="challenge",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -332,7 +308,6 @@ class TestAccessRules:
access_rule = client.firewall.access_rules.get(
{},
account_id="string",
zone_id="string",
)
assert_matches_type(AccessRuleGetResponse, access_rule, path=["response"])
@ -342,7 +317,6 @@ class TestAccessRules:
access_rule = client.firewall.access_rules.get(
{},
account_id="string",
zone_id="string",
)
assert_matches_type(AccessRuleGetResponse, access_rule, path=["response"])
@ -352,7 +326,6 @@ class TestAccessRules:
response = client.firewall.access_rules.with_raw_response.get(
{},
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -366,7 +339,6 @@ class TestAccessRules:
with client.firewall.access_rules.with_streaming_response.get(
{},
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -383,14 +355,12 @@ class TestAccessRules:
client.firewall.access_rules.with_raw_response.get(
{},
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.get(
{},
account_id="string",
zone_id="",
)
@ -404,7 +374,6 @@ class TestAsyncAccessRules:
configuration={},
mode="challenge",
account_id="string",
zone_id="string",
)
assert_matches_type(AccessRuleCreateResponse, access_rule, path=["response"])
@ -418,7 +387,6 @@ class TestAsyncAccessRules:
},
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(AccessRuleCreateResponse, access_rule, path=["response"])
@ -430,7 +398,6 @@ class TestAsyncAccessRules:
configuration={},
mode="challenge",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -445,7 +412,6 @@ class TestAsyncAccessRules:
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"
@ -463,7 +429,6 @@ class TestAsyncAccessRules:
configuration={},
mode="challenge",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -471,7 +436,6 @@ class TestAsyncAccessRules:
configuration={},
mode="challenge",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -479,7 +443,6 @@ class TestAsyncAccessRules:
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
access_rule = await async_client.firewall.access_rules.list(
account_id="string",
zone_id="string",
)
assert_matches_type(AsyncV4PagePaginationArray[object], access_rule, path=["response"])
@ -488,7 +451,6 @@ class TestAsyncAccessRules:
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
access_rule = await async_client.firewall.access_rules.list(
account_id="string",
zone_id="string",
direction="desc",
egs_pagination={
"json": {
@ -514,7 +476,6 @@ class TestAsyncAccessRules:
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
response = await async_client.firewall.access_rules.with_raw_response.list(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -527,7 +488,6 @@ class TestAsyncAccessRules:
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
async with async_client.firewall.access_rules.with_streaming_response.list(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -543,13 +503,11 @@ class TestAsyncAccessRules:
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.list(
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.list(
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -558,7 +516,6 @@ class TestAsyncAccessRules:
access_rule = await async_client.firewall.access_rules.delete(
{},
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[AccessRuleDeleteResponse], access_rule, path=["response"])
@ -568,7 +525,6 @@ class TestAsyncAccessRules:
access_rule = await async_client.firewall.access_rules.delete(
{},
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[AccessRuleDeleteResponse], access_rule, path=["response"])
@ -578,7 +534,6 @@ class TestAsyncAccessRules:
response = await async_client.firewall.access_rules.with_raw_response.delete(
{},
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -592,7 +547,6 @@ class TestAsyncAccessRules:
async with async_client.firewall.access_rules.with_streaming_response.delete(
{},
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -609,14 +563,12 @@ class TestAsyncAccessRules:
await async_client.firewall.access_rules.with_raw_response.delete(
{},
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.delete(
{},
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -627,7 +579,6 @@ class TestAsyncAccessRules:
configuration={},
mode="challenge",
account_id="string",
zone_id="string",
)
assert_matches_type(AccessRuleEditResponse, access_rule, path=["response"])
@ -642,7 +593,6 @@ class TestAsyncAccessRules:
},
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(AccessRuleEditResponse, access_rule, path=["response"])
@ -655,7 +605,6 @@ class TestAsyncAccessRules:
configuration={},
mode="challenge",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -671,7 +620,6 @@ class TestAsyncAccessRules:
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"
@ -690,7 +638,6 @@ class TestAsyncAccessRules:
configuration={},
mode="challenge",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -699,7 +646,6 @@ class TestAsyncAccessRules:
configuration={},
mode="challenge",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -708,7 +654,6 @@ class TestAsyncAccessRules:
access_rule = await async_client.firewall.access_rules.get(
{},
account_id="string",
zone_id="string",
)
assert_matches_type(AccessRuleGetResponse, access_rule, path=["response"])
@ -718,7 +663,6 @@ class TestAsyncAccessRules:
access_rule = await async_client.firewall.access_rules.get(
{},
account_id="string",
zone_id="string",
)
assert_matches_type(AccessRuleGetResponse, access_rule, path=["response"])
@ -728,7 +672,6 @@ class TestAsyncAccessRules:
response = await async_client.firewall.access_rules.with_raw_response.get(
{},
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -742,7 +685,6 @@ class TestAsyncAccessRules:
async with async_client.firewall.access_rules.with_streaming_response.get(
{},
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -759,12 +701,10 @@ class TestAsyncAccessRules:
await async_client.firewall.access_rules.with_raw_response.get(
{},
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.get(
{},
account_id="string",
zone_id="",
)

View file

@ -22,7 +22,6 @@ class TestFields:
field = client.logpush.datasets.fields.get(
"http_requests",
account_id="string",
zone_id="string",
)
assert_matches_type(object, field, path=["response"])
@ -32,7 +31,6 @@ class TestFields:
field = client.logpush.datasets.fields.get(
"http_requests",
account_id="string",
zone_id="string",
)
assert_matches_type(object, field, path=["response"])
@ -42,7 +40,6 @@ class TestFields:
response = client.logpush.datasets.fields.with_raw_response.get(
"http_requests",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -56,7 +53,6 @@ class TestFields:
with client.logpush.datasets.fields.with_streaming_response.get(
"http_requests",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -73,21 +69,18 @@ class TestFields:
client.logpush.datasets.fields.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.logpush.datasets.fields.with_raw_response.get(
"http_requests",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.logpush.datasets.fields.with_raw_response.get(
"http_requests",
account_id="string",
zone_id="",
)
@ -100,7 +93,6 @@ class TestAsyncFields:
field = await async_client.logpush.datasets.fields.get(
"http_requests",
account_id="string",
zone_id="string",
)
assert_matches_type(object, field, path=["response"])
@ -110,7 +102,6 @@ class TestAsyncFields:
field = await async_client.logpush.datasets.fields.get(
"http_requests",
account_id="string",
zone_id="string",
)
assert_matches_type(object, field, path=["response"])
@ -120,7 +111,6 @@ class TestAsyncFields:
response = await async_client.logpush.datasets.fields.with_raw_response.get(
"http_requests",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -134,7 +124,6 @@ class TestAsyncFields:
async with async_client.logpush.datasets.fields.with_streaming_response.get(
"http_requests",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -151,19 +140,16 @@ class TestAsyncFields:
await async_client.logpush.datasets.fields.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.logpush.datasets.fields.with_raw_response.get(
"http_requests",
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.datasets.fields.with_raw_response.get(
"http_requests",
account_id="string",
zone_id="",
)

View file

@ -23,7 +23,6 @@ class TestJobs:
job = client.logpush.datasets.jobs.get(
"http_requests",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[JobGetResponse], job, path=["response"])
@ -33,7 +32,6 @@ class TestJobs:
job = client.logpush.datasets.jobs.get(
"http_requests",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[JobGetResponse], job, path=["response"])
@ -43,7 +41,6 @@ class TestJobs:
response = client.logpush.datasets.jobs.with_raw_response.get(
"http_requests",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -57,7 +54,6 @@ class TestJobs:
with client.logpush.datasets.jobs.with_streaming_response.get(
"http_requests",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -74,21 +70,18 @@ class TestJobs:
client.logpush.datasets.jobs.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.logpush.datasets.jobs.with_raw_response.get(
"http_requests",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.logpush.datasets.jobs.with_raw_response.get(
"http_requests",
account_id="string",
zone_id="",
)
@ -101,7 +94,6 @@ class TestAsyncJobs:
job = await async_client.logpush.datasets.jobs.get(
"http_requests",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[JobGetResponse], job, path=["response"])
@ -111,7 +103,6 @@ class TestAsyncJobs:
job = await async_client.logpush.datasets.jobs.get(
"http_requests",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[JobGetResponse], job, path=["response"])
@ -121,7 +112,6 @@ class TestAsyncJobs:
response = await async_client.logpush.datasets.jobs.with_raw_response.get(
"http_requests",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -135,7 +125,6 @@ class TestAsyncJobs:
async with async_client.logpush.datasets.jobs.with_streaming_response.get(
"http_requests",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -152,19 +141,16 @@ class TestAsyncJobs:
await async_client.logpush.datasets.jobs.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.logpush.datasets.jobs.with_raw_response.get(
"http_requests",
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.datasets.jobs.with_raw_response.get(
"http_requests",
account_id="string",
zone_id="",
)

View file

@ -24,7 +24,6 @@ class TestJobs:
job = client.logpush.jobs.create(
destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[LogpushJob], job, path=["response"])
@ -34,7 +33,6 @@ class TestJobs:
job = client.logpush.jobs.create(
destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
dataset="http_requests",
enabled=False,
frequency="high",
@ -64,7 +62,6 @@ class TestJobs:
response = client.logpush.jobs.with_raw_response.create(
destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -78,7 +75,6 @@ class TestJobs:
with client.logpush.jobs.with_streaming_response.create(
destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -95,14 +91,12 @@ class TestJobs:
client.logpush.jobs.with_raw_response.create(
destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="",
zone_id="string",
)
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="",
)
@pytest.mark.skip()
@ -111,7 +105,6 @@ class TestJobs:
job = client.logpush.jobs.update(
1,
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[LogpushJob], job, path=["response"])
@ -121,7 +114,6 @@ class TestJobs:
job = client.logpush.jobs.update(
1,
account_id="string",
zone_id="string",
destination_conf="s3://mybucket/logs?region=us-west-2",
enabled=False,
frequency="high",
@ -150,7 +142,6 @@ class TestJobs:
response = client.logpush.jobs.with_raw_response.update(
1,
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -164,7 +155,6 @@ class TestJobs:
with client.logpush.jobs.with_streaming_response.update(
1,
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -181,14 +171,12 @@ class TestJobs:
client.logpush.jobs.with_raw_response.update(
1,
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.logpush.jobs.with_raw_response.update(
1,
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -196,7 +184,6 @@ class TestJobs:
def test_method_list(self, client: Cloudflare) -> None:
job = client.logpush.jobs.list(
account_id="string",
zone_id="string",
)
assert_matches_type(SyncSinglePage[Optional[LogpushJob]], job, path=["response"])
@ -205,7 +192,6 @@ class TestJobs:
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(SyncSinglePage[Optional[LogpushJob]], job, path=["response"])
@ -214,7 +200,6 @@ class TestJobs:
def test_raw_response_list(self, client: Cloudflare) -> None:
response = client.logpush.jobs.with_raw_response.list(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -227,7 +212,6 @@ class TestJobs:
def test_streaming_response_list(self, client: Cloudflare) -> None:
with client.logpush.jobs.with_streaming_response.list(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -243,13 +227,11 @@ class TestJobs:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.logpush.jobs.with_raw_response.list(
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.logpush.jobs.with_raw_response.list(
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -258,7 +240,6 @@ class TestJobs:
job = client.logpush.jobs.delete(
1,
account_id="string",
zone_id="string",
)
assert_matches_type(object, job, path=["response"])
@ -268,7 +249,6 @@ class TestJobs:
job = client.logpush.jobs.delete(
1,
account_id="string",
zone_id="string",
)
assert_matches_type(object, job, path=["response"])
@ -278,7 +258,6 @@ class TestJobs:
response = client.logpush.jobs.with_raw_response.delete(
1,
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -292,7 +271,6 @@ class TestJobs:
with client.logpush.jobs.with_streaming_response.delete(
1,
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -309,14 +287,12 @@ class TestJobs:
client.logpush.jobs.with_raw_response.delete(
1,
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.logpush.jobs.with_raw_response.delete(
1,
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -325,7 +301,6 @@ class TestJobs:
job = client.logpush.jobs.get(
1,
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[LogpushJob], job, path=["response"])
@ -335,7 +310,6 @@ class TestJobs:
job = client.logpush.jobs.get(
1,
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[LogpushJob], job, path=["response"])
@ -345,7 +319,6 @@ class TestJobs:
response = client.logpush.jobs.with_raw_response.get(
1,
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -359,7 +332,6 @@ class TestJobs:
with client.logpush.jobs.with_streaming_response.get(
1,
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -376,14 +348,12 @@ class TestJobs:
client.logpush.jobs.with_raw_response.get(
1,
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.logpush.jobs.with_raw_response.get(
1,
account_id="string",
zone_id="",
)
@ -396,7 +366,6 @@ class TestAsyncJobs:
job = await async_client.logpush.jobs.create(
destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[LogpushJob], job, path=["response"])
@ -406,7 +375,6 @@ class TestAsyncJobs:
job = await async_client.logpush.jobs.create(
destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
dataset="http_requests",
enabled=False,
frequency="high",
@ -436,7 +404,6 @@ class TestAsyncJobs:
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",
)
assert response.is_closed is True
@ -450,7 +417,6 @@ class TestAsyncJobs:
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",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -467,14 +433,12 @@ class TestAsyncJobs:
await async_client.logpush.jobs.with_raw_response.create(
destination_conf="s3://mybucket/logs?region=us-west-2",
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.jobs.with_raw_response.create(
destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -483,7 +447,6 @@ class TestAsyncJobs:
job = await async_client.logpush.jobs.update(
1,
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[LogpushJob], job, path=["response"])
@ -493,7 +456,6 @@ class TestAsyncJobs:
job = await async_client.logpush.jobs.update(
1,
account_id="string",
zone_id="string",
destination_conf="s3://mybucket/logs?region=us-west-2",
enabled=False,
frequency="high",
@ -522,7 +484,6 @@ class TestAsyncJobs:
response = await async_client.logpush.jobs.with_raw_response.update(
1,
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -536,7 +497,6 @@ class TestAsyncJobs:
async with async_client.logpush.jobs.with_streaming_response.update(
1,
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -553,14 +513,12 @@ class TestAsyncJobs:
await async_client.logpush.jobs.with_raw_response.update(
1,
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.jobs.with_raw_response.update(
1,
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -568,7 +526,6 @@ class TestAsyncJobs:
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
job = await async_client.logpush.jobs.list(
account_id="string",
zone_id="string",
)
assert_matches_type(AsyncSinglePage[Optional[LogpushJob]], job, path=["response"])
@ -577,7 +534,6 @@ class TestAsyncJobs:
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(AsyncSinglePage[Optional[LogpushJob]], job, path=["response"])
@ -586,7 +542,6 @@ class TestAsyncJobs:
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
response = await async_client.logpush.jobs.with_raw_response.list(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -599,7 +554,6 @@ class TestAsyncJobs:
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
async with async_client.logpush.jobs.with_streaming_response.list(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -615,13 +569,11 @@ class TestAsyncJobs:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.logpush.jobs.with_raw_response.list(
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.jobs.with_raw_response.list(
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -630,7 +582,6 @@ class TestAsyncJobs:
job = await async_client.logpush.jobs.delete(
1,
account_id="string",
zone_id="string",
)
assert_matches_type(object, job, path=["response"])
@ -640,7 +591,6 @@ class TestAsyncJobs:
job = await async_client.logpush.jobs.delete(
1,
account_id="string",
zone_id="string",
)
assert_matches_type(object, job, path=["response"])
@ -650,7 +600,6 @@ class TestAsyncJobs:
response = await async_client.logpush.jobs.with_raw_response.delete(
1,
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -664,7 +613,6 @@ class TestAsyncJobs:
async with async_client.logpush.jobs.with_streaming_response.delete(
1,
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -681,14 +629,12 @@ class TestAsyncJobs:
await async_client.logpush.jobs.with_raw_response.delete(
1,
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.jobs.with_raw_response.delete(
1,
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -697,7 +643,6 @@ class TestAsyncJobs:
job = await async_client.logpush.jobs.get(
1,
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[LogpushJob], job, path=["response"])
@ -707,7 +652,6 @@ class TestAsyncJobs:
job = await async_client.logpush.jobs.get(
1,
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[LogpushJob], job, path=["response"])
@ -717,7 +661,6 @@ class TestAsyncJobs:
response = await async_client.logpush.jobs.with_raw_response.get(
1,
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -731,7 +674,6 @@ class TestAsyncJobs:
async with async_client.logpush.jobs.with_streaming_response.get(
1,
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -748,12 +690,10 @@ class TestAsyncJobs:
await async_client.logpush.jobs.with_raw_response.get(
1,
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.jobs.with_raw_response.get(
1,
account_id="string",
zone_id="",
)

View file

@ -24,7 +24,6 @@ class TestOwnership:
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,7 +33,6 @@ class TestOwnership:
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"])
@ -44,7 +42,6 @@ class TestOwnership:
response = client.logpush.ownership.with_raw_response.create(
destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -58,7 +55,6 @@ class TestOwnership:
with client.logpush.ownership.with_streaming_response.create(
destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -75,14 +71,12 @@ class TestOwnership:
client.logpush.ownership.with_raw_response.create(
destination_conf="s3://mybucket/logs?region=us-west-2",
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.create(
destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -92,7 +86,6 @@ class TestOwnership:
destination_conf="s3://mybucket/logs?region=us-west-2",
ownership_challenge="00000000000000000000",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[OwnershipValidation], ownership, path=["response"])
@ -103,7 +96,6 @@ class TestOwnership:
destination_conf="s3://mybucket/logs?region=us-west-2",
ownership_challenge="00000000000000000000",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[OwnershipValidation], ownership, path=["response"])
@ -114,7 +106,6 @@ class TestOwnership:
destination_conf="s3://mybucket/logs?region=us-west-2",
ownership_challenge="00000000000000000000",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -129,7 +120,6 @@ class TestOwnership:
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"
@ -147,7 +137,6 @@ class TestOwnership:
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 ''"):
@ -155,7 +144,6 @@ class TestOwnership:
destination_conf="s3://mybucket/logs?region=us-west-2",
ownership_challenge="00000000000000000000",
account_id="string",
zone_id="",
)
@ -168,7 +156,6 @@ class TestAsyncOwnership:
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"])
@ -178,7 +165,6 @@ class TestAsyncOwnership:
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"])
@ -188,7 +174,6 @@ class TestAsyncOwnership:
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",
)
assert response.is_closed is True
@ -202,7 +187,6 @@ class TestAsyncOwnership:
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",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -219,14 +203,12 @@ class TestAsyncOwnership:
await async_client.logpush.ownership.with_raw_response.create(
destination_conf="s3://mybucket/logs?region=us-west-2",
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.create(
destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -236,7 +218,6 @@ class TestAsyncOwnership:
destination_conf="s3://mybucket/logs?region=us-west-2",
ownership_challenge="00000000000000000000",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[OwnershipValidation], ownership, path=["response"])
@ -247,7 +228,6 @@ class TestAsyncOwnership:
destination_conf="s3://mybucket/logs?region=us-west-2",
ownership_challenge="00000000000000000000",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[OwnershipValidation], ownership, path=["response"])
@ -258,7 +238,6 @@ class TestAsyncOwnership:
destination_conf="s3://mybucket/logs?region=us-west-2",
ownership_challenge="00000000000000000000",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -273,7 +252,6 @@ class TestAsyncOwnership:
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"
@ -291,7 +269,6 @@ class TestAsyncOwnership:
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 ''"):
@ -299,5 +276,4 @@ class TestAsyncOwnership:
destination_conf="s3://mybucket/logs?region=us-west-2",
ownership_challenge="00000000000000000000",
account_id="string",
zone_id="",
)

View file

@ -24,7 +24,6 @@ class TestValidate:
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,7 +33,6 @@ class TestValidate:
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"])
@ -44,7 +42,6 @@ class TestValidate:
response = client.logpush.validate.with_raw_response.destination(
destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -58,7 +55,6 @@ class TestValidate:
with client.logpush.validate.with_streaming_response.destination(
destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -75,14 +71,12 @@ class TestValidate:
client.logpush.validate.with_raw_response.destination(
destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="",
zone_id="string",
)
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="",
)
@pytest.mark.skip()
@ -91,7 +85,6 @@ class TestValidate:
validate = client.logpush.validate.origin(
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ValidateOriginResponse], validate, path=["response"])
@ -101,7 +94,6 @@ class TestValidate:
validate = client.logpush.validate.origin(
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ValidateOriginResponse], validate, path=["response"])
@ -111,7 +103,6 @@ class TestValidate:
response = client.logpush.validate.with_raw_response.origin(
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -125,7 +116,6 @@ class TestValidate:
with client.logpush.validate.with_streaming_response.origin(
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -142,14 +132,12 @@ class TestValidate:
client.logpush.validate.with_raw_response.origin(
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
account_id="",
zone_id="string",
)
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&timestamps=rfc3339",
account_id="string",
zone_id="",
)
@ -162,7 +150,6 @@ class TestAsyncValidate:
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"])
@ -172,7 +159,6 @@ class TestAsyncValidate:
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"])
@ -182,7 +168,6 @@ class TestAsyncValidate:
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",
)
assert response.is_closed is True
@ -196,7 +181,6 @@ class TestAsyncValidate:
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",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -213,14 +197,12 @@ class TestAsyncValidate:
await async_client.logpush.validate.with_raw_response.destination(
destination_conf="s3://mybucket/logs?region=us-west-2",
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.validate.with_raw_response.destination(
destination_conf="s3://mybucket/logs?region=us-west-2",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -229,7 +211,6 @@ class TestAsyncValidate:
validate = await async_client.logpush.validate.origin(
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ValidateOriginResponse], validate, path=["response"])
@ -239,7 +220,6 @@ class TestAsyncValidate:
validate = await async_client.logpush.validate.origin(
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ValidateOriginResponse], validate, path=["response"])
@ -249,7 +229,6 @@ class TestAsyncValidate:
response = await async_client.logpush.validate.with_raw_response.origin(
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -263,7 +242,6 @@ class TestAsyncValidate:
async with async_client.logpush.validate.with_streaming_response.origin(
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -280,12 +258,10 @@ class TestAsyncValidate:
await async_client.logpush.validate.with_raw_response.origin(
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
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.validate.with_raw_response.origin(
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
account_id="string",
zone_id="",
)

View file

@ -25,7 +25,6 @@ class TestVersions:
version = client.rulesets.phases.versions.list(
"http_request_firewall_custom",
account_id="string",
zone_id="string",
)
assert_matches_type(SyncSinglePage[Ruleset], version, path=["response"])
@ -35,7 +34,6 @@ class TestVersions:
version = client.rulesets.phases.versions.list(
"http_request_firewall_custom",
account_id="string",
zone_id="string",
)
assert_matches_type(SyncSinglePage[Ruleset], version, path=["response"])
@ -45,7 +43,6 @@ class TestVersions:
response = client.rulesets.phases.versions.with_raw_response.list(
"http_request_firewall_custom",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -59,7 +56,6 @@ class TestVersions:
with client.rulesets.phases.versions.with_streaming_response.list(
"http_request_firewall_custom",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -76,14 +72,12 @@ class TestVersions:
client.rulesets.phases.versions.with_raw_response.list(
"http_request_firewall_custom",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.rulesets.phases.versions.with_raw_response.list(
"http_request_firewall_custom",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -93,7 +87,6 @@ class TestVersions:
"1",
ruleset_phase="http_request_firewall_custom",
account_id="string",
zone_id="string",
)
assert_matches_type(VersionGetResponse, version, path=["response"])
@ -104,7 +97,6 @@ class TestVersions:
"1",
ruleset_phase="http_request_firewall_custom",
account_id="string",
zone_id="string",
)
assert_matches_type(VersionGetResponse, version, path=["response"])
@ -115,7 +107,6 @@ class TestVersions:
"1",
ruleset_phase="http_request_firewall_custom",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -130,7 +121,6 @@ class TestVersions:
"1",
ruleset_phase="http_request_firewall_custom",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -148,7 +138,6 @@ class TestVersions:
"",
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 ''"):
@ -156,7 +145,6 @@ class TestVersions:
"1",
ruleset_phase="http_request_firewall_custom",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -164,7 +152,6 @@ class TestVersions:
"1",
ruleset_phase="http_request_firewall_custom",
account_id="string",
zone_id="",
)
@ -177,7 +164,6 @@ class TestAsyncVersions:
version = await async_client.rulesets.phases.versions.list(
"http_request_firewall_custom",
account_id="string",
zone_id="string",
)
assert_matches_type(AsyncSinglePage[Ruleset], version, path=["response"])
@ -187,7 +173,6 @@ class TestAsyncVersions:
version = await async_client.rulesets.phases.versions.list(
"http_request_firewall_custom",
account_id="string",
zone_id="string",
)
assert_matches_type(AsyncSinglePage[Ruleset], version, path=["response"])
@ -197,7 +182,6 @@ class TestAsyncVersions:
response = await async_client.rulesets.phases.versions.with_raw_response.list(
"http_request_firewall_custom",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -211,7 +195,6 @@ class TestAsyncVersions:
async with async_client.rulesets.phases.versions.with_streaming_response.list(
"http_request_firewall_custom",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -228,14 +211,12 @@ class TestAsyncVersions:
await async_client.rulesets.phases.versions.with_raw_response.list(
"http_request_firewall_custom",
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.versions.with_raw_response.list(
"http_request_firewall_custom",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -245,7 +226,6 @@ class TestAsyncVersions:
"1",
ruleset_phase="http_request_firewall_custom",
account_id="string",
zone_id="string",
)
assert_matches_type(VersionGetResponse, version, path=["response"])
@ -256,7 +236,6 @@ class TestAsyncVersions:
"1",
ruleset_phase="http_request_firewall_custom",
account_id="string",
zone_id="string",
)
assert_matches_type(VersionGetResponse, version, path=["response"])
@ -267,7 +246,6 @@ class TestAsyncVersions:
"1",
ruleset_phase="http_request_firewall_custom",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -282,7 +260,6 @@ class TestAsyncVersions:
"1",
ruleset_phase="http_request_firewall_custom",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -300,7 +277,6 @@ class TestAsyncVersions:
"",
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 ''"):
@ -308,7 +284,6 @@ class TestAsyncVersions:
"1",
ruleset_phase="http_request_firewall_custom",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -316,5 +291,4 @@ class TestAsyncVersions:
"1",
ruleset_phase="http_request_firewall_custom",
account_id="string",
zone_id="",
)

View file

@ -25,7 +25,6 @@ class TestPhases:
"http_request_firewall_custom",
rules=[{}, {}, {}],
account_id="string",
zone_id="string",
)
assert_matches_type(PhaseUpdateResponse, phase, path=["response"])
@ -85,7 +84,6 @@ class TestPhases:
},
],
account_id="string",
zone_id="string",
description="My ruleset to execute managed rulesets",
kind="root",
name="My ruleset",
@ -100,7 +98,6 @@ class TestPhases:
"http_request_firewall_custom",
rules=[{}, {}, {}],
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -115,7 +112,6 @@ class TestPhases:
"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"
@ -133,7 +129,6 @@ class TestPhases:
"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 ''"):
@ -141,7 +136,6 @@ class TestPhases:
"http_request_firewall_custom",
rules=[{}, {}, {}],
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -150,7 +144,6 @@ class TestPhases:
phase = client.rulesets.phases.get(
"http_request_firewall_custom",
account_id="string",
zone_id="string",
)
assert_matches_type(PhaseGetResponse, phase, path=["response"])
@ -160,7 +153,6 @@ class TestPhases:
phase = client.rulesets.phases.get(
"http_request_firewall_custom",
account_id="string",
zone_id="string",
)
assert_matches_type(PhaseGetResponse, phase, path=["response"])
@ -170,7 +162,6 @@ class TestPhases:
response = client.rulesets.phases.with_raw_response.get(
"http_request_firewall_custom",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -184,7 +175,6 @@ class TestPhases:
with client.rulesets.phases.with_streaming_response.get(
"http_request_firewall_custom",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -201,14 +191,12 @@ class TestPhases:
client.rulesets.phases.with_raw_response.get(
"http_request_firewall_custom",
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.get(
"http_request_firewall_custom",
account_id="string",
zone_id="",
)
@ -222,7 +210,6 @@ class TestAsyncPhases:
"http_request_firewall_custom",
rules=[{}, {}, {}],
account_id="string",
zone_id="string",
)
assert_matches_type(PhaseUpdateResponse, phase, path=["response"])
@ -282,7 +269,6 @@ class TestAsyncPhases:
},
],
account_id="string",
zone_id="string",
description="My ruleset to execute managed rulesets",
kind="root",
name="My ruleset",
@ -297,7 +283,6 @@ class TestAsyncPhases:
"http_request_firewall_custom",
rules=[{}, {}, {}],
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -312,7 +297,6 @@ class TestAsyncPhases:
"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"
@ -330,7 +314,6 @@ class TestAsyncPhases:
"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 ''"):
@ -338,7 +321,6 @@ class TestAsyncPhases:
"http_request_firewall_custom",
rules=[{}, {}, {}],
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -347,7 +329,6 @@ class TestAsyncPhases:
phase = await async_client.rulesets.phases.get(
"http_request_firewall_custom",
account_id="string",
zone_id="string",
)
assert_matches_type(PhaseGetResponse, phase, path=["response"])
@ -357,7 +338,6 @@ class TestAsyncPhases:
phase = await async_client.rulesets.phases.get(
"http_request_firewall_custom",
account_id="string",
zone_id="string",
)
assert_matches_type(PhaseGetResponse, phase, path=["response"])
@ -367,7 +347,6 @@ class TestAsyncPhases:
response = await async_client.rulesets.phases.with_raw_response.get(
"http_request_firewall_custom",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -381,7 +360,6 @@ class TestAsyncPhases:
async with async_client.rulesets.phases.with_streaming_response.get(
"http_request_firewall_custom",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -398,12 +376,10 @@ class TestAsyncPhases:
await async_client.rulesets.phases.with_raw_response.get(
"http_request_firewall_custom",
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.get(
"http_request_firewall_custom",
account_id="string",
zone_id="",
)

File diff suppressed because it is too large Load diff

View file

@ -25,7 +25,6 @@ class TestVersions:
version = client.rulesets.versions.list(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert_matches_type(SyncSinglePage[Ruleset], version, path=["response"])
@ -35,7 +34,6 @@ class TestVersions:
version = client.rulesets.versions.list(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert_matches_type(SyncSinglePage[Ruleset], version, path=["response"])
@ -45,7 +43,6 @@ class TestVersions:
response = client.rulesets.versions.with_raw_response.list(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -59,7 +56,6 @@ class TestVersions:
with client.rulesets.versions.with_streaming_response.list(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -76,21 +72,18 @@ class TestVersions:
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",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.rulesets.versions.with_raw_response.list(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -100,7 +93,6 @@ class TestVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert version is None
@ -111,7 +103,6 @@ class TestVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert version is None
@ -122,7 +113,6 @@ class TestVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -137,7 +127,6 @@ class TestVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -155,7 +144,6 @@ class TestVersions:
"1",
ruleset_id="",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"):
@ -163,7 +151,6 @@ class TestVersions:
"",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
@ -171,7 +158,6 @@ class TestVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -179,7 +165,6 @@ class TestVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -189,7 +174,6 @@ class TestVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert_matches_type(VersionGetResponse, version, path=["response"])
@ -200,7 +184,6 @@ class TestVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert_matches_type(VersionGetResponse, version, path=["response"])
@ -211,7 +194,6 @@ class TestVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -226,7 +208,6 @@ class TestVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -244,7 +225,6 @@ class TestVersions:
"1",
ruleset_id="",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"):
@ -252,7 +232,6 @@ class TestVersions:
"",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
@ -260,7 +239,6 @@ class TestVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -268,7 +246,6 @@ class TestVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="",
)
@ -281,7 +258,6 @@ class TestAsyncVersions:
version = await async_client.rulesets.versions.list(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert_matches_type(AsyncSinglePage[Ruleset], version, path=["response"])
@ -291,7 +267,6 @@ class TestAsyncVersions:
version = await async_client.rulesets.versions.list(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert_matches_type(AsyncSinglePage[Ruleset], version, path=["response"])
@ -301,7 +276,6 @@ class TestAsyncVersions:
response = await async_client.rulesets.versions.with_raw_response.list(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -315,7 +289,6 @@ class TestAsyncVersions:
async with async_client.rulesets.versions.with_streaming_response.list(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -332,21 +305,18 @@ class TestAsyncVersions:
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",
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.versions.with_raw_response.list(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -356,7 +326,6 @@ class TestAsyncVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert version is None
@ -367,7 +336,6 @@ class TestAsyncVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert version is None
@ -378,7 +346,6 @@ class TestAsyncVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -393,7 +360,6 @@ class TestAsyncVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -411,7 +377,6 @@ class TestAsyncVersions:
"1",
ruleset_id="",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"):
@ -419,7 +384,6 @@ class TestAsyncVersions:
"",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
@ -427,7 +391,6 @@ class TestAsyncVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -435,7 +398,6 @@ class TestAsyncVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -445,7 +407,6 @@ class TestAsyncVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert_matches_type(VersionGetResponse, version, path=["response"])
@ -456,7 +417,6 @@ class TestAsyncVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert_matches_type(VersionGetResponse, version, path=["response"])
@ -467,7 +427,6 @@ class TestAsyncVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -482,7 +441,6 @@ class TestAsyncVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -500,7 +458,6 @@ class TestAsyncVersions:
"1",
ruleset_id="",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"):
@ -508,7 +465,6 @@ class TestAsyncVersions:
"",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
@ -516,7 +472,6 @@ class TestAsyncVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -524,5 +479,4 @@ class TestAsyncVersions:
"1",
ruleset_id="2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="",
)

View file

@ -30,7 +30,6 @@ class TestRulesets:
phase="http_request_firewall_custom",
rules=[{}, {}, {}],
account_id="string",
zone_id="string",
)
assert_matches_type(RulesetCreateResponse, ruleset, path=["response"])
@ -92,7 +91,6 @@ class TestRulesets:
},
],
account_id="string",
zone_id="string",
description="My ruleset to execute managed rulesets",
)
assert_matches_type(RulesetCreateResponse, ruleset, path=["response"])
@ -106,7 +104,6 @@ class TestRulesets:
phase="http_request_firewall_custom",
rules=[{}, {}, {}],
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -123,7 +120,6 @@ class TestRulesets:
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"
@ -143,7 +139,6 @@ class TestRulesets:
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 ''"):
@ -153,7 +148,6 @@ class TestRulesets:
phase="http_request_firewall_custom",
rules=[{}, {}, {}],
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -163,7 +157,6 @@ class TestRulesets:
"2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
account_id="string",
zone_id="string",
)
assert_matches_type(RulesetUpdateResponse, ruleset, path=["response"])
@ -223,7 +216,6 @@ class TestRulesets:
},
],
account_id="string",
zone_id="string",
description="My ruleset to execute managed rulesets",
kind="root",
name="My ruleset",
@ -238,7 +230,6 @@ class TestRulesets:
"2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -253,7 +244,6 @@ class TestRulesets:
"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,7 +261,6 @@ class TestRulesets:
"",
rules=[{}, {}, {}],
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
@ -279,7 +268,6 @@ class TestRulesets:
"2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -287,7 +275,6 @@ class TestRulesets:
"2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -295,7 +282,6 @@ class TestRulesets:
def test_method_list(self, client: Cloudflare) -> None:
ruleset = client.rulesets.list(
account_id="string",
zone_id="string",
)
assert_matches_type(SyncSinglePage[Ruleset], ruleset, path=["response"])
@ -304,7 +290,6 @@ class TestRulesets:
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
ruleset = client.rulesets.list(
account_id="string",
zone_id="string",
)
assert_matches_type(SyncSinglePage[Ruleset], ruleset, path=["response"])
@ -313,7 +298,6 @@ class TestRulesets:
def test_raw_response_list(self, client: Cloudflare) -> None:
response = client.rulesets.with_raw_response.list(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -326,7 +310,6 @@ class TestRulesets:
def test_streaming_response_list(self, client: Cloudflare) -> None:
with client.rulesets.with_streaming_response.list(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -342,13 +325,11 @@ class TestRulesets:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.rulesets.with_raw_response.list(
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.list(
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -357,7 +338,6 @@ class TestRulesets:
ruleset = client.rulesets.delete(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert ruleset is None
@ -367,7 +347,6 @@ class TestRulesets:
ruleset = client.rulesets.delete(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert ruleset is None
@ -377,7 +356,6 @@ class TestRulesets:
response = client.rulesets.with_raw_response.delete(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -391,7 +369,6 @@ class TestRulesets:
with client.rulesets.with_streaming_response.delete(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -408,21 +385,18 @@ class TestRulesets:
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",
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.delete(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -431,7 +405,6 @@ class TestRulesets:
ruleset = client.rulesets.get(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert_matches_type(RulesetGetResponse, ruleset, path=["response"])
@ -441,7 +414,6 @@ class TestRulesets:
ruleset = client.rulesets.get(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert_matches_type(RulesetGetResponse, ruleset, path=["response"])
@ -451,7 +423,6 @@ class TestRulesets:
response = client.rulesets.with_raw_response.get(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -465,7 +436,6 @@ class TestRulesets:
with client.rulesets.with_streaming_response.get(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -482,21 +452,18 @@ class TestRulesets:
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",
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.get(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="",
)
@ -512,7 +479,6 @@ class TestAsyncRulesets:
phase="http_request_firewall_custom",
rules=[{}, {}, {}],
account_id="string",
zone_id="string",
)
assert_matches_type(RulesetCreateResponse, ruleset, path=["response"])
@ -574,7 +540,6 @@ class TestAsyncRulesets:
},
],
account_id="string",
zone_id="string",
description="My ruleset to execute managed rulesets",
)
assert_matches_type(RulesetCreateResponse, ruleset, path=["response"])
@ -588,7 +553,6 @@ class TestAsyncRulesets:
phase="http_request_firewall_custom",
rules=[{}, {}, {}],
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -605,7 +569,6 @@ class TestAsyncRulesets:
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"
@ -625,7 +588,6 @@ class TestAsyncRulesets:
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 ''"):
@ -635,7 +597,6 @@ class TestAsyncRulesets:
phase="http_request_firewall_custom",
rules=[{}, {}, {}],
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -645,7 +606,6 @@ class TestAsyncRulesets:
"2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
account_id="string",
zone_id="string",
)
assert_matches_type(RulesetUpdateResponse, ruleset, path=["response"])
@ -705,7 +665,6 @@ class TestAsyncRulesets:
},
],
account_id="string",
zone_id="string",
description="My ruleset to execute managed rulesets",
kind="root",
name="My ruleset",
@ -720,7 +679,6 @@ class TestAsyncRulesets:
"2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -735,7 +693,6 @@ class TestAsyncRulesets:
"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"
@ -753,7 +710,6 @@ class TestAsyncRulesets:
"",
rules=[{}, {}, {}],
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
@ -761,7 +717,6 @@ class TestAsyncRulesets:
"2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -769,7 +724,6 @@ class TestAsyncRulesets:
"2f2feab2026849078ba485f918791bdc",
rules=[{}, {}, {}],
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -777,7 +731,6 @@ class TestAsyncRulesets:
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
ruleset = await async_client.rulesets.list(
account_id="string",
zone_id="string",
)
assert_matches_type(AsyncSinglePage[Ruleset], ruleset, path=["response"])
@ -786,7 +739,6 @@ class TestAsyncRulesets:
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(AsyncSinglePage[Ruleset], ruleset, path=["response"])
@ -795,7 +747,6 @@ class TestAsyncRulesets:
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
response = await async_client.rulesets.with_raw_response.list(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -808,7 +759,6 @@ class TestAsyncRulesets:
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
async with async_client.rulesets.with_streaming_response.list(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -824,13 +774,11 @@ class TestAsyncRulesets:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.rulesets.with_raw_response.list(
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.list(
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -839,7 +787,6 @@ class TestAsyncRulesets:
ruleset = await async_client.rulesets.delete(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert ruleset is None
@ -849,7 +796,6 @@ class TestAsyncRulesets:
ruleset = await async_client.rulesets.delete(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert ruleset is None
@ -859,7 +805,6 @@ class TestAsyncRulesets:
response = await async_client.rulesets.with_raw_response.delete(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -873,7 +818,6 @@ class TestAsyncRulesets:
async with async_client.rulesets.with_streaming_response.delete(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -890,21 +834,18 @@ class TestAsyncRulesets:
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",
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.delete(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -913,7 +854,6 @@ class TestAsyncRulesets:
ruleset = await async_client.rulesets.get(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert_matches_type(RulesetGetResponse, ruleset, path=["response"])
@ -923,7 +863,6 @@ class TestAsyncRulesets:
ruleset = await async_client.rulesets.get(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert_matches_type(RulesetGetResponse, ruleset, path=["response"])
@ -933,7 +872,6 @@ class TestAsyncRulesets:
response = await async_client.rulesets.with_raw_response.get(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -947,7 +885,6 @@ class TestAsyncRulesets:
async with async_client.rulesets.with_streaming_response.get(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -964,19 +901,16 @@ class TestAsyncRulesets:
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",
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.get(
"2f2feab2026849078ba485f918791bdc",
account_id="string",
zone_id="",
)

View file

@ -27,7 +27,6 @@ class TestCAs:
ca = client.zero_trust.access.applications.cas.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[CACreateResponse], ca, path=["response"])
@ -37,7 +36,6 @@ class TestCAs:
ca = client.zero_trust.access.applications.cas.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[CACreateResponse], ca, path=["response"])
@ -47,7 +45,6 @@ class TestCAs:
response = client.zero_trust.access.applications.cas.with_raw_response.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -61,7 +58,6 @@ class TestCAs:
with client.zero_trust.access.applications.cas.with_streaming_response.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -78,21 +74,18 @@ class TestCAs:
client.zero_trust.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.zero_trust.access.applications.cas.with_raw_response.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.access.applications.cas.with_raw_response.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -100,7 +93,6 @@ class TestCAs:
def test_method_list(self, client: Cloudflare) -> None:
ca = client.zero_trust.access.applications.cas.list(
account_id="string",
zone_id="string",
)
assert_matches_type(SyncSinglePage[CA], ca, path=["response"])
@ -109,7 +101,6 @@ class TestCAs:
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
ca = client.zero_trust.access.applications.cas.list(
account_id="string",
zone_id="string",
)
assert_matches_type(SyncSinglePage[CA], ca, path=["response"])
@ -118,7 +109,6 @@ class TestCAs:
def test_raw_response_list(self, client: Cloudflare) -> None:
response = client.zero_trust.access.applications.cas.with_raw_response.list(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -131,7 +121,6 @@ class TestCAs:
def test_streaming_response_list(self, client: Cloudflare) -> None:
with client.zero_trust.access.applications.cas.with_streaming_response.list(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -147,13 +136,11 @@ class TestCAs:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.zero_trust.access.applications.cas.with_raw_response.list(
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.access.applications.cas.with_raw_response.list(
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -162,7 +149,6 @@ class TestCAs:
ca = client.zero_trust.access.applications.cas.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[CADeleteResponse], ca, path=["response"])
@ -172,7 +158,6 @@ class TestCAs:
ca = client.zero_trust.access.applications.cas.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[CADeleteResponse], ca, path=["response"])
@ -182,7 +167,6 @@ class TestCAs:
response = client.zero_trust.access.applications.cas.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -196,7 +180,6 @@ class TestCAs:
with client.zero_trust.access.applications.cas.with_streaming_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -213,21 +196,18 @@ class TestCAs:
client.zero_trust.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.zero_trust.access.applications.cas.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.access.applications.cas.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -236,7 +216,6 @@ class TestCAs:
ca = client.zero_trust.access.applications.cas.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[CAGetResponse], ca, path=["response"])
@ -246,7 +225,6 @@ class TestCAs:
ca = client.zero_trust.access.applications.cas.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[CAGetResponse], ca, path=["response"])
@ -256,7 +234,6 @@ class TestCAs:
response = client.zero_trust.access.applications.cas.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -270,7 +247,6 @@ class TestCAs:
with client.zero_trust.access.applications.cas.with_streaming_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -287,21 +263,18 @@ class TestCAs:
client.zero_trust.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.zero_trust.access.applications.cas.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.access.applications.cas.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@ -314,7 +287,6 @@ class TestAsyncCAs:
ca = await async_client.zero_trust.access.applications.cas.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[CACreateResponse], ca, path=["response"])
@ -324,7 +296,6 @@ class TestAsyncCAs:
ca = await async_client.zero_trust.access.applications.cas.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[CACreateResponse], ca, path=["response"])
@ -334,7 +305,6 @@ class TestAsyncCAs:
response = await async_client.zero_trust.access.applications.cas.with_raw_response.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -348,7 +318,6 @@ class TestAsyncCAs:
async with async_client.zero_trust.access.applications.cas.with_streaming_response.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -365,21 +334,18 @@ class TestAsyncCAs:
await async_client.zero_trust.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.zero_trust.access.applications.cas.with_raw_response.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.access.applications.cas.with_raw_response.create(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -387,7 +353,6 @@ class TestAsyncCAs:
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
ca = await async_client.zero_trust.access.applications.cas.list(
account_id="string",
zone_id="string",
)
assert_matches_type(AsyncSinglePage[CA], ca, path=["response"])
@ -396,7 +361,6 @@ class TestAsyncCAs:
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
ca = await async_client.zero_trust.access.applications.cas.list(
account_id="string",
zone_id="string",
)
assert_matches_type(AsyncSinglePage[CA], ca, path=["response"])
@ -405,7 +369,6 @@ class TestAsyncCAs:
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
response = await async_client.zero_trust.access.applications.cas.with_raw_response.list(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -418,7 +381,6 @@ class TestAsyncCAs:
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
async with async_client.zero_trust.access.applications.cas.with_streaming_response.list(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -434,13 +396,11 @@ class TestAsyncCAs:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.zero_trust.access.applications.cas.with_raw_response.list(
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.access.applications.cas.with_raw_response.list(
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -449,7 +409,6 @@ class TestAsyncCAs:
ca = await async_client.zero_trust.access.applications.cas.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[CADeleteResponse], ca, path=["response"])
@ -459,7 +418,6 @@ class TestAsyncCAs:
ca = await async_client.zero_trust.access.applications.cas.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[CADeleteResponse], ca, path=["response"])
@ -469,7 +427,6 @@ class TestAsyncCAs:
response = await async_client.zero_trust.access.applications.cas.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -483,7 +440,6 @@ class TestAsyncCAs:
async with async_client.zero_trust.access.applications.cas.with_streaming_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -500,21 +456,18 @@ class TestAsyncCAs:
await async_client.zero_trust.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.zero_trust.access.applications.cas.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.access.applications.cas.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -523,7 +476,6 @@ class TestAsyncCAs:
ca = await async_client.zero_trust.access.applications.cas.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[CAGetResponse], ca, path=["response"])
@ -533,7 +485,6 @@ class TestAsyncCAs:
ca = await async_client.zero_trust.access.applications.cas.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[CAGetResponse], ca, path=["response"])
@ -543,7 +494,6 @@ class TestAsyncCAs:
response = await async_client.zero_trust.access.applications.cas.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -557,7 +507,6 @@ class TestAsyncCAs:
async with async_client.zero_trust.access.applications.cas.with_streaming_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -574,19 +523,16 @@ class TestAsyncCAs:
await async_client.zero_trust.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.zero_trust.access.applications.cas.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.access.applications.cas.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)

View file

@ -32,7 +32,6 @@ class TestPolicies:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Policy], policy, path=["response"])
@ -49,7 +48,6 @@ class TestPolicies:
],
name="Allow devs",
account_id="string",
zone_id="string",
approval_groups=[
{
"approvals_needed": 1,
@ -94,7 +92,6 @@ class TestPolicies:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -115,7 +112,6 @@ class TestPolicies:
],
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"
@ -139,7 +135,6 @@ class TestPolicies:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
@ -153,7 +148,6 @@ class TestPolicies:
],
name="Allow devs",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -167,7 +161,6 @@ class TestPolicies:
],
name="Allow devs",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -184,7 +177,6 @@ class TestPolicies:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Policy], policy, path=["response"])
@ -202,7 +194,6 @@ class TestPolicies:
],
name="Allow devs",
account_id="string",
zone_id="string",
approval_groups=[
{
"approvals_needed": 1,
@ -248,7 +239,6 @@ class TestPolicies:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -270,7 +260,6 @@ class TestPolicies:
],
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"
@ -295,7 +284,6 @@ class TestPolicies:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
@ -310,7 +298,6 @@ class TestPolicies:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
@ -325,7 +312,6 @@ class TestPolicies:
],
name="Allow devs",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -340,7 +326,6 @@ class TestPolicies:
],
name="Allow devs",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -349,7 +334,6 @@ class TestPolicies:
policy = client.zero_trust.access.applications.policies.list(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(SyncSinglePage[Policy], policy, path=["response"])
@ -359,7 +343,6 @@ class TestPolicies:
policy = client.zero_trust.access.applications.policies.list(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(SyncSinglePage[Policy], policy, path=["response"])
@ -369,7 +352,6 @@ class TestPolicies:
response = client.zero_trust.access.applications.policies.with_raw_response.list(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -383,7 +365,6 @@ class TestPolicies:
with client.zero_trust.access.applications.policies.with_streaming_response.list(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -400,21 +381,18 @@ class TestPolicies:
client.zero_trust.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.zero_trust.access.applications.policies.with_raw_response.list(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.access.applications.policies.with_raw_response.list(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -424,7 +402,6 @@ class TestPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[PolicyDeleteResponse], policy, path=["response"])
@ -435,7 +412,6 @@ class TestPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[PolicyDeleteResponse], policy, path=["response"])
@ -446,7 +422,6 @@ class TestPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -461,7 +436,6 @@ class TestPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -479,7 +453,6 @@ class TestPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
@ -487,7 +460,6 @@ class TestPolicies:
"",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
@ -495,7 +467,6 @@ class TestPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -503,7 +474,6 @@ class TestPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -513,7 +483,6 @@ class TestPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Policy], policy, path=["response"])
@ -524,7 +493,6 @@ class TestPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Policy], policy, path=["response"])
@ -535,7 +503,6 @@ class TestPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -550,7 +517,6 @@ class TestPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -568,7 +534,6 @@ class TestPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
@ -576,7 +541,6 @@ class TestPolicies:
"",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
@ -584,7 +548,6 @@ class TestPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -592,7 +555,6 @@ class TestPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@ -612,7 +574,6 @@ class TestAsyncPolicies:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Policy], policy, path=["response"])
@ -629,7 +590,6 @@ class TestAsyncPolicies:
],
name="Allow devs",
account_id="string",
zone_id="string",
approval_groups=[
{
"approvals_needed": 1,
@ -674,7 +634,6 @@ class TestAsyncPolicies:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -695,7 +654,6 @@ class TestAsyncPolicies:
],
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"
@ -719,7 +677,6 @@ class TestAsyncPolicies:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
@ -733,7 +690,6 @@ class TestAsyncPolicies:
],
name="Allow devs",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -747,7 +703,6 @@ class TestAsyncPolicies:
],
name="Allow devs",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -764,7 +719,6 @@ class TestAsyncPolicies:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Policy], policy, path=["response"])
@ -782,7 +736,6 @@ class TestAsyncPolicies:
],
name="Allow devs",
account_id="string",
zone_id="string",
approval_groups=[
{
"approvals_needed": 1,
@ -828,7 +781,6 @@ class TestAsyncPolicies:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -850,7 +802,6 @@ class TestAsyncPolicies:
],
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"
@ -875,7 +826,6 @@ class TestAsyncPolicies:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
@ -890,7 +840,6 @@ class TestAsyncPolicies:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
@ -905,7 +854,6 @@ class TestAsyncPolicies:
],
name="Allow devs",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -920,7 +868,6 @@ class TestAsyncPolicies:
],
name="Allow devs",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -929,7 +876,6 @@ class TestAsyncPolicies:
policy = await async_client.zero_trust.access.applications.policies.list(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(AsyncSinglePage[Policy], policy, path=["response"])
@ -939,7 +885,6 @@ class TestAsyncPolicies:
policy = await async_client.zero_trust.access.applications.policies.list(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(AsyncSinglePage[Policy], policy, path=["response"])
@ -949,7 +894,6 @@ class TestAsyncPolicies:
response = await async_client.zero_trust.access.applications.policies.with_raw_response.list(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -963,7 +907,6 @@ class TestAsyncPolicies:
async with async_client.zero_trust.access.applications.policies.with_streaming_response.list(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -980,21 +923,18 @@ class TestAsyncPolicies:
await async_client.zero_trust.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.zero_trust.access.applications.policies.with_raw_response.list(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.access.applications.policies.with_raw_response.list(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -1004,7 +944,6 @@ class TestAsyncPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[PolicyDeleteResponse], policy, path=["response"])
@ -1015,7 +954,6 @@ class TestAsyncPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[PolicyDeleteResponse], policy, path=["response"])
@ -1026,7 +964,6 @@ class TestAsyncPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -1041,7 +978,6 @@ class TestAsyncPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -1059,7 +995,6 @@ class TestAsyncPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
@ -1067,7 +1002,6 @@ class TestAsyncPolicies:
"",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
@ -1075,7 +1009,6 @@ class TestAsyncPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -1083,7 +1016,6 @@ class TestAsyncPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -1093,7 +1025,6 @@ class TestAsyncPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Policy], policy, path=["response"])
@ -1104,7 +1035,6 @@ class TestAsyncPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Policy], policy, path=["response"])
@ -1115,7 +1045,6 @@ class TestAsyncPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -1130,7 +1059,6 @@ class TestAsyncPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -1148,7 +1076,6 @@ class TestAsyncPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
@ -1156,7 +1083,6 @@ class TestAsyncPolicies:
"",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
@ -1164,7 +1090,6 @@ class TestAsyncPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -1172,5 +1097,4 @@ class TestAsyncPolicies:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
uuid1="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)

View file

@ -23,7 +23,6 @@ class TestUserPolicyChecks:
user_policy_check = client.zero_trust.access.applications.user_policy_checks.list(
"023e105f4ecef8ad9ca31a8372d0c353",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[UserPolicyCheckListResponse], user_policy_check, path=["response"])
@ -33,7 +32,6 @@ class TestUserPolicyChecks:
user_policy_check = client.zero_trust.access.applications.user_policy_checks.list(
"023e105f4ecef8ad9ca31a8372d0c353",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[UserPolicyCheckListResponse], user_policy_check, path=["response"])
@ -43,7 +41,6 @@ class TestUserPolicyChecks:
response = client.zero_trust.access.applications.user_policy_checks.with_raw_response.list(
"023e105f4ecef8ad9ca31a8372d0c353",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -57,7 +54,6 @@ class TestUserPolicyChecks:
with client.zero_trust.access.applications.user_policy_checks.with_streaming_response.list(
"023e105f4ecef8ad9ca31a8372d0c353",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -74,14 +70,12 @@ class TestUserPolicyChecks:
client.zero_trust.access.applications.user_policy_checks.with_raw_response.list(
"023e105f4ecef8ad9ca31a8372d0c353",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.access.applications.user_policy_checks.with_raw_response.list(
"023e105f4ecef8ad9ca31a8372d0c353",
account_id="string",
zone_id="",
)
@ -94,7 +88,6 @@ class TestAsyncUserPolicyChecks:
user_policy_check = await async_client.zero_trust.access.applications.user_policy_checks.list(
"023e105f4ecef8ad9ca31a8372d0c353",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[UserPolicyCheckListResponse], user_policy_check, path=["response"])
@ -104,7 +97,6 @@ class TestAsyncUserPolicyChecks:
user_policy_check = await async_client.zero_trust.access.applications.user_policy_checks.list(
"023e105f4ecef8ad9ca31a8372d0c353",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[UserPolicyCheckListResponse], user_policy_check, path=["response"])
@ -114,7 +106,6 @@ class TestAsyncUserPolicyChecks:
response = await async_client.zero_trust.access.applications.user_policy_checks.with_raw_response.list(
"023e105f4ecef8ad9ca31a8372d0c353",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -128,7 +119,6 @@ class TestAsyncUserPolicyChecks:
async with async_client.zero_trust.access.applications.user_policy_checks.with_streaming_response.list(
"023e105f4ecef8ad9ca31a8372d0c353",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -145,12 +135,10 @@ class TestAsyncUserPolicyChecks:
await async_client.zero_trust.access.applications.user_policy_checks.with_raw_response.list(
"023e105f4ecef8ad9ca31a8372d0c353",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.access.applications.user_policy_checks.with_raw_response.list(
"023e105f4ecef8ad9ca31a8372d0c353",
account_id="string",
zone_id="",
)

View file

@ -40,7 +40,6 @@ class TestSettings:
},
],
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"])
@ -66,7 +65,6 @@ class TestSettings:
},
],
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"])
@ -92,7 +90,6 @@ class TestSettings:
},
],
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -122,7 +119,6 @@ class TestSettings:
},
],
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -155,7 +151,6 @@ class TestSettings:
},
],
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -178,7 +173,6 @@ class TestSettings:
},
],
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -186,7 +180,6 @@ class TestSettings:
def test_method_get(self, client: Cloudflare) -> None:
setting = client.zero_trust.access.certificates.settings.get(
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[SettingGetResponse], setting, path=["response"])
@ -195,7 +188,6 @@ class TestSettings:
def test_method_get_with_all_params(self, client: Cloudflare) -> None:
setting = client.zero_trust.access.certificates.settings.get(
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[SettingGetResponse], setting, path=["response"])
@ -204,7 +196,6 @@ class TestSettings:
def test_raw_response_get(self, client: Cloudflare) -> None:
response = client.zero_trust.access.certificates.settings.with_raw_response.get(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -217,7 +208,6 @@ class TestSettings:
def test_streaming_response_get(self, client: Cloudflare) -> None:
with client.zero_trust.access.certificates.settings.with_streaming_response.get(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -233,13 +223,11 @@ class TestSettings:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.zero_trust.access.certificates.settings.with_raw_response.get(
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.access.certificates.settings.with_raw_response.get(
account_id="string",
zone_id="",
)
@ -268,7 +256,6 @@ class TestAsyncSettings:
},
],
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"])
@ -294,7 +281,6 @@ class TestAsyncSettings:
},
],
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"])
@ -320,7 +306,6 @@ class TestAsyncSettings:
},
],
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -350,7 +335,6 @@ class TestAsyncSettings:
},
],
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -383,7 +367,6 @@ class TestAsyncSettings:
},
],
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -406,7 +389,6 @@ class TestAsyncSettings:
},
],
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -414,7 +396,6 @@ class TestAsyncSettings:
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
setting = await async_client.zero_trust.access.certificates.settings.get(
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[SettingGetResponse], setting, path=["response"])
@ -423,7 +404,6 @@ class TestAsyncSettings:
async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
setting = await async_client.zero_trust.access.certificates.settings.get(
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[SettingGetResponse], setting, path=["response"])
@ -432,7 +412,6 @@ class TestAsyncSettings:
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
response = await async_client.zero_trust.access.certificates.settings.with_raw_response.get(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -445,7 +424,6 @@ class TestAsyncSettings:
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
async with async_client.zero_trust.access.certificates.settings.with_streaming_response.get(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -461,11 +439,9 @@ class TestAsyncSettings:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.zero_trust.access.certificates.settings.with_raw_response.get(
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.access.certificates.settings.with_raw_response.get(
account_id="string",
zone_id="",
)

File diff suppressed because it is too large Load diff

View file

@ -26,7 +26,6 @@ class TestCertificates:
certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----",
name="Allow devs",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Certificate], certificate, path=["response"])
@ -37,7 +36,6 @@ class TestCertificates:
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(Optional[Certificate], certificate, path=["response"])
@ -49,7 +47,6 @@ class TestCertificates:
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
@ -64,7 +61,6 @@ class TestCertificates:
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"
@ -82,7 +78,6 @@ class TestCertificates:
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 ''"):
@ -90,7 +85,6 @@ class TestCertificates:
certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----",
name="Allow devs",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -100,7 +94,6 @@ class TestCertificates:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Certificate], certificate, path=["response"])
@ -111,7 +104,6 @@ class TestCertificates:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="string",
zone_id="string",
name="Allow devs",
)
assert_matches_type(Optional[Certificate], certificate, path=["response"])
@ -123,7 +115,6 @@ class TestCertificates:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -138,7 +129,6 @@ class TestCertificates:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
associated_hostnames=["admin.example.com", "admin.example.com", "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"
@ -156,7 +146,6 @@ class TestCertificates:
"",
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 ''"):
@ -164,7 +153,6 @@ class TestCertificates:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -172,7 +160,6 @@ class TestCertificates:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -180,7 +167,6 @@ class TestCertificates:
def test_method_list(self, client: Cloudflare) -> None:
certificate = client.zero_trust.access.certificates.list(
account_id="string",
zone_id="string",
)
assert_matches_type(SyncSinglePage[Certificate], certificate, path=["response"])
@ -189,7 +175,6 @@ class TestCertificates:
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
certificate = client.zero_trust.access.certificates.list(
account_id="string",
zone_id="string",
)
assert_matches_type(SyncSinglePage[Certificate], certificate, path=["response"])
@ -198,7 +183,6 @@ class TestCertificates:
def test_raw_response_list(self, client: Cloudflare) -> None:
response = client.zero_trust.access.certificates.with_raw_response.list(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -211,7 +195,6 @@ class TestCertificates:
def test_streaming_response_list(self, client: Cloudflare) -> None:
with client.zero_trust.access.certificates.with_streaming_response.list(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -227,13 +210,11 @@ class TestCertificates:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.zero_trust.access.certificates.with_raw_response.list(
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.access.certificates.with_raw_response.list(
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -242,7 +223,6 @@ class TestCertificates:
certificate = client.zero_trust.access.certificates.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[CertificateDeleteResponse], certificate, path=["response"])
@ -252,7 +232,6 @@ class TestCertificates:
certificate = client.zero_trust.access.certificates.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[CertificateDeleteResponse], certificate, path=["response"])
@ -262,7 +241,6 @@ class TestCertificates:
response = client.zero_trust.access.certificates.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -276,7 +254,6 @@ class TestCertificates:
with client.zero_trust.access.certificates.with_streaming_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -293,21 +270,18 @@ class TestCertificates:
client.zero_trust.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.zero_trust.access.certificates.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.access.certificates.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -316,7 +290,6 @@ class TestCertificates:
certificate = client.zero_trust.access.certificates.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Certificate], certificate, path=["response"])
@ -326,7 +299,6 @@ class TestCertificates:
certificate = client.zero_trust.access.certificates.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Certificate], certificate, path=["response"])
@ -336,7 +308,6 @@ class TestCertificates:
response = client.zero_trust.access.certificates.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -350,7 +321,6 @@ class TestCertificates:
with client.zero_trust.access.certificates.with_streaming_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -367,21 +337,18 @@ class TestCertificates:
client.zero_trust.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.zero_trust.access.certificates.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.access.certificates.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@ -395,7 +362,6 @@ class TestAsyncCertificates:
certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----",
name="Allow devs",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Certificate], certificate, path=["response"])
@ -406,7 +372,6 @@ class TestAsyncCertificates:
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(Optional[Certificate], certificate, path=["response"])
@ -418,7 +383,6 @@ class TestAsyncCertificates:
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
@ -433,7 +397,6 @@ class TestAsyncCertificates:
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"
@ -451,7 +414,6 @@ class TestAsyncCertificates:
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 ''"):
@ -459,7 +421,6 @@ class TestAsyncCertificates:
certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----",
name="Allow devs",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -469,7 +430,6 @@ class TestAsyncCertificates:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Certificate], certificate, path=["response"])
@ -480,7 +440,6 @@ class TestAsyncCertificates:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="string",
zone_id="string",
name="Allow devs",
)
assert_matches_type(Optional[Certificate], certificate, path=["response"])
@ -492,7 +451,6 @@ class TestAsyncCertificates:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -507,7 +465,6 @@ class TestAsyncCertificates:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
associated_hostnames=["admin.example.com", "admin.example.com", "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"
@ -525,7 +482,6 @@ class TestAsyncCertificates:
"",
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 ''"):
@ -533,7 +489,6 @@ class TestAsyncCertificates:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -541,7 +496,6 @@ class TestAsyncCertificates:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
associated_hostnames=["admin.example.com", "admin.example.com", "admin.example.com"],
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -549,7 +503,6 @@ class TestAsyncCertificates:
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
certificate = await async_client.zero_trust.access.certificates.list(
account_id="string",
zone_id="string",
)
assert_matches_type(AsyncSinglePage[Certificate], certificate, path=["response"])
@ -558,7 +511,6 @@ class TestAsyncCertificates:
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
certificate = await async_client.zero_trust.access.certificates.list(
account_id="string",
zone_id="string",
)
assert_matches_type(AsyncSinglePage[Certificate], certificate, path=["response"])
@ -567,7 +519,6 @@ class TestAsyncCertificates:
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
response = await async_client.zero_trust.access.certificates.with_raw_response.list(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -580,7 +531,6 @@ class TestAsyncCertificates:
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
async with async_client.zero_trust.access.certificates.with_streaming_response.list(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -596,13 +546,11 @@ class TestAsyncCertificates:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.zero_trust.access.certificates.with_raw_response.list(
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.access.certificates.with_raw_response.list(
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -611,7 +559,6 @@ class TestAsyncCertificates:
certificate = await async_client.zero_trust.access.certificates.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[CertificateDeleteResponse], certificate, path=["response"])
@ -621,7 +568,6 @@ class TestAsyncCertificates:
certificate = await async_client.zero_trust.access.certificates.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[CertificateDeleteResponse], certificate, path=["response"])
@ -631,7 +577,6 @@ class TestAsyncCertificates:
response = await async_client.zero_trust.access.certificates.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -645,7 +590,6 @@ class TestAsyncCertificates:
async with async_client.zero_trust.access.certificates.with_streaming_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -662,21 +606,18 @@ class TestAsyncCertificates:
await async_client.zero_trust.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.zero_trust.access.certificates.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.access.certificates.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -685,7 +626,6 @@ class TestAsyncCertificates:
certificate = await async_client.zero_trust.access.certificates.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Certificate], certificate, path=["response"])
@ -695,7 +635,6 @@ class TestAsyncCertificates:
certificate = await async_client.zero_trust.access.certificates.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Certificate], certificate, path=["response"])
@ -705,7 +644,6 @@ class TestAsyncCertificates:
response = await async_client.zero_trust.access.certificates.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -719,7 +657,6 @@ class TestAsyncCertificates:
async with async_client.zero_trust.access.certificates.with_streaming_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -736,19 +673,16 @@ class TestAsyncCertificates:
await async_client.zero_trust.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.zero_trust.access.certificates.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.access.certificates.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)

View file

@ -30,7 +30,6 @@ class TestGroups:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"])
@ -45,7 +44,6 @@ class TestGroups:
],
name="Allow devs",
account_id="string",
zone_id="string",
exclude=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
@ -71,7 +69,6 @@ class TestGroups:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -90,7 +87,6 @@ class TestGroups:
],
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"
@ -112,7 +108,6 @@ class TestGroups:
],
name="Allow devs",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -124,7 +119,6 @@ class TestGroups:
],
name="Allow devs",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -139,7 +133,6 @@ class TestGroups:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"])
@ -155,7 +148,6 @@ class TestGroups:
],
name="Allow devs",
account_id="string",
zone_id="string",
exclude=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
@ -182,7 +174,6 @@ class TestGroups:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -202,7 +193,6 @@ class TestGroups:
],
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"
@ -225,7 +215,6 @@ class TestGroups:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
@ -238,7 +227,6 @@ class TestGroups:
],
name="Allow devs",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -251,7 +239,6 @@ class TestGroups:
],
name="Allow devs",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -259,7 +246,6 @@ class TestGroups:
def test_method_list(self, client: Cloudflare) -> None:
group = client.zero_trust.access.groups.list(
account_id="string",
zone_id="string",
)
assert_matches_type(SyncSinglePage[ZeroTrustGroup], group, path=["response"])
@ -268,7 +254,6 @@ class TestGroups:
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
group = client.zero_trust.access.groups.list(
account_id="string",
zone_id="string",
)
assert_matches_type(SyncSinglePage[ZeroTrustGroup], group, path=["response"])
@ -277,7 +262,6 @@ class TestGroups:
def test_raw_response_list(self, client: Cloudflare) -> None:
response = client.zero_trust.access.groups.with_raw_response.list(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -290,7 +274,6 @@ class TestGroups:
def test_streaming_response_list(self, client: Cloudflare) -> None:
with client.zero_trust.access.groups.with_streaming_response.list(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -306,13 +289,11 @@ class TestGroups:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.zero_trust.access.groups.with_raw_response.list(
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.access.groups.with_raw_response.list(
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -321,7 +302,6 @@ class TestGroups:
group = client.zero_trust.access.groups.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[GroupDeleteResponse], group, path=["response"])
@ -331,7 +311,6 @@ class TestGroups:
group = client.zero_trust.access.groups.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[GroupDeleteResponse], group, path=["response"])
@ -341,7 +320,6 @@ class TestGroups:
response = client.zero_trust.access.groups.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -355,7 +333,6 @@ class TestGroups:
with client.zero_trust.access.groups.with_streaming_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -372,21 +349,18 @@ class TestGroups:
client.zero_trust.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.zero_trust.access.groups.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.access.groups.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -395,7 +369,6 @@ class TestGroups:
group = client.zero_trust.access.groups.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"])
@ -405,7 +378,6 @@ class TestGroups:
group = client.zero_trust.access.groups.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"])
@ -415,7 +387,6 @@ class TestGroups:
response = client.zero_trust.access.groups.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -429,7 +400,6 @@ class TestGroups:
with client.zero_trust.access.groups.with_streaming_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -446,21 +416,18 @@ class TestGroups:
client.zero_trust.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.zero_trust.access.groups.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.access.groups.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@ -478,7 +445,6 @@ class TestAsyncGroups:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"])
@ -493,7 +459,6 @@ class TestAsyncGroups:
],
name="Allow devs",
account_id="string",
zone_id="string",
exclude=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
@ -519,7 +484,6 @@ class TestAsyncGroups:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -538,7 +502,6 @@ class TestAsyncGroups:
],
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"
@ -560,7 +523,6 @@ class TestAsyncGroups:
],
name="Allow devs",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -572,7 +534,6 @@ class TestAsyncGroups:
],
name="Allow devs",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -587,7 +548,6 @@ class TestAsyncGroups:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"])
@ -603,7 +563,6 @@ class TestAsyncGroups:
],
name="Allow devs",
account_id="string",
zone_id="string",
exclude=[
{"email": {"email": "test@example.com"}},
{"email": {"email": "test@example.com"}},
@ -630,7 +589,6 @@ class TestAsyncGroups:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -650,7 +608,6 @@ class TestAsyncGroups:
],
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"
@ -673,7 +630,6 @@ class TestAsyncGroups:
],
name="Allow devs",
account_id="string",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
@ -686,7 +642,6 @@ class TestAsyncGroups:
],
name="Allow devs",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
@ -699,7 +654,6 @@ class TestAsyncGroups:
],
name="Allow devs",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -707,7 +661,6 @@ class TestAsyncGroups:
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
group = await async_client.zero_trust.access.groups.list(
account_id="string",
zone_id="string",
)
assert_matches_type(AsyncSinglePage[ZeroTrustGroup], group, path=["response"])
@ -716,7 +669,6 @@ class TestAsyncGroups:
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
group = await async_client.zero_trust.access.groups.list(
account_id="string",
zone_id="string",
)
assert_matches_type(AsyncSinglePage[ZeroTrustGroup], group, path=["response"])
@ -725,7 +677,6 @@ class TestAsyncGroups:
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
response = await async_client.zero_trust.access.groups.with_raw_response.list(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -738,7 +689,6 @@ class TestAsyncGroups:
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
async with async_client.zero_trust.access.groups.with_streaming_response.list(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -754,13 +704,11 @@ class TestAsyncGroups:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.zero_trust.access.groups.with_raw_response.list(
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.access.groups.with_raw_response.list(
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -769,7 +717,6 @@ class TestAsyncGroups:
group = await async_client.zero_trust.access.groups.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[GroupDeleteResponse], group, path=["response"])
@ -779,7 +726,6 @@ class TestAsyncGroups:
group = await async_client.zero_trust.access.groups.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[GroupDeleteResponse], group, path=["response"])
@ -789,7 +735,6 @@ class TestAsyncGroups:
response = await async_client.zero_trust.access.groups.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -803,7 +748,6 @@ class TestAsyncGroups:
async with async_client.zero_trust.access.groups.with_streaming_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -820,21 +764,18 @@ class TestAsyncGroups:
await async_client.zero_trust.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.zero_trust.access.groups.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.access.groups.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -843,7 +784,6 @@ class TestAsyncGroups:
group = await async_client.zero_trust.access.groups.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"])
@ -853,7 +793,6 @@ class TestAsyncGroups:
group = await async_client.zero_trust.access.groups.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"])
@ -863,7 +802,6 @@ class TestAsyncGroups:
response = await async_client.zero_trust.access.groups.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -877,7 +815,6 @@ class TestAsyncGroups:
async with async_client.zero_trust.access.groups.with_streaming_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -894,19 +831,16 @@ class TestAsyncGroups:
await async_client.zero_trust.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.zero_trust.access.groups.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.access.groups.with_raw_response.get(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)

View file

@ -26,7 +26,6 @@ class TestServiceTokens:
service_token = client.zero_trust.access.service_tokens.create(
name="CI/CD token",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ServiceTokenCreateResponse], service_token, path=["response"])
@ -36,7 +35,6 @@ class TestServiceTokens:
service_token = client.zero_trust.access.service_tokens.create(
name="CI/CD token",
account_id="string",
zone_id="string",
duration="60m",
)
assert_matches_type(Optional[ServiceTokenCreateResponse], service_token, path=["response"])
@ -47,7 +45,6 @@ class TestServiceTokens:
response = client.zero_trust.access.service_tokens.with_raw_response.create(
name="CI/CD token",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -61,7 +58,6 @@ class TestServiceTokens:
with client.zero_trust.access.service_tokens.with_streaming_response.create(
name="CI/CD token",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -78,14 +74,12 @@ class TestServiceTokens:
client.zero_trust.access.service_tokens.with_raw_response.create(
name="CI/CD token",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.access.service_tokens.with_raw_response.create(
name="CI/CD token",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -94,7 +88,6 @@ class TestServiceTokens:
service_token = client.zero_trust.access.service_tokens.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ServiceToken], service_token, path=["response"])
@ -104,7 +97,6 @@ class TestServiceTokens:
service_token = client.zero_trust.access.service_tokens.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
duration="60m",
name="CI/CD token",
)
@ -116,7 +108,6 @@ class TestServiceTokens:
response = client.zero_trust.access.service_tokens.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -130,7 +121,6 @@ class TestServiceTokens:
with client.zero_trust.access.service_tokens.with_streaming_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -147,21 +137,18 @@ class TestServiceTokens:
client.zero_trust.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.zero_trust.access.service_tokens.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.access.service_tokens.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -169,7 +156,6 @@ class TestServiceTokens:
def test_method_list(self, client: Cloudflare) -> None:
service_token = client.zero_trust.access.service_tokens.list(
account_id="string",
zone_id="string",
)
assert_matches_type(SyncSinglePage[ServiceToken], service_token, path=["response"])
@ -178,7 +164,6 @@ class TestServiceTokens:
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
service_token = client.zero_trust.access.service_tokens.list(
account_id="string",
zone_id="string",
)
assert_matches_type(SyncSinglePage[ServiceToken], service_token, path=["response"])
@ -187,7 +172,6 @@ class TestServiceTokens:
def test_raw_response_list(self, client: Cloudflare) -> None:
response = client.zero_trust.access.service_tokens.with_raw_response.list(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -200,7 +184,6 @@ class TestServiceTokens:
def test_streaming_response_list(self, client: Cloudflare) -> None:
with client.zero_trust.access.service_tokens.with_streaming_response.list(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -216,13 +199,11 @@ class TestServiceTokens:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.zero_trust.access.service_tokens.with_raw_response.list(
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.access.service_tokens.with_raw_response.list(
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -231,7 +212,6 @@ class TestServiceTokens:
service_token = client.zero_trust.access.service_tokens.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ServiceToken], service_token, path=["response"])
@ -241,7 +221,6 @@ class TestServiceTokens:
service_token = client.zero_trust.access.service_tokens.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ServiceToken], service_token, path=["response"])
@ -251,7 +230,6 @@ class TestServiceTokens:
response = client.zero_trust.access.service_tokens.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -265,7 +243,6 @@ class TestServiceTokens:
with client.zero_trust.access.service_tokens.with_streaming_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -282,21 +259,18 @@ class TestServiceTokens:
client.zero_trust.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.zero_trust.access.service_tokens.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.access.service_tokens.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -413,7 +387,6 @@ class TestAsyncServiceTokens:
service_token = await async_client.zero_trust.access.service_tokens.create(
name="CI/CD token",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ServiceTokenCreateResponse], service_token, path=["response"])
@ -423,7 +396,6 @@ class TestAsyncServiceTokens:
service_token = await async_client.zero_trust.access.service_tokens.create(
name="CI/CD token",
account_id="string",
zone_id="string",
duration="60m",
)
assert_matches_type(Optional[ServiceTokenCreateResponse], service_token, path=["response"])
@ -434,7 +406,6 @@ class TestAsyncServiceTokens:
response = await async_client.zero_trust.access.service_tokens.with_raw_response.create(
name="CI/CD token",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -448,7 +419,6 @@ class TestAsyncServiceTokens:
async with async_client.zero_trust.access.service_tokens.with_streaming_response.create(
name="CI/CD token",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -465,14 +435,12 @@ class TestAsyncServiceTokens:
await async_client.zero_trust.access.service_tokens.with_raw_response.create(
name="CI/CD token",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.access.service_tokens.with_raw_response.create(
name="CI/CD token",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -481,7 +449,6 @@ class TestAsyncServiceTokens:
service_token = await async_client.zero_trust.access.service_tokens.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ServiceToken], service_token, path=["response"])
@ -491,7 +458,6 @@ class TestAsyncServiceTokens:
service_token = await async_client.zero_trust.access.service_tokens.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
duration="60m",
name="CI/CD token",
)
@ -503,7 +469,6 @@ class TestAsyncServiceTokens:
response = await async_client.zero_trust.access.service_tokens.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -517,7 +482,6 @@ class TestAsyncServiceTokens:
async with async_client.zero_trust.access.service_tokens.with_streaming_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -534,21 +498,18 @@ class TestAsyncServiceTokens:
await async_client.zero_trust.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.zero_trust.access.service_tokens.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.access.service_tokens.with_raw_response.update(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -556,7 +517,6 @@ class TestAsyncServiceTokens:
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
service_token = await async_client.zero_trust.access.service_tokens.list(
account_id="string",
zone_id="string",
)
assert_matches_type(AsyncSinglePage[ServiceToken], service_token, path=["response"])
@ -565,7 +525,6 @@ class TestAsyncServiceTokens:
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
service_token = await async_client.zero_trust.access.service_tokens.list(
account_id="string",
zone_id="string",
)
assert_matches_type(AsyncSinglePage[ServiceToken], service_token, path=["response"])
@ -574,7 +533,6 @@ class TestAsyncServiceTokens:
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
response = await async_client.zero_trust.access.service_tokens.with_raw_response.list(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -587,7 +545,6 @@ class TestAsyncServiceTokens:
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
async with async_client.zero_trust.access.service_tokens.with_streaming_response.list(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -603,13 +560,11 @@ class TestAsyncServiceTokens:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.zero_trust.access.service_tokens.with_raw_response.list(
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.access.service_tokens.with_raw_response.list(
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -618,7 +573,6 @@ class TestAsyncServiceTokens:
service_token = await async_client.zero_trust.access.service_tokens.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ServiceToken], service_token, path=["response"])
@ -628,7 +582,6 @@ class TestAsyncServiceTokens:
service_token = await async_client.zero_trust.access.service_tokens.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[ServiceToken], service_token, path=["response"])
@ -638,7 +591,6 @@ class TestAsyncServiceTokens:
response = await async_client.zero_trust.access.service_tokens.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -652,7 +604,6 @@ class TestAsyncServiceTokens:
async with async_client.zero_trust.access.service_tokens.with_streaming_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -669,21 +620,18 @@ class TestAsyncServiceTokens:
await async_client.zero_trust.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.zero_trust.access.service_tokens.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.access.service_tokens.with_raw_response.delete(
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="string",
zone_id="",
)
@pytest.mark.skip()

File diff suppressed because it is too large Load diff

View file

@ -25,7 +25,6 @@ class TestOrganizations:
auth_domain="test.cloudflareaccess.com",
name="Widget Corps Internal Applications",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Organization], organization, path=["response"])
@ -36,7 +35,6 @@ class TestOrganizations:
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,
@ -61,7 +59,6 @@ class TestOrganizations:
auth_domain="test.cloudflareaccess.com",
name="Widget Corps Internal Applications",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -76,7 +73,6 @@ class TestOrganizations:
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"
@ -94,7 +90,6 @@ class TestOrganizations:
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 ''"):
@ -102,7 +97,6 @@ class TestOrganizations:
auth_domain="test.cloudflareaccess.com",
name="Widget Corps Internal Applications",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -110,7 +104,6 @@ class TestOrganizations:
def test_method_update(self, client: Cloudflare) -> None:
organization = client.zero_trust.organizations.update(
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Organization], organization, path=["response"])
@ -119,7 +112,6 @@ class TestOrganizations:
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
organization = client.zero_trust.organizations.update(
account_id="string",
zone_id="string",
allow_authenticate_via_warp=True,
auth_domain="test.cloudflareaccess.com",
auto_redirect_to_identity=True,
@ -148,7 +140,6 @@ class TestOrganizations:
def test_raw_response_update(self, client: Cloudflare) -> None:
response = client.zero_trust.organizations.with_raw_response.update(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -161,7 +152,6 @@ class TestOrganizations:
def test_streaming_response_update(self, client: Cloudflare) -> None:
with client.zero_trust.organizations.with_streaming_response.update(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -177,13 +167,11 @@ class TestOrganizations:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.zero_trust.organizations.with_raw_response.update(
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.organizations.with_raw_response.update(
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -191,7 +179,6 @@ class TestOrganizations:
def test_method_list(self, client: Cloudflare) -> None:
organization = client.zero_trust.organizations.list(
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Organization], organization, path=["response"])
@ -200,7 +187,6 @@ class TestOrganizations:
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
organization = client.zero_trust.organizations.list(
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Organization], organization, path=["response"])
@ -209,7 +195,6 @@ class TestOrganizations:
def test_raw_response_list(self, client: Cloudflare) -> None:
response = client.zero_trust.organizations.with_raw_response.list(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -222,7 +207,6 @@ class TestOrganizations:
def test_streaming_response_list(self, client: Cloudflare) -> None:
with client.zero_trust.organizations.with_streaming_response.list(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -238,13 +222,11 @@ class TestOrganizations:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.zero_trust.organizations.with_raw_response.list(
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.organizations.with_raw_response.list(
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -253,7 +235,6 @@ class TestOrganizations:
organization = client.zero_trust.organizations.revoke_users(
email="test@example.com",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[OrganizationRevokeUsersResponse], organization, path=["response"])
@ -263,7 +244,6 @@ class TestOrganizations:
organization = client.zero_trust.organizations.revoke_users(
email="test@example.com",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[OrganizationRevokeUsersResponse], organization, path=["response"])
@ -273,7 +253,6 @@ class TestOrganizations:
response = client.zero_trust.organizations.with_raw_response.revoke_users(
email="test@example.com",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -287,7 +266,6 @@ class TestOrganizations:
with client.zero_trust.organizations.with_streaming_response.revoke_users(
email="test@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"
@ -304,14 +282,12 @@ class TestOrganizations:
client.zero_trust.organizations.with_raw_response.revoke_users(
email="test@example.com",
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.organizations.with_raw_response.revoke_users(
email="test@example.com",
account_id="string",
zone_id="",
)
@ -325,7 +301,6 @@ class TestAsyncOrganizations:
auth_domain="test.cloudflareaccess.com",
name="Widget Corps Internal Applications",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Organization], organization, path=["response"])
@ -336,7 +311,6 @@ class TestAsyncOrganizations:
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,
@ -361,7 +335,6 @@ class TestAsyncOrganizations:
auth_domain="test.cloudflareaccess.com",
name="Widget Corps Internal Applications",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -376,7 +349,6 @@ class TestAsyncOrganizations:
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"
@ -394,7 +366,6 @@ class TestAsyncOrganizations:
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 ''"):
@ -402,7 +373,6 @@ class TestAsyncOrganizations:
auth_domain="test.cloudflareaccess.com",
name="Widget Corps Internal Applications",
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -410,7 +380,6 @@ class TestAsyncOrganizations:
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
organization = await async_client.zero_trust.organizations.update(
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Organization], organization, path=["response"])
@ -419,7 +388,6 @@ class TestAsyncOrganizations:
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
organization = await async_client.zero_trust.organizations.update(
account_id="string",
zone_id="string",
allow_authenticate_via_warp=True,
auth_domain="test.cloudflareaccess.com",
auto_redirect_to_identity=True,
@ -448,7 +416,6 @@ class TestAsyncOrganizations:
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
response = await async_client.zero_trust.organizations.with_raw_response.update(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -461,7 +428,6 @@ class TestAsyncOrganizations:
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
async with async_client.zero_trust.organizations.with_streaming_response.update(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -477,13 +443,11 @@ class TestAsyncOrganizations:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.zero_trust.organizations.with_raw_response.update(
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.organizations.with_raw_response.update(
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -491,7 +455,6 @@ class TestAsyncOrganizations:
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
organization = await async_client.zero_trust.organizations.list(
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Organization], organization, path=["response"])
@ -500,7 +463,6 @@ class TestAsyncOrganizations:
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
organization = await async_client.zero_trust.organizations.list(
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[Organization], organization, path=["response"])
@ -509,7 +471,6 @@ class TestAsyncOrganizations:
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
response = await async_client.zero_trust.organizations.with_raw_response.list(
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -522,7 +483,6 @@ class TestAsyncOrganizations:
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
async with async_client.zero_trust.organizations.with_streaming_response.list(
account_id="string",
zone_id="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -538,13 +498,11 @@ class TestAsyncOrganizations:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.zero_trust.organizations.with_raw_response.list(
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.organizations.with_raw_response.list(
account_id="string",
zone_id="",
)
@pytest.mark.skip()
@ -553,7 +511,6 @@ class TestAsyncOrganizations:
organization = await async_client.zero_trust.organizations.revoke_users(
email="test@example.com",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[OrganizationRevokeUsersResponse], organization, path=["response"])
@ -563,7 +520,6 @@ class TestAsyncOrganizations:
organization = await async_client.zero_trust.organizations.revoke_users(
email="test@example.com",
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[OrganizationRevokeUsersResponse], organization, path=["response"])
@ -573,7 +529,6 @@ class TestAsyncOrganizations:
response = await async_client.zero_trust.organizations.with_raw_response.revoke_users(
email="test@example.com",
account_id="string",
zone_id="string",
)
assert response.is_closed is True
@ -587,7 +542,6 @@ class TestAsyncOrganizations:
async with async_client.zero_trust.organizations.with_streaming_response.revoke_users(
email="test@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"
@ -604,12 +558,10 @@ class TestAsyncOrganizations:
await async_client.zero_trust.organizations.with_raw_response.revoke_users(
email="test@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.zero_trust.organizations.with_raw_response.revoke_users(
email="test@example.com",
account_id="string",
zone_id="",
)

View file

@ -97,7 +97,22 @@ def assert_matches_type(
assert_matches_type(key_type, key, path=[*path, "<dict key>"])
assert_matches_type(items_type, item, path=[*path, "<dict item>"])
elif is_union_type(type_):
for i, variant in enumerate(get_args(type_)):
variants = get_args(type_)
try:
none_index = variants.index(type(None))
except ValueError:
pass
else:
# special case Optional[T] for better error messages
if len(variants) == 2:
if value is None:
# valid
return
return assert_matches_type(type_=variants[not none_index], value=value, path=path)
for i, variant in enumerate(variants):
try:
assert_matches_type(variant, value, path=[*path, f"variant {i}"])
return