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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.4.0"
".": "1.5.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ from nimble_python.types.jobs import (

Methods:

- <code title="post /v2/jobs/{job_id}/runs">client.jobs.runs.<a href="./src/nimble_python/resources/jobs/runs/runs.py">create</a>(job_id) -> <a href="./src/nimble_python/types/jobs/run_create_response.py">RunCreateResponse</a></code>
- <code title="post /v2/jobs/{job_id}/runs">client.jobs.runs.<a href="./src/nimble_python/resources/jobs/runs/runs.py">create</a>(job_id, \*\*<a href="src/nimble_python/types/jobs/run_create_params.py">params</a>) -> <a href="./src/nimble_python/types/jobs/run_create_response.py">RunCreateResponse</a></code>
- <code title="get /v2/jobs/{job_id}/runs">client.jobs.runs.<a href="./src/nimble_python/resources/jobs/runs/runs.py">list</a>(job_id, \*\*<a href="src/nimble_python/types/jobs/run_list_params.py">params</a>) -> <a href="./src/nimble_python/types/jobs/run_list_response.py">RunListResponse</a></code>
- <code title="post /v2/jobs/runs/{run_id}/cancel">client.jobs.runs.<a href="./src/nimble_python/resources/jobs/runs/runs.py">cancel</a>(run_id) -> <a href="./src/nimble_python/types/jobs/run_cancel_response.py">RunCancelResponse</a></code>
- <code title="get /v2/jobs/runs/{run_id}">client.jobs.runs.<a href="./src/nimble_python/resources/jobs/runs/runs.py">get</a>(run_id) -> <a href="./src/nimble_python/types/jobs/run_get_response.py">RunGetResponse</a></code>
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/nimble_python/_version.py
Original file line number Diff line number Diff line change
@@ -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
12 changes: 11 additions & 1 deletion src/nimble_python/resources/jobs/runs/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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
),
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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
),
Expand Down
1 change: 1 addition & 0 deletions src/nimble_python/types/jobs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
39 changes: 39 additions & 0 deletions src/nimble_python/types/jobs/run_create_params.py
Original file line number Diff line number Diff line change
@@ -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'.
"""
44 changes: 36 additions & 8 deletions tests/api_resources/jobs/test_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,29 @@ 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"])

@pytest.mark.skip(reason="Mock server tests are disabled")
@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
Expand All @@ -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"
Expand All @@ -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")
Expand Down Expand Up @@ -210,15 +224,29 @@ 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"])

@pytest.mark.skip(reason="Mock server tests are disabled")
@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
Expand All @@ -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"
Expand All @@ -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")
Expand Down
Loading