Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Apr 12, 2024
1 parent d3067ec commit 9257ee1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5252,12 +5252,12 @@ Methods:
Types:

```python
from cloudflare.types.zero_trust.access import User
from cloudflare.types.zero_trust.access import AccessUser
```

Methods:

- <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>
- <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>

#### ActiveSessions

Expand Down
14 changes: 7 additions & 7 deletions src/cloudflare/resources/zero_trust/access/users/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
LastSeenIdentityWithStreamingResponse,
AsyncLastSeenIdentityWithStreamingResponse,
)
from .....types.zero_trust.access import User
from .....types.zero_trust.access import AccessUser

__all__ = ["Users", "AsyncUsers"]

Expand Down Expand Up @@ -78,7 +78,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncSinglePage[User]:
) -> SyncSinglePage[AccessUser]:
"""
Gets a list of users for an account.
Expand All @@ -97,11 +97,11 @@ def list(
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
return self._get_api_list(
f"/accounts/{identifier}/access/users",
page=SyncSinglePage[User],
page=SyncSinglePage[AccessUser],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=User,
model=AccessUser,
)


Expand Down Expand Up @@ -136,7 +136,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[User, AsyncSinglePage[User]]:
) -> AsyncPaginator[AccessUser, AsyncSinglePage[AccessUser]]:
"""
Gets a list of users for an account.
Expand All @@ -155,11 +155,11 @@ def list(
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
return self._get_api_list(
f"/accounts/{identifier}/access/users",
page=AsyncSinglePage[User],
page=AsyncSinglePage[AccessUser],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=User,
model=AccessUser,
)


Expand Down
2 changes: 1 addition & 1 deletion src/cloudflare/types/zero_trust/access/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from __future__ import annotations

from .tag import Tag as Tag
from .user import User as User
from .bookmark import Bookmark as Bookmark
from .access_user import AccessUser as AccessUser
from .application import Application as Application
from .certificate import Certificate as Certificate
from .custom_page import CustomPage as CustomPage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

from ...._models import BaseModel

__all__ = ["User"]
__all__ = ["AccessUser"]


class User(BaseModel):
class AccessUser(BaseModel):
id: Optional[str] = None
"""UUID"""

Expand Down
14 changes: 7 additions & 7 deletions tests/api_resources/zero_trust/access/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.zero_trust.access import User
from cloudflare.types.zero_trust.access import AccessUser

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

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

@pytest.mark.skip()
@parametrize
Expand All @@ -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"
user = response.parse()
assert_matches_type(SyncSinglePage[User], user, path=["response"])
assert_matches_type(SyncSinglePage[AccessUser], user, path=["response"])

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

user = response.parse()
assert_matches_type(SyncSinglePage[User], user, path=["response"])
assert_matches_type(SyncSinglePage[AccessUser], user, path=["response"])

assert cast(Any, response.is_closed) is True

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

@pytest.mark.skip()
@parametrize
Expand All @@ -82,7 +82,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"
user = await response.parse()
assert_matches_type(AsyncSinglePage[User], user, path=["response"])
assert_matches_type(AsyncSinglePage[AccessUser], user, path=["response"])

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

user = await response.parse()
assert_matches_type(AsyncSinglePage[User], user, path=["response"])
assert_matches_type(AsyncSinglePage[AccessUser], user, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down

0 comments on commit 9257ee1

Please sign in to comment.