From 90e8984f58c98d51e25e78723be71632a181f270 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2024 15:00:38 +0000 Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API (#29) --- .stats.yml | 2 +- src/writerai/resources/files.py | 5 +++-- src/writerai/types/file_list_params.py | 3 ++- tests/api_resources/test_files.py | 12 ++++++++++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index a85d0c3..3273a31 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 12 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-5ec9075c9a60b855ae0ac9907a6c2a4c6216fb2087d8d47125aec013ebc5f3d5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-ca8da7974057afac39ab3f38dbd707d4db9ea11fa15d95061c82642ca4c79ef8.yml diff --git a/src/writerai/resources/files.py b/src/writerai/resources/files.py index c1e7e78..d30a6f4 100644 --- a/src/writerai/resources/files.py +++ b/src/writerai/resources/files.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import List from typing_extensions import Literal import httpx @@ -41,7 +42,7 @@ def list( *, after: str | NotGiven = NOT_GIVEN, before: str | NotGiven = NOT_GIVEN, - graph_id: str | NotGiven = NOT_GIVEN, + graph_id: List[str] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -156,7 +157,7 @@ def list( *, after: str | NotGiven = NOT_GIVEN, before: str | NotGiven = NOT_GIVEN, - graph_id: str | NotGiven = NOT_GIVEN, + graph_id: List[str] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/writerai/types/file_list_params.py b/src/writerai/types/file_list_params.py index 1a80301..a890be7 100644 --- a/src/writerai/types/file_list_params.py +++ b/src/writerai/types/file_list_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import List from typing_extensions import Literal, TypedDict __all__ = ["FileListParams"] @@ -20,7 +21,7 @@ class FileListParams(TypedDict, total=False): This parameter instructs the API to return the previous page of results. """ - graph_id: str + graph_id: List[str] """The unique identifier of the graph to which the files belong.""" limit: int diff --git a/tests/api_resources/test_files.py b/tests/api_resources/test_files.py index 925cde4..e947e98 100644 --- a/tests/api_resources/test_files.py +++ b/tests/api_resources/test_files.py @@ -28,7 +28,11 @@ def test_method_list_with_all_params(self, client: Writer) -> None: file = client.files.list( after="after", before="before", - graph_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + graph_id=[ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], limit=0, order="asc", ) @@ -111,7 +115,11 @@ async def test_method_list_with_all_params(self, async_client: AsyncWriter) -> N file = await async_client.files.list( after="after", before="before", - graph_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + graph_id=[ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], limit=0, order="asc", )