Skip to content

Commit 8d62f4b

Browse files
feat(api): api update
1 parent 02ec86a commit 8d62f4b

10 files changed

Lines changed: 305 additions & 190 deletions

File tree

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 90
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9b2e136aedff0713e8d50d6c53a930cd2c3583dcac1a9fce552cf25bb0d29214.yml
3-
openapi_spec_hash: 81e1da702f2dfb28bbe1bfab0d5d8cbd
4-
config_hash: 5b2602a56850cf0d0e50da298d1c6916
1+
configured_endpoints: 91
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-034d0b86510db8b712b55ac88c1c4a322db2ce84edc632f6d27be1eb4f34fd37.yml
3+
openapi_spec_hash: 0485ec0d01253b2c1bdab3015370808e
4+
config_hash: 35e129f39a0c1fd38209b0dafb7c7562

api.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,14 @@ Types:
4545

4646
```python
4747
from runloop_api_client.types import (
48+
BlueprintBuildFromInspectionParameters,
4849
BlueprintBuildLog,
4950
BlueprintBuildLogsListView,
5051
BlueprintBuildParameters,
5152
BlueprintListView,
5253
BlueprintPreviewView,
5354
BlueprintView,
55+
InspectionSource,
5456
)
5557
```
5658

@@ -298,6 +300,7 @@ Methods:
298300
- <code title="get /v1/repositories/{id}">client.repositories.<a href="./src/runloop_api_client/resources/repositories.py">retrieve</a>(id) -> <a href="./src/runloop_api_client/types/repository_connection_view.py">RepositoryConnectionView</a></code>
299301
- <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>
300302
- <code title="post /v1/repositories/{id}/delete">client.repositories.<a href="./src/runloop_api_client/resources/repositories.py">delete</a>(id) -> object</code>
303+
- <code title="post /v1/repositories/{id}/inspect">client.repositories.<a href="./src/runloop_api_client/resources/repositories.py">inspect</a>(id, \*\*<a href="src/runloop_api_client/types/repository_inspect_params.py">params</a>) -> <a href="./src/runloop_api_client/types/repository_inspection_details.py">RepositoryInspectionDetails</a></code>
301304
- <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>
302305
- <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>
303306

src/runloop_api_client/resources/blueprints.py

