From 90a4c8d4b0a6fede1e674aa1e6792db2c3dd1572 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 10 Oct 2024 22:28:11 +0000 Subject: [PATCH] feat(api): api update --- .release-please-manifest.json | 2 +- .stats.yml | 2 +- README.md | 2 +- api.md | 6 ++++- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- .../resources/blueprints.py | 9 ++++--- .../resources/devboxes/devboxes.py | 5 ++-- src/runloop_api_client/types/__init__.py | 1 + .../types/blueprint_build_parameters.py | 20 +++------------ .../types/blueprint_create_params.py | 20 +++------------ .../types/blueprint_preview_params.py | 20 +++------------ .../types/devbox_create_params.py | 20 +++------------ src/runloop_api_client/types/devbox_view.py | 22 +++------------- .../types/shared/__init__.py | 1 + .../types/shared/lauch_parameters.py | 22 ++++++++++++++++ .../types/shared_params/__init__.py | 3 +++ .../types/shared_params/lauch_parameters.py | 25 +++++++++++++++++++ 18 files changed, 86 insertions(+), 98 deletions(-) create mode 100644 src/runloop_api_client/types/shared/lauch_parameters.py create mode 100644 src/runloop_api_client/types/shared_params/__init__.py create mode 100644 src/runloop_api_client/types/shared_params/lauch_parameters.py diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1c0bb8852..10f309169 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.23" + ".": "0.2.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index d9a0a6044..40d23e1b2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 28 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d5b31b4bbf540f07391766a9217f0dc872e3c9015dc2282b7b346f6594acbe0c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1b1dd59a8326d972ab26f979561252cda4bcaeeb0cc7eb1ab2b8fe2522f90ec0.yml diff --git a/README.md b/README.md index 3c8dbdbd0..16c2947ae 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The REST API documentation can be found on [runloop.ai](https://runloop.ai). The ```sh # install from PyPI -pip install --pre runloop_api_client +pip install runloop_api_client ``` ## Usage diff --git a/api.md b/api.md index f9ca5e509..0ddfd9895 100644 --- a/api.md +++ b/api.md @@ -1,7 +1,11 @@ # Shared Types ```python -from runloop_api_client.types import FunctionInvocationExecutionDetailView, ProjectLogsView +from runloop_api_client.types import ( + FunctionInvocationExecutionDetailView, + LauchParameters, + ProjectLogsView, +) ``` # Account diff --git a/pyproject.toml b/pyproject.toml index 148978741..4077fc8eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.23" +version = "0.2.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 7bd91e9f3..7e03c3115 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.23" # x-release-please-version +__version__ = "0.2.0" # x-release-please-version diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index f4405b773..c702f3861 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -26,6 +26,7 @@ from ..types.blueprint_preview_view import BlueprintPreviewView from ..types.code_mount_parameters_param import CodeMountParametersParam from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView +from ..types.shared_params.lauch_parameters import LauchParameters __all__ = ["BlueprintsResource", "AsyncBlueprintsResource"] @@ -57,7 +58,7 @@ def create( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: blueprint_create_params.LaunchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -237,7 +238,7 @@ def preview( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -319,7 +320,7 @@ async def create( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: blueprint_create_params.LaunchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -499,7 +500,7 @@ async def preview( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index df85bf094..dd7a4d3b1 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -63,6 +63,7 @@ from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse from ...types.devbox_disk_snapshots_response import DevboxDiskSnapshotsResponse +from ...types.shared_params.lauch_parameters import LauchParameters from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView __all__ = ["DevboxesResource", "AsyncDevboxesResource"] @@ -105,7 +106,7 @@ def create( entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, prebuilt: str | NotGiven = NOT_GIVEN, @@ -688,7 +689,7 @@ async def create( entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, prebuilt: str | NotGiven = NOT_GIVEN, diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 1b6c191cd..00d698ab8 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -3,6 +3,7 @@ from __future__ import annotations from .shared import ( + LauchParameters as LauchParameters, ProjectLogsView as ProjectLogsView, FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, ) diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index 57d16c93c..b27ed818f 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -3,24 +3,10 @@ from typing import Dict, List, Optional from .._models import BaseModel -from .resource_size import ResourceSize from .code_mount_parameters import CodeMountParameters +from .shared.lauch_parameters import LauchParameters -__all__ = ["BlueprintBuildParameters", "LaunchParameters"] - - -class LaunchParameters(BaseModel): - keep_alive_time_seconds: Optional[int] = None - """Time in seconds after which Devbox will automatically shutdown. - - Default is 1 hour. - """ - - launch_commands: Optional[List[str]] = None - """Set of commands to be run at launch time, before the entrypoint process is run.""" - - resource_size_request: Optional[ResourceSize] = None - """Manual resource configuration for Devbox. If not set, defaults will be used.""" +__all__ = ["BlueprintBuildParameters"] class BlueprintBuildParameters(BaseModel): @@ -36,7 +22,7 @@ class BlueprintBuildParameters(BaseModel): file_mounts: Optional[Dict[str, str]] = None """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: Optional[LaunchParameters] = None + launch_parameters: Optional[LauchParameters] = None """Parameters to configure your Devbox at launch time.""" system_setup_commands: Optional[List[str]] = None diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 742befdbb..6507bd147 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -5,10 +5,10 @@ from typing import Dict, List, Iterable from typing_extensions import Required, TypedDict -from .resource_size import ResourceSize from .code_mount_parameters_param import CodeMountParametersParam +from .shared_params.lauch_parameters import LauchParameters -__all__ = ["BlueprintCreateParams", "LaunchParameters"] +__all__ = ["BlueprintCreateParams"] class BlueprintCreateParams(TypedDict, total=False): @@ -24,22 +24,8 @@ class BlueprintCreateParams(TypedDict, total=False): file_mounts: Dict[str, str] """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: LaunchParameters + launch_parameters: LauchParameters """Parameters to configure your Devbox at launch time.""" system_setup_commands: List[str] """A list of commands to run to set up your system.""" - - -class LaunchParameters(TypedDict, total=False): - keep_alive_time_seconds: int - """Time in seconds after which Devbox will automatically shutdown. - - Default is 1 hour. - """ - - launch_commands: List[str] - """Set of commands to be run at launch time, before the entrypoint process is run.""" - - resource_size_request: ResourceSize - """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index eba4d0b20..5415988c5 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -5,10 +5,10 @@ from typing import Dict, List, Iterable from typing_extensions import Required, TypedDict -from .resource_size import ResourceSize from .code_mount_parameters_param import CodeMountParametersParam +from .shared_params.lauch_parameters import LauchParameters -__all__ = ["BlueprintPreviewParams", "LaunchParameters"] +__all__ = ["BlueprintPreviewParams"] class BlueprintPreviewParams(TypedDict, total=False): @@ -24,22 +24,8 @@ class BlueprintPreviewParams(TypedDict, total=False): file_mounts: Dict[str, str] """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: LaunchParameters + launch_parameters: LauchParameters """Parameters to configure your Devbox at launch time.""" system_setup_commands: List[str] """A list of commands to run to set up your system.""" - - -class LaunchParameters(TypedDict, total=False): - keep_alive_time_seconds: int - """Time in seconds after which Devbox will automatically shutdown. - - Default is 1 hour. - """ - - launch_commands: List[str] - """Set of commands to be run at launch time, before the entrypoint process is run.""" - - resource_size_request: ResourceSize - """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 5f8455746..01fbd811d 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -5,10 +5,10 @@ from typing import Dict, List, Iterable from typing_extensions import TypedDict -from .resource_size import ResourceSize from .code_mount_parameters_param import CodeMountParametersParam +from .shared_params.lauch_parameters import LauchParameters -__all__ = ["DevboxCreateParams", "LaunchParameters"] +__all__ = ["DevboxCreateParams"] class DevboxCreateParams(TypedDict, total=False): @@ -41,7 +41,7 @@ class DevboxCreateParams(TypedDict, total=False): file_mounts: Dict[str, str] """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: LaunchParameters + launch_parameters: LauchParameters """Parameters to configure the resources and launch time behavior of the Devbox.""" metadata: Dict[str, str] @@ -62,17 +62,3 @@ class DevboxCreateParams(TypedDict, total=False): snapshot_id: str """Snapshot ID to use for the Devbox.""" - - -class LaunchParameters(TypedDict, total=False): - keep_alive_time_seconds: int - """Time in seconds after which Devbox will automatically shutdown. - - Default is 1 hour. - """ - - launch_commands: List[str] - """Set of commands to be run at launch time, before the entrypoint process is run.""" - - resource_size_request: ResourceSize - """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index ce50abebf..d24734202 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -1,26 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import Dict, Optional from typing_extensions import Literal from .._models import BaseModel -from .resource_size import ResourceSize +from .shared.lauch_parameters import LauchParameters -__all__ = ["DevboxView", "LaunchParameters"] - - -class LaunchParameters(BaseModel): - keep_alive_time_seconds: Optional[int] = None - """Time in seconds after which Devbox will automatically shutdown. - - Default is 1 hour. - """ - - launch_commands: Optional[List[str]] = None - """Set of commands to be run at launch time, before the entrypoint process is run.""" - - resource_size_request: Optional[ResourceSize] = None - """Manual resource configuration for Devbox. If not set, defaults will be used.""" +__all__ = ["DevboxView"] class DevboxView(BaseModel): @@ -36,7 +22,7 @@ class DevboxView(BaseModel): initiator_type: Literal["unknown", "api", "invocation"] """The initiator of the devbox.""" - launch_parameters: LaunchParameters + launch_parameters: LauchParameters """The launch parameters used to create the Devbox.""" metadata: Dict[str, str] diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py index e7ddc6d87..7bd350b35 100644 --- a/src/runloop_api_client/types/shared/__init__.py +++ b/src/runloop_api_client/types/shared/__init__.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lauch_parameters import LauchParameters as LauchParameters from .project_logs_view import ProjectLogsView as ProjectLogsView from .function_invocation_execution_detail_view import ( FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, diff --git a/src/runloop_api_client/types/shared/lauch_parameters.py b/src/runloop_api_client/types/shared/lauch_parameters.py new file mode 100644 index 000000000..bc0ae8f25 --- /dev/null +++ b/src/runloop_api_client/types/shared/lauch_parameters.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel +from ..resource_size import ResourceSize + +__all__ = ["LauchParameters"] + + +class LauchParameters(BaseModel): + keep_alive_time_seconds: Optional[int] = None + """Time in seconds after which Devbox will automatically shutdown. + + Default is 1 hour. + """ + + launch_commands: Optional[List[str]] = None + """Set of commands to be run at launch time, before the entrypoint process is run.""" + + resource_size_request: Optional[ResourceSize] = None + """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/src/runloop_api_client/types/shared_params/__init__.py b/src/runloop_api_client/types/shared_params/__init__.py new file mode 100644 index 000000000..d8a6bca13 --- /dev/null +++ b/src/runloop_api_client/types/shared_params/__init__.py @@ -0,0 +1,3 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .lauch_parameters import LauchParameters as LauchParameters diff --git a/src/runloop_api_client/types/shared_params/lauch_parameters.py b/src/runloop_api_client/types/shared_params/lauch_parameters.py new file mode 100644 index 000000000..371f1b652 --- /dev/null +++ b/src/runloop_api_client/types/shared_params/lauch_parameters.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import TypedDict + +from .resource_size import ResourceSize +from ..resource_size import ResourceSize + +__all__ = ["LauchParameters"] + + +class LauchParameters(TypedDict, total=False): + keep_alive_time_seconds: int + """Time in seconds after which Devbox will automatically shutdown. + + Default is 1 hour. + """ + + launch_commands: List[str] + """Set of commands to be run at launch time, before the entrypoint process is run.""" + + resource_size_request: ResourceSize + """Manual resource configuration for Devbox. If not set, defaults will be used."""