Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed May 22, 2024
1 parent 0264f17 commit 307af07
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-b8d351f2a44220b8f07b16d3dce1ca3bd14df4ade1a83fa0b40ff9047dbc2934.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-7e044297a8d3c5c64964532d19e0667b059ef5a121cf3c1e64b806eec55e0767.yml
16 changes: 8 additions & 8 deletions src/rizaio/resources/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def exec(
*,
code: str,
language: Literal["PYTHON", "JAVASCRIPT", "TYPESCRIPT", "RUBY", "PHP"],
allow_http_hosts: List[str] | NotGiven = NOT_GIVEN,
args: List[str] | NotGiven = NOT_GIVEN,
env: Dict[str, str] | NotGiven = NOT_GIVEN,
net: List[str] | NotGiven = NOT_GIVEN,
stdin: 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.
Expand All @@ -65,12 +65,12 @@ def exec(
language: The interpreter to use when executing code.
allow_http_hosts: List of allowed hosts for HTTP requests
args: List of command line arguments to pass to the script.
env: Set of key-value pairs to add to the script's execution environment.
net: List of allowed hosts for HTTP requests
stdin: Input to pass to the script via `stdin`.
extra_headers: Send extra headers
Expand All @@ -87,9 +87,9 @@ def exec(
{
"code": code,
"language": language,
"allow_http_hosts": allow_http_hosts,
"args": args,
"env": env,
"net": net,
"stdin": stdin,
},
command_exec_params.CommandExecParams,
Expand All @@ -115,9 +115,9 @@ async def exec(
*,
code: str,
language: Literal["PYTHON", "JAVASCRIPT", "TYPESCRIPT", "RUBY", "PHP"],
allow_http_hosts: List[str] | NotGiven = NOT_GIVEN,
args: List[str] | NotGiven = NOT_GIVEN,
env: Dict[str, str] | NotGiven = NOT_GIVEN,
net: List[str] | NotGiven = NOT_GIVEN,
stdin: 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.
Expand All @@ -137,12 +137,12 @@ async def exec(
language: The interpreter to use when executing code.
allow_http_hosts: List of allowed hosts for HTTP requests
args: List of command line arguments to pass to the script.
env: Set of key-value pairs to add to the script's execution environment.
net: List of allowed hosts for HTTP requests
stdin: Input to pass to the script via `stdin`.
extra_headers: Send extra headers
Expand All @@ -159,9 +159,9 @@ async def exec(
{
"code": code,
"language": language,
"allow_http_hosts": allow_http_hosts,
"args": args,
"env": env,
"net": net,
"stdin": stdin,
},
command_exec_params.CommandExecParams,
Expand Down
6 changes: 3 additions & 3 deletions src/rizaio/types/command_exec_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ class CommandExecParams(TypedDict, total=False):
language: Required[Literal["PYTHON", "JAVASCRIPT", "TYPESCRIPT", "RUBY", "PHP"]]
"""The interpreter to use when executing code."""

allow_http_hosts: List[str]
"""List of allowed hosts for HTTP requests"""

args: List[str]
"""List of command line arguments to pass to the script."""

env: Dict[str, str]
"""Set of key-value pairs to add to the script's execution environment."""

net: List[str]
"""List of allowed hosts for HTTP requests"""

stdin: str
"""Input to pass to the script via `stdin`."""
4 changes: 2 additions & 2 deletions tests/api_resources/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def test_method_exec_with_all_params(self, client: Riza) -> None:
command = client.command.exec(
code='print("Hello world!")',
language="PYTHON",
allow_http_hosts=["string", "string", "string"],
args=["string", "string", "string"],
env={"foo": "string"},
net=["string", "string", "string"],
stdin="string",
)
assert_matches_type(CommandExecResponse, command, path=["response"])
Expand Down Expand Up @@ -80,9 +80,9 @@ async def test_method_exec_with_all_params(self, async_client: AsyncRiza) -> Non
command = await async_client.command.exec(
code='print("Hello world!")',
language="PYTHON",
allow_http_hosts=["string", "string", "string"],
args=["string", "string", "string"],
env={"foo": "string"},
net=["string", "string", "string"],
stdin="string",
)
assert_matches_type(CommandExecResponse, command, path=["response"])
Expand Down

0 comments on commit 307af07

Please sign in to comment.