diff --git a/.stats.yml b/.stats.yml index b68b9a715de..ddeeffb5d02 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1343 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dd6f560da6eb9ae8d43a6fd37d706e939ef20c6cca15655adc5dc821fa2fd19f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-90de7c383d660ce2dd1c4dfa53b4c75ef8c4c37d485f16f9cc2da269d4852095.yml diff --git a/src/cloudflare/resources/accounts/members.py b/src/cloudflare/resources/accounts/members.py index a36881ed695..642cb60d058 100644 --- a/src/cloudflare/resources/accounts/members.py +++ b/src/cloudflare/resources/accounts/members.py @@ -2,14 +2,13 @@ from __future__ import annotations -from typing import Any, List, Type, Iterable, Optional, cast, overload +from typing import Any, List, Type, Iterable, Optional, cast from typing_extensions import Literal import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - required_args, maybe_transform, async_maybe_transform, ) @@ -46,7 +45,6 @@ def with_raw_response(self) -> MembersResourceWithRawResponse: def with_streaming_response(self) -> MembersResourceWithStreamingResponse: return MembersResourceWithStreamingResponse(self) - @overload def create( self, *, @@ -77,57 +75,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - def create( - self, - *, - account_id: str, - email: str, - policies: Iterable[member_create_params.IamCreateMemberWithPoliciesPolicy], - status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MemberCreateResponse: - """ - Add a user to the list of members for this account. - - Args: - email: The contact email address of the user. - - policies: Array of policies associated with this member. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["account_id", "email", "roles"], ["account_id", "email", "policies"]) - def create( - self, - *, - account_id: str, - email: str, - roles: List[str] | NotGiven = NOT_GIVEN, - status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN, - policies: Iterable[member_create_params.IamCreateMemberWithPoliciesPolicy] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MemberCreateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -139,7 +86,6 @@ def create( "email": email, "roles": roles, "status": status, - "policies": policies, }, member_create_params.MemberCreateParams, ), @@ -152,13 +98,12 @@ def create( ), ) - @overload def update( self, member_id: str, *, account_id: str, - roles: Iterable[member_update_params.MemberRole] | NotGiven = NOT_GIVEN, + roles: Iterable[member_update_params.Role] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -182,55 +127,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - def update( - self, - member_id: str, - *, - account_id: str, - policies: Iterable[member_update_params.IamUpdateMemberWithPoliciesPolicy], - # 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, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MemberUpdateResponse: - """ - Modify an account member. - - Args: - member_id: Membership identifier tag. - - policies: Array of policies associated with this member. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["account_id"], ["account_id", "policies"]) - def update( - self, - member_id: str, - *, - account_id: str, - roles: Iterable[member_update_params.MemberRole] | NotGiven = NOT_GIVEN, - policies: Iterable[member_update_params.IamUpdateMemberWithPoliciesPolicy] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MemberUpdateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not member_id: @@ -239,13 +135,7 @@ def update( MemberUpdateResponse, self._put( f"/accounts/{account_id}/members/{member_id}", - body=maybe_transform( - { - "roles": roles, - "policies": policies, - }, - member_update_params.MemberUpdateParams, - ), + body=maybe_transform({"roles": roles}, member_update_params.MemberUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -410,7 +300,6 @@ def with_raw_response(self) -> AsyncMembersResourceWithRawResponse: def with_streaming_response(self) -> AsyncMembersResourceWithStreamingResponse: return AsyncMembersResourceWithStreamingResponse(self) - @overload async def create( self, *, @@ -441,57 +330,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - async def create( - self, - *, - account_id: str, - email: str, - policies: Iterable[member_create_params.IamCreateMemberWithPoliciesPolicy], - status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MemberCreateResponse: - """ - Add a user to the list of members for this account. - - Args: - email: The contact email address of the user. - - policies: Array of policies associated with this member. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["account_id", "email", "roles"], ["account_id", "email", "policies"]) - async def create( - self, - *, - account_id: str, - email: str, - roles: List[str] | NotGiven = NOT_GIVEN, - status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN, - policies: Iterable[member_create_params.IamCreateMemberWithPoliciesPolicy] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MemberCreateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -503,7 +341,6 @@ async def create( "email": email, "roles": roles, "status": status, - "policies": policies, }, member_create_params.MemberCreateParams, ), @@ -516,13 +353,12 @@ async def create( ), ) - @overload async def update( self, member_id: str, *, account_id: str, - roles: Iterable[member_update_params.MemberRole] | NotGiven = NOT_GIVEN, + roles: Iterable[member_update_params.Role] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -546,55 +382,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - async def update( - self, - member_id: str, - *, - account_id: str, - policies: Iterable[member_update_params.IamUpdateMemberWithPoliciesPolicy], - # 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, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MemberUpdateResponse: - """ - Modify an account member. - - Args: - member_id: Membership identifier tag. - - policies: Array of policies associated with this member. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["account_id"], ["account_id", "policies"]) - async def update( - self, - member_id: str, - *, - account_id: str, - roles: Iterable[member_update_params.MemberRole] | NotGiven = NOT_GIVEN, - policies: Iterable[member_update_params.IamUpdateMemberWithPoliciesPolicy] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MemberUpdateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not member_id: @@ -603,13 +390,7 @@ async def update( MemberUpdateResponse, await self._put( f"/accounts/{account_id}/members/{member_id}", - body=await async_maybe_transform( - { - "roles": roles, - "policies": policies, - }, - member_update_params.MemberUpdateParams, - ), + body=await async_maybe_transform({"roles": roles}, member_update_params.MemberUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/cloudflare/types/accounts/member_create_params.py b/src/cloudflare/types/accounts/member_create_params.py index 8706522e855..69acda8f5da 100644 --- a/src/cloudflare/types/accounts/member_create_params.py +++ b/src/cloudflare/types/accounts/member_create_params.py @@ -2,20 +2,13 @@ from __future__ import annotations -from typing import List, Union, Iterable +from typing import List from typing_extensions import Literal, Required, TypedDict -__all__ = [ - "MemberCreateParams", - "IamCreateMemberWithRoles", - "IamCreateMemberWithPolicies", - "IamCreateMemberWithPoliciesPolicy", - "IamCreateMemberWithPoliciesPolicyPermissionGroup", - "IamCreateMemberWithPoliciesPolicyResourceGroup", -] +__all__ = ["MemberCreateParams"] -class IamCreateMemberWithRoles(TypedDict, total=False): +class MemberCreateParams(TypedDict, total=False): account_id: Required[str] email: Required[str] @@ -25,39 +18,3 @@ class IamCreateMemberWithRoles(TypedDict, total=False): """Array of roles associated with this member.""" status: Literal["accepted", "pending"] - - -class IamCreateMemberWithPolicies(TypedDict, total=False): - account_id: Required[str] - - email: Required[str] - """The contact email address of the user.""" - - policies: Required[Iterable[IamCreateMemberWithPoliciesPolicy]] - """Array of policies associated with this member.""" - - status: Literal["accepted", "pending"] - - -class IamCreateMemberWithPoliciesPolicyPermissionGroup(TypedDict, total=False): - id: Required[str] - """Identifier of the group.""" - - -class IamCreateMemberWithPoliciesPolicyResourceGroup(TypedDict, total=False): - id: Required[str] - """Identifier of the group.""" - - -class IamCreateMemberWithPoliciesPolicy(TypedDict, total=False): - access: Required[Literal["allow", "deny"]] - """Allow or deny operations against the resources.""" - - permission_groups: Required[Iterable[IamCreateMemberWithPoliciesPolicyPermissionGroup]] - """A set of permission groups that are specified to the policy.""" - - resource_groups: Required[Iterable[IamCreateMemberWithPoliciesPolicyResourceGroup]] - """A list of resource groups that the policy applies to.""" - - -MemberCreateParams = Union[IamCreateMemberWithRoles, IamCreateMemberWithPolicies] diff --git a/src/cloudflare/types/accounts/member_update_params.py b/src/cloudflare/types/accounts/member_update_params.py index 851713903c8..66b3ee3cbac 100644 --- a/src/cloudflare/types/accounts/member_update_params.py +++ b/src/cloudflare/types/accounts/member_update_params.py @@ -2,58 +2,19 @@ from __future__ import annotations -from typing import Union, Iterable -from typing_extensions import Literal, Required, TypedDict +from typing import Iterable +from typing_extensions import Required, TypedDict -__all__ = [ - "MemberUpdateParams", - "Member", - "MemberRole", - "IamUpdateMemberWithPolicies", - "IamUpdateMemberWithPoliciesPolicy", - "IamUpdateMemberWithPoliciesPolicyPermissionGroup", - "IamUpdateMemberWithPoliciesPolicyResourceGroup", -] +__all__ = ["MemberUpdateParams", "Role"] -class Member(TypedDict, total=False): +class MemberUpdateParams(TypedDict, total=False): account_id: Required[str] - roles: Iterable[MemberRole] + roles: Iterable[Role] """Roles assigned to this member.""" -class MemberRole(TypedDict, total=False): +class Role(TypedDict, total=False): id: Required[str] """Role identifier tag.""" - - -class IamUpdateMemberWithPolicies(TypedDict, total=False): - account_id: Required[str] - - policies: Required[Iterable[IamUpdateMemberWithPoliciesPolicy]] - """Array of policies associated with this member.""" - - -class IamUpdateMemberWithPoliciesPolicyPermissionGroup(TypedDict, total=False): - id: Required[str] - """Identifier of the group.""" - - -class IamUpdateMemberWithPoliciesPolicyResourceGroup(TypedDict, total=False): - id: Required[str] - """Identifier of the group.""" - - -class IamUpdateMemberWithPoliciesPolicy(TypedDict, total=False): - access: Required[Literal["allow", "deny"]] - """Allow or deny operations against the resources.""" - - permission_groups: Required[Iterable[IamUpdateMemberWithPoliciesPolicyPermissionGroup]] - """A set of permission groups that are specified to the policy.""" - - resource_groups: Required[Iterable[IamUpdateMemberWithPoliciesPolicyResourceGroup]] - """A list of resource groups that the policy applies to.""" - - -MemberUpdateParams = Union[Member, IamUpdateMemberWithPolicies] diff --git a/tests/api_resources/accounts/test_members.py b/tests/api_resources/accounts/test_members.py index 05cb40faa08..c1062178a50 100644 --- a/tests/api_resources/accounts/test_members.py +++ b/tests/api_resources/accounts/test_members.py @@ -25,7 +25,7 @@ class TestMembers: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - def test_method_create_overload_1(self, client: Cloudflare) -> None: + def test_method_create(self, client: Cloudflare) -> None: member = client.accounts.members.create( account_id="string", email="user@example.com", @@ -38,7 +38,7 @@ def test_method_create_overload_1(self, client: Cloudflare) -> None: assert_matches_type(MemberCreateResponse, member, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> None: + def test_method_create_with_all_params(self, client: Cloudflare) -> None: member = client.accounts.members.create( account_id="string", email="user@example.com", @@ -52,7 +52,7 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N assert_matches_type(MemberCreateResponse, member, path=["response"]) @parametrize - def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: + def test_raw_response_create(self, client: Cloudflare) -> None: response = client.accounts.members.with_raw_response.create( account_id="string", email="user@example.com", @@ -69,7 +69,7 @@ def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: assert_matches_type(MemberCreateResponse, member, path=["response"]) @parametrize - def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: + def test_streaming_response_create(self, client: Cloudflare) -> None: with client.accounts.members.with_streaming_response.create( account_id="string", email="user@example.com", @@ -88,7 +88,7 @@ def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_create_overload_1(self, client: Cloudflare) -> None: + def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.accounts.members.with_raw_response.create( account_id="", @@ -100,250 +100,9 @@ def test_path_params_create_overload_1(self, client: Cloudflare) -> None: ], ) - @parametrize - def test_method_create_overload_2(self, client: Cloudflare) -> None: - member = client.accounts.members.create( - account_id="string", - email="user@example.com", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], - ) - assert_matches_type(MemberCreateResponse, member, path=["response"]) - - @parametrize - def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> None: - member = client.accounts.members.create( - account_id="string", - email="user@example.com", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], - status="accepted", - ) - assert_matches_type(MemberCreateResponse, member, path=["response"]) - - @parametrize - def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: - response = client.accounts.members.with_raw_response.create( - account_id="string", - email="user@example.com", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - member = response.parse() - assert_matches_type(MemberCreateResponse, member, path=["response"]) - - @parametrize - def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: - with client.accounts.members.with_streaming_response.create( - account_id="string", - email="user@example.com", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - member = response.parse() - assert_matches_type(MemberCreateResponse, member, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_create_overload_2(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", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], - ) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_overload_1(self, client: Cloudflare) -> None: + def test_method_update(self, client: Cloudflare) -> None: member = client.accounts.members.update( "4536bcfad5faccb111b47003c79917fa", account_id="string", @@ -352,7 +111,7 @@ def test_method_update_overload_1(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: + def test_method_update_with_all_params(self, client: Cloudflare) -> None: member = client.accounts.members.update( "4536bcfad5faccb111b47003c79917fa", account_id="string", @@ -366,138 +125,10 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: - response = client.accounts.members.with_raw_response.update( - "4536bcfad5faccb111b47003c79917fa", - account_id="string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - member = response.parse() - assert_matches_type(MemberUpdateResponse, member, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: - with client.accounts.members.with_streaming_response.update( - "4536bcfad5faccb111b47003c79917fa", - account_id="string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - member = response.parse() - assert_matches_type(MemberUpdateResponse, member, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_path_params_update_overload_1(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="", - ) - - 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="string", - ) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_method_update_overload_2(self, client: Cloudflare) -> None: - member = client.accounts.members.update( - "4536bcfad5faccb111b47003c79917fa", - account_id="string", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], - ) - assert_matches_type(MemberUpdateResponse, member, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: + def test_raw_response_update(self, client: Cloudflare) -> None: response = client.accounts.members.with_raw_response.update( "4536bcfad5faccb111b47003c79917fa", account_id="string", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], ) assert response.is_closed is True @@ -507,48 +138,10 @@ def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: + def test_streaming_response_update(self, client: Cloudflare) -> None: with client.accounts.members.with_streaming_response.update( "4536bcfad5faccb111b47003c79917fa", account_id="string", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -560,93 +153,17 @@ def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_update_overload_2(self, client: Cloudflare) -> None: + def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.accounts.members.with_raw_response.update( "4536bcfad5faccb111b47003c79917fa", account_id="", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], ) 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="string", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], ) @parametrize @@ -800,7 +317,7 @@ class TestAsyncMembers: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_method_create(self, async_client: AsyncCloudflare) -> None: member = await async_client.accounts.members.create( account_id="string", email="user@example.com", @@ -813,7 +330,7 @@ async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> assert_matches_type(MemberCreateResponse, member, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: member = await async_client.accounts.members.create( account_id="string", email="user@example.com", @@ -827,7 +344,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn assert_matches_type(MemberCreateResponse, member, path=["response"]) @parametrize - async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.members.with_raw_response.create( account_id="string", email="user@example.com", @@ -844,7 +361,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflar assert_matches_type(MemberCreateResponse, member, path=["response"]) @parametrize - async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.members.with_streaming_response.create( account_id="string", email="user@example.com", @@ -863,7 +380,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncClo assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare) -> None: + 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="", @@ -875,250 +392,9 @@ async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare ], ) - @parametrize - async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: - member = await async_client.accounts.members.create( - account_id="string", - email="user@example.com", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], - ) - assert_matches_type(MemberCreateResponse, member, path=["response"]) - - @parametrize - async def test_method_create_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: - member = await async_client.accounts.members.create( - account_id="string", - email="user@example.com", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], - status="accepted", - ) - assert_matches_type(MemberCreateResponse, member, path=["response"]) - - @parametrize - async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: - response = await async_client.accounts.members.with_raw_response.create( - account_id="string", - email="user@example.com", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - member = await response.parse() - assert_matches_type(MemberCreateResponse, member, path=["response"]) - - @parametrize - async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: - async with async_client.accounts.members.with_streaming_response.create( - account_id="string", - email="user@example.com", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - member = await response.parse() - assert_matches_type(MemberCreateResponse, member, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_create_overload_2(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", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], - ) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_method_update(self, async_client: AsyncCloudflare) -> None: member = await async_client.accounts.members.update( "4536bcfad5faccb111b47003c79917fa", account_id="string", @@ -1127,7 +403,7 @@ async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: member = await async_client.accounts.members.update( "4536bcfad5faccb111b47003c79917fa", account_id="string", @@ -1141,138 +417,10 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: - response = await async_client.accounts.members.with_raw_response.update( - "4536bcfad5faccb111b47003c79917fa", - account_id="string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - member = await response.parse() - assert_matches_type(MemberUpdateResponse, member, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: - async with async_client.accounts.members.with_streaming_response.update( - "4536bcfad5faccb111b47003c79917fa", - account_id="string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - member = await response.parse() - assert_matches_type(MemberUpdateResponse, member, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_path_params_update_overload_1(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="", - ) - - 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="string", - ) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: - member = await async_client.accounts.members.update( - "4536bcfad5faccb111b47003c79917fa", - account_id="string", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], - ) - assert_matches_type(MemberUpdateResponse, member, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.members.with_raw_response.update( "4536bcfad5faccb111b47003c79917fa", account_id="string", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], ) assert response.is_closed is True @@ -1282,48 +430,10 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflar @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.members.with_streaming_response.update( "4536bcfad5faccb111b47003c79917fa", account_id="string", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1335,93 +445,17 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare) -> None: + 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="", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], ) 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="string", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [ - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - {"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}, - ], - }, - ], ) @parametrize