Skip to content

Commit 1bfef28

Browse files
feat(api): api update
1 parent 4b1fb3d commit 1bfef28

File tree

7 files changed

+6
-245
lines changed

7 files changed

+6
-245
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 20
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-5c32c854b3a68ddee47fb9f4ae077ac9df93d9ecb46311282285e9ff56f979be.yml
3-
openapi_spec_hash: eb7f5be1d2520355ad5657607c1c03d2
1+
configured_endpoints: 19
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-f6ce5154226fb08b6df06b813c46950bf10835af91a7e7b64dd54fc077e35dcc.yml
3+
openapi_spec_hash: f63ed123d263784f1e9971061494f730
44
config_hash: e29127278ff246754ce4801403db0cd9

api.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,13 @@ from hyperspell.types import QueryResult
99
Types:
1010

1111
```python
12-
from hyperspell.types import (
13-
IntegrationListResponse,
14-
IntegrationConnectResponse,
15-
IntegrationRevokeResponse,
16-
)
12+
from hyperspell.types import IntegrationListResponse, IntegrationConnectResponse
1713
```
1814

1915
Methods:
2016

2117
- <code title="get /integrations/list">client.integrations.<a href="./src/hyperspell/resources/integrations/integrations.py">list</a>() -> <a href="./src/hyperspell/types/integration_list_response.py">IntegrationListResponse</a></code>
2218
- <code title="get /integrations/{integration_id}/connect">client.integrations.<a href="./src/hyperspell/resources/integrations/integrations.py">connect</a>(integration_id, \*\*<a href="src/hyperspell/types/integration_connect_params.py">params</a>) -> <a href="./src/hyperspell/types/integration_connect_response.py">IntegrationConnectResponse</a></code>
23-
- <code title="get /integrations/{integration_id}/revoke">client.integrations.<a href="./src/hyperspell/resources/integrations/integrations.py">revoke</a>(integration_id) -> <a href="./src/hyperspell/types/integration_revoke_response.py">IntegrationRevokeResponse</a></code>
2419

2520
## GoogleCalendar
2621

src/hyperspell/resources/integrations/integrations.py

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
AsyncGoogleCalendarResourceWithStreamingResponse,
4444
)
4545
from ...types.integration_list_response import IntegrationListResponse
46-
from ...types.integration_revoke_response import IntegrationRevokeResponse
4746
from ...types.integration_connect_response import IntegrationConnectResponse
4847

4948
__all__ = ["IntegrationsResource", "AsyncIntegrationsResource"]
@@ -140,40 +139,6 @@ def connect(
140139
cast_to=IntegrationConnectResponse,
141140
)
142141

143-
def revoke(
144-
self,
145-
integration_id: str,
146-
*,
147-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
148-
# The extra values given here take precedence over values defined on the client or passed to this method.
149-
extra_headers: Headers | None = None,
150-
extra_query: Query | None = None,
151-
extra_body: Body | None = None,
152-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
153-
) -> IntegrationRevokeResponse:
154-
"""
155-
Revokes Hyperspell's access the given provider and deletes all stored
156-
credentials and indexed data.
157-
158-
Args:
159-
extra_headers: Send extra headers
160-
161-
extra_query: Add additional query parameters to the request
162-
163-
extra_body: Add additional JSON properties to the request
164-
165-
timeout: Override the client-level default timeout for this request, in seconds
166-
"""
167-
if not integration_id:
168-
raise ValueError(f"Expected a non-empty value for `integration_id` but received {integration_id!r}")
169-
return self._get(
170-
f"/integrations/{integration_id}/revoke",
171-
options=make_request_options(
172-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
173-
),
174-
cast_to=IntegrationRevokeResponse,
175-
)
176-
177142

178143
class AsyncIntegrationsResource(AsyncAPIResource):
179144
@cached_property
@@ -266,40 +231,6 @@ async def connect(
266231
cast_to=IntegrationConnectResponse,
267232
)
268233

