Skip to content

Commit 5d3bc9c

Browse files
feat(api): update via SDK Studio
1 parent 6bc9bf2 commit 5d3bc9c

File tree

6 files changed

+118
-4
lines changed

6 files changed

+118
-4
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 13
1+
configured_endpoints: 14
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-ec1420af27ac837f49a977cb95726af45a5ee5b5cd367e54b8a611de47ee3c84.yml
33
openapi_spec_hash: 0fc5dd84801ee8f46a9b5d0941bdefda
4-
config_hash: 7e89b01037138060a2d7fa13e6025469
4+
config_hash: 985dd1bd217ba3c5c5b614da08d43e5f

api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ Methods:
7575
Types:
7676

7777
```python
78-
from hyperspell.types import Token, AuthMeResponse
78+
from hyperspell.types import Token, AuthDeleteUserResponse, AuthMeResponse
7979
```
8080

8181
Methods:
8282

83+
- <code title="delete /auth/delete">client.auth.<a href="./src/hyperspell/resources/auth.py">delete_user</a>() -> <a href="./src/hyperspell/types/auth_delete_user_response.py">AuthDeleteUserResponse</a></code>
8384
- <code title="get /auth/me">client.auth.<a href="./src/hyperspell/resources/auth.py">me</a>() -> <a href="./src/hyperspell/types/auth_me_response.py">AuthMeResponse</a></code>
8485
- <code title="post /auth/user_token">client.auth.<a href="./src/hyperspell/resources/auth.py">user_token</a>(\*\*<a href="src/hyperspell/types/auth_user_token_params.py">params</a>) -> <a href="./src/hyperspell/types/token.py">Token</a></code>

src/hyperspell/resources/auth.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from ..types.token import Token
2121
from .._base_client import make_request_options
2222
from ..types.auth_me_response import AuthMeResponse
23+
from ..types.auth_delete_user_response import AuthDeleteUserResponse
2324

2425
__all__ = ["AuthResource", "AsyncAuthResource"]
2526

@@ -44,6 +45,25 @@ def with_streaming_response(self) -> AuthResourceWithStreamingResponse:
4445
"""
4546
return AuthResourceWithStreamingResponse(self)
4647

48+
def delete_user(
49+
self,
50+
*,
51+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
52+
# The extra values given here take precedence over values defined on the client or passed to this method.
53+
extra_headers: Headers | None = None,
54+
extra_query: Query | None = None,
55+
extra_body: Body | None = None,
56+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
57+
) -> AuthDeleteUserResponse:
58+
"""Endpoint to delete user."""
59+
return self._delete(
60+
"/auth/delete",
61+
options=make_request_options(
62+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
63+
),
64+
cast_to=AuthDeleteUserResponse,
65+
)
66+
4767
def me(
4868
self,
4969
*,
@@ -127,6 +147,25 @@ def with_streaming_response(self) -> AsyncAuthResourceWithStreamingResponse:
127147
"""
128148
return AsyncAuthResourceWithStreamingResponse(self)
129149

