From 70bd1e4cb34e6320d3415a8b7819316d7f6ad2e8 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 3 Apr 2024 04:34:01 +0000
Subject: [PATCH] feat(api): update via SDK Studio (#209)
---
api.md | 30 ++++++-------------
src/cloudflare/resources/accounts/members.py | 5 ++--
src/cloudflare/resources/accounts/roles.py | 14 ++++-----
src/cloudflare/resources/memberships.py | 14 ++++-----
src/cloudflare/resources/queues/queues.py | 30 +++++++++++--------
.../resources/zones/dns_settings.py | 18 +++++------
src/cloudflare/types/__init__.py | 1 +
src/cloudflare/types/accounts/__init__.py | 3 +-
src/cloudflare/types/accounts/member.py | 17 ++---------
.../types/accounts/member_list_response.py | 17 +++++++++--
.../types/accounts/member_update_params.py | 11 +++----
.../types/accounts/member_with_code.py | 17 ++---------
src/cloudflare/types/accounts/role.py | 8 ++---
.../types/accounts/role_list_response.py | 21 +++++++++++++
src/cloudflare/types/accounts/role_param.py | 12 ++++++++
.../member_role.py => membership.py} | 10 +++----
src/cloudflare/types/queue_list_response.py | 9 ++++--
.../types/user/invite_list_response.py | 17 +++++++++--
src/cloudflare/types/zones/__init__.py | 3 +-
...setting_get_response.py => dns_setting.py} | 4 +--
.../types/zones/dns_setting_edit_response.py | 20 -------------
tests/api_resources/accounts/test_roles.py | 14 ++++-----
tests/api_resources/test_memberships.py | 18 +++++------
tests/api_resources/test_queues.py | 13 ++++----
.../api_resources/zones/test_dns_settings.py | 30 +++++++++----------
25 files changed, 181 insertions(+), 175 deletions(-)
create mode 100644 src/cloudflare/types/accounts/role_list_response.py
create mode 100644 src/cloudflare/types/accounts/role_param.py
rename src/cloudflare/types/{accounts/member_role.py => membership.py} (84%)
rename src/cloudflare/types/zones/{dns_setting_get_response.py => dns_setting.py} (83%)
delete mode 100644 src/cloudflare/types/zones/dns_setting_edit_response.py
diff --git a/api.md b/api.md
index fd6057c8cb9..479c140dede 100644
--- a/api.md
+++ b/api.md
@@ -26,7 +26,6 @@ Types:
from cloudflare.types.accounts import (
Member,
MemberPermission,
- MemberRole,
MemberWithCode,
MemberListResponse,
MemberDeleteResponse,
@@ -46,12 +45,12 @@ Methods:
Types:
```python
-from cloudflare.types.accounts import PermissionGrant, Role, RoleGetResponse
+from cloudflare.types.accounts import PermissionGrant, Role, RoleListResponse, RoleGetResponse
```
Methods:
-- client.accounts.roles.list(\*, account_id) -> SyncSinglePage[Role]
+- client.accounts.roles.list(\*, account_id) -> SyncSinglePage[RoleListResponse]
- client.accounts.roles.get(role_id, \*, account_id) -> RoleGetResponse
# OriginCACertificates
@@ -102,7 +101,7 @@ from cloudflare.types import (
Methods:
- client.memberships.update(membership_id, \*\*params) -> MembershipUpdateResponse
-- client.memberships.list(\*\*params) -> SyncV4PagePaginationArray[MemberRole]
+- client.memberships.list(\*\*params) -> SyncV4PagePaginationArray[Membership]
- client.memberships.delete(membership_id) -> MembershipDeleteResponse
- client.memberships.get(membership_id) -> MembershipGetResponse
@@ -179,12 +178,7 @@ Methods:
Types:
```python
-from cloudflare.types.user import (
- UserInvite,
- InviteListResponse,
- InviteEditResponse,
- InviteGetResponse,
-)
+from cloudflare.types.user import Invite, InviteListResponse, InviteEditResponse, InviteGetResponse
```
Methods:
@@ -387,13 +381,13 @@ Methods:
Types:
```python
-from cloudflare.types.zones import DNSSettingEditResponse, DNSSettingGetResponse
+from cloudflare.types.zones import DNSSetting
```
Methods:
-- client.zones.dns_settings.edit(\*, zone_id, \*\*params) -> DNSSettingEditResponse
-- client.zones.dns_settings.get(\*, zone_id) -> DNSSettingGetResponse
+- client.zones.dns_settings.edit(\*, zone_id, \*\*params) -> DNSSetting
+- client.zones.dns_settings.get(\*, zone_id) -> DNSSetting
## Settings
@@ -2966,7 +2960,7 @@ Methods:
- client.queues.create(\*, account_id, \*\*params) -> Optional
- client.queues.update(queue_id, \*, account_id, \*\*params) -> Optional
-- client.queues.list(\*, account_id) -> SyncSinglePage[QueueListResponse]
+- client.queues.list(\*, account_id) -> Optional
- client.queues.delete(queue_id, \*, account_id) -> Optional
- client.queues.get(queue_id, \*, account_id) -> Optional
@@ -2995,13 +2989,7 @@ Methods:
Types:
```python
-from cloudflare.types.queues import (
- QueueConsumer,
- QueueConsumerCreated,
- QueueConsumerUpdated,
- MessageAckResponse,
- MessagePullResponse,
-)
+from cloudflare.types.queues import QueueConsumer, MessageAckResponse, MessagePullResponse
```
Methods:
diff --git a/src/cloudflare/resources/accounts/members.py b/src/cloudflare/resources/accounts/members.py
index 7ffc4782e66..ff5a4a51b04 100644
--- a/src/cloudflare/resources/accounts/members.py
+++ b/src/cloudflare/resources/accounts/members.py
@@ -28,6 +28,7 @@
)
from ...types.accounts import (
Member,
+ RoleParam,
MemberWithCode,
MemberListResponse,
MemberDeleteResponse,
@@ -103,7 +104,7 @@ def update(
member_id: str,
*,
account_id: object,
- roles: Iterable[member_update_params.Role],
+ roles: Iterable[RoleParam],
# 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,
@@ -347,7 +348,7 @@ async def update(
member_id: str,
*,
account_id: object,
- roles: Iterable[member_update_params.Role],
+ roles: Iterable[RoleParam],
# 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,
diff --git a/src/cloudflare/resources/accounts/roles.py b/src/cloudflare/resources/accounts/roles.py
index 0bfc6405723..c3d7190308e 100644
--- a/src/cloudflare/resources/accounts/roles.py
+++ b/src/cloudflare/resources/accounts/roles.py
@@ -21,7 +21,7 @@
AsyncPaginator,
make_request_options,
)
-from ...types.accounts import Role, RoleGetResponse
+from ...types.accounts import RoleGetResponse, RoleListResponse
__all__ = ["Roles", "AsyncRoles"]
@@ -45,7 +45,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncSinglePage[Role]:
+ ) -> SyncSinglePage[RoleListResponse]:
"""
Get all available roles for an account.
@@ -60,11 +60,11 @@ def list(
"""
return self._get_api_list(
f"/accounts/{account_id}/roles",
- page=SyncSinglePage[Role],
+ page=SyncSinglePage[RoleListResponse],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- model=Role,
+ model=RoleListResponse,
)
def get(
@@ -128,7 +128,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[Role, AsyncSinglePage[Role]]:
+ ) -> AsyncPaginator[RoleListResponse, AsyncSinglePage[RoleListResponse]]:
"""
Get all available roles for an account.
@@ -143,11 +143,11 @@ def list(
"""
return self._get_api_list(
f"/accounts/{account_id}/roles",
- page=AsyncSinglePage[Role],
+ page=AsyncSinglePage[RoleListResponse],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- model=Role,
+ model=RoleListResponse,
)
async def get(
diff --git a/src/cloudflare/resources/memberships.py b/src/cloudflare/resources/memberships.py
index 6319bd61ef1..ba9f0192a13 100644
--- a/src/cloudflare/resources/memberships.py
+++ b/src/cloudflare/resources/memberships.py
@@ -8,6 +8,7 @@
import httpx
from ..types import (
+ Membership,
MembershipGetResponse,
MembershipDeleteResponse,
MembershipUpdateResponse,
@@ -33,7 +34,6 @@
AsyncPaginator,
make_request_options,
)
-from ..types.accounts import MemberRole
__all__ = ["Memberships", "AsyncMemberships"]
@@ -111,7 +111,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncV4PagePaginationArray[MemberRole]:
+ ) -> SyncV4PagePaginationArray[Membership]:
"""
List memberships of accounts the user can access.
@@ -138,7 +138,7 @@ def list(
"""
return self._get_api_list(
"/memberships",
- page=SyncV4PagePaginationArray[MemberRole],
+ page=SyncV4PagePaginationArray[Membership],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -157,7 +157,7 @@ def list(
membership_list_params.MembershipListParams,
),
),
- model=MemberRole,
+ model=Membership,
)
def delete(
@@ -317,7 +317,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[MemberRole, AsyncV4PagePaginationArray[MemberRole]]:
+ ) -> AsyncPaginator[Membership, AsyncV4PagePaginationArray[Membership]]:
"""
List memberships of accounts the user can access.
@@ -344,7 +344,7 @@ def list(
"""
return self._get_api_list(
"/memberships",
- page=AsyncV4PagePaginationArray[MemberRole],
+ page=AsyncV4PagePaginationArray[Membership],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -363,7 +363,7 @@ def list(
membership_list_params.MembershipListParams,
),
),
- model=MemberRole,
+ model=Membership,
)
async def delete(
diff --git a/src/cloudflare/resources/queues/queues.py b/src/cloudflare/resources/queues/queues.py
index 0f3f2a0c7fe..5f3220b8cbb 100644
--- a/src/cloudflare/resources/queues/queues.py
+++ b/src/cloudflare/resources/queues/queues.py
@@ -45,9 +45,7 @@
async_to_streamed_response_wrapper,
)
from ..._wrappers import ResultWrapper
-from ...pagination import SyncSinglePage, AsyncSinglePage
from ..._base_client import (
- AsyncPaginator,
make_request_options,
)
@@ -168,7 +166,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncSinglePage[QueueListResponse]:
+ ) -> Optional[QueueListResponse]:
"""
Returns the queues owned by an account.
@@ -185,13 +183,16 @@ def list(
"""
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(
+ return self._get(
f"/accounts/{account_id}/queues",
- page=SyncSinglePage[QueueListResponse],
options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
),
- model=QueueListResponse,
+ cast_to=cast(Type[Optional[QueueListResponse]], ResultWrapper[QueueListResponse]),
)
def delete(
@@ -392,7 +393,7 @@ async def update(
cast_to=cast(Type[Optional[QueueUpdateResponse]], ResultWrapper[QueueUpdateResponse]),
)
- def list(
+ async def list(
self,
*,
account_id: str,
@@ -402,7 +403,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[QueueListResponse, AsyncSinglePage[QueueListResponse]]:
+ ) -> Optional[QueueListResponse]:
"""
Returns the queues owned by an account.
@@ -419,13 +420,16 @@ def list(
"""
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(
+ return await self._get(
f"/accounts/{account_id}/queues",
- page=AsyncSinglePage[QueueListResponse],
options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
),
- model=QueueListResponse,
+ cast_to=cast(Type[Optional[QueueListResponse]], ResultWrapper[QueueListResponse]),
)
async def delete(
diff --git a/src/cloudflare/resources/zones/dns_settings.py b/src/cloudflare/resources/zones/dns_settings.py
index b09d13d1041..f3a9f9923c2 100644
--- a/src/cloudflare/resources/zones/dns_settings.py
+++ b/src/cloudflare/resources/zones/dns_settings.py
@@ -20,7 +20,7 @@
async_to_streamed_response_wrapper,
)
from ..._wrappers import ResultWrapper
-from ...types.zones import DNSSettingGetResponse, DNSSettingEditResponse, dns_setting_edit_params
+from ...types.zones import DNSSetting, dns_setting_edit_params
from ..._base_client import (
make_request_options,
)
@@ -48,7 +48,7 @@ def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> DNSSettingEditResponse:
+ ) -> DNSSetting:
"""
Update DNS settings for a zone
@@ -77,7 +77,7 @@ def edit(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
- cast_to=cast(Type[DNSSettingEditResponse], ResultWrapper[DNSSettingEditResponse]),
+ cast_to=cast(Type[DNSSetting], ResultWrapper[DNSSetting]),
)
def get(
@@ -90,7 +90,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> DNSSettingGetResponse:
+ ) -> DNSSetting:
"""
Show DNS settings for a zone
@@ -116,7 +116,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
- cast_to=cast(Type[DNSSettingGetResponse], ResultWrapper[DNSSettingGetResponse]),
+ cast_to=cast(Type[DNSSetting], ResultWrapper[DNSSetting]),
)
@@ -140,7 +140,7 @@ async def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> DNSSettingEditResponse:
+ ) -> DNSSetting:
"""
Update DNS settings for a zone
@@ -171,7 +171,7 @@ async def edit(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
- cast_to=cast(Type[DNSSettingEditResponse], ResultWrapper[DNSSettingEditResponse]),
+ cast_to=cast(Type[DNSSetting], ResultWrapper[DNSSetting]),
)
async def get(
@@ -184,7 +184,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> DNSSettingGetResponse:
+ ) -> DNSSetting:
"""
Show DNS settings for a zone
@@ -210,7 +210,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
- cast_to=cast(Type[DNSSettingGetResponse], ResultWrapper[DNSSettingGetResponse]),
+ cast_to=cast(Type[DNSSetting], ResultWrapper[DNSSetting]),
)
diff --git a/src/cloudflare/types/__init__.py b/src/cloudflare/types/__init__.py
index d1362c4b5da..9d99cc14a2a 100644
--- a/src/cloudflare/types/__init__.py
+++ b/src/cloudflare/types/__init__.py
@@ -10,6 +10,7 @@
from .ruleset import Ruleset as Ruleset
from .snippet import Snippet as Snippet
from .calls_app import CallsApp as CallsApp
+from .membership import Membership as Membership
from .healthcheck import Healthcheck as Healthcheck
from .jdcloud_ips import JDCloudIPs as JDCloudIPs
from .waiting_room import WaitingRoom as WaitingRoom
diff --git a/src/cloudflare/types/accounts/__init__.py b/src/cloudflare/types/accounts/__init__.py
index e1d4eab4ad9..dd2b4344ad6 100644
--- a/src/cloudflare/types/accounts/__init__.py
+++ b/src/cloudflare/types/accounts/__init__.py
@@ -4,12 +4,13 @@
from .role import Role as Role
from .member import Member as Member
-from .member_role import MemberRole as MemberRole
+from .role_param import RoleParam as RoleParam
from .member_with_code import MemberWithCode as MemberWithCode
from .permission_grant import PermissionGrant as PermissionGrant
from .member_permission import MemberPermission as MemberPermission
from .role_get_response import RoleGetResponse as RoleGetResponse
from .member_list_params import MemberListParams as MemberListParams
+from .role_list_response import RoleListResponse as RoleListResponse
from .member_create_params import MemberCreateParams as MemberCreateParams
from .member_list_response import MemberListResponse as MemberListResponse
from .member_update_params import MemberUpdateParams as MemberUpdateParams
diff --git a/src/cloudflare/types/accounts/member.py b/src/cloudflare/types/accounts/member.py
index ca3b971a5cf..ed46dd07964 100644
--- a/src/cloudflare/types/accounts/member.py
+++ b/src/cloudflare/types/accounts/member.py
@@ -2,23 +2,10 @@
from typing import List, Optional
+from .role import Role
from ..._models import BaseModel
-from .member_permission import MemberPermission
-__all__ = ["Member", "Role", "User"]
-
-
-class Role(BaseModel):
- id: str
- """Role identifier tag."""
-
- description: str
- """Description of role's permissions."""
-
- name: str
- """Role name."""
-
- permissions: MemberPermission
+__all__ = ["Member", "User"]
class User(BaseModel):
diff --git a/src/cloudflare/types/accounts/member_list_response.py b/src/cloudflare/types/accounts/member_list_response.py
index 26182b74f97..8df7afe8947 100644
--- a/src/cloudflare/types/accounts/member_list_response.py
+++ b/src/cloudflare/types/accounts/member_list_response.py
@@ -3,10 +3,23 @@
from typing import List, Optional
from typing_extensions import Literal
-from .role import Role
from ..._models import BaseModel
-__all__ = ["MemberListResponse"]
+__all__ = ["MemberListResponse", "Role"]
+
+
+class Role(BaseModel):
+ id: str
+ """Role identifier tag."""
+
+ description: str
+ """Description of role's permissions."""
+
+ name: str
+ """Role Name."""
+
+ permissions: List[str]
+ """Access permissions for this User."""
class MemberListResponse(BaseModel):
diff --git a/src/cloudflare/types/accounts/member_update_params.py b/src/cloudflare/types/accounts/member_update_params.py
index 69867eb443e..c41c872c805 100644
--- a/src/cloudflare/types/accounts/member_update_params.py
+++ b/src/cloudflare/types/accounts/member_update_params.py
@@ -5,16 +5,13 @@
from typing import Iterable
from typing_extensions import Required, TypedDict
-__all__ = ["MemberUpdateParams", "Role"]
+from .role_param import RoleParam
+
+__all__ = ["MemberUpdateParams"]
class MemberUpdateParams(TypedDict, total=False):
account_id: Required[object]
- roles: Required[Iterable[Role]]
+ roles: Required[Iterable[RoleParam]]
"""Roles assigned to this member."""
-
-
-class Role(TypedDict, total=False):
- id: Required[str]
- """Role identifier tag."""
diff --git a/src/cloudflare/types/accounts/member_with_code.py b/src/cloudflare/types/accounts/member_with_code.py
index 32fa17c3962..aa82792c67d 100644
--- a/src/cloudflare/types/accounts/member_with_code.py
+++ b/src/cloudflare/types/accounts/member_with_code.py
@@ -2,23 +2,10 @@
from typing import List, Optional
+from .role import Role
from ..._models import BaseModel
-from .member_permission import MemberPermission
-__all__ = ["MemberWithCode", "Role", "User"]
-
-
-class Role(BaseModel):
- id: str
- """Role identifier tag."""
-
- description: str
- """Description of role's permissions."""
-
- name: str
- """Role name."""
-
- permissions: MemberPermission
+__all__ = ["MemberWithCode", "User"]
class User(BaseModel):
diff --git a/src/cloudflare/types/accounts/role.py b/src/cloudflare/types/accounts/role.py
index 85afa978780..d2b800e18cc 100644
--- a/src/cloudflare/types/accounts/role.py
+++ b/src/cloudflare/types/accounts/role.py
@@ -1,8 +1,9 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List
+
from ..._models import BaseModel
+from .member_permission import MemberPermission
__all__ = ["Role"]
@@ -15,7 +16,6 @@ class Role(BaseModel):
"""Description of role's permissions."""
name: str
- """Role Name."""
+ """Role name."""
- permissions: List[str]
- """Access permissions for this User."""
+ permissions: MemberPermission
diff --git a/src/cloudflare/types/accounts/role_list_response.py b/src/cloudflare/types/accounts/role_list_response.py
new file mode 100644
index 00000000000..864dfccca64
--- /dev/null
+++ b/src/cloudflare/types/accounts/role_list_response.py
@@ -0,0 +1,21 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List
+
+from ..._models import BaseModel
+
+__all__ = ["RoleListResponse"]
+
+
+class RoleListResponse(BaseModel):
+ id: str
+ """Role identifier tag."""
+
+ description: str
+ """Description of role's permissions."""
+
+ name: str
+ """Role Name."""
+
+ permissions: List[str]
+ """Access permissions for this User."""
diff --git a/src/cloudflare/types/accounts/role_param.py b/src/cloudflare/types/accounts/role_param.py
new file mode 100644
index 00000000000..1ee83fe7e15
--- /dev/null
+++ b/src/cloudflare/types/accounts/role_param.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Required, TypedDict
+
+__all__ = ["RoleParam"]
+
+
+class RoleParam(TypedDict, total=False):
+ id: Required[str]
+ """Role identifier tag."""
diff --git a/src/cloudflare/types/accounts/member_role.py b/src/cloudflare/types/membership.py
similarity index 84%
rename from src/cloudflare/types/accounts/member_role.py
rename to src/cloudflare/types/membership.py
index b927b8c00cc..02f080b8959 100644
--- a/src/cloudflare/types/accounts/member_role.py
+++ b/src/cloudflare/types/membership.py
@@ -3,14 +3,14 @@
from typing import List, Optional
from typing_extensions import Literal
-from ..account import Account
-from ..._models import BaseModel
-from .member_permission import MemberPermission
+from .account import Account
+from .._models import BaseModel
+from .accounts import MemberPermission
-__all__ = ["MemberRole"]
+__all__ = ["Membership"]
-class MemberRole(BaseModel):
+class Membership(BaseModel):
id: Optional[str] = None
"""Membership identifier tag."""
diff --git a/src/cloudflare/types/queue_list_response.py b/src/cloudflare/types/queue_list_response.py
index 1ccfe1e6e71..9b0038b8c4d 100644
--- a/src/cloudflare/types/queue_list_response.py
+++ b/src/cloudflare/types/queue_list_response.py
@@ -1,13 +1,13 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Optional
+from typing import List, Optional
from .._models import BaseModel
-__all__ = ["QueueListResponse"]
+__all__ = ["QueueListResponse", "QueueListResponseItem"]
-class QueueListResponse(BaseModel):
+class QueueListResponseItem(BaseModel):
consumers: Optional[object] = None
consumers_total_count: Optional[object] = None
@@ -23,3 +23,6 @@ class QueueListResponse(BaseModel):
queue_id: Optional[str] = None
queue_name: Optional[str] = None
+
+
+QueueListResponse = List[QueueListResponseItem]
diff --git a/src/cloudflare/types/user/invite_list_response.py b/src/cloudflare/types/user/invite_list_response.py
index 4552dab6bdb..1c7fae63a42 100644
--- a/src/cloudflare/types/user/invite_list_response.py
+++ b/src/cloudflare/types/user/invite_list_response.py
@@ -5,9 +5,22 @@
from typing_extensions import Literal
from ..._models import BaseModel
-from ..accounts import Role
-__all__ = ["InviteListResponse"]
+__all__ = ["InviteListResponse", "Role"]
+
+
+class Role(BaseModel):
+ id: str
+ """Role identifier tag."""
+
+ description: str
+ """Description of role's permissions."""
+
+ name: str
+ """Role Name."""
+
+ permissions: List[str]
+ """Access permissions for this User."""
class InviteListResponse(BaseModel):
diff --git a/src/cloudflare/types/zones/__init__.py b/src/cloudflare/types/zones/__init__.py
index 3fb58b135a5..aeacfccb200 100644
--- a/src/cloudflare/types/zones/__init__.py
+++ b/src/cloudflare/types/zones/__init__.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+from .dns_setting import DNSSetting as DNSSetting
from .hold_get_response import HoldGetResponse as HoldGetResponse
from .hold_create_params import HoldCreateParams as HoldCreateParams
from .hold_delete_params import HoldDeleteParams as HoldDeleteParams
@@ -11,8 +12,6 @@
from .setting_get_response import SettingGetResponse as SettingGetResponse
from .setting_edit_response import SettingEditResponse as SettingEditResponse
from .dns_setting_edit_params import DNSSettingEditParams as DNSSettingEditParams
-from .dns_setting_get_response import DNSSettingGetResponse as DNSSettingGetResponse
-from .dns_setting_edit_response import DNSSettingEditResponse as DNSSettingEditResponse
from .subscription_get_response import SubscriptionGetResponse as SubscriptionGetResponse
from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams
from .subscription_list_response import SubscriptionListResponse as SubscriptionListResponse
diff --git a/src/cloudflare/types/zones/dns_setting_get_response.py b/src/cloudflare/types/zones/dns_setting.py
similarity index 83%
rename from src/cloudflare/types/zones/dns_setting_get_response.py
rename to src/cloudflare/types/zones/dns_setting.py
index 784da31db6e..4099cc53b59 100644
--- a/src/cloudflare/types/zones/dns_setting_get_response.py
+++ b/src/cloudflare/types/zones/dns_setting.py
@@ -5,7 +5,7 @@
from ..._models import BaseModel
-__all__ = ["DNSSettingGetResponse", "Nameservers"]
+__all__ = ["DNSSetting", "Nameservers"]
class Nameservers(BaseModel):
@@ -13,7 +13,7 @@ class Nameservers(BaseModel):
"""Nameserver type"""
-class DNSSettingGetResponse(BaseModel):
+class DNSSetting(BaseModel):
nameservers: Optional[Nameservers] = None
"""
Settings determining the nameservers through which the zone should be available.
diff --git a/src/cloudflare/types/zones/dns_setting_edit_response.py b/src/cloudflare/types/zones/dns_setting_edit_response.py
deleted file mode 100644
index e1a4b6d6c17..00000000000
--- a/src/cloudflare/types/zones/dns_setting_edit_response.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Optional
-from typing_extensions import Literal
-
-from ..._models import BaseModel
-
-__all__ = ["DNSSettingEditResponse", "Nameservers"]
-
-
-class Nameservers(BaseModel):
- type: Literal["cloudflare.standard", "cloudflare.foundation_dns"]
- """Nameserver type"""
-
-
-class DNSSettingEditResponse(BaseModel):
- nameservers: Optional[Nameservers] = None
- """
- Settings determining the nameservers through which the zone should be available.
- """
diff --git a/tests/api_resources/accounts/test_roles.py b/tests/api_resources/accounts/test_roles.py
index 53121acc6ff..2cbdcfab4c5 100644
--- a/tests/api_resources/accounts/test_roles.py
+++ b/tests/api_resources/accounts/test_roles.py
@@ -10,7 +10,7 @@
from cloudflare import Cloudflare, AsyncCloudflare
from tests.utils import assert_matches_type
from cloudflare.pagination import SyncSinglePage, AsyncSinglePage
-from cloudflare.types.accounts import Role, RoleGetResponse
+from cloudflare.types.accounts import RoleGetResponse, RoleListResponse
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -24,7 +24,7 @@ def test_method_list(self, client: Cloudflare) -> None:
role = client.accounts.roles.list(
account_id={},
)
- assert_matches_type(SyncSinglePage[Role], role, path=["response"])
+ assert_matches_type(SyncSinglePage[RoleListResponse], role, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -36,7 +36,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
role = response.parse()
- assert_matches_type(SyncSinglePage[Role], role, path=["response"])
+ assert_matches_type(SyncSinglePage[RoleListResponse], role, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -48,7 +48,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
role = response.parse()
- assert_matches_type(SyncSinglePage[Role], role, path=["response"])
+ assert_matches_type(SyncSinglePage[RoleListResponse], role, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -99,7 +99,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
role = await async_client.accounts.roles.list(
account_id={},
)
- assert_matches_type(AsyncSinglePage[Role], role, path=["response"])
+ assert_matches_type(AsyncSinglePage[RoleListResponse], role, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -111,7 +111,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
role = await response.parse()
- assert_matches_type(AsyncSinglePage[Role], role, path=["response"])
+ assert_matches_type(AsyncSinglePage[RoleListResponse], role, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -123,7 +123,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
role = await response.parse()
- assert_matches_type(AsyncSinglePage[Role], role, path=["response"])
+ assert_matches_type(AsyncSinglePage[RoleListResponse], role, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_memberships.py b/tests/api_resources/test_memberships.py
index fd239161a87..a61d32f96f0 100644
--- a/tests/api_resources/test_memberships.py
+++ b/tests/api_resources/test_memberships.py
@@ -10,12 +10,12 @@
from cloudflare import Cloudflare, AsyncCloudflare
from tests.utils import assert_matches_type
from cloudflare.types import (
+ Membership,
MembershipGetResponse,
MembershipDeleteResponse,
MembershipUpdateResponse,
)
from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
-from cloudflare.types.accounts import MemberRole
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -73,7 +73,7 @@ def test_path_params_update(self, client: Cloudflare) -> None:
@parametrize
def test_method_list(self, client: Cloudflare) -> None:
membership = client.memberships.list()
- assert_matches_type(SyncV4PagePaginationArray[MemberRole], membership, path=["response"])
+ assert_matches_type(SyncV4PagePaginationArray[Membership], membership, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -87,7 +87,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
per_page=5,
status="accepted",
)
- assert_matches_type(SyncV4PagePaginationArray[MemberRole], membership, path=["response"])
+ assert_matches_type(SyncV4PagePaginationArray[Membership], membership, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -97,7 +97,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
membership = response.parse()
- assert_matches_type(SyncV4PagePaginationArray[MemberRole], membership, path=["response"])
+ assert_matches_type(SyncV4PagePaginationArray[Membership], membership, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -107,7 +107,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
membership = response.parse()
- assert_matches_type(SyncV4PagePaginationArray[MemberRole], membership, path=["response"])
+ assert_matches_type(SyncV4PagePaginationArray[Membership], membership, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -249,7 +249,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
membership = await async_client.memberships.list()
- assert_matches_type(AsyncV4PagePaginationArray[MemberRole], membership, path=["response"])
+ assert_matches_type(AsyncV4PagePaginationArray[Membership], membership, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -263,7 +263,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare)
per_page=5,
status="accepted",
)
- assert_matches_type(AsyncV4PagePaginationArray[MemberRole], membership, path=["response"])
+ assert_matches_type(AsyncV4PagePaginationArray[Membership], membership, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -273,7 +273,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
membership = await response.parse()
- assert_matches_type(AsyncV4PagePaginationArray[MemberRole], membership, path=["response"])
+ assert_matches_type(AsyncV4PagePaginationArray[Membership], membership, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -283,7 +283,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
membership = await response.parse()
- assert_matches_type(AsyncV4PagePaginationArray[MemberRole], membership, path=["response"])
+ assert_matches_type(AsyncV4PagePaginationArray[Membership], membership, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_queues.py b/tests/api_resources/test_queues.py
index 2204fc81cdb..0d2b8b65738 100644
--- a/tests/api_resources/test_queues.py
+++ b/tests/api_resources/test_queues.py
@@ -16,7 +16,6 @@
QueueDeleteResponse,
QueueUpdateResponse,
)
-from cloudflare.pagination import SyncSinglePage, AsyncSinglePage
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -133,7 +132,7 @@ def test_method_list(self, client: Cloudflare) -> None:
queue = client.queues.list(
account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
- assert_matches_type(SyncSinglePage[QueueListResponse], queue, path=["response"])
+ assert_matches_type(Optional[QueueListResponse], queue, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -145,7 +144,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
queue = response.parse()
- assert_matches_type(SyncSinglePage[QueueListResponse], queue, path=["response"])
+ assert_matches_type(Optional[QueueListResponse], queue, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -157,7 +156,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
queue = response.parse()
- assert_matches_type(SyncSinglePage[QueueListResponse], queue, path=["response"])
+ assert_matches_type(Optional[QueueListResponse], queue, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -386,7 +385,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
queue = await async_client.queues.list(
account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
- assert_matches_type(AsyncSinglePage[QueueListResponse], queue, path=["response"])
+ assert_matches_type(Optional[QueueListResponse], queue, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -398,7 +397,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
queue = await response.parse()
- assert_matches_type(AsyncSinglePage[QueueListResponse], queue, path=["response"])
+ assert_matches_type(Optional[QueueListResponse], queue, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -410,7 +409,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
queue = await response.parse()
- assert_matches_type(AsyncSinglePage[QueueListResponse], queue, path=["response"])
+ assert_matches_type(Optional[QueueListResponse], queue, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/zones/test_dns_settings.py b/tests/api_resources/zones/test_dns_settings.py
index 7f234aa2d37..08e422a0b89 100644
--- a/tests/api_resources/zones/test_dns_settings.py
+++ b/tests/api_resources/zones/test_dns_settings.py
@@ -9,7 +9,7 @@
from cloudflare import Cloudflare, AsyncCloudflare
from tests.utils import assert_matches_type
-from cloudflare.types.zones import DNSSettingGetResponse, DNSSettingEditResponse
+from cloudflare.types.zones import DNSSetting
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -23,7 +23,7 @@ def test_method_edit(self, client: Cloudflare) -> None:
dns_setting = client.zones.dns_settings.edit(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
- assert_matches_type(DNSSettingEditResponse, dns_setting, path=["response"])
+ assert_matches_type(DNSSetting, dns_setting, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -32,7 +32,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None:
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
nameservers={"type": "cloudflare.standard"},
)
- assert_matches_type(DNSSettingEditResponse, dns_setting, path=["response"])
+ assert_matches_type(DNSSetting, dns_setting, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -44,7 +44,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dns_setting = response.parse()
- assert_matches_type(DNSSettingEditResponse, dns_setting, path=["response"])
+ assert_matches_type(DNSSetting, dns_setting, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -56,7 +56,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dns_setting = response.parse()
- assert_matches_type(DNSSettingEditResponse, dns_setting, path=["response"])
+ assert_matches_type(DNSSetting, dns_setting, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -74,7 +74,7 @@ def test_method_get(self, client: Cloudflare) -> None:
dns_setting = client.zones.dns_settings.get(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
- assert_matches_type(DNSSettingGetResponse, dns_setting, path=["response"])
+ assert_matches_type(DNSSetting, dns_setting, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -86,7 +86,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dns_setting = response.parse()
- assert_matches_type(DNSSettingGetResponse, dns_setting, path=["response"])
+ assert_matches_type(DNSSetting, dns_setting, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -98,7 +98,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dns_setting = response.parse()
- assert_matches_type(DNSSettingGetResponse, dns_setting, path=["response"])
+ assert_matches_type(DNSSetting, dns_setting, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -120,7 +120,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
dns_setting = await async_client.zones.dns_settings.edit(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
- assert_matches_type(DNSSettingEditResponse, dns_setting, path=["response"])
+ assert_matches_type(DNSSetting, dns_setting, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -129,7 +129,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare)
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
nameservers={"type": "cloudflare.standard"},
)
- assert_matches_type(DNSSettingEditResponse, dns_setting, path=["response"])
+ assert_matches_type(DNSSetting, dns_setting, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -141,7 +141,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dns_setting = await response.parse()
- assert_matches_type(DNSSettingEditResponse, dns_setting, path=["response"])
+ assert_matches_type(DNSSetting, dns_setting, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -153,7 +153,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dns_setting = await response.parse()
- assert_matches_type(DNSSettingEditResponse, dns_setting, path=["response"])
+ assert_matches_type(DNSSetting, dns_setting, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -171,7 +171,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
dns_setting = await async_client.zones.dns_settings.get(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
- assert_matches_type(DNSSettingGetResponse, dns_setting, path=["response"])
+ assert_matches_type(DNSSetting, dns_setting, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -183,7 +183,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dns_setting = await response.parse()
- assert_matches_type(DNSSettingGetResponse, dns_setting, path=["response"])
+ assert_matches_type(DNSSetting, dns_setting, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -195,7 +195,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dns_setting = await response.parse()
- assert_matches_type(DNSSettingGetResponse, dns_setting, path=["response"])
+ assert_matches_type(DNSSetting, dns_setting, path=["response"])
assert cast(Any, response.is_closed) is True