269-
async def revoke(
270-
self,
271-
integration_id: str,
272-
*,
273-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
274-
# The extra values given here take precedence over values defined on the client or passed to this method.
275-
extra_headers: Headers | None = None,
276-
extra_query: Query | None = None,
277-
extra_body: Body | None = None,
278-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
279-
) -> IntegrationRevokeResponse:
280-
"""
281-
Revokes Hyperspell's access the given provider and deletes all stored
282-
credentials and indexed data.
283-
284-
Args:
285-
extra_headers: Send extra headers
286-
287-
extra_query: Add additional query parameters to the request
288-
289-
extra_body: Add additional JSON properties to the request
290-
291-
timeout: Override the client-level default timeout for this request, in seconds
292-
"""
293-
if not integration_id:
294-
raise ValueError(f"Expected a non-empty value for `integration_id` but received {integration_id!r}")
295-
return await self._get(
296-
f"/integrations/{integration_id}/revoke",
297-
options=make_request_options(
298-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
299-
),
300-
cast_to=IntegrationRevokeResponse,
301-
)
302-
303234

304235
class IntegrationsResourceWithRawResponse:
305236
def __init__(self, integrations: IntegrationsResource) -> None:
@@ -311,9 +242,6 @@ def __init__(self, integrations: IntegrationsResource) -> None:
311242
self.connect = to_raw_response_wrapper(
312243
integrations.connect,
313244
)
314-
self.revoke = to_raw_response_wrapper(
315-
integrations.revoke,
316-
)
317245

318246
@cached_property
319247
def google_calendar(self) -> GoogleCalendarResourceWithRawResponse:
@@ -338,9 +266,6 @@ def __init__(self, integrations: AsyncIntegrationsResource) -> None:
338266
self.connect = async_to_raw_response_wrapper(
339267
integrations.connect,
340268
)
341-
self.revoke = async_to_raw_response_wrapper(
342-
integrations.revoke,
343-
)
344269

345270
@cached_property
346271
def google_calendar(self) -> AsyncGoogleCalendarResourceWithRawResponse:
@@ -365,9 +290,6 @@ def __init__(self, integrations: IntegrationsResource) -> None:
365290
self.connect = to_streamed_response_wrapper(
366291
integrations.connect,
367292
)
368-
self.revoke = to_streamed_response_wrapper(
369-
integrations.revoke,
370-
)
371293

372294
@cached_property
373295
def google_calendar(self) -> GoogleCalendarResourceWithStreamingResponse:
@@ -392,9 +314,6 @@ def __init__(self, integrations: AsyncIntegrationsResource) -> None:
392314
self.connect = async_to_streamed_response_wrapper(
393315
integrations.connect,
394316
)
395-
self.revoke = async_to_streamed_response_wrapper(
396-
integrations.revoke,
397-
)
398317

399318
@cached_property
400319
def google_calendar(self) -> AsyncGoogleCalendarResourceWithStreamingResponse:

src/hyperspell/types/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from .integration_list_response import IntegrationListResponse as IntegrationListResponse
2121
from .integration_connect_params import IntegrationConnectParams as IntegrationConnectParams
2222
from .evaluate_score_query_params import EvaluateScoreQueryParams as EvaluateScoreQueryParams
23-
from .integration_revoke_response import IntegrationRevokeResponse as IntegrationRevokeResponse
2423
from .integration_connect_response import IntegrationConnectResponse as IntegrationConnectResponse
2524
from .evaluate_score_query_response import EvaluateScoreQueryResponse as EvaluateScoreQueryResponse
2625
from .evaluate_score_highlight_params import EvaluateScoreHighlightParams as EvaluateScoreHighlightParams

src/hyperspell/types/auth_me_response.py

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from .._models import BaseModel
88

9-
__all__ = ["AuthMeResponse", "App", "Connection"]
9+
__all__ = ["AuthMeResponse", "App"]
1010

1111

1212
class App(BaseModel):
@@ -23,64 +23,6 @@ class App(BaseModel):
2323
"""The app's redirect URL"""
2424

2525

26-
class Connection(BaseModel):
27-
id: str
28-
"""The connection's id"""
29-
30-
label: Optional[str] = None
31-
"""The connection's label"""
32-
33-
provider: Literal[
34-
"collections",
35-
"vault",
36-
"web_crawler",
37-
"notion",
38-
"slack",
39-
"google_calendar",
40-
"reddit",
41-
"box",
42-
"google_drive",
43-
"airtable",
44-
"algolia",
45-
"amplitude",
46-
"asana",
47-
"ashby",
48-
"bamboohr",
49-
"basecamp",
50-
"bubbles",
51-
"calendly",
52-
"confluence",
53-
"clickup",
54-
"datadog",
55-
"deel",
56-
"discord",
57-
"dropbox",
58-
"exa",
59-
"facebook",
60-
"front",
61-
"github",
62-
"gitlab",
63-
"google_docs",
64-
"google_mail",
65-
"google_sheet",
66-
"hubspot",
67-
"jira",
68-
"linear",
69-
"microsoft_teams",
70-
"mixpanel",
71-
"monday",
72-
"outlook",
73-
"perplexity",
74-
"rippling",
75-
"salesforce",
76-
"segment",
77-
"todoist",
78-
"twitter",
79-
"zoom",
80-
]
81-
"""The connection's provider"""
82-
83-
8426
class AuthMeResponse(BaseModel):
8527
id: str
8628
"""The user's id"""
@@ -140,9 +82,6 @@ class AuthMeResponse(BaseModel):
14082
]
14183
"""All integrations available for the app"""
14284

