Skip to content

Commit de304ee

Browse files
feat(api): api update
1 parent 91230da commit de304ee

File tree

9 files changed

+68
-13
lines changed

9 files changed

+68
-13
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 26
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-7a58e1a70c530090711ce5ab5f7adf382db133adef92510e3211ee42b4f3f062.yml
3-
openapi_spec_hash: 6f2bba390cde353198cd1677390a4848
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-83aebd1251bcf8b6b81906dd5fd50995f393cc9cc03326bc5bd3000605448e1f.yml
3+
openapi_spec_hash: d3e6ae37bf8b023d3d95bf9561135dd3
44
config_hash: f3eb5ca71172780678106f6d46f15dda

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Methods:
104104
- <code title="post /v3/connections/{provider}">client.connections.<a href="./src/supermemory/resources/connections.py">create</a>(provider, \*\*<a href="src/supermemory/types/connection_create_params.py">params</a>) -> <a href="./src/supermemory/types/connection_create_response.py">ConnectionCreateResponse</a></code>
105105
- <code title="post /v3/connections/list">client.connections.<a href="./src/supermemory/resources/connections.py">list</a>(\*\*<a href="src/supermemory/types/connection_list_params.py">params</a>) -> <a href="./src/supermemory/types/connection_list_response.py">ConnectionListResponse</a></code>
106106
- <code title="post /v3/connections/{connectionId}/configure">client.connections.<a href="./src/supermemory/resources/connections.py">configure</a>(connection_id, \*\*<a href="src/supermemory/types/connection_configure_params.py">params</a>) -> <a href="./src/supermemory/types/connection_configure_response.py">ConnectionConfigureResponse</a></code>
107-
- <code title="delete /v3/connections/{connectionId}">client.connections.<a href="./src/supermemory/resources/connections.py">delete_by_id</a>(connection_id) -> <a href="./src/supermemory/types/connection_delete_by_id_response.py">ConnectionDeleteByIDResponse</a></code>
107+
- <code title="delete /v3/connections/{connectionId}">client.connections.<a href="./src/supermemory/resources/connections.py">delete_by_id</a>(connection_id, \*\*<a href="src/supermemory/types/connection_delete_by_id_params.py">params</a>) -> <a href="./src/supermemory/types/connection_delete_by_id_response.py">ConnectionDeleteByIDResponse</a></code>
108108
- <code title="delete /v3/connections/{provider}">client.connections.<a href="./src/supermemory/resources/connections.py">delete_by_provider</a>(provider, \*\*<a href="src/supermemory/types/connection_delete_by_provider_params.py">params</a>) -> <a href="./src/supermemory/types/connection_delete_by_provider_response.py">ConnectionDeleteByProviderResponse</a></code>
109109
- <code title="get /v3/connections/{connectionId}">client.connections.<a href="./src/supermemory/resources/connections.py">get_by_id</a>(connection_id) -> <a href="./src/supermemory/types/connection_get_by_id_response.py">ConnectionGetByIDResponse</a></code>
110110
- <code title="post /v3/connections/{provider}/connection">client.connections.<a href="./src/supermemory/resources/connections.py">get_by_tag</a>(provider, \*\*<a href="src/supermemory/types/connection_get_by_tag_params.py">params</a>) -> <a href="./src/supermemory/types/connection_get_by_tag_response.py">ConnectionGetByTagResponse</a></code>

