Skip to content

Commit 1febe28

Browse files
authored
feat(blueprints): blueprints create_and_await_build_complete now take in build_context and named_build_context arguments (#681)
* add build_context and named_build_context args to blueprint create_and_await_build_complete * added proper type guard to _validate_file_mounts and formatted imports
1 parent e8d1053 commit 1febe28

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/runloop_api_client/resources/blueprints.py

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

43
from __future__ import annotations
54

@@ -15,8 +14,7 @@
1514
blueprint_create_from_inspection_params,
1615
)
1716
from .._types import NOT_GIVEN, Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
18-
from .._utils import maybe_transform, async_maybe_transform
19-
from .._utils._validation import ValidationNotification
17+
from .._utils import is_given, maybe_transform, async_maybe_transform
2018
from .._compat import cached_property
2119
from .._resource import SyncAPIResource, AsyncAPIResource
2220
from .._response import (
@@ -31,6 +29,7 @@
3129
from ..lib.polling import PollingConfig, poll_until
3230
from .._base_client import AsyncPaginator, make_request_options
3331
from ..lib.polling_async import async_poll_until
32+
from .._utils._validation import ValidationNotification
3433
from ..types.blueprint_view import BlueprintView
3534
from ..types.blueprint_preview_view import BlueprintPreviewView
3635
from ..types.inspection_source_param import InspectionSourceParam
@@ -79,7 +78,7 @@ def _validate_file_mounts(file_mounts: Optional[Dict[str, str]] | Omit) -> Valid
7978

8079
note = ValidationNotification()
8180

82-
if file_mounts is omit or file_mounts is None:
81+
if file_mounts is None or not is_given(file_mounts):
8382
return note
8483

8584
total_size_bytes = 0
@@ -327,11 +326,13 @@ def create_and_await_build_complete(
327326
base_blueprint_id: Optional[str] | Omit = omit,
328327
base_blueprint_name: Optional[str] | Omit = omit,
329328
build_args: Optional[Dict[str, str]] | Omit = omit,
329+
build_context: Optional[blueprint_create_params.BuildContext] | Omit = omit,
330330
code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit,
331331
dockerfile: Optional[str] | Omit = omit,
332332
file_mounts: Optional[Dict[str, str]] | Omit = omit,
333333
launch_parameters: Optional[LaunchParameters] | Omit = omit,
334334
metadata: Optional[Dict[str, str]] | Omit = omit,
335+
named_build_contexts: Optional[Dict[str, blueprint_create_params.NamedBuildContexts]] | Omit = omit,
335336
secrets: Optional[Dict[str, str]] | Omit = omit,
336337
services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit,
337338
system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit,
@@ -365,11 +366,13 @@ def create_and_await_build_complete(
365366
base_blueprint_id=base_blueprint_id,
366367
base_blueprint_name=base_blueprint_name,
367368
build_args=build_args,
369+
build_context=build_context,
368370
code_mounts=code_mounts,
369371
dockerfile=dockerfile,
370372
file_mounts=file_mounts,
371373
launch_parameters=launch_parameters,
372374
metadata=metadata,
375+
named_build_contexts=named_build_contexts,
373376
secrets=secrets,
374377
services=services,
375378
system_setup_commands=system_setup_commands,

0 commit comments

Comments
 (0)