Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 19
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-6d453e96e34a36ecb9e215d646d7102302edb0fd495191f44fb1a1506d9cbb8f.yml
openapi_spec_hash: a68cd77477bac3d0c50351e2a174ae50
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-992c4cfe194f4e4bfed0877e15c601e0577b661c779bb1b28d7d0531bba03677.yml
openapi_spec_hash: 2a2799549615cc0b9b6d5dcc83441d15
config_hash: d86655f9af7ae4c4c444d9a16685a7c5
8 changes: 4 additions & 4 deletions src/arcadepy/resources/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ def create(
self,
*,
id: str,
type: str,
enabled: bool | NotGiven = NOT_GIVEN,
http: worker_create_params.HTTP | NotGiven = NOT_GIVEN,
mcp: worker_create_params.Mcp | NotGiven = NOT_GIVEN,
type: str | 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,
Expand All @@ -79,10 +79,10 @@ def create(
body=maybe_transform(
{
"id": id,
"type": type,
"enabled": enabled,
"http": http,
"mcp": mcp,
"type": type,
},
worker_create_params.WorkerCreateParams,
),
Expand Down Expand Up @@ -358,10 +358,10 @@ async def create(
self,
*,
id: str,
type: str,
enabled: bool | NotGiven = NOT_GIVEN,
http: worker_create_params.HTTP | NotGiven = NOT_GIVEN,
mcp: worker_create_params.Mcp | NotGiven = NOT_GIVEN,
type: str | 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,
Expand All @@ -386,10 +386,10 @@ async def create(
body=await async_maybe_transform(
{
"id": id,
"type": type,
"enabled": enabled,
"http": http,
"mcp": mcp,
"type": type,
},
worker_create_params.WorkerCreateParams,
),
Expand Down
4 changes: 2 additions & 2 deletions src/arcadepy/types/worker_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
class WorkerCreateParams(TypedDict, total=False):
id: Required[str]

type: Required[str]

enabled: bool

http: HTTP

mcp: Mcp

type: str


class HTTP(TypedDict, total=False):
retry: Required[int]
Expand Down
10 changes: 2 additions & 8 deletions tests/api_resources/test_workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ class TestWorkers:
def test_method_create(self, client: Arcade) -> None:
worker = client.workers.create(
id="id",
type="type",
)
assert_matches_type(WorkerResponse, worker, path=["response"])

@parametrize
def test_method_create_with_all_params(self, client: Arcade) -> None:
worker = client.workers.create(
id="id",
type="type",
enabled=True,
http={
"retry": 0,
Expand All @@ -47,14 +45,14 @@ def test_method_create_with_all_params(self, client: Arcade) -> None:
"timeout": 1,
"uri": "uri",
},
type="type",
)
assert_matches_type(WorkerResponse, worker, path=["response"])

@parametrize
def test_raw_response_create(self, client: Arcade) -> None:
response = client.workers.with_raw_response.create(
id="id",
type="type",
)

assert response.is_closed is True
Expand All @@ -66,7 +64,6 @@ 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",
type="type",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand Down Expand Up @@ -335,15 +332,13 @@ class TestAsyncWorkers:
async def test_method_create(self, async_client: AsyncArcade) -> None:
worker = await async_client.workers.create(
id="id",
type="type",
)
assert_matches_type(WorkerResponse, worker, path=["response"])

@parametrize
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,
Expand All @@ -356,14 +351,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncArcade) ->
"timeout": 1,
"uri": "uri",
},
type="type",
)
assert_matches_type(WorkerResponse, worker, path=["response"])

@parametrize
async def test_raw_response_create(self, async_client: AsyncArcade) -> None:
response = await async_client.workers.with_raw_response.create(
id="id",
type="type",
)

assert response.is_closed is True
Expand All @@ -375,7 +370,6 @@ 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",
type="type",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand Down