src/supermemory/resources/connections.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
connection_configure_params,
1515
connection_resources_params,
1616
connection_get_by_tag_params,
17+
connection_delete_by_id_params,
1718
connection_list_documents_params,
1819
connection_delete_by_provider_params,
1920
)
@@ -182,6 +183,7 @@ def delete_by_id(
182183
self,
183184
connection_id: str,
184185
*,
186+
delete_documents: str | Omit = omit,
185187
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
186188
# The extra values given here take precedence over values defined on the client or passed to this method.
187189
extra_headers: Headers | None = None,
@@ -193,6 +195,8 @@ def delete_by_id(
193195
Delete a specific connection by ID
194196
195197
Args:
198+
delete_documents: Whether to also delete documents imported by this connection. Defaults to true.
199+
196200
extra_headers: Send extra headers
197201
198202
extra_query: Add additional query parameters to the request
@@ -206,7 +210,13 @@ def delete_by_id(
206210
return self._delete(
207211
f"/v3/connections/{connection_id}",
208212
options=make_request_options(
209-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
213+
extra_headers=extra_headers,
214+
extra_query=extra_query,
215+
extra_body=extra_body,
216+
timeout=timeout,
217+
query=maybe_transform(
218+
{"delete_documents": delete_documents}, connection_delete_by_id_params.ConnectionDeleteByIDParams
219+
),
210220
),
211221
cast_to=ConnectionDeleteByIDResponse,
212222
)
@@ -591,6 +601,7 @@ async def delete_by_id(
591601
self,
592602
connection_id: str,
593603
*,
604+
delete_documents: str | Omit = omit,
594605
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
595606
# The extra values given here take precedence over values defined on the client or passed to this method.
596607
extra_headers: Headers | None = None,
@@ -602,6 +613,8 @@ async def delete_by_id(
602613
Delete a specific connection by ID
603614
604615
Args:
616+
delete_documents: Whether to also delete documents imported by this connection. Defaults to true.
617+
605618
extra_headers: Send extra headers
606619
607620
extra_query: Add additional query parameters to the request
@@ -615,7 +628,13 @@ async def delete_by_id(
615628
return await self._delete(
616629
f"/v3/connections/{connection_id}",
617630
options=make_request_options(
618-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
631+
extra_headers=extra_headers,
632+
extra_query=extra_query,
633+
extra_body=extra_body,
634+
timeout=timeout,
635+
query=await async_maybe_transform(
636+
{"delete_documents": delete_documents}, connection_delete_by_id_params.ConnectionDeleteByIDParams
637+
),
619638
),
620639
cast_to=ConnectionDeleteByIDResponse,
621640
)

src/supermemory/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
from .document_delete_bulk_response import DocumentDeleteBulkResponse as DocumentDeleteBulkResponse
4545
from .document_upload_file_response import DocumentUploadFileResponse as DocumentUploadFileResponse
4646
from .memory_update_memory_response import MemoryUpdateMemoryResponse as MemoryUpdateMemoryResponse
47+
from .connection_delete_by_id_params import ConnectionDeleteByIDParams as ConnectionDeleteByIDParams
4748
from .connection_get_by_tag_response import ConnectionGetByTagResponse as ConnectionGetByTagResponse
4849
from .connection_delete_by_id_response import ConnectionDeleteByIDResponse as ConnectionDeleteByIDResponse
4950
from .connection_list_documents_params import ConnectionListDocumentsParams as ConnectionListDocumentsParams
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Annotated, TypedDict
6+
7+
from .._utils import PropertyInfo
8+
9+
__all__ = ["ConnectionDeleteByIDParams"]
10+
11+
12+
class ConnectionDeleteByIDParams(TypedDict, total=False):
13+
delete_documents: Annotated[str, PropertyInfo(alias="deleteDocuments")]
14+
"""Whether to also delete documents imported by this connection. Defaults to true."""

src/supermemory/types/document_get_response.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ class DocumentGetResponse(BaseModel):
8181
"google_sheet",
8282
"image",
8383
"video",
84+
"audio",
8485
"notion_doc",
8586
"webpage",
8687
"onedrive",

src/supermemory/types/document_list_processing_response.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class Document(BaseModel):
4848
"google_sheet",
4949
"image",
5050
"video",
51+
"audio",
5152
"notion_doc",
5253
"webpage",
5354
"onedrive",

src/supermemory/types/document_list_response.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class Memory(BaseModel):
5757
"google_sheet",
5858
"image",
5959
"video",
60+
"audio",
6061
"notion_doc",
6162
"webpage",
6263
"onedrive",

tests/api_resources/test_connections.py

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,24 @@ def test_path_params_configure(self, client: Supermemory) -> None:
160160
@parametrize
161161
def test_method_delete_by_id(self, client: Supermemory) -> None:
162162
connection = client.connections.delete_by_id(
163-
"connectionId",
163+
connection_id="connectionId",
164+
)
165+
assert_matches_type(ConnectionDeleteByIDResponse, connection, path=["response"])
166+
167+
@pytest.mark.skip(reason="Mock server tests are disabled")
168+
@parametrize
169+
def test_method_delete_by_id_with_all_params(self, client: Supermemory) -> None:
170+
connection = client.connections.delete_by_id(
171+
connection_id="connectionId",
172+
delete_documents="deleteDocuments",
164173
)
165174
assert_matches_type(ConnectionDeleteByIDResponse, connection, path=["response"])
166175

167176
@pytest.mark.skip(reason="Mock server tests are disabled")
168177
@parametrize
169178
def test_raw_response_delete_by_id(self, client: Supermemory) -> None:
170179
response = client.connections.with_raw_response.delete_by_id(
171-
"connectionId",
180+
connection_id="connectionId",
172181
)
173182

174183
assert response.is_closed is True
@@ -180,7 +189,7 @@ def test_raw_response_delete_by_id(self, client: Supermemory) -> None:
180189
@parametrize
181190
def test_streaming_response_delete_by_id(self, client: Supermemory) -> None:
182191
with client.connections.with_streaming_response.delete_by_id(
183-
"connectionId",
192+
connection_id="connectionId",
184193
) as response:
185194
assert not response.is_closed
186195
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -195,7 +204,7 @@ def test_streaming_response_delete_by_id(self, client: Supermemory) -> None:
195204
def test_path_params_delete_by_id(self, client: Supermemory) -> None:
196205
with pytest.raises(ValueError, match=r"Expected a non-empty value for `connection_id` but received ''"):
197206
client.connections.with_raw_response.delete_by_id(
198-
"",
207+
connection_id="",
199208
)
200209

201210
@pytest.mark.skip(reason="Mock server tests are disabled")
@@ -591,15 +600,24 @@ async def test_path_params_configure(self, async_client: AsyncSupermemory) -> No
591600
@parametrize
592601
async def test_method_delete_by_id(self, async_client: AsyncSupermemory) -> None:
593602
connection = await async_client.connections.delete_by_id(
594-
"connectionId",
603+
connection_id="connectionId",
604+
)
605+
assert_matches_type(ConnectionDeleteByIDResponse, connection, path=["response"])
606+
607+
@pytest.mark.skip(reason="Mock server tests are disabled")
608+
@parametrize
609+
async def test_method_delete_by_id_with_all_params(self, async_client: AsyncSupermemory) -> None:
610+
connection = await async_client.connections.delete_by_id(
611+
connection_id="connectionId",
612+
delete_documents="deleteDocuments",
595613
)
596614
assert_matches_type(ConnectionDeleteByIDResponse, connection, path=["response"])
597615

598616
@pytest.mark.skip(reason="Mock server tests are disabled")
599617
@parametrize
600618
async def test_raw_response_delete_by_id(self, async_client: AsyncSupermemory) -> None:
601619
response = await async_client.connections.with_raw_response.delete_by_id(
602-
"connectionId",
620+
connection_id="connectionId",
603621
)
604622

605623
assert response.is_closed is True
@@ -611,7 +629,7 @@ async def test_raw_response_delete_by_id(self, async_client: AsyncSupermemory) -
611629
@parametrize
612630
async def test_streaming_response_delete_by_id(self, async_client: AsyncSupermemory) -> None:
613631
async with async_client.connections.with_streaming_response.delete_by_id(
614-
"connectionId",
632+
connection_id="connectionId",
615633
) as response:
616634
assert not response.is_closed
617635
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -626,7 +644,7 @@ async def test_streaming_response_delete_by_id(self, async_client: AsyncSupermem
626644
async def test_path_params_delete_by_id(self, async_client: AsyncSupermemory) -> None:
627645
with pytest.raises(ValueError, match=r"Expected a non-empty value for `connection_id` but received ''"):
628646
await async_client.connections.with_raw_response.delete_by_id(
629-
"",
647+
connection_id="",
630648
)
631649

632650
@pytest.mark.skip(reason="Mock server tests are disabled")

0 commit comments

Comments
 (0)