|
11 | 11 | blueprint_create_params, |
12 | 12 | blueprint_preview_params, |
13 | 13 | blueprint_list_public_params, |
| 14 | + blueprint_create_from_inspection_params, |
14 | 15 | ) |
15 | 16 | from .._types import NOT_GIVEN, Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given |
16 | 17 | from .._utils import maybe_transform, async_maybe_transform |
|
29 | 30 | from ..lib.polling_async import async_poll_until |
30 | 31 | from ..types.blueprint_view import BlueprintView |
31 | 32 | from ..types.blueprint_preview_view import BlueprintPreviewView |
| 33 | +from ..types.inspection_source_param import InspectionSourceParam |
32 | 34 | from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView |
33 | 35 | from ..types.shared_params.launch_parameters import LaunchParameters |
34 | 36 | from ..types.shared_params.code_mount_parameters import CodeMountParameters |
@@ -394,6 +396,75 @@ def delete( |
394 | 396 | cast_to=object, |
395 | 397 | ) |
396 | 398 |
|
| 399 | + def create_from_inspection( |
| 400 | + self, |
| 401 | + *, |
| 402 | + inspection_source: InspectionSourceParam, |
| 403 | + name: str, |
| 404 | + file_mounts: Optional[Dict[str, str]] | Omit = omit, |
| 405 | + launch_parameters: Optional[LaunchParameters] | Omit = omit, |
| 406 | + metadata: Optional[Dict[str, str]] | Omit = omit, |
| 407 | + system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, |
| 408 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 409 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 410 | + extra_headers: Headers | None = None, |
| 411 | + extra_query: Query | None = None, |
| 412 | + extra_body: Body | None = None, |
| 413 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 414 | + idempotency_key: str | None = None, |
| 415 | + ) -> BlueprintView: |
| 416 | + """ |
| 417 | + Starts build of custom defined container Blueprint using a RepositoryConnection |
| 418 | + Inspection as a source container specification. |
| 419 | +
|
| 420 | + Args: |
| 421 | + inspection_source: (Optional) Use a RepositoryInspection a source of a Blueprint build. The |
| 422 | + Dockerfile will be automatically created based on the RepositoryInspection |
| 423 | + contents. |
| 424 | +
|
| 425 | + name: Name of the Blueprint. |
| 426 | +
|
| 427 | + file_mounts: (Optional) Map of paths and file contents to write before setup. |
| 428 | +
|
| 429 | + launch_parameters: Parameters to configure your Devbox at launch time. |
| 430 | +
|
| 431 | + metadata: (Optional) User defined metadata for the Blueprint. |
| 432 | +
|
| 433 | + system_setup_commands: A list of commands to run to set up your system. |
| 434 | +
|
| 435 | + extra_headers: Send extra headers |
| 436 | +
|
| 437 | + extra_query: Add additional query parameters to the request |
| 438 | +
|
| 439 | + extra_body: Add additional JSON properties to the request |
| 440 | +
|
| 441 | + timeout: Override the client-level default timeout for this request, in seconds |
| 442 | +
|
| 443 | + idempotency_key: Specify a custom idempotency key for this request |
| 444 | + """ |
| 445 | + return self._post( |
| 446 | + "/v1/blueprints/create_from_inspection", |
| 447 | + body=maybe_transform( |
| 448 | + { |
| 449 | + "inspection_source": inspection_source, |
| 450 | + "name": name, |
| 451 | + "file_mounts": file_mounts, |
| 452 | + "launch_parameters": launch_parameters, |
| 453 | + "metadata": metadata, |
| 454 | + "system_setup_commands": system_setup_commands, |
| 455 | + }, |
| 456 | + blueprint_create_from_inspection_params.BlueprintCreateFromInspectionParams, |
| 457 | + ), |
| 458 | + options=make_request_options( |
| 459 | + extra_headers=extra_headers, |
| 460 | + extra_query=extra_query, |
| 461 | + extra_body=extra_body, |
| 462 | + timeout=timeout, |
| 463 | + idempotency_key=idempotency_key, |
| 464 | + ), |
| 465 | + cast_to=BlueprintView, |
| 466 | + ) |
| 467 | + |
397 | 468 | def list_public( |
398 | 469 | self, |
399 | 470 | *, |
@@ -919,6 +990,75 @@ async def delete( |
919 | 990 | cast_to=object, |
920 | 991 | ) |
921 | 992 |
|
| 993 | + async def create_from_inspection( |
| 994 | + self, |
| 995 | + *, |
| 996 | + inspection_source: InspectionSourceParam, |
| 997 | + name: str, |
| 998 | + file_mounts: Optional[Dict[str, str]] | Omit = omit, |
| 999 | + launch_parameters: Optional[LaunchParameters] | Omit = omit, |
| 1000 | + metadata: Optional[Dict[str, str]] | Omit = omit, |
| 1001 | + system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, |
| 1002 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 1003 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 1004 | + extra_headers: Headers | None = None, |
| 1005 | + extra_query: Query | None = None, |
| 1006 | + extra_body: Body | None = None, |
| 1007 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 1008 | + idempotency_key: str | None = None, |
| 1009 | + ) -> BlueprintView: |
| 1010 | + """ |
| 1011 | + Starts build of custom defined container Blueprint using a RepositoryConnection |
| 1012 | + Inspection as a source container specification. |
| 1013 | +
|
| 1014 | + Args: |
| 1015 | + inspection_source: (Optional) Use a RepositoryInspection a source of a Blueprint build. The |
| 1016 | + Dockerfile will be automatically created based on the RepositoryInspection |
| 1017 | + contents. |
| 1018 | +
|
| 1019 | + name: Name of the Blueprint. |
| 1020 | +
|
| 1021 | + file_mounts: (Optional) Map of paths and file contents to write before setup. |
| 1022 | +
|
| 1023 | + launch_parameters: Parameters to configure your Devbox at launch time. |
| 1024 | +
|
| 1025 | + metadata: (Optional) User defined metadata for the Blueprint. |
| 1026 | +
|
| 1027 | + system_setup_commands: A list of commands to run to set up your system. |
| 1028 | +
|
| 1029 | + extra_headers: Send extra headers |
| 1030 | +
|
| 1031 | + extra_query: Add additional query parameters to the request |
| 1032 | +
|
| 1033 | + extra_body: Add additional JSON properties to the request |
| 1034 | +
|
| 1035 | + timeout: Override the client-level default timeout for this request, in seconds |
| 1036 | +
|
| 1037 | + idempotency_key: Specify a custom idempotency key for this request |
| 1038 | + """ |
| 1039 | + return await self._post( |
| 1040 | + "/v1/blueprints/create_from_inspection", |
| 1041 | + body=await async_maybe_transform( |
| 1042 | + { |
| 1043 | + "inspection_source": inspection_source, |
| 1044 | + "name": name, |
| 1045 | + "file_mounts": file_mounts, |
| 1046 | + "launch_parameters": launch_parameters, |
| 1047 | + "metadata": metadata, |
| 1048 | + "system_setup_commands": system_setup_commands, |
| 1049 | + }, |
| 1050 | + blueprint_create_from_inspection_params.BlueprintCreateFromInspectionParams, |
| 1051 | + ), |
| 1052 | + options=make_request_options( |
| 1053 | + extra_headers=extra_headers, |
| 1054 | + extra_query=extra_query, |
| 1055 | + extra_body=extra_body, |
| 1056 | + timeout=timeout, |
| 1057 | + idempotency_key=idempotency_key, |
| 1058 | + ), |
| 1059 | + cast_to=BlueprintView, |
| 1060 | + ) |
| 1061 | + |
922 | 1062 | def list_public( |
923 | 1063 | self, |
924 | 1064 | *, |
@@ -1114,6 +1254,9 @@ def __init__(self, blueprints: BlueprintsResource) -> None: |
1114 | 1254 | self.delete = to_raw_response_wrapper( |
1115 | 1255 | blueprints.delete, |
1116 | 1256 | ) |
| 1257 | + self.create_from_inspection = to_raw_response_wrapper( |
| 1258 | + blueprints.create_from_inspection, |
| 1259 | + ) |
1117 | 1260 | self.list_public = to_raw_response_wrapper( |
1118 | 1261 | blueprints.list_public, |
1119 | 1262 | ) |
@@ -1141,6 +1284,9 @@ def __init__(self, blueprints: AsyncBlueprintsResource) -> None: |
1141 | 1284 | self.delete = async_to_raw_response_wrapper( |
1142 | 1285 | blueprints.delete, |
1143 | 1286 | ) |
| 1287 | + self.create_from_inspection = async_to_raw_response_wrapper( |
| 1288 | + blueprints.create_from_inspection, |
| 1289 | + ) |
1144 | 1290 | self.list_public = async_to_raw_response_wrapper( |
1145 | 1291 | blueprints.list_public, |
1146 | 1292 | ) |
@@ -1168,6 +1314,9 @@ def __init__(self, blueprints: BlueprintsResource) -> None: |
1168 | 1314 | self.delete = to_streamed_response_wrapper( |
1169 | 1315 | blueprints.delete, |
1170 | 1316 | ) |
| 1317 | + self.create_from_inspection = to_streamed_response_wrapper( |
| 1318 | + blueprints.create_from_inspection, |
| 1319 | + ) |
1171 | 1320 | self.list_public = to_streamed_response_wrapper( |
1172 | 1321 | blueprints.list_public, |
1173 | 1322 | ) |
@@ -1195,6 +1344,9 @@ def __init__(self, blueprints: AsyncBlueprintsResource) -> None: |
1195 | 1344 | self.delete = async_to_streamed_response_wrapper( |
1196 | 1345 | blueprints.delete, |
1197 | 1346 | ) |
| 1347 | + self.create_from_inspection = async_to_streamed_response_wrapper( |
| 1348 | + blueprints.create_from_inspection, |
| 1349 | + ) |
1198 | 1350 | self.list_public = async_to_streamed_response_wrapper( |
1199 | 1351 | blueprints.list_public, |
1200 | 1352 | ) |
|
0 commit comments