Skip to content

Commit 2cd01fb

Browse files
committed
expose request options in push()
1 parent 3a02429 commit 2cd01fb

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/runloop_api_client/sdk/async_scenario_builder.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
from __future__ import annotations
44

55
from typing import Dict, List, Iterable, Optional
6-
from typing_extensions import Self, Literal, override
6+
from typing_extensions import Self, Unpack, Literal, override
77

88
from ..types import ScenarioCreateParams, ScenarioEnvironmentParam
9+
from ._types import LongRequestOptions
910
from .._client import AsyncRunloop
1011
from .async_scenario import AsyncScenario
1112
from .async_snapshot import AsyncSnapshot
@@ -443,13 +444,14 @@ def _build_params(self) -> ScenarioCreateParams:
443444

444445
return params
445446

446-
async def push(self) -> AsyncScenario:
447+
async def push(self, **options: Unpack[LongRequestOptions]) -> AsyncScenario:
447448
"""Create the scenario on the platform.
448449
450+
:param options: Optional long-running request configuration
449451
:raises ValueError: If required fields are missing
450452
:return: Created scenario wrapper
451453
:rtype: AsyncScenario
452454
"""
453455
params = self._build_params()
454-
scenario_view = await self._client.scenarios.create(**params)
456+
scenario_view = await self._client.scenarios.create(**params, **options)
455457
return AsyncScenario(self._client, scenario_view.id)

src/runloop_api_client/sdk/scenario_builder.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
from __future__ import annotations
44

55
from typing import Dict, List, Iterable, Optional
6-
from typing_extensions import Self, Literal, override
6+
from typing_extensions import Self, Unpack, Literal, override
77

88
from ..types import ScenarioCreateParams, ScenarioEnvironmentParam
9+
from ._types import LongRequestOptions
910
from .._client import Runloop
1011
from .scenario import Scenario
1112
from .snapshot import Snapshot
@@ -443,13 +444,14 @@ def _build_params(self) -> ScenarioCreateParams:
443444

444445
return params
445446

446-
def push(self) -> Scenario:
447+
def push(self, **options: Unpack[LongRequestOptions]) -> Scenario:
447448
"""Create the scenario on the platform.
448449
450+
:param options: Optional long-running request configuration
449451
:raises ValueError: If required fields are missing
450452
:return: Created scenario wrapper
451453
:rtype: Scenario
452454
"""
453455
params = self._build_params()
454-
scenario_view = self._client.scenarios.create(**params)
456+
scenario_view = self._client.scenarios.create(**params, **options)
455457
return Scenario(self._client, scenario_view.id)

0 commit comments

Comments
 (0)