diff --git a/.stats.yml b/.stats.yml index 41f7fdd..0435b64 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 15 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-fb88a69cdf1c683229e1b4955389acf571be1cb9c2724bd2e03375c314e5d564.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-cf7aadf0b0db354f95e6a80756043f9588fa1c90ec9556e2255ad00c45be2528.yml diff --git a/src/rizaio/resources/command.py b/src/rizaio/resources/command.py index 9a29204..946c6b9 100644 --- a/src/rizaio/resources/command.py +++ b/src/rizaio/resources/command.py @@ -150,8 +150,8 @@ def exec_func( `execute`. The function will be passed `input` as an object. Args: - code: The function to execute. Your code must define a function named 'execute' and - return a JSON-serializable value. + code: The function to execute. Your code must define a function named "execute" that + takes in a single argument and returns a JSON-serializable value. language: The interpreter to use when executing code. @@ -317,8 +317,8 @@ async def exec_func( `execute`. The function will be passed `input` as an object. Args: - code: The function to execute. Your code must define a function named 'execute' and - return a JSON-serializable value. + code: The function to execute. Your code must define a function named "execute" that + takes in a single argument and returns a JSON-serializable value. language: The interpreter to use when executing code. diff --git a/src/rizaio/types/command_exec_func_params.py b/src/rizaio/types/command_exec_func_params.py index 19a6be4..78b452a 100644 --- a/src/rizaio/types/command_exec_func_params.py +++ b/src/rizaio/types/command_exec_func_params.py @@ -23,8 +23,8 @@ class CommandExecFuncParams(TypedDict, total=False): code: Required[str] """The function to execute. - Your code must define a function named 'execute' and return a JSON-serializable - value. + Your code must define a function named "execute" that takes in a single argument + and returns a JSON-serializable value. """ language: Required[Literal["python", "javascript", "typescript", "ruby", "php"]] diff --git a/tests/api_resources/test_command.py b/tests/api_resources/test_command.py index 4a84592..950895f 100644 --- a/tests/api_resources/test_command.py +++ b/tests/api_resources/test_command.py @@ -99,7 +99,7 @@ def test_streaming_response_exec(self, client: Riza) -> None: @parametrize def test_method_exec_func(self, client: Riza) -> None: command = client.command.exec_func( - code='def execute(input): return { "name": "John", "executed": True }', + code='def execute(input): return { "name": input["name"], "executed": True }', language="python", ) assert_matches_type(CommandExecFuncResponse, command, path=["response"]) @@ -107,7 +107,7 @@ def test_method_exec_func(self, client: Riza) -> None: @parametrize def test_method_exec_func_with_all_params(self, client: Riza) -> None: command = client.command.exec_func( - code='def execute(input): return { "name": "John", "executed": True }', + code='def execute(input): return { "name": input["name"], "executed": True }', language="python", env={"foo": "string"}, files=[ @@ -150,7 +150,7 @@ def test_method_exec_func_with_all_params(self, client: Riza) -> None: @parametrize def test_raw_response_exec_func(self, client: Riza) -> None: response = client.command.with_raw_response.exec_func( - code='def execute(input): return { "name": "John", "executed": True }', + code='def execute(input): return { "name": input["name"], "executed": True }', language="python", ) @@ -162,7 +162,7 @@ def test_raw_response_exec_func(self, client: Riza) -> None: @parametrize def test_streaming_response_exec_func(self, client: Riza) -> None: with client.command.with_streaming_response.exec_func( - code='def execute(input): return { "name": "John", "executed": True }', + code='def execute(input): return { "name": input["name"], "executed": True }', language="python", ) as response: assert not response.is_closed @@ -259,7 +259,7 @@ async def test_streaming_response_exec(self, async_client: AsyncRiza) -> None: @parametrize async def test_method_exec_func(self, async_client: AsyncRiza) -> None: command = await async_client.command.exec_func( - code='def execute(input): return { "name": "John", "executed": True }', + code='def execute(input): return { "name": input["name"], "executed": True }', language="python", ) assert_matches_type(CommandExecFuncResponse, command, path=["response"]) @@ -267,7 +267,7 @@ async def test_method_exec_func(self, async_client: AsyncRiza) -> None: @parametrize async def test_method_exec_func_with_all_params(self, async_client: AsyncRiza) -> None: command = await async_client.command.exec_func( - code='def execute(input): return { "name": "John", "executed": True }', + code='def execute(input): return { "name": input["name"], "executed": True }', language="python", env={"foo": "string"}, files=[ @@ -310,7 +310,7 @@ async def test_method_exec_func_with_all_params(self, async_client: AsyncRiza) - @parametrize async def test_raw_response_exec_func(self, async_client: AsyncRiza) -> None: response = await async_client.command.with_raw_response.exec_func( - code='def execute(input): return { "name": "John", "executed": True }', + code='def execute(input): return { "name": input["name"], "executed": True }', language="python", ) @@ -322,7 +322,7 @@ async def test_raw_response_exec_func(self, async_client: AsyncRiza) -> None: @parametrize async def test_streaming_response_exec_func(self, async_client: AsyncRiza) -> None: async with async_client.command.with_streaming_response.exec_func( - code='def execute(input): return { "name": "John", "executed": True }', + code='def execute(input): return { "name": input["name"], "executed": True }', language="python", ) as response: assert not response.is_closed