150+
async def delete_user(
151+
self,
152+
*,
153+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
154+
# The extra values given here take precedence over values defined on the client or passed to this method.
155+
extra_headers: Headers | None = None,
156+
extra_query: Query | None = None,
157+
extra_body: Body | None = None,
158+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
159+
) -> AuthDeleteUserResponse:
160+
"""Endpoint to delete user."""
161+
return await self._delete(
162+
"/auth/delete",
163+
options=make_request_options(
164+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
165+
),
166+
cast_to=AuthDeleteUserResponse,
167+
)
168+
130169
async def me(
131170
self,
132171
*,
@@ -194,6 +233,9 @@ class AuthResourceWithRawResponse:
194233
def __init__(self, auth: AuthResource) -> None:
195234
self._auth = auth
196235

236+
self.delete_user = to_raw_response_wrapper(
237+
auth.delete_user,
238+
)
197239
self.me = to_raw_response_wrapper(
198240
auth.me,
199241
)
@@ -206,6 +248,9 @@ class AsyncAuthResourceWithRawResponse:
206248
def __init__(self, auth: AsyncAuthResource) -> None:
207249
self._auth = auth
208250

251+
self.delete_user = async_to_raw_response_wrapper(
252+
auth.delete_user,
253+
)
209254
self.me = async_to_raw_response_wrapper(
210255
auth.me,
211256
)
@@ -218,6 +263,9 @@ class AuthResourceWithStreamingResponse:
218263
def __init__(self, auth: AuthResource) -> None:
219264
self._auth = auth
220265

266+
self.delete_user = to_streamed_response_wrapper(
267+
auth.delete_user,
268+
)
221269
self.me = to_streamed_response_wrapper(
222270
auth.me,
223271
)
@@ -230,6 +278,9 @@ class AsyncAuthResourceWithStreamingResponse:
230278
def __init__(self, auth: AsyncAuthResource) -> None:
231279
self._auth = auth
232280

281+
self.delete_user = async_to_streamed_response_wrapper(
282+
auth.delete_user,
283+
)
233284
self.me = async_to_streamed_response_wrapper(
234285
auth.me,
235286
)

src/hyperspell/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
from .memory_delete_response import MemoryDeleteResponse as MemoryDeleteResponse
1717
from .memory_search_response import MemorySearchResponse as MemorySearchResponse
1818
from .memory_status_response import MemoryStatusResponse as MemoryStatusResponse
19+
from .auth_delete_user_response import AuthDeleteUserResponse as AuthDeleteUserResponse
1920
from .integration_revoke_response import IntegrationRevokeResponse as IntegrationRevokeResponse
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .._models import BaseModel
4+
5+
__all__ = ["AuthDeleteUserResponse"]
6+
7+
8+
class AuthDeleteUserResponse(BaseModel):
9+
message: str
10+
11+
success: bool

tests/api_resources/test_auth.py

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,39 @@
99

1010
from hyperspell import Hyperspell, AsyncHyperspell
1111
from tests.utils import assert_matches_type
12-
from hyperspell.types import Token, AuthMeResponse
12+
from hyperspell.types import Token, AuthMeResponse, AuthDeleteUserResponse
1313

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

1616

1717
class TestAuth:
1818
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
1919

20+
@parametrize
21+
def test_method_delete_user(self, client: Hyperspell) -> None:
22+
auth = client.auth.delete_user()
23+
assert_matches_type(AuthDeleteUserResponse, auth, path=["response"])
24+
25+
@parametrize
26+
def test_raw_response_delete_user(self, client: Hyperspell) -> None:
27+
response = client.auth.with_raw_response.delete_user()
28+
29+
assert response.is_closed is True
30+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
31+
auth = response.parse()
32+
assert_matches_type(AuthDeleteUserResponse, auth, path=["response"])
33+
34+
@parametrize
35+
def test_streaming_response_delete_user(self, client: Hyperspell) -> None:
36+
with client.auth.with_streaming_response.delete_user() as response:
37+
assert not response.is_closed
38+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
39+
40+
auth = response.parse()
41+
assert_matches_type(AuthDeleteUserResponse, auth, path=["response"])
42+
43+
assert cast(Any, response.is_closed) is True
44+
2045
@parametrize
2146
def test_method_me(self, client: Hyperspell) -> None:
2247
auth = client.auth.me()
@@ -87,6 +112,31 @@ class TestAsyncAuth:
87112
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
88113
)
89114

115+
@parametrize
116+
async def test_method_delete_user(self, async_client: AsyncHyperspell) -> None:
117+
auth = await async_client.auth.delete_user()
118+
assert_matches_type(AuthDeleteUserResponse, auth, path=["response"])
119+
120+
@parametrize
121+
async def test_raw_response_delete_user(self, async_client: AsyncHyperspell) -> None:
122+
response = await async_client.auth.with_raw_response.delete_user()
123+
124+
assert response.is_closed is True
125+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
126+
auth = await response.parse()
127+
assert_matches_type(AuthDeleteUserResponse, auth, path=["response"])
128+
129+
@parametrize
130+
async def test_streaming_response_delete_user(self, async_client: AsyncHyperspell) -> None:
131+
async with async_client.auth.with_streaming_response.delete_user() as response:
132+
assert not response.is_closed
133+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
134+
135+
auth = await response.parse()
136+
assert_matches_type(AuthDeleteUserResponse, auth, path=["response"])
137+
138+
assert cast(Any, response.is_closed) is True
139+
90140
@parametrize
91141
async def test_method_me(self, async_client: AsyncHyperspell) -> None:
92142
auth = await async_client.auth.me()

0 commit comments

Comments
 (0)