Skip to content

Commit f74e151

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#306)
1 parent 8e45d94 commit f74e151

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5252,12 +5252,12 @@ Methods:
52525252
Types:
52535253

52545254
```python
5255-
from cloudflare.types.zero_trust.access import User
5255+
from cloudflare.types.zero_trust.access import AccessUser
52565256
```
52575257

52585258
Methods:
52595259

5260-
- <code title="get /accounts/{identifier}/access/users">client.zero_trust.access.users.<a href="./src/cloudflare/resources/zero_trust/access/users/users.py">list</a>(identifier) -> <a href="./src/cloudflare/types/zero_trust/access/user.py">SyncSinglePage[User]</a></code>
5260+
- <code title="get /accounts/{identifier}/access/users">client.zero_trust.access.users.<a href="./src/cloudflare/resources/zero_trust/access/users/users.py">list</a>(identifier) -> <a href="./src/cloudflare/types/zero_trust/access/access_user.py">SyncSinglePage[AccessUser]</a></code>
52615261

52625262
#### ActiveSessions
52635263

src/cloudflare/resources/zero_trust/access/users/users.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
LastSeenIdentityWithStreamingResponse,
4343
AsyncLastSeenIdentityWithStreamingResponse,
4444
)
45-
from .....types.zero_trust.access import User
45+
from .....types.zero_trust.access import AccessUser
4646

4747
__all__ = ["Users", "AsyncUsers"]
4848

@@ -78,7 +78,7 @@ def list(
7878
extra_query: Query | None = None,
7979
extra_body: Body | None = None,
8080
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
81-
) -> SyncSinglePage[User]:
81+
) -> SyncSinglePage[AccessUser]:
8282
"""
8383
Gets a list of users for an account.
8484
@@ -97,11 +97,11 @@ def list(
9797
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
9898
return self._get_api_list(
9999
f"/accounts/{identifier}/access/users",
100-
page=SyncSinglePage[User],
100+
page=SyncSinglePage[AccessUser],
101101
options=make_request_options(
102102
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
103103
),
104-
model=User,
104+
model=AccessUser,
105105
)
106106

107107

@@ -136,7 +136,7 @@ def list(
136136
extra_query: Query | None = None,
137137
extra_body: Body | None = None,
138138
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
139-
) -> AsyncPaginator[User, AsyncSinglePage[User]]:
139+
) -> AsyncPaginator[AccessUser, AsyncSinglePage[AccessUser]]:
140140
"""
141141
Gets a list of users for an account.
142142
@@ -155,11 +155,11 @@ def list(
155155
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
156156
return self._get_api_list(
157157
f"/accounts/{identifier}/access/users",
158-
page=AsyncSinglePage[User],
158+
page=AsyncSinglePage[AccessUser],
159159
options=make_request_options(
160160
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
161161
),
162-
model=User,
162+
model=AccessUser,
163163
)
164164

165165

src/cloudflare/types/zero_trust/access/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from __future__ import annotations
44

55
from .tag import Tag as Tag
6-
from .user import User as User
76
from .bookmark import Bookmark as Bookmark
7+
from .access_user import AccessUser as AccessUser
88
from .application import Application as Application
99
from .certificate import Certificate as Certificate
1010
from .custom_page import CustomPage as CustomPage

src/cloudflare/types/zero_trust/access/user.py src/cloudflare/types/zero_trust/access/access_user.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
from ...._models import BaseModel
77

8-
__all__ = ["User"]
8+
__all__ = ["AccessUser"]
99

1010

11-
class User(BaseModel):
11+
class AccessUser(BaseModel):
1212
id: Optional[str] = None
1313
"""UUID"""
1414

tests/api_resources/zero_trust/access/test_users.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from cloudflare import Cloudflare, AsyncCloudflare
1111
from tests.utils import assert_matches_type
1212
from cloudflare.pagination import SyncSinglePage, AsyncSinglePage
13-
from cloudflare.types.zero_trust.access import User
13+
from cloudflare.types.zero_trust.access import AccessUser
1414

1515
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
1616

@@ -24,7 +24,7 @@ def test_method_list(self, client: Cloudflare) -> None:
2424
user = client.zero_trust.access.users.list(
2525
"023e105f4ecef8ad9ca31a8372d0c353",
2626
)
27-
assert_matches_type(SyncSinglePage[User], user, path=["response"])
27+
assert_matches_type(SyncSinglePage[AccessUser], user, path=["response"])
2828

2929
@pytest.mark.skip()
3030
@parametrize
@@ -36,7 +36,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None:
3636
assert response.is_closed is True
3737
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
3838
user = response.parse()
39-
assert_matches_type(SyncSinglePage[User], user, path=["response"])
39+
assert_matches_type(SyncSinglePage[AccessUser], user, path=["response"])
4040

4141
@pytest.mark.skip()
4242
@parametrize
@@ -48,7 +48,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None:
4848
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
4949

5050
user = response.parse()
51-
assert_matches_type(SyncSinglePage[User], user, path=["response"])
51+
assert_matches_type(SyncSinglePage[AccessUser], user, path=["response"])
5252

5353
assert cast(Any, response.is_closed) is True
5454

@@ -70,7 +70,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
7070
user = await async_client.zero_trust.access.users.list(
7171
"023e105f4ecef8ad9ca31a8372d0c353",
7272
)
73-
assert_matches_type(AsyncSinglePage[User], user, path=["response"])
73+
assert_matches_type(AsyncSinglePage[AccessUser], user, path=["response"])
7474

7575
@pytest.mark.skip()
7676
@parametrize
@@ -82,7 +82,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
8282
assert response.is_closed is True
8383
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
8484
user = await response.parse()
85-
assert_matches_type(AsyncSinglePage[User], user, path=["response"])
85+
assert_matches_type(AsyncSinglePage[AccessUser], user, path=["response"])
8686

8787
@pytest.mark.skip()
8888
@parametrize
@@ -94,7 +94,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N
9494
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
9595

9696
user = await response.parse()
97-
assert_matches_type(AsyncSinglePage[User], user, path=["response"])
97+
assert_matches_type(AsyncSinglePage[AccessUser], user, path=["response"])
9898

9999
assert cast(Any, response.is_closed) is True
100100

0 commit comments

Comments
 (0)