diff --git a/pyproject.toml b/pyproject.toml index 9f38e45..3cbadf4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "qtsurfer-api-client" -version = "0.99.1" +version = "0.99.2" description = "Auto-generated Python client for the QTSurfer API." readme = "README.md" license = "Apache-2.0" diff --git a/src/qtsurfer/api/client/_generated/api/backtesting/get_backtest_result.py b/src/qtsurfer/api/client/_generated/api/backtesting/get_backtest_result.py index fd017ed..99ff70d 100644 --- a/src/qtsurfer/api/client/_generated/api/backtesting/get_backtest_result.py +++ b/src/qtsurfer/api/client/_generated/api/backtesting/get_backtest_result.py @@ -8,6 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.backtest_job_result import BacktestJobResult from ...models.data_source_type import DataSourceType +from ...models.get_backtest_result_response_202 import GetBacktestResultResponse202 from ...models.response_error import ResponseError from ...types import Response @@ -32,12 +33,17 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BacktestJobResult | ResponseError | None: +) -> BacktestJobResult | GetBacktestResultResponse202 | ResponseError | None: if response.status_code == 200: response_200 = BacktestJobResult.from_dict(response.json()) return response_200 + if response.status_code == 202: + response_202 = GetBacktestResultResponse202.from_dict(response.json()) + + return response_202 + if response.status_code == 400: response_400 = ResponseError.from_dict(response.json()) @@ -56,7 +62,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BacktestJobResult | ResponseError]: +) -> Response[BacktestJobResult | GetBacktestResultResponse202 | ResponseError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,12 +77,16 @@ def sync_detailed( job_id: str, *, client: AuthenticatedClient, -) -> Response[BacktestJobResult | ResponseError]: +) -> Response[BacktestJobResult | GetBacktestResultResponse202 | ResponseError]: """Get the result of a backtest execution job Retrieves the current state and results of the execute job identified by `jobId`. Poll until `state.status` is `Completed`, `Failed`, or `Aborted`. + A `202` means the result is not readable yet — keep polling. It is never a terminal + outcome, and it carries no `state`, so a poll loop that stops on a terminal status will + not stop on it. + Args: exchange_id (str): Example: binance. type_ (DataSourceType): Managed exchange data sources available for backtesting. Example: @@ -88,7 +98,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BacktestJobResult | ResponseError] + Response[BacktestJobResult | GetBacktestResultResponse202 | ResponseError] """ kwargs = _get_kwargs( @@ -110,12 +120,16 @@ def sync( job_id: str, *, client: AuthenticatedClient, -) -> BacktestJobResult | ResponseError | None: +) -> BacktestJobResult | GetBacktestResultResponse202 | ResponseError | None: """Get the result of a backtest execution job Retrieves the current state and results of the execute job identified by `jobId`. Poll until `state.status` is `Completed`, `Failed`, or `Aborted`. + A `202` means the result is not readable yet — keep polling. It is never a terminal + outcome, and it carries no `state`, so a poll loop that stops on a terminal status will + not stop on it. + Args: exchange_id (str): Example: binance. type_ (DataSourceType): Managed exchange data sources available for backtesting. Example: @@ -127,7 +141,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BacktestJobResult | ResponseError + BacktestJobResult | GetBacktestResultResponse202 | ResponseError """ return sync_detailed( @@ -144,12 +158,16 @@ async def asyncio_detailed( job_id: str, *, client: AuthenticatedClient, -) -> Response[BacktestJobResult | ResponseError]: +) -> Response[BacktestJobResult | GetBacktestResultResponse202 | ResponseError]: """Get the result of a backtest execution job Retrieves the current state and results of the execute job identified by `jobId`. Poll until `state.status` is `Completed`, `Failed`, or `Aborted`. + A `202` means the result is not readable yet — keep polling. It is never a terminal + outcome, and it carries no `state`, so a poll loop that stops on a terminal status will + not stop on it. + Args: exchange_id (str): Example: binance. type_ (DataSourceType): Managed exchange data sources available for backtesting. Example: @@ -161,7 +179,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BacktestJobResult | ResponseError] + Response[BacktestJobResult | GetBacktestResultResponse202 | ResponseError] """ kwargs = _get_kwargs( @@ -181,12 +199,16 @@ async def asyncio( job_id: str, *, client: AuthenticatedClient, -) -> BacktestJobResult | ResponseError | None: +) -> BacktestJobResult | GetBacktestResultResponse202 | ResponseError | None: """Get the result of a backtest execution job Retrieves the current state and results of the execute job identified by `jobId`. Poll until `state.status` is `Completed`, `Failed`, or `Aborted`. + A `202` means the result is not readable yet — keep polling. It is never a terminal + outcome, and it carries no `state`, so a poll loop that stops on a terminal status will + not stop on it. + Args: exchange_id (str): Example: binance. type_ (DataSourceType): Managed exchange data sources available for backtesting. Example: @@ -198,7 +220,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BacktestJobResult | ResponseError + BacktestJobResult | GetBacktestResultResponse202 | ResponseError """ return ( diff --git a/src/qtsurfer/api/client/_generated/models/__init__.py b/src/qtsurfer/api/client/_generated/models/__init__.py index 9cb0dd8..03de918 100644 --- a/src/qtsurfer/api/client/_generated/models/__init__.py +++ b/src/qtsurfer/api/client/_generated/models/__init__.py @@ -25,6 +25,7 @@ from .execute_sweep_result_objective import ExecuteSweepResultObjective from .execute_sweep_result_order import ExecuteSweepResultOrder from .execute_sweep_result_status import ExecuteSweepResultStatus +from .get_backtest_result_response_202 import GetBacktestResultResponse202 from .get_strategy_response_200 import GetStrategyResponse200 from .get_strategy_response_200_status import GetStrategyResponse200Status from .get_sweep_result_objective import GetSweepResultObjective @@ -85,6 +86,7 @@ "ExecuteSweepResultObjective", "ExecuteSweepResultOrder", "ExecuteSweepResultStatus", + "GetBacktestResultResponse202", "GetStrategyResponse200", "GetStrategyResponse200Status", "GetSweepResultObjective", diff --git a/src/qtsurfer/api/client/_generated/models/get_backtest_result_response_202.py b/src/qtsurfer/api/client/_generated/models/get_backtest_result_response_202.py new file mode 100644 index 0000000..61ed055 --- /dev/null +++ b/src/qtsurfer/api/client/_generated/models/get_backtest_result_response_202.py @@ -0,0 +1,25 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="GetBacktestResultResponse202") + + +@_attrs_define +class GetBacktestResultResponse202: + """ """ + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + get_backtest_result_response_202 = cls() + + return get_backtest_result_response_202 diff --git a/uv.lock b/uv.lock index 8e22db5..7df54c7 100644 --- a/uv.lock +++ b/uv.lock @@ -1025,7 +1025,7 @@ wheels = [ [[package]] name = "qtsurfer-api-client" -version = "0.99.1" +version = "0.99.2" source = { editable = "." } dependencies = [ { name = "attrs" },