Skip to content

Commit e7bfa6e

Browse files
feat(api): manual updates
1 parent 38f5701 commit e7bfa6e

File tree

6 files changed

+180
-2
lines changed

6 files changed

+180
-2
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: 15
1+
configured_endpoints: 16
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-1a2a84a9cc99c25a9d726bc9300a72871f9469e3ceacebd5e71fd37e87891318.yml
33
openapi_spec_hash: e71e86a645bc47a86664080c8697b8db
4-
config_hash: 98555becb03f89d0fcf2e35a0fa6a41b
4+
config_hash: b560219f71fa815fec30fe25ca5a71f5

api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Types:
5252
from supermemory_new.types import (
5353
ConnectionCreateResponse,
5454
ConnectionListResponse,
55+
ConnectionDeleteByIDResponse,
5556
ConnectionDeleteByProviderResponse,
5657
ConnectionGetByIDResponse,
5758
ConnectionGetByTagsResponse,
@@ -63,6 +64,7 @@ Methods:
6364

6465
- <code title="post /v3/connections/{provider}">client.connections.<a href="./src/supermemory_new/resources/connections.py">create</a>(provider, \*\*<a href="src/supermemory_new/types/connection_create_params.py">params</a>) -> <a href="./src/supermemory_new/types/connection_create_response.py">ConnectionCreateResponse</a></code>
6566
- <code title="post /v3/connections/list">client.connections.<a href="./src/supermemory_new/resources/connections.py">list</a>(\*\*<a href="src/supermemory_new/types/connection_list_params.py">params</a>) -> <a href="./src/supermemory_new/types/connection_list_response.py">ConnectionListResponse</a></code>
67+
- <code title="delete /v3/connections/{connectionId}">client.connections.<a href="./src/supermemory_new/resources/connections.py">delete_by_id</a>(connection_id) -> <a href="./src/supermemory_new/types/connection_delete_by_id_response.py">ConnectionDeleteByIDResponse</a></code>
6668
- <code title="delete /v3/connections/{provider}">client.connections.<a href="./src/supermemory_new/resources/connections.py">delete_by_provider</a>(provider, \*\*<a href="src/supermemory_new/types/connection_delete_by_provider_params.py">params</a>) -> <a href="./src/supermemory_new/types/connection_delete_by_provider_response.py">ConnectionDeleteByProviderResponse</a></code>
6769
- <code title="get /v3/connections/{connectionId}">client.connections.<a href="./src/supermemory_new/resources/connections.py">get_by_id</a>(connection_id) -> <a href="./src/supermemory_new/types/connection_get_by_id_response.py">ConnectionGetByIDResponse</a></code>
6870
- <code title="post /v3/connections/{provider}/connection">client.connections.<a href="./src/supermemory_new/resources/connections.py">get_by_tags</a>(provider, \*\*<a href="src/supermemory_new/types/connection_get_by_tags_params.py">params</a>) -> <a href="./src/supermemory_new/types/connection_get_by_tags_response.py">ConnectionGetByTagsResponse</a></code>

src/supermemory_new/resources/connections.py

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from ..types.connection_create_response import ConnectionCreateResponse
3131
from ..types.connection_get_by_id_response import ConnectionGetByIDResponse
3232
from ..types.connection_get_by_tags_response import ConnectionGetByTagsResponse
33+
from ..types.connection_delete_by_id_response import ConnectionDeleteByIDResponse
3334
from ..types.connection_list_documents_response import ConnectionListDocumentsResponse
3435
from ..types.connection_delete_by_provider_response import ConnectionDeleteByProviderResponse
3536

@@ -136,6 +137,39 @@ def list(
136137
cast_to=ConnectionListResponse,
137138
)
138139

140+
def delete_by_id(
141+
self,
142+
connection_id: str,
143+
*,
144+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
145+
# The extra values given here take precedence over values defined on the client or passed to this method.
146+
extra_headers: Headers | None = None,
147+
extra_query: Query | None = None,
148+
extra_body: Body | None = None,
149+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
150+
) -> ConnectionDeleteByIDResponse:
151+
"""
152+
Delete a specific connection by ID
153+
154+
Args:
155+
extra_headers: Send extra headers
156+
157+
extra_query: Add additional query parameters to the request
158+
159+
extra_body: Add additional JSON properties to the request
160+
161+
timeout: Override the client-level default timeout for this request, in seconds
162+
"""
163+
if not connection_id:
164+
raise ValueError(f"Expected a non-empty value for `connection_id` but received {connection_id!r}")
165+
return self._delete(
166+
f"/v3/connections/{connection_id}",
167+
options=make_request_options(
168+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
169+
),
170+
cast_to=ConnectionDeleteByIDResponse,
171+
)
172+
139173
def delete_by_provider(
140174
self,
141175
provider: Literal["notion", "google-drive", "onedrive"],
@@ -428,6 +462,39 @@ async def list(
428462
cast_to=ConnectionListResponse,
429463
)
430464

465+
async def delete_by_id(
466+
self,
467+
connection_id: str,
468+
*,
469+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
470+
# The extra values given here take precedence over values defined on the client or passed to this method.
471+
extra_headers: Headers | None = None,
472+
extra_query: Query | None = None,
473+
extra_body: Body | None = None,
474+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
475+
) -> ConnectionDeleteByIDResponse:
476+
"""
477+
Delete a specific connection by ID
478+
479+
Args:
480+
extra_headers: Send extra headers
481+
482+
extra_query: Add additional query parameters to the request
483+
484+
extra_body: Add additional JSON properties to the request
485+
486+
timeout: Override the client-level default timeout for this request, in seconds
487+
"""
488+
if not connection_id:
489+
raise ValueError(f"Expected a non-empty value for `connection_id` but received {connection_id!r}")
490+
return await self._delete(
491+
f"/v3/connections/{connection_id}",
492+
options=make_request_options(
493+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
494+
),
495+
cast_to=ConnectionDeleteByIDResponse,
496+
)
497+
431498
async def delete_by_provider(
432499
self,
433500
provider: Literal["notion", "google-drive", "onedrive"],
@@ -630,6 +697,9 @@ def __init__(self, connections: ConnectionsResource) -> None:
630697
self.list = to_raw_response_wrapper(
631698
connections.list,
632699
)
700+
self.delete_by_id = to_raw_response_wrapper(
701+
connections.delete_by_id,
702+
)
633703
self.delete_by_provider = to_raw_response_wrapper(
634704
connections.delete_by_provider,
635705
)
@@ -657,6 +727,9 @@ def __init__(self, connections: AsyncConnectionsResource) -> None:
657727
self.list = async_to_raw_response_wrapper(
658728
connections.list,
659729
)
730+
self.delete_by_id = async_to_raw_response_wrapper(
731+
connections.delete_by_id,
732+
)
660733
self.delete_by_provider = async_to_raw_response_wrapper(
661734
connections.delete_by_provider,
662735
)
@@ -684,6 +757,9 @@ def __init__(self, connections: ConnectionsResource) -> None:
684757
self.list = to_streamed_response_wrapper(
685758
connections.list,
686759
)
760+
self.delete_by_id = to_streamed_response_wrapper(
761+
connections.delete_by_id,
762+
)
687763
self.delete_by_provider = to_streamed_response_wrapper(
688764
connections.delete_by_provider,
689765
)
@@ -711,6 +787,9 @@ def __init__(self, connections: AsyncConnectionsResource) -> None:
711787
self.list = async_to_streamed_response_wrapper(
712788
connections.list,
713789
)
790+
self.delete_by_id = async_to_streamed_response_wrapper(
791+
connections.delete_by_id,
792+
)
714793
self.delete_by_provider = async_to_streamed_response_wrapper(
715794
connections.delete_by_provider,
716795
)

src/supermemory_new/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from .connection_get_by_id_response import ConnectionGetByIDResponse as ConnectionGetByIDResponse
2323
from .connection_get_by_tags_params import ConnectionGetByTagsParams as ConnectionGetByTagsParams
2424
from .connection_get_by_tags_response import ConnectionGetByTagsResponse as ConnectionGetByTagsResponse
25+
from .connection_delete_by_id_response import ConnectionDeleteByIDResponse as ConnectionDeleteByIDResponse
2526
from .connection_list_documents_params import ConnectionListDocumentsParams as ConnectionListDocumentsParams
2627
from .connection_list_documents_response import ConnectionListDocumentsResponse as ConnectionListDocumentsResponse
2728
from .connection_delete_by_provider_params import ConnectionDeleteByProviderParams as ConnectionDeleteByProviderParams
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__ = ["ConnectionDeleteByIDResponse"]
6+
7+
8+
class ConnectionDeleteByIDResponse(BaseModel):
9+
id: str
10+
11+
provider: str

tests/api_resources/test_connections.py

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
ConnectionCreateResponse,
1515
ConnectionGetByIDResponse,
1616
ConnectionGetByTagsResponse,
17+
ConnectionDeleteByIDResponse,
1718
ConnectionListDocumentsResponse,
1819
ConnectionDeleteByProviderResponse,
1920
)
@@ -106,6 +107,48 @@ def test_streaming_response_list(self, client: Supermemory) -> None:
106107

107108
assert cast(Any, response.is_closed) is True
108109

110+
@pytest.mark.skip()
111+
@parametrize
112+
def test_method_delete_by_id(self, client: Supermemory) -> None:
113+
connection = client.connections.delete_by_id(
114+
"connectionId",
115+
)
116+
assert_matches_type(ConnectionDeleteByIDResponse, connection, path=["response"])
117+
118+
@pytest.mark.skip()
119+
@parametrize
120+
def test_raw_response_delete_by_id(self, client: Supermemory) -> None:
121+
response = client.connections.with_raw_response.delete_by_id(
122+
"connectionId",
123+
)
124+
125+
assert response.is_closed is True
126+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
127+
connection = response.parse()
128+
assert_matches_type(ConnectionDeleteByIDResponse, connection, path=["response"])
129+
130+
@pytest.mark.skip()
131+
@parametrize
132+
def test_streaming_response_delete_by_id(self, client: Supermemory) -> None:
133+
with client.connections.with_streaming_response.delete_by_id(
134+
"connectionId",
135+
) as response:
136+
assert not response.is_closed
137+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
138+
139+
connection = response.parse()
140+
assert_matches_type(ConnectionDeleteByIDResponse, connection, path=["response"])
141+
142+
assert cast(Any, response.is_closed) is True
143+
144+
@pytest.mark.skip()
145+
@parametrize
146+
def test_path_params_delete_by_id(self, client: Supermemory) -> None:
147+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `connection_id` but received ''"):
148+
client.connections.with_raw_response.delete_by_id(
149+
"",
150+
)
151+
109152
@pytest.mark.skip()
110153
@parametrize
111154
def test_method_delete_by_provider(self, client: Supermemory) -> None:
@@ -396,6 +439,48 @@ async def test_streaming_response_list(self, async_client: AsyncSupermemory) ->
396439

397440
assert cast(Any, response.is_closed) is True
398441

442+
@pytest.mark.skip()
443+
@parametrize
444+
async def test_method_delete_by_id(self, async_client: AsyncSupermemory) -> None:
445+
connection = await async_client.connections.delete_by_id(
446+
"connectionId",
447+
)
448+
assert_matches_type(ConnectionDeleteByIDResponse, connection, path=["response"])
449+
450+
@pytest.mark.skip()
451+
@parametrize
452+
async def test_raw_response_delete_by_id(self, async_client: AsyncSupermemory) -> None:
453+
response = await async_client.connections.with_raw_response.delete_by_id(
454+
"connectionId",
455+
)
456+
457+
assert response.is_closed is True
458+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
459+
connection = await response.parse()
460+
assert_matches_type(ConnectionDeleteByIDResponse, connection, path=["response"])
461+
462+
@pytest.mark.skip()
463+
@parametrize
464+
async def test_streaming_response_delete_by_id(self, async_client: AsyncSupermemory) -> None:
465+
async with async_client.connections.with_streaming_response.delete_by_id(
466+
"connectionId",
467+
) as response:
468+
assert not response.is_closed
469+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
470+
471+
connection = await response.parse()
472+
assert_matches_type(ConnectionDeleteByIDResponse, connection, path=["response"])
473+
474+
assert cast(Any, response.is_closed) is True
475+
476+
@pytest.mark.skip()
477+
@parametrize
478+
async def test_path_params_delete_by_id(self, async_client: AsyncSupermemory) -> None:
479+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `connection_id` but received ''"):
480+
await async_client.connections.with_raw_response.delete_by_id(
481+
"",
482+
)
483+
399484
@pytest.mark.skip()
400485
@parametrize
401486
async def test_method_delete_by_provider(self, async_client: AsyncSupermemory) -> None:

0 commit comments

Comments
 (0)