Skip to content

Commit 5bc5a86

Browse files
feat(api): api update
1 parent 1f9f018 commit 5bc5a86

File tree

4 files changed

+33
-39
lines changed

4 files changed

+33
-39
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: 12
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-101f86a36ccd7f0652cfb6cac5d8f49e45ce3bee2b96692e8decd1eda3419604.yml
3-
openapi_spec_hash: b6c08c22ab103285c7ada4eff95cfd0a
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-302f75c936837c3e1163b7455cbec192cbf57f5769541258debfc1573c8597e2.yml
3+
openapi_spec_hash: a36f25703f8a1ead0c95b7a7219096d5
44
config_hash: 8477e3ee6fd596ab6ac911d052e4de79

src/supermemory/resources/connections.py

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Union, Optional
5+
from typing import Dict, List, Union, Optional
66
from typing_extensions import Literal
77

88
import httpx
@@ -50,9 +50,9 @@ def create(
5050
self,
5151
provider: Literal["notion", "google-drive", "onedrive"],
5252
*,
53-
end_user_id: str | NotGiven = NOT_GIVEN,
54-
redirect_url: str | NotGiven = NOT_GIVEN,
53+
container_tags: List[str] | NotGiven = NOT_GIVEN,
5554
metadata: Optional[Dict[str, Union[str, float, bool]]] | NotGiven = NOT_GIVEN,
55+
redirect_url: str | NotGiven = NOT_GIVEN,
5656
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5757
# The extra values given here take precedence over values defined on the client or passed to this method.
5858
extra_headers: Headers | None = None,
@@ -76,19 +76,16 @@ def create(
7676
raise ValueError(f"Expected a non-empty value for `provider` but received {provider!r}")
7777
return self._post(
7878
f"/v3/connections/{provider}",
79-
body=maybe_transform({"metadata": metadata}, connection_create_params.ConnectionCreateParams),
79+
body=maybe_transform(
80+
{
81+
"container_tags": container_tags,
82+
"metadata": metadata,
83+
"redirect_url": redirect_url,
84+
},
85+
connection_create_params.ConnectionCreateParams,
86+
),
8087
options=make_request_options(
81-
extra_headers=extra_headers,
82-
extra_query=extra_query,
83-
extra_body=extra_body,
84-
timeout=timeout,
85-
query=maybe_transform(
86-
{
87-
"end_user_id": end_user_id,
88-
"redirect_url": redirect_url,
89-
},
90-
connection_create_params.ConnectionCreateParams,
91-
),
88+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
9289
),
9390
cast_to=ConnectionCreateResponse,
9491
)
@@ -186,9 +183,9 @@ async def create(
186183
self,
187184
provider: Literal["notion", "google-drive", "onedrive"],
188185
*,
189-
end_user_id: str | NotGiven = NOT_GIVEN,
190-
redirect_url: str | NotGiven = NOT_GIVEN,
186+
container_tags: List[str] | NotGiven = NOT_GIVEN,
191187
metadata: Optional[Dict[str, Union[str, float, bool]]] | NotGiven = NOT_GIVEN,
188+
redirect_url: str | NotGiven = NOT_GIVEN,
192189
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
193190
# The extra values given here take precedence over values defined on the client or passed to this method.
194191
extra_headers: Headers | None = None,
@@ -212,19 +209,16 @@ async def create(
212209
raise ValueError(f"Expected a non-empty value for `provider` but received {provider!r}")
213210
return await self._post(
214211
f"/v3/connections/{provider}",
215-
body=await async_maybe_transform({"metadata": metadata}, connection_create_params.ConnectionCreateParams),
212+
body=await async_maybe_transform(
213+
{
214+
"container_tags": container_tags,
215+
"metadata": metadata,
216+
"redirect_url": redirect_url,
217+
},
218+
connection_create_params.ConnectionCreateParams,
219+
),
216220
options=make_request_options(
217-
extra_headers=extra_headers,
218-
extra_query=extra_query,
219-
extra_body=extra_body,
220-
timeout=timeout,
221-
query=await async_maybe_transform(
222-
{
223-
"end_user_id": end_user_id,
224-
"redirect_url": redirect_url,
225-
},
226-
connection_create_params.ConnectionCreateParams,
227-
),
221+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
228222
),
229223
cast_to=ConnectionCreateResponse,
230224
)

src/supermemory/types/connection_create_params.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Union, Optional
5+
from typing import Dict, List, Union, Optional
66
from typing_extensions import Annotated, TypedDict
77

88
from .._utils import PropertyInfo
@@ -11,8 +11,8 @@
1111

1212

1313
class ConnectionCreateParams(TypedDict, total=False):
14-
end_user_id: Annotated[str, PropertyInfo(alias="endUserId")]
15-
16-
redirect_url: Annotated[str, PropertyInfo(alias="redirectUrl")]
14+
container_tags: Annotated[List[str], PropertyInfo(alias="containerTags")]
1715

1816
metadata: Optional[Dict[str, Union[str, float, bool]]]
17+
18+
redirect_url: Annotated[str, PropertyInfo(alias="redirectUrl")]

tests/api_resources/test_connections.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ def test_method_create(self, client: Supermemory) -> None:
3434
def test_method_create_with_all_params(self, client: Supermemory) -> None:
3535
connection = client.connections.create(
3636
provider="notion",
37-
end_user_id="endUserId",
38-
redirect_url="redirectUrl",
37+
container_tags=["string"],
3938
metadata={"foo": "string"},
39+
redirect_url="redirectUrl",
4040
)
4141
assert_matches_type(ConnectionCreateResponse, connection, path=["response"])
4242

@@ -161,9 +161,9 @@ async def test_method_create(self, async_client: AsyncSupermemory) -> None:
161161
async def test_method_create_with_all_params(self, async_client: AsyncSupermemory) -> None:
162162
connection = await async_client.connections.create(
163163
provider="notion",
164-
end_user_id="endUserId",
165-
redirect_url="redirectUrl",
164+
container_tags=["string"],
166165
metadata={"foo": "string"},
166+
redirect_url="redirectUrl",
167167
)
168168
assert_matches_type(ConnectionCreateResponse, connection, path=["response"])
169169

0 commit comments

Comments
 (0)