From c4ec6efd30def1186ca51eb77ad5dfe47acf6d3d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 22:59:46 +0000 Subject: [PATCH] feat(api): api update --- .stats.yml | 4 ++- src/arcadepy/_models.py | 2 +- src/arcadepy/_utils/_transform.py | 2 +- src/arcadepy/resources/workers.py | 16 ++++++++-- src/arcadepy/types/worker_create_params.py | 16 ++++++++-- src/arcadepy/types/worker_response.py | 36 ++++++++++++++++++++-- src/arcadepy/types/worker_update_params.py | 12 +++++++- tests/api_resources/test_workers.py | 34 ++++++++++++++++---- 8 files changed, 106 insertions(+), 16 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2b9d2660..1a0b8be9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,4 @@ configured_endpoints: 19 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-e0b226d400563e77eb480ed532a4a42e6594f2932d030a906147c2917595af05.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-d4269d3e7013741eeb30221bb022d65c5d81d7ed0edc06980eccf7c83fcb48a9.yml +openapi_spec_hash: 5661031e615bccd01256d82705ae27cc +config_hash: d86655f9af7ae4c4c444d9a16685a7c5 diff --git a/src/arcadepy/_models.py b/src/arcadepy/_models.py index b51a1bf5..34935716 100644 --- a/src/arcadepy/_models.py +++ b/src/arcadepy/_models.py @@ -681,7 +681,7 @@ def set_pydantic_config(typ: Any, config: pydantic.ConfigDict) -> None: setattr(typ, "__pydantic_config__", config) # noqa: B010 -# our use of subclasssing here causes weirdness for type checkers, +# our use of subclassing here causes weirdness for type checkers, # so we just pretend that we don't subclass if TYPE_CHECKING: GenericModel = BaseModel diff --git a/src/arcadepy/_utils/_transform.py b/src/arcadepy/_utils/_transform.py index 18afd9d8..7ac2e17f 100644 --- a/src/arcadepy/_utils/_transform.py +++ b/src/arcadepy/_utils/_transform.py @@ -126,7 +126,7 @@ def _get_annotated_type(type_: type) -> type | None: def _maybe_transform_key(key: str, type_: type) -> str: """Transform the given `data` based on the annotations provided in `type_`. - Note: this function only looks at `Annotated` types that contain `PropertInfo` metadata. + Note: this function only looks at `Annotated` types that contain `PropertyInfo` metadata. """ annotated_type = _get_annotated_type(type_) if annotated_type is None: diff --git a/src/arcadepy/resources/workers.py b/src/arcadepy/resources/workers.py index 05893630..986d5c1e 100644 --- a/src/arcadepy/resources/workers.py +++ b/src/arcadepy/resources/workers.py @@ -51,8 +51,10 @@ def create( self, *, id: str, - enabled: bool, + type: str, + enabled: bool | NotGiven = NOT_GIVEN, http: worker_create_params.HTTP | NotGiven = NOT_GIVEN, + mcp: worker_create_params.Mcp | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -77,8 +79,10 @@ def create( body=maybe_transform( { "id": id, + "type": type, "enabled": enabled, "http": http, + "mcp": mcp, }, worker_create_params.WorkerCreateParams, ), @@ -94,6 +98,7 @@ def update( *, enabled: bool | NotGiven = NOT_GIVEN, http: worker_update_params.HTTP | NotGiven = NOT_GIVEN, + mcp: worker_update_params.Mcp | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -121,6 +126,7 @@ def update( { "enabled": enabled, "http": http, + "mcp": mcp, }, worker_update_params.WorkerUpdateParams, ), @@ -352,8 +358,10 @@ async def create( self, *, id: str, - enabled: bool, + type: str, + enabled: bool | NotGiven = NOT_GIVEN, http: worker_create_params.HTTP | NotGiven = NOT_GIVEN, + mcp: worker_create_params.Mcp | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -378,8 +386,10 @@ async def create( body=await async_maybe_transform( { "id": id, + "type": type, "enabled": enabled, "http": http, + "mcp": mcp, }, worker_create_params.WorkerCreateParams, ), @@ -395,6 +405,7 @@ async def update( *, enabled: bool | NotGiven = NOT_GIVEN, http: worker_update_params.HTTP | NotGiven = NOT_GIVEN, + mcp: worker_update_params.Mcp | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -422,6 +433,7 @@ async def update( { "enabled": enabled, "http": http, + "mcp": mcp, }, worker_update_params.WorkerUpdateParams, ), diff --git a/src/arcadepy/types/worker_create_params.py b/src/arcadepy/types/worker_create_params.py index d08266e3..df77dded 100644 --- a/src/arcadepy/types/worker_create_params.py +++ b/src/arcadepy/types/worker_create_params.py @@ -4,16 +4,20 @@ from typing_extensions import Required, TypedDict -__all__ = ["WorkerCreateParams", "HTTP"] +__all__ = ["WorkerCreateParams", "HTTP", "Mcp"] class WorkerCreateParams(TypedDict, total=False): id: Required[str] - enabled: Required[bool] + type: Required[str] + + enabled: bool http: HTTP + mcp: Mcp + class HTTP(TypedDict, total=False): retry: Required[int] @@ -23,3 +27,11 @@ class HTTP(TypedDict, total=False): timeout: Required[int] uri: Required[str] + + +class Mcp(TypedDict, total=False): + retry: Required[int] + + timeout: Required[int] + + uri: Required[str] diff --git a/src/arcadepy/types/worker_response.py b/src/arcadepy/types/worker_response.py index 0f7f434d..27722a20 100644 --- a/src/arcadepy/types/worker_response.py +++ b/src/arcadepy/types/worker_response.py @@ -5,7 +5,7 @@ from .._models import BaseModel -__all__ = ["WorkerResponse", "HTTP", "HTTPSecret"] +__all__ = ["WorkerResponse", "HTTP", "HTTPSecret", "Mcp", "Oxp", "OxpSecret"] class HTTPSecret(BaseModel): @@ -30,6 +30,36 @@ class HTTP(BaseModel): uri: Optional[str] = None +class Mcp(BaseModel): + retry: Optional[int] = None + + timeout: Optional[int] = None + + uri: Optional[str] = None + + +class OxpSecret(BaseModel): + binding: Optional[Literal["static", "tenant", "organization", "account"]] = None + + editable: Optional[bool] = None + + exists: Optional[bool] = None + + hint: Optional[str] = None + + value: Optional[str] = None + + +class Oxp(BaseModel): + retry: Optional[int] = None + + secret: Optional[OxpSecret] = None + + timeout: Optional[int] = None + + uri: Optional[str] = None + + class WorkerResponse(BaseModel): id: Optional[str] = None @@ -37,4 +67,6 @@ class WorkerResponse(BaseModel): http: Optional[HTTP] = None - type: Optional[str] = None + mcp: Optional[Mcp] = None + + oxp: Optional[Oxp] = None diff --git a/src/arcadepy/types/worker_update_params.py b/src/arcadepy/types/worker_update_params.py index 0215ac17..a07fbb69 100644 --- a/src/arcadepy/types/worker_update_params.py +++ b/src/arcadepy/types/worker_update_params.py @@ -4,7 +4,7 @@ from typing_extensions import TypedDict -__all__ = ["WorkerUpdateParams", "HTTP"] +__all__ = ["WorkerUpdateParams", "HTTP", "Mcp"] class WorkerUpdateParams(TypedDict, total=False): @@ -12,6 +12,8 @@ class WorkerUpdateParams(TypedDict, total=False): http: HTTP + mcp: Mcp + class HTTP(TypedDict, total=False): retry: int @@ -21,3 +23,11 @@ class HTTP(TypedDict, total=False): timeout: int uri: str + + +class Mcp(TypedDict, total=False): + retry: int + + timeout: int + + uri: str diff --git a/tests/api_resources/test_workers.py b/tests/api_resources/test_workers.py index ab065073..0a300735 100644 --- a/tests/api_resources/test_workers.py +++ b/tests/api_resources/test_workers.py @@ -26,7 +26,7 @@ class TestWorkers: def test_method_create(self, client: Arcade) -> None: worker = client.workers.create( id="id", - enabled=True, + type="type", ) assert_matches_type(WorkerResponse, worker, path=["response"]) @@ -34,6 +34,7 @@ def test_method_create(self, client: Arcade) -> None: def test_method_create_with_all_params(self, client: Arcade) -> None: worker = client.workers.create( id="id", + type="type", enabled=True, http={ "retry": 0, @@ -41,6 +42,11 @@ def test_method_create_with_all_params(self, client: Arcade) -> None: "timeout": 1, "uri": "uri", }, + mcp={ + "retry": 0, + "timeout": 1, + "uri": "uri", + }, ) assert_matches_type(WorkerResponse, worker, path=["response"]) @@ -48,7 +54,7 @@ def test_method_create_with_all_params(self, client: Arcade) -> None: def test_raw_response_create(self, client: Arcade) -> None: response = client.workers.with_raw_response.create( id="id", - enabled=True, + type="type", ) assert response.is_closed is True @@ -60,7 +66,7 @@ def test_raw_response_create(self, client: Arcade) -> None: def test_streaming_response_create(self, client: Arcade) -> None: with client.workers.with_streaming_response.create( id="id", - enabled=True, + type="type", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -88,6 +94,11 @@ def test_method_update_with_all_params(self, client: Arcade) -> None: "timeout": 1, "uri": "uri", }, + mcp={ + "retry": 0, + "timeout": 1, + "uri": "uri", + }, ) assert_matches_type(WorkerResponse, worker, path=["response"]) @@ -324,7 +335,7 @@ class TestAsyncWorkers: async def test_method_create(self, async_client: AsyncArcade) -> None: worker = await async_client.workers.create( id="id", - enabled=True, + type="type", ) assert_matches_type(WorkerResponse, worker, path=["response"]) @@ -332,6 +343,7 @@ async def test_method_create(self, async_client: AsyncArcade) -> None: async def test_method_create_with_all_params(self, async_client: AsyncArcade) -> None: worker = await async_client.workers.create( id="id", + type="type", enabled=True, http={ "retry": 0, @@ -339,6 +351,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncArcade) -> "timeout": 1, "uri": "uri", }, + mcp={ + "retry": 0, + "timeout": 1, + "uri": "uri", + }, ) assert_matches_type(WorkerResponse, worker, path=["response"]) @@ -346,7 +363,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncArcade) -> async def test_raw_response_create(self, async_client: AsyncArcade) -> None: response = await async_client.workers.with_raw_response.create( id="id", - enabled=True, + type="type", ) assert response.is_closed is True @@ -358,7 +375,7 @@ async def test_raw_response_create(self, async_client: AsyncArcade) -> None: async def test_streaming_response_create(self, async_client: AsyncArcade) -> None: async with async_client.workers.with_streaming_response.create( id="id", - enabled=True, + type="type", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -386,6 +403,11 @@ async def test_method_update_with_all_params(self, async_client: AsyncArcade) -> "timeout": 1, "uri": "uri", }, + mcp={ + "retry": 0, + "timeout": 1, + "uri": "uri", + }, ) assert_matches_type(WorkerResponse, worker, path=["response"])