Skip to content

Commit 4a9a9e3

Browse files
feat(api): api update
1 parent 2040e0c commit 4a9a9e3

File tree

7 files changed

+76
-35
lines changed

7 files changed

+76
-35
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 87
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4cd38d2f4180cc9bd949f182a221d6221c44e7e0ec1ddc110dd7677ba822b51a.yml
3-
openapi_spec_hash: e186fd7fd5f09ba496f0b7bb87365f3b
4-
config_hash: e36a10de3bba40d7894f4893019bf671
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6bbcd490ee6a51a17c19f8d2b545791744a73145b4f9f05b8a7fae5590b21135.yml
3+
openapi_spec_hash: 832de93ff415ecc09a7fa66017ee012f
4+
config_hash: 4514558503b7aa6eba8c2941564c247d

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,4 +339,4 @@ Methods:
339339
- <code title="get /v1/repositories">client.repositories.<a href="./src/runloop_api_client/resources/repositories.py">list</a>(\*\*<a href="src/runloop_api_client/types/repository_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/repository_connection_view.py">SyncRepositoriesCursorIDPage[RepositoryConnectionView]</a></code>
340340
- <code title="post /v1/repositories/{id}/delete">client.repositories.<a href="./src/runloop_api_client/resources/repositories.py">delete</a>(id) -> object</code>
341341
- <code title="get /v1/repositories/{id}/inspections">client.repositories.<a href="./src/runloop_api_client/resources/repositories.py">list_inspections</a>(id) -> <a href="./src/runloop_api_client/types/repository_inspection_list_view.py">RepositoryInspectionListView</a></code>
342-
- <code title="post /v1/repositories/{id}/refresh">client.repositories.<a href="./src/runloop_api_client/resources/repositories.py">refresh</a>(id) -> object</code>
342+
- <code title="post /v1/repositories/{id}/refresh">client.repositories.<a href="./src/runloop_api_client/resources/repositories.py">refresh</a>(id, \*\*<a href="src/runloop_api_client/types/repository_refresh_params.py">params</a>) -> object</code>

src/runloop_api_client/resources/repositories.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import httpx
88

9-
from ..types import repository_list_params, repository_create_params
9+
from ..types import repository_list_params, repository_create_params, repository_refresh_params
1010
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
1111
from .._utils import maybe_transform, async_maybe_transform
1212
from .._compat import cached_property
@@ -272,6 +272,8 @@ def refresh(
272272
self,
273273
id: str,
274274
*,
275+
blueprint_id: Optional[str] | NotGiven = NOT_GIVEN,
276+
github_auth_token: Optional[str] | NotGiven = NOT_GIVEN,
275277
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
276278
# The extra values given here take precedence over values defined on the client or passed to this method.
277279
extra_headers: Headers | None = None,
@@ -285,6 +287,10 @@ def refresh(
285287
repo's technical stack and developer environment requirements.
286288
287289
Args:
290+
blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint.
291+
292+
github_auth_token: GitHub authentication token for accessing private repositories.
293+
288294
extra_headers: Send extra headers
289295
290296
extra_query: Add additional query parameters to the request
@@ -299,6 +305,13 @@ def refresh(
299305
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
300306
return self._post(
301307
f"/v1/repositories/{id}/refresh",
308+
body=maybe_transform(
309+
{
310+
"blueprint_id": blueprint_id,
311+
"github_auth_token": github_auth_token,
312+
},
313+
repository_refresh_params.RepositoryRefreshParams,
314+
),
302315
options=make_request_options(
303316
extra_headers=extra_headers,
304317
extra_query=extra_query,
@@ -557,6 +570,8 @@ async def refresh(
557570
self,
558571
id: str,
559572
*,
573+
blueprint_id: Optional[str] | NotGiven = NOT_GIVEN,
574+
github_auth_token: Optional[str] | NotGiven = NOT_GIVEN,
560575
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
561576
# The extra values given here take precedence over values defined on the client or passed to this method.
562577
extra_headers: Headers | None = None,
@@ -570,6 +585,10 @@ async def refresh(
570585
repo's technical stack and developer environment requirements.
571586
572587
Args:
588+
blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint.
589+
590+
github_auth_token: GitHub authentication token for accessing private repositories.
591+
573592
extra_headers: Send extra headers
574593
575594
extra_query: Add additional query parameters to the request
@@ -584,6 +603,13 @@ async def refresh(
584603
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
585604
return await self._post(
586605
f"/v1/repositories/{id}/refresh",
606+
body=await async_maybe_transform(
607+
{
608+
"blueprint_id": blueprint_id,
609+
"github_auth_token": github_auth_token,
610+
},
611+
repository_refresh_params.RepositoryRefreshParams,
612+
),
587613
options=make_request_options(
588614
extra_headers=extra_headers,
589615
extra_query=extra_query,

src/runloop_api_client/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
from .repository_manifest_view import RepositoryManifestView as RepositoryManifestView
4646
from .devbox_snapshot_list_view import DevboxSnapshotListView as DevboxSnapshotListView
4747
from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams
48+
from .repository_refresh_params import RepositoryRefreshParams as RepositoryRefreshParams
4849
from .scenario_start_run_params import ScenarioStartRunParams as ScenarioStartRunParams
4950
from .benchmark_start_run_params import BenchmarkStartRunParams as BenchmarkStartRunParams
5051
from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters

src/runloop_api_client/types/benchmark_run_view.py

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,11 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Dict, List, Optional
3+
from typing import Dict, Optional
44
from typing_extensions import Literal
55

6-
from pydantic import Field as FieldInfo
7-
86
from .._models import BaseModel
9-
from .scoring_contract_result_view import ScoringContractResultView
10-
11-
__all__ = ["BenchmarkRunView", "ScenarioRun"]
12-
13-
14-
class ScenarioRun(BaseModel):
15-
scenario_id: str
16-
"""ID of the Scenario that has been run."""
177

18-
scoring_result: ScoringContractResultView = FieldInfo(alias="scoringResult")
19-
"""The scoring result of the ScenarioRun."""
20-
21-
scenario_run_id: Optional[str] = FieldInfo(alias="scenarioRunId", default=None)
22-
"""ID of the scenario run."""
8+
__all__ = ["BenchmarkRunView"]
239

2410

2511
class BenchmarkRunView(BaseModel):
@@ -32,12 +18,6 @@ class BenchmarkRunView(BaseModel):
3218
metadata: Dict[str, str]
3319
"""User defined metadata to attach to the benchmark run for organization."""
3420

35-
pending_scenarios: List[str]
36-
"""List of Scenarios that have yet to be scored."""
37-
38-
scenario_runs: List[ScenarioRun]
39-
"""List of Scenarios have been completed."""
40-
4121
start_time_ms: int
4222
"""The time the benchmark run execution started (Unix timestamp milliseconds)."""
4323

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Optional
6+
from typing_extensions import TypedDict
7+
8+
__all__ = ["RepositoryRefreshParams"]
9+
10+
11+
class RepositoryRefreshParams(TypedDict, total=False):
12+
blueprint_id: Optional[str]
13+
"""ID of blueprint to use as base for resulting RepositoryVersion blueprint."""
14+
15+
github_auth_token: Optional[str]
16+
"""GitHub authentication token for accessing private repositories."""

tests/api_resources/test_repositories.py

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,23 @@ def test_path_params_list_inspections(self, client: Runloop) -> None:
217217
@parametrize
218218
def test_method_refresh(self, client: Runloop) -> None:
219219
repository = client.repositories.refresh(
220-
"id",
220+
id="id",
221+
)
222+
assert_matches_type(object, repository, path=["response"])
223+
224+
@parametrize
225+
def test_method_refresh_with_all_params(self, client: Runloop) -> None:
226+
repository = client.repositories.refresh(
227+
id="id",
228+
blueprint_id="blueprint_id",
229+
github_auth_token="github_auth_token",
221230
)
222231
assert_matches_type(object, repository, path=["response"])
223232

224233
@parametrize
225234
def test_raw_response_refresh(self, client: Runloop) -> None:
226235
response = client.repositories.with_raw_response.refresh(
227-
"id",
236+
id="id",
228237
)
229238

230239
assert response.is_closed is True
@@ -235,7 +244,7 @@ def test_raw_response_refresh(self, client: Runloop) -> None:
235244
@parametrize
236245
def test_streaming_response_refresh(self, client: Runloop) -> None:
237246
with client.repositories.with_streaming_response.refresh(
238-
"id",
247+
id="id",
239248
) as response:
240249
assert not response.is_closed
241250
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -249,7 +258,7 @@ def test_streaming_response_refresh(self, client: Runloop) -> None:
249258
def test_path_params_refresh(self, client: Runloop) -> None:
250259
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
251260
client.repositories.with_raw_response.refresh(
252-
"",
261+
id="",
253262
)
254263

255264

@@ -452,14 +461,23 @@ async def test_path_params_list_inspections(self, async_client: AsyncRunloop) ->
452461
@parametrize
453462
async def test_method_refresh(self, async_client: AsyncRunloop) -> None:
454463
repository = await async_client.repositories.refresh(
455-
"id",
464+
id="id",
465+
)
466+
assert_matches_type(object, repository, path=["response"])
467+
468+
@parametrize
469+
async def test_method_refresh_with_all_params(self, async_client: AsyncRunloop) -> None:
470+
repository = await async_client.repositories.refresh(
471+
id="id",
472+
blueprint_id="blueprint_id",
473+
github_auth_token="github_auth_token",
456474
)
457475
assert_matches_type(object, repository, path=["response"])
458476

459477
@parametrize
460478
async def test_raw_response_refresh(self, async_client: AsyncRunloop) -> None:
461479
response = await async_client.repositories.with_raw_response.refresh(
462-
"id",
480+
id="id",
463481
)
464482

465483
assert response.is_closed is True
@@ -470,7 +488,7 @@ async def test_raw_response_refresh(self, async_client: AsyncRunloop) -> None:
470488
@parametrize
471489
async def test_streaming_response_refresh(self, async_client: AsyncRunloop) -> None:
472490
async with async_client.repositories.with_streaming_response.refresh(
473-
"id",
491+
id="id",
474492
) as response:
475493
assert not response.is_closed
476494
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -484,5 +502,5 @@ async def test_streaming_response_refresh(self, async_client: AsyncRunloop) -> N
484502
async def test_path_params_refresh(self, async_client: AsyncRunloop) -> None:
485503
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
486504
await async_client.repositories.with_raw_response.refresh(
487-
"",
505+
id="",
488506
)

0 commit comments

Comments
 (0)