Lines changed: 19 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from ..lib.polling_async import async_poll_until
3030
from ..types.blueprint_view import BlueprintView
3131
from ..types.blueprint_preview_view import BlueprintPreviewView
32+
from ..types.inspection_source_param import InspectionSourceParam
3233
from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView
3334
from ..types.shared_params.launch_parameters import LaunchParameters
3435
from ..types.shared_params.code_mount_parameters import CodeMountParameters
@@ -71,16 +72,11 @@ def with_streaming_response(self) -> BlueprintsResourceWithStreamingResponse:
7172
def create(
7273
self,
7374
*,
75+
inspection_source: InspectionSourceParam,
7476
name: str,
75-
base_blueprint_id: Optional[str] | Omit = omit,
76-
base_blueprint_name: Optional[str] | Omit = omit,
77-
build_args: Optional[Dict[str, str]] | Omit = omit,
78-
code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit,
79-
dockerfile: Optional[str] | Omit = omit,
8077
file_mounts: Optional[Dict[str, str]] | Omit = omit,
8178
launch_parameters: Optional[LaunchParameters] | Omit = omit,
8279
metadata: Optional[Dict[str, str]] | Omit = omit,
83-
services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit,
8480
system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit,
8581
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
8682
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -90,40 +86,23 @@ def create(
9086
timeout: float | httpx.Timeout | None | NotGiven = not_given,
9187
idempotency_key: str | None = None,
9288
) -> BlueprintView:
93-
"""Starts build of custom defined container Blueprint.
94-
95-
The Blueprint will begin in
96-
the 'provisioning' step and transition to the 'building' step once it is
97-
selected off the build queue., Upon build complete it will transition to
98-
'building_complete' if the build is successful.
89+
"""
90+
Starts build of custom defined container Blueprint using a RepositoryConnection
91+
Inspection as a source container specification.
9992
10093
Args:
101-
name: Name of the Blueprint.
102-
103-
base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this
104-
build.
105-
106-
base_blueprint_name: (Optional) Name of previously built blueprint to use as a base blueprint for
107-
this build. When set, this will load the latest successfully built Blueprint
108-
with the given name. Only one of (base_blueprint_id, base_blueprint_name) should
109-
be specified.
94+
inspection_source: (Optional) Use a RepositoryInspection a source of a Blueprint build. The
95+
Dockerfile will be automatically created based on the RepositoryInspection
96+
contents.
11097
111-
build_args: (Optional) Arbitrary Docker build args to pass during build.
112-
113-
code_mounts: A list of code mounts to be included in the Blueprint.
114-
115-
dockerfile: Dockerfile contents to be used to build the Blueprint.
98+
name: Name of the Blueprint.
11699
117100
file_mounts: (Optional) Map of paths and file contents to write before setup.
118101
119102
launch_parameters: Parameters to configure your Devbox at launch time.
120103
121104
metadata: (Optional) User defined metadata for the Blueprint.
122105
123-
services: (Optional) List of containerized services to include in the Blueprint. These
124-
services will be pre-pulled during the build phase for optimized startup
125-
performance.
126-
127106
system_setup_commands: A list of commands to run to set up your system.
128107
129108
extra_headers: Send extra headers
@@ -140,16 +119,11 @@ def create(
140119
"/v1/blueprints",
141120
body=maybe_transform(
142121
{
122+
"inspection_source": inspection_source,
143123
"name": name,
144-
"base_blueprint_id": base_blueprint_id,
145-
"base_blueprint_name": base_blueprint_name,
146-
"build_args": build_args,
147-
"code_mounts": code_mounts,
148-
"dockerfile": dockerfile,
149124
"file_mounts": file_mounts,
150125
"launch_parameters": launch_parameters,
151126
"metadata": metadata,
152-
"services": services,
153127
"system_setup_commands": system_setup_commands,
154128
},
155129
blueprint_create_params.BlueprintCreateParams,
@@ -596,16 +570,11 @@ def with_streaming_response(self) -> AsyncBlueprintsResourceWithStreamingRespons
596570
async def create(
597571
self,
598572
*,
573+
inspection_source: InspectionSourceParam,
599574
name: str,
600-
base_blueprint_id: Optional[str] | Omit = omit,
601-
base_blueprint_name: Optional[str] | Omit = omit,
602-
build_args: Optional[Dict[str, str]] | Omit = omit,
603-
code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit,
604-
dockerfile: Optional[str] | Omit = omit,
605575
file_mounts: Optional[Dict[str, str]] | Omit = omit,
606576
launch_parameters: Optional[LaunchParameters] | Omit = omit,
607577
metadata: Optional[Dict[str, str]] | Omit = omit,
608-
services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit,
609578
system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit,
610579
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
611580
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -615,40 +584,23 @@ async def create(
615584
timeout: float | httpx.Timeout | None | NotGiven = not_given,
616585
idempotency_key: str | None = None,
617586
) -> BlueprintView:
618-
"""Starts build of custom defined container Blueprint.
619-
620-
The Blueprint will begin in
621-
the 'provisioning' step and transition to the 'building' step once it is
622-
selected off the build queue., Upon build complete it will transition to
623-
'building_complete' if the build is successful.
587+
"""
588+
Starts build of custom defined container Blueprint using a RepositoryConnection
589+
Inspection as a source container specification.
624590
625591
Args:
626-
name: Name of the Blueprint.
627-
628-
base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this
629-
build.
630-
631-
base_blueprint_name: (Optional) Name of previously built blueprint to use as a base blueprint for
632-
this build. When set, this will load the latest successfully built Blueprint
633-
with the given name. Only one of (base_blueprint_id, base_blueprint_name) should
634-
be specified.
592+
inspection_source: (Optional) Use a RepositoryInspection a source of a Blueprint build. The
593+
Dockerfile will be automatically created based on the RepositoryInspection
594+
contents.
635595
636-
build_args: (Optional) Arbitrary Docker build args to pass during build.
637-
638-
code_mounts: A list of code mounts to be included in the Blueprint.
639-
640-
dockerfile: Dockerfile contents to be used to build the Blueprint.
596+
name: Name of the Blueprint.
641597
642598
file_mounts: (Optional) Map of paths and file contents to write before setup.
643599
644600
launch_parameters: Parameters to configure your Devbox at launch time.
645601
646602
metadata: (Optional) User defined metadata for the Blueprint.
647603
648-
services: (Optional) List of containerized services to include in the Blueprint. These
649-
services will be pre-pulled during the build phase for optimized startup
650-
performance.
651-
652604
system_setup_commands: A list of commands to run to set up your system.
653605
654606
extra_headers: Send extra headers
@@ -665,16 +617,11 @@ async def create(
665617
"/v1/blueprints",
666618
body=await async_maybe_transform(
667619
{
620+
"inspection_source": inspection_source,
668621
"name": name,
669-
"base_blueprint_id": base_blueprint_id,
670-
"base_blueprint_name": base_blueprint_name,
671-
"build_args": build_args,
672-
"code_mounts": code_mounts,
673-
"dockerfile": dockerfile,
674622
"file_mounts": file_mounts,
675623
"launch_parameters": launch_parameters,
676624
"metadata": metadata,
677-
"services": services,
678625
"system_setup_commands": system_setup_commands,
679626
},
680627
blueprint_create_params.BlueprintCreateParams,

src/runloop_api_client/resources/repositories.py

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

77
import httpx
88

9-
from ..types import repository_list_params, repository_create_params, repository_refresh_params
9+
from ..types import (
10+
repository_list_params,
11+
repository_create_params,
12+
repository_inspect_params,
13+
repository_refresh_params,
14+
)
1015
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
1116
from .._utils import maybe_transform, async_maybe_transform
1217
from .._compat import cached_property
@@ -20,6 +25,7 @@
2025
from ..pagination import SyncRepositoriesCursorIDPage, AsyncRepositoriesCursorIDPage
2126
from .._base_client import AsyncPaginator, make_request_options
2227
from ..types.repository_connection_view import RepositoryConnectionView
28+
from ..types.repository_inspection_details import RepositoryInspectionDetails
2329
from ..types.repository_inspection_list_view import RepositoryInspectionListView
2430

2531
__all__ = ["RepositoriesResource", "AsyncRepositoriesResource"]
@@ -234,6 +240,60 @@ def delete(
234240
cast_to=object,
235241
)
236242

243+
def inspect(
244+
self,
245+
id: str,
246+
*,
247+
blueprint_id: Optional[str] | Omit = omit,
248+
github_auth_token: Optional[str] | Omit = omit,
249+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
250+
# The extra values given here take precedence over values defined on the client or passed to this method.
251+
extra_headers: Headers | None = None,
252+
extra_query: Query | None = None,
253+
extra_body: Body | None = None,
254+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
255+
idempotency_key: str | None = None,
256+
) -> RepositoryInspectionDetails:
257+
"""
258+
Inspect a repository connection by inspecting the specified version including
259+
repo's technical stack and developer environment requirements.
260+
261+
Args:
262+
blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint.
263+
264+
github_auth_token: GitHub authentication token for accessing private repositories.
265+
266+
extra_headers: Send extra headers
267+
268+
extra_query: Add additional query parameters to the request
269+
270+
extra_body: Add additional JSON properties to the request
271+
272+
timeout: Override the client-level default timeout for this request, in seconds
273+
274+
idempotency_key: Specify a custom idempotency key for this request
275+
"""
276+
if not id:
277+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
278+
return self._post(
279+
f"/v1/repositories/{id}/inspect",
280+
body=maybe_transform(
281+
{
282+
"blueprint_id": blueprint_id,
283+
"github_auth_token": github_auth_token,
284+
},
285+
repository_inspect_params.RepositoryInspectParams,
286+
),
287+
options=make_request_options(
288+
extra_headers=extra_headers,
289+
extra_query=extra_query,
290+
extra_body=extra_body,
291+
timeout=timeout,
292+
idempotency_key=idempotency_key,
293+
),
294+
cast_to=RepositoryInspectionDetails,
295+
)
296+
237297
def list_inspections(
238298
self,
239299
id: str,
@@ -532,6 +592,60 @@ async def delete(
532592
cast_to=object,
533593
)
534594

595+
async def inspect(
596+
self,
597+
id: str,
598+
*,
599+
blueprint_id: Optional[str] | Omit = omit,
600+
github_auth_token: Optional[str] | Omit = omit,
601+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
602+
# The extra values given here take precedence over values defined on the client or passed to this method.
603+
extra_headers: Headers | None = None,
604+
extra_query: Query | None = None,
605+
extra_body: Body | None = None,
606+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
607+
idempotency_key: str | None = None,
608+
) -> RepositoryInspectionDetails:
609+
"""
610+
Inspect a repository connection by inspecting the specified version including
611+
repo's technical stack and developer environment requirements.
612+
613+
Args:
614+
blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint.
615+
616+
github_auth_token: GitHub authentication token for accessing private repositories.
617+
618+
extra_headers: Send extra headers
619+
620+
extra_query: Add additional query parameters to the request
621+
622+
extra_body: Add additional JSON properties to the request
623+
624+
timeout: Override the client-level default timeout for this request, in seconds
625+
626+
idempotency_key: Specify a custom idempotency key for this request
627+
"""
628+
if not id:
629+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
630+
return await self._post(
631+
f"/v1/repositories/{id}/inspect",
632+
body=await async_maybe_transform(
633+
{
634+
"blueprint_id": blueprint_id,
635+
"github_auth_token": github_auth_token,
636+
},
637+
repository_inspect_params.RepositoryInspectParams,
638+
),
639+
options=make_request_options(
640+
extra_headers=extra_headers,
641+
extra_query=extra_query,
642+
extra_body=extra_body,
643+
timeout=timeout,
644+
idempotency_key=idempotency_key,
645+
),
646+
cast_to=RepositoryInspectionDetails,
647+
)
648+
535649
async def list_inspections(
536650
self,
537651
id: str,
@@ -637,6 +751,9 @@ def __init__(self, repositories: RepositoriesResource) -> None:
637751
self.delete = to_raw_response_wrapper(
638752
repositories.delete,
639753
)
754+
self.inspect = to_raw_response_wrapper(
755+
repositories.inspect,
756+
)
640757
self.list_inspections = to_raw_response_wrapper(
641758
repositories.list_inspections,
642759
)
@@ -661,6 +778,9 @@ def __init__(self, repositories: AsyncRepositoriesResource) -> None:
661778
self.delete = async_to_raw_response_wrapper(
662779
repositories.delete,
663780
)
781+
self.inspect = async_to_raw_response_wrapper(
782+
repositories.inspect,
783+
)
664784
self.list_inspections = async_to_raw_response_wrapper(
665785
repositories.list_inspections,
666786
)
@@ -685,6 +805,9 @@ def __init__(self, repositories: RepositoriesResource) -> None:
685805
self.delete = to_streamed_response_wrapper(
686806
repositories.delete,
687807
)
808+
self.inspect = to_streamed_response_wrapper(
809+
repositories.inspect,
810+
)
688811
self.list_inspections = to_streamed_response_wrapper(
689812
repositories.list_inspections,
690813
)
@@ -709,6 +832,9 @@ def __init__(self, repositories: AsyncRepositoriesResource) -> None:
709832
self.delete = async_to_streamed_response_wrapper(
710833
repositories.delete,
711834
)
835+
self.inspect = async_to_streamed_response_wrapper(
836+
repositories.inspect,
837+
)
712838
self.list_inspections = async_to_streamed_response_wrapper(
713839
repositories.list_inspections,
714840
)

0 commit comments

Comments
 (0)