diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3e9af1b..fbd9082 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.4.0" + ".": "1.5.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 25bea02..6daca8c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 59 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nimbleway/nimbleway-043980ccbddd4bbd3365e4a8d1df10f0ccbf09dfaed72d80b4a0b7cdf41f5a1a.yml -openapi_spec_hash: 0958d512de22310755bc3de1a03bfafa +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nimbleway/nimbleway-fd1582a9a8f119deb86514ce3d2511abb157d010ea4cfca321eb9c7923f562e5.yml +openapi_spec_hash: 932cd90fd600c7a7cfb419cbd92b5975 config_hash: a9878e098a6929e32711d66374797185 diff --git a/CHANGELOG.md b/CHANGELOG.md index 883f37e..1a6675e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.5.0 (2026-08-25) + +Full Changelog: [v1.4.0...v1.5.0](https://github.com/Nimbleway/nimble-python/compare/v1.4.0...v1.5.0) + +### Features + +* **api:** api update ([97894ec](https://github.com/Nimbleway/nimble-python/commit/97894eca7385829cf64163430f523f796b530676)) + ## 1.4.0 (2026-08-23) Full Changelog: [v1.3.0...v1.4.0](https://github.com/Nimbleway/nimble-python/compare/v1.3.0...v1.4.0) diff --git a/api.md b/api.md index 3f4f29a..2c7025e 100644 --- a/api.md +++ b/api.md @@ -288,7 +288,7 @@ from nimble_python.types.jobs import ( Methods: -- client.jobs.runs.create(job_id) -> RunCreateResponse +- client.jobs.runs.create(job_id, \*\*params) -> RunCreateResponse - client.jobs.runs.list(job_id, \*\*params) -> RunListResponse - client.jobs.runs.cancel(run_id) -> RunCancelResponse - client.jobs.runs.get(run_id) -> RunGetResponse diff --git a/pyproject.toml b/pyproject.toml index 3da08a6..e14c713 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nimble_python" -version = "1.4.0" +version = "1.5.0" description = "The official Python library for the nimble API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/nimble_python/_version.py b/src/nimble_python/_version.py index e0e3dd0..f650b14 100644 --- a/src/nimble_python/_version.py +++ b/src/nimble_python/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "nimble_python" -__version__ = "1.4.0" # x-release-please-version +__version__ = "1.5.0" # x-release-please-version diff --git a/src/nimble_python/resources/jobs/runs/runs.py b/src/nimble_python/resources/jobs/runs/runs.py index 09610b4..6cf080e 100644 --- a/src/nimble_python/resources/jobs/runs/runs.py +++ b/src/nimble_python/resources/jobs/runs/runs.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import Optional + import httpx from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given @@ -22,7 +24,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ....types.jobs import run_list_params +from ....types.jobs import run_list_params, run_create_params from ...._base_client import make_request_options from ....types.jobs.run_get_response import RunGetResponse from ....types.jobs.run_list_response import RunListResponse @@ -60,6 +62,7 @@ def create( self, job_id: str, *, + inputs: Optional[run_create_params.Inputs] | Omit = omit, # 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, @@ -71,6 +74,8 @@ def create( Trigger Job Run Public V2 Args: + inputs: Configuration for the input data a job processes. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -83,6 +88,7 @@ def create( raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}") return self._post( path_template("/v2/jobs/{job_id}/runs", job_id=job_id), + body=maybe_transform({"inputs": inputs}, run_create_params.RunCreateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -229,6 +235,7 @@ async def create( self, job_id: str, *, + inputs: Optional[run_create_params.Inputs] | Omit = omit, # 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, @@ -240,6 +247,8 @@ async def create( Trigger Job Run Public V2 Args: + inputs: Configuration for the input data a job processes. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -252,6 +261,7 @@ async def create( raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}") return await self._post( path_template("/v2/jobs/{job_id}/runs", job_id=job_id), + body=await async_maybe_transform({"inputs": inputs}, run_create_params.RunCreateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/nimble_python/types/jobs/__init__.py b/src/nimble_python/types/jobs/__init__.py index fd83456..de47b19 100644 --- a/src/nimble_python/types/jobs/__init__.py +++ b/src/nimble_python/types/jobs/__init__.py @@ -4,6 +4,7 @@ from .run_list_params import RunListParams as RunListParams from .run_get_response import RunGetResponse as RunGetResponse +from .run_create_params import RunCreateParams as RunCreateParams from .run_list_response import RunListResponse as RunListResponse from .run_cancel_response import RunCancelResponse as RunCancelResponse from .run_create_response import RunCreateResponse as RunCreateResponse diff --git a/src/nimble_python/types/jobs/run_create_params.py b/src/nimble_python/types/jobs/run_create_params.py new file mode 100644 index 0000000..8b47f2c --- /dev/null +++ b/src/nimble_python/types/jobs/run_create_params.py @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable, Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["RunCreateParams", "Inputs"] + + +class RunCreateParams(TypedDict, total=False): + inputs: Optional[Inputs] + """Configuration for the input data a job processes.""" + + +class Inputs(TypedDict, total=False): + """Configuration for the input data a job processes.""" + + type: Required[Literal["s3", "inline", "file"]] + """ + How inputs are supplied: an 's3' bucket, 'inline' records, or an uploaded + 'file'. + """ + + data: Optional[Iterable[Dict[str, object]]] + """Inline list of input records. Used when type is 'inline'.""" + + file_path: Optional[str] + """Path to the input file; must start with 's3' or 'file\\__'. + + Used for 's3'/'file' types. + """ + + node_data: Optional[Dict[str, Iterable[Dict[str, object]]]] + """Inline input records keyed by source node id, e.g. + + {'source_a': [{...}]}. Used when type is 'inline' on a dynamic-workflow job, + which has one source node per input file. Mutually exclusive with 'data'. + """ diff --git a/tests/api_resources/jobs/test_runs.py b/tests/api_resources/jobs/test_runs.py index 815e409..cbbfa3f 100644 --- a/tests/api_resources/jobs/test_runs.py +++ b/tests/api_resources/jobs/test_runs.py @@ -26,7 +26,21 @@ class TestRuns: @parametrize def test_method_create(self, client: Nimble) -> None: run = client.jobs.runs.create( - "job_id", + job_id="job_id", + ) + assert_matches_type(RunCreateResponse, run, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Nimble) -> None: + run = client.jobs.runs.create( + job_id="job_id", + inputs={ + "type": "s3", + "data": [{"foo": "bar"}], + "file_path": "file_path", + "node_data": {"foo": [{"foo": "bar"}]}, + }, ) assert_matches_type(RunCreateResponse, run, path=["response"]) @@ -34,7 +48,7 @@ def test_method_create(self, client: Nimble) -> None: @parametrize def test_raw_response_create(self, client: Nimble) -> None: response = client.jobs.runs.with_raw_response.create( - "job_id", + job_id="job_id", ) assert response.is_closed is True @@ -46,7 +60,7 @@ def test_raw_response_create(self, client: Nimble) -> None: @parametrize def test_streaming_response_create(self, client: Nimble) -> None: with client.jobs.runs.with_streaming_response.create( - "job_id", + job_id="job_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -61,7 +75,7 @@ def test_streaming_response_create(self, client: Nimble) -> None: def test_path_params_create(self, client: Nimble) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_id` but received ''"): client.jobs.runs.with_raw_response.create( - "", + job_id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -210,7 +224,21 @@ class TestAsyncRuns: @parametrize async def test_method_create(self, async_client: AsyncNimble) -> None: run = await async_client.jobs.runs.create( - "job_id", + job_id="job_id", + ) + assert_matches_type(RunCreateResponse, run, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncNimble) -> None: + run = await async_client.jobs.runs.create( + job_id="job_id", + inputs={ + "type": "s3", + "data": [{"foo": "bar"}], + "file_path": "file_path", + "node_data": {"foo": [{"foo": "bar"}]}, + }, ) assert_matches_type(RunCreateResponse, run, path=["response"]) @@ -218,7 +246,7 @@ async def test_method_create(self, async_client: AsyncNimble) -> None: @parametrize async def test_raw_response_create(self, async_client: AsyncNimble) -> None: response = await async_client.jobs.runs.with_raw_response.create( - "job_id", + job_id="job_id", ) assert response.is_closed is True @@ -230,7 +258,7 @@ async def test_raw_response_create(self, async_client: AsyncNimble) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncNimble) -> None: async with async_client.jobs.runs.with_streaming_response.create( - "job_id", + job_id="job_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -245,7 +273,7 @@ async def test_streaming_response_create(self, async_client: AsyncNimble) -> Non async def test_path_params_create(self, async_client: AsyncNimble) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_id` but received ''"): await async_client.jobs.runs.with_raw_response.create( - "", + job_id="", ) @pytest.mark.skip(reason="Mock server tests are disabled")