143-
connections: List[Connection]
144-
"""Established connections for the user"""
145-
14685
installed_integrations: List[
14786
Literal[
14887
"collections",

src/hyperspell/types/integration_revoke_response.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/api_resources/test_integrations.py

Lines changed: 1 addition & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99

1010
from hyperspell import Hyperspell, AsyncHyperspell
1111
from tests.utils import assert_matches_type
12-
from hyperspell.types import (
13-
IntegrationListResponse,
14-
IntegrationRevokeResponse,
15-
IntegrationConnectResponse,
16-
)
12+
from hyperspell.types import IntegrationListResponse, IntegrationConnectResponse
1713

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

@@ -92,44 +88,6 @@ def test_path_params_connect(self, client: Hyperspell) -> None:
9288
integration_id="",
9389
)
9490

95-
@parametrize
96-
def test_method_revoke(self, client: Hyperspell) -> None:
97-
integration = client.integrations.revoke(
98-
"integration_id",
99-
)
100-
assert_matches_type(IntegrationRevokeResponse, integration, path=["response"])
101-
102-
@parametrize
103-
def test_raw_response_revoke(self, client: Hyperspell) -> None:
104-
response = client.integrations.with_raw_response.revoke(
105-
"integration_id",
106-
)
107-
108-
assert response.is_closed is True
109-
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
110-
integration = response.parse()
111-
assert_matches_type(IntegrationRevokeResponse, integration, path=["response"])
112-
113-
@parametrize
114-
def test_streaming_response_revoke(self, client: Hyperspell) -> None:
115-
with client.integrations.with_streaming_response.revoke(
116-
"integration_id",
117-
) as response:
118-
assert not response.is_closed
119-
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
120-
121-
integration = response.parse()
122-
assert_matches_type(IntegrationRevokeResponse, integration, path=["response"])
123-
124-
assert cast(Any, response.is_closed) is True
125-
126-
@parametrize
127-
def test_path_params_revoke(self, client: Hyperspell) -> None:
128-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `integration_id` but received ''"):
129-
client.integrations.with_raw_response.revoke(
130-
"",
131-
)
132-
13391

13492
class TestAsyncIntegrations:
13593
parametrize = pytest.mark.parametrize(
@@ -206,41 +164,3 @@ async def test_path_params_connect(self, async_client: AsyncHyperspell) -> None:
206164
await async_client.integrations.with_raw_response.connect(
207165
integration_id="",
208166
)
209-
210-
@parametrize
211-
async def test_method_revoke(self, async_client: AsyncHyperspell) -> None:
212-
integration = await async_client.integrations.revoke(
213-
"integration_id",
214-
)
215-
assert_matches_type(IntegrationRevokeResponse, integration, path=["response"])
216-
217-
@parametrize
218-
async def test_raw_response_revoke(self, async_client: AsyncHyperspell) -> None:
219-
response = await async_client.integrations.with_raw_response.revoke(
220-
"integration_id",
221-
)
222-
223-
assert response.is_closed is True
224-
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
225-
integration = await response.parse()
226-
assert_matches_type(IntegrationRevokeResponse, integration, path=["response"])
227-
228-
@parametrize
229-
async def test_streaming_response_revoke(self, async_client: AsyncHyperspell) -> None:
230-
async with async_client.integrations.with_streaming_response.revoke(
231-
"integration_id",
232-
) as response:
233-
assert not response.is_closed
234-
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
235-
236-
integration = await response.parse()
237-
assert_matches_type(IntegrationRevokeResponse, integration, path=["response"])
238-
239-
assert cast(Any, response.is_closed) is True
240-
241-
@parametrize
242-
async def test_path_params_revoke(self, async_client: AsyncHyperspell) -> None:
243-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `integration_id` but received ''"):
244-
await async_client.integrations.with_raw_response.revoke(
245-
"",
246-
)

0 commit comments

Comments
 (0)