Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Support both pydantic v1 and v2 in python sdk (#176)

Jakub Novák4ad651feaa99
diff --git a/.changeset/late-games-double.md b/.changeset/late-games-double.md
new file mode 100644
index 000000000..c98c3a84c
--- /dev/null
+++ b/.changeset/late-games-double.md
@@ -0,0 +1,5 @@
+---
+'@e2b/python-sdk': patch
+---
+
+Support both pydantic v1 and v2
diff --git a/packages/python-sdk/Makefile b/packages/python-sdk/Makefile
index c05fbe5ab..3dcf603ee 100644
--- a/packages/python-sdk/Makefile
+++ b/packages/python-sdk/Makefile
@@ -1,6 +1,7 @@
-.PHONY: generate
-generate:
- rm -rf ./e2b/api/client
+.PHONY: generate-v2
+generate-v2:
+ mv ./e2b/api/__init__.py ./e2b/api/__init__.py.bck
+ rm -rf ./e2b/api/v2
# Waiting for https://github.com/OpenAPITools/openapi-generator/pull/16655 to be merged
# Using this branch to use pydantic v2: https://github.com/fa0311/openapi-generator/tree/oshmoun-master-2
# After released, use npx -yes @openapitools/openapi-generator-cli generate
@@ -13,9 +14,32 @@ generate:
--additional-properties=generateSourceCodeOnly=true \
--additional-properties=disallowAdditionalPropertiesIfNotPresent=true \
--additional-properties=usePydanticV2=true \
- --additional-properties=packageName=e2b.api.client
+ --additional-properties=packageName=e2b.api.v2.client
mv ./e2b/api/e2b/api/* ./e2b/api/
rm -r ./e2b/api/e2b
- rm -r ./e2b/api/client/docs
- rm -r ./e2b/api/client/test
+ rm -r ./e2b/api/v2/client/docs
+ rm -r ./e2b/api/v2/client/test
+ rm -r ./e2b/api/.openapi-generator
+ mv ./e2b/api/__init__.py.bck ./e2b/api/__init__.py
+ black .
+
+.PHONY: generate-v1
+generate-v1:
+ mv ./e2b/api/__init__.py ./e2b/api/__init__.py.bck
+ rm -rf ./e2b/api/v1
+ npx -yes @openapitools/openapi-generator-cli generate \
+ -i ../../spec/openapi.yml \
+ --library asyncio \
+ -g python-nextgen \
+ -o ./e2b/api \
+ --global-property apis,models,supportingFiles,modelDocs=false \
+ --additional-properties=generateSourceCodeOnly=true \
+ --additional-properties=disallowAdditionalPropertiesIfNotPresent=true \
+ --additional-properties=packageName=e2b.api.v1.client
+ mv ./e2b/api/e2b/api/* ./e2b/api/
+ rm -r ./e2b/api/e2b
+ rm -r ./e2b/api/v1/client/docs
+ rm -r ./e2b/api/v1/client/test
+ rm -r ./e2b/api/.openapi-generator
+ mv ./e2b/api/__init__.py.bck ./e2b/api/__init__.py
black .
diff --git a/packages/python-sdk/e2b/api/.openapi-generator/FILES b/packages/python-sdk/e2b/api/.openapi-generator/FILES
deleted file mode 100644
index ea405fdf4..000000000
--- a/packages/python-sdk/e2b/api/.openapi-generator/FILES
+++ /dev/null
@@ -1,39 +0,0 @@
-e2b/__init__.py
-e2b/api/__init__.py
-e2b/api/client/__init__.py
-e2b/api/client/api/__init__.py
-e2b/api/client/api/default_api.py
-e2b/api/client/api/envs_api.py
-e2b/api/client/api/sessions_api.py
-e2b/api/client/api_client.py
-e2b/api/client/api_response.py
-e2b/api/client/configuration.py
-e2b/api/client/docs/DefaultApi.md
-e2b/api/client/docs/EnvsApi.md
-e2b/api/client/docs/SessionsApi.md
-e2b/api/client/exceptions.py
-e2b/api/client/models/__init__.py
-e2b/api/client/models/environment.py
-e2b/api/client/models/environment_state.py
-e2b/api/client/models/environment_state_update.py
-e2b/api/client/models/environment_title_update.py
-e2b/api/client/models/error.py
-e2b/api/client/models/new_environment.py
-e2b/api/client/models/new_session.py
-e2b/api/client/models/session.py
-e2b/api/client/models/template.py
-e2b/api/client/rest.py
-e2b/api/client/test/__init__.py
-e2b/api/client/test/test_default_api.py
-e2b/api/client/test/test_environment.py
-e2b/api/client/test/test_environment_state.py
-e2b/api/client/test/test_environment_state_update.py
-e2b/api/client/test/test_environment_title_update.py
-e2b/api/client/test/test_envs_api.py
-e2b/api/client/test/test_error.py
-e2b/api/client/test/test_new_environment.py
-e2b/api/client/test/test_new_session.py
-e2b/api/client/test/test_session.py
-e2b/api/client/test/test_sessions_api.py
-e2b/api/client/test/test_template.py
-e2b/api/client_README.md
diff --git a/packages/python-sdk/e2b/api/.openapi-generator/VERSION b/packages/python-sdk/e2b/api/.openapi-generator/VERSION
deleted file mode 100644
index 44bad91b1..000000000
--- a/packages/python-sdk/e2b/api/.openapi-generator/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-7.0.1-SNAPSHOT
\ No newline at end of file
diff --git a/packages/python-sdk/e2b/api/__init__.py b/packages/python-sdk/e2b/api/__init__.py
index e69de29bb..dfc48f071 100644
--- a/packages/python-sdk/e2b/api/__init__.py
+++ b/packages/python-sdk/e2b/api/__init__.py
@@ -0,0 +1,21 @@
+from importlib.metadata import version
+
+pydantic_version = version("pydantic")
+if pydantic_version < "2.0.0":
+ import e2b.api.v1.client as client
+ import e2b.api.v1.client.models as models
+ import e2b.api.v1.client.exceptions as exceptions
+else:
+ import e2b.api.v2.client as client
+ import e2b.api.v2.client.models as models
+ import e2b.api.v2.client.exceptions as exceptions
+
+from e2b.constants import SESSION_DOMAIN
+
+# Defining the host is optional and defaults to https://ondevbook.com
+# See configuration.py for a list of all supported configuration parameters.
+configuration = client.Configuration(
+ host=f"https://{SESSION_DOMAIN}",
+)
+
+__all__ = ["configuration", "client", "models"]
diff --git a/packages/python-sdk/e2b/api/client/__init__.py b/packages/python-sdk/e2b/api/client/__init__.py
deleted file mode 100644
index e0470f8f6..000000000
--- a/packages/python-sdk/e2b/api/client/__init__.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# coding: utf-8
-
-# flake8: noqa
-
-"""
- Devbook
-
- Devbook API
-
- The version of the OpenAPI document: 1.0.0
- Generated by OpenAPI Generator (https://openapi-generator.tech)
-
- Do not edit the class manually.
-""" # noqa: E501
-
-
-__version__ = "1.0.0"
-
-# import apis into sdk package
-from e2b.api.client.api.default_api import DefaultApi
-from e2b.api.client.api.envs_api import EnvsApi
-from e2b.api.client.api.sessions_api import SessionsApi
-
-# import ApiClient
-from e2b.api.client.api_response import ApiResponse
-from e2b.api.client.api_client import ApiClient
-from e2b.api.client.configuration import Configuration
-from e2b.api.client.exceptions import OpenApiException
-from e2b.api.client.exceptions import ApiTypeError
-from e2b.api.client.exceptions import ApiValueError
-from e2b.api.client.exceptions import ApiKeyError
-from e2b.api.client.exceptions import ApiAttributeError
-from e2b.api.client.exceptions import ApiException
-
-# import models into sdk package
-from e2b.api.client.models.environment import Environment
-from e2b.api.client.models.environment_state import EnvironmentState
-from e2b.api.client.models.environment_state_update import EnvironmentStateUpdate
-from e2b.api.client.models.environment_title_update import EnvironmentTitleUpdate
-from e2b.api.client.models.error import Error
-from e2b.api.client.models.new_environment import NewEnvironment
-from e2b.api.client.models.new_session import NewSession
-from e2b.api.client.models.session import Session
-from e2b.api.client.models.template import Template
diff --git a/packages/python-sdk/e2b/api/client/api/__init__.py b/packages/python-sdk/e2b/api/client/api/__init__.py
deleted file mode 100644
index 39d6924a2..000000000
--- a/packages/python-sdk/e2b/api/client/api/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-# flake8: noqa
-
-# import apis into api package
-from e2b.api.client.api.default_api import DefaultApi
-from e2b.api.client.api.envs_api import EnvsApi
-from e2b.api.client.api.sessions_api import SessionsApi
diff --git a/packages/python-sdk/e2b/api/client/models/__init__.py b/packages/python-sdk/e2b/api/client/models/__init__.py
deleted file mode 100644
index 1ae622672..000000000
--- a/packages/python-sdk/e2b/api/client/models/__init__.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# coding: utf-8
-
-# flake8: noqa
-"""
- Devbook
-
- Devbook API
-
- The version of the OpenAPI document: 1.0.0
- Generated by OpenAPI Generator (https://openapi-generator.tech)
-
- Do not edit the class manually.
-""" # noqa: E501
-
-
-# import models into model package
-from e2b.api.client.models.environment import Environment
-from e2b.api.client.models.environment_state import EnvironmentState
-from e2b.api.client.models.environment_state_update import EnvironmentStateUpdate
-from e2b.api.client.models.environment_title_update import EnvironmentTitleUpdate
-from e2b.api.client.models.error import Error
-from e2b.api.client.models.new_environment import NewEnvironment
-from e2b.api.client.models.new_session import NewSession
-from e2b.api.client.models.session import Session
-from e2b.api.client.models.template import Template
diff --git a/packages/python-sdk/e2b/api/client_README.md b/packages/python-sdk/e2b/api/client_README.md
deleted file mode 100644
index 8387137e2..000000000
--- a/packages/python-sdk/e2b/api/client_README.md
+++ /dev/null
@@ -1,108 +0,0 @@
-# e2b.api.client
-Devbook API
-
-The `e2b.api.client` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
-
-- API version: 1.0.0
-- Package version: 1.0.0
-- Build package: org.openapitools.codegen.languages.PythonClientCodegen
-
-## Requirements.
-
-Python 3.7+
-
-## Installation & Usage
-
-This python library package is generated without supporting files like setup.py or requirements files
-
-To be able to use it, you will need these dependencies in your own package that uses this library:
-
-* urllib3 >= 1.25.3
-* python-dateutil
-* aiohttp
-* pydantic
-* aenum
-
-## Getting Started
-
-In your own code, to use this library to connect and interact with e2b.api.client,
-you can run the following:
-
-```python
-
-import time
-import e2b.api.client
-from e2b.api.client.rest import ApiException
-from pprint import pprint
-
-# Defining the host is optional and defaults to https://ondevbook.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = e2b.api.client.Configuration(
- host = "https://ondevbook.com"
-)
-
-
-
-# Enter a context with an instance of the API client
-async with e2b.api.client.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = e2b.api.client.DefaultApi(api_client)
-
- try:
- await api_instance.health_get()
- except ApiException as e:
- print("Exception when calling DefaultApi->health_get: %s\n" % e)
-
-```
-
-## Documentation for API Endpoints
-
-All URIs are relative to *https://ondevbook.com*
-
-Class | Method | HTTP request | Description
------------- | ------------- | ------------- | -------------
-*DefaultApi* | [**health_get**](e2b/api/client/docs/DefaultApi.md#health_get) | **GET** /health |
-*EnvsApi* | [**envs_code_snippet_id_delete**](e2b/api/client/docs/EnvsApi.md#envs_code_snippet_id_delete) | **DELETE** /envs/{codeSnippetID} |
-*EnvsApi* | [**envs_code_snippet_id_patch**](e2b/api/client/docs/EnvsApi.md#envs_code_snippet_id_patch) | **PATCH** /envs/{codeSnippetID} |
-*EnvsApi* | [**envs_code_snippet_id_post**](e2b/api/client/docs/EnvsApi.md#envs_code_snippet_id_post) | **POST** /envs/{codeSnippetID} |
-*EnvsApi* | [**envs_code_snippet_id_state_put**](e2b/api/client/docs/EnvsApi.md#envs_code_snippet_id_state_put) | **PUT** /envs/{codeSnippetID}/state |
-*EnvsApi* | [**envs_code_snippet_id_title_put**](e2b/api/client/docs/EnvsApi.md#envs_code_snippet_id_title_put) | **PUT** /envs/{codeSnippetID}/title |
-*EnvsApi* | [**envs_get**](e2b/api/client/docs/EnvsApi.md#envs_get) | **GET** /envs |
-*EnvsApi* | [**envs_post**](e2b/api/client/docs/EnvsApi.md#envs_post) | **POST** /envs |
-*SessionsApi* | [**sessions_get**](e2b/api/client/docs/SessionsApi.md#sessions_get) | **GET** /sessions |
-*SessionsApi* | [**sessions_post**](e2b/api/client/docs/SessionsApi.md#sessions_post) | **POST** /sessions |
-*SessionsApi* | [**sessions_session_id_delete**](e2b/api/client/docs/SessionsApi.md#sessions_session_id_delete) | **DELETE** /sessions/{sessionID} |
-*SessionsApi* | [**sessions_session_id_refresh_post**](e2b/api/client/docs/SessionsApi.md#sessions_session_id_refresh_post) | **POST** /sessions/{sessionID}/refresh |
-
-
-## Documentation For Models
-
- - [Environment](e2b/api/client/docs/Environment.md)
- - [EnvironmentState](e2b/api/client/docs/EnvironmentState.md)
- - [EnvironmentStateUpdate](e2b/api/client/docs/EnvironmentStateUpdate.md)
- - [EnvironmentTitleUpdate](e2b/api/client/docs/EnvironmentTitleUpdate.md)
- - [Error](e2b/api/client/docs/Error.md)
- - [NewEnvironment](e2b/api/client/docs/NewEnvironment.md)
- - [NewSession](e2b/api/client/docs/NewSession.md)
- - [Session](e2b/api/client/docs/Session.md)
- - [Template](e2b/api/client/docs/Template.md)
-
-
-<a id="documentation-for-authorization"></a>
-## Documentation For Authorization
-
-
-Authentication schemes defined for the API:
-<a id="ApiKeyAuth"></a>
-### ApiKeyAuth
-
-- **Type**: API key
-- **API key parameter name**: api_key
-- **Location**: URL query string
-
-
-## Author
-
-
-
-
diff --git a/packages/python-sdk/e2b/api/main.py b/packages/python-sdk/e2b/api/main.py
deleted file mode 100644
index fc1fc08b1..000000000
--- a/packages/python-sdk/e2b/api/main.py
+++ /dev/null
@@ -1,9 +0,0 @@
-import e2b.api.client as client
-
-from e2b.constants import SESSION_DOMAIN
-
-# Defining the host is optional and defaults to https://ondevbook.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = client.Configuration(
- host=f"https://{SESSION_DOMAIN}",
-)
diff --git a/packages/python-sdk/e2b/api/v1/__init__.py b/packages/python-sdk/e2b/api/v1/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/packages/python-sdk/e2b/api/v1/client/__init__.py b/packages/python-sdk/e2b/api/v1/client/__init__.py
new file mode 100644
index 000000000..a897a1620
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/__init__.py
@@ -0,0 +1,48 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+__version__ = "1.0.0"
+
+# import apis into sdk package
+from e2b.api.v1.client.api.default_api import DefaultApi
+from e2b.api.v1.client.api.envs_api import EnvsApi
+from e2b.api.v1.client.api.sessions_api import SessionsApi
+
+# import ApiClient
+from e2b.api.v1.client.api_response import ApiResponse
+from e2b.api.v1.client.api_client import ApiClient
+from e2b.api.v1.client.configuration import Configuration
+from e2b.api.v1.client.exceptions import OpenApiException
+from e2b.api.v1.client.exceptions import ApiTypeError
+from e2b.api.v1.client.exceptions import ApiValueError
+from e2b.api.v1.client.exceptions import ApiKeyError
+from e2b.api.v1.client.exceptions import ApiAttributeError
+from e2b.api.v1.client.exceptions import ApiException
+
+# import models into sdk package
+from e2b.api.v1.client.models.environment import Environment
+from e2b.api.v1.client.models.environment_state import EnvironmentState
+from e2b.api.v1.client.models.environment_state_update import EnvironmentStateUpdate
+from e2b.api.v1.client.models.environment_title_update import EnvironmentTitleUpdate
+from e2b.api.v1.client.models.envs_get200_response_inner import EnvsGet200ResponseInner
+from e2b.api.v1.client.models.error import Error
+from e2b.api.v1.client.models.new_environment import NewEnvironment
+from e2b.api.v1.client.models.new_session import NewSession
+from e2b.api.v1.client.models.session import Session
+from e2b.api.v1.client.models.sessions_get200_response_inner import (
+ SessionsGet200ResponseInner,
+)
+from e2b.api.v1.client.models.template import Template
diff --git a/packages/python-sdk/e2b/api/v1/client/api/__init__.py b/packages/python-sdk/e2b/api/v1/client/api/__init__.py
new file mode 100644
index 000000000..f1ca49c03
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/api/__init__.py
@@ -0,0 +1,6 @@
+# flake8: noqa
+
+# import apis into api package
+from e2b.api.v1.client.api.default_api import DefaultApi
+from e2b.api.v1.client.api.envs_api import EnvsApi
+from e2b.api.v1.client.api.sessions_api import SessionsApi
diff --git a/packages/python-sdk/e2b/api/v1/client/api/default_api.py b/packages/python-sdk/e2b/api/v1/client/api/default_api.py
new file mode 100644
index 000000000..deb32527a
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/api/default_api.py
@@ -0,0 +1,186 @@
+# coding: utf-8
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+import re # noqa: F401
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+from typing import overload, Optional, Union, Awaitable
+
+
+from e2b.api.v1.client.api_client import ApiClient
+from e2b.api.v1.client.api_response import ApiResponse
+from e2b.api.v1.client.exceptions import ApiTypeError, ApiValueError # noqa: F401
+
+
+class DefaultApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @overload
+ async def health_get(self, **kwargs) -> None: # noqa: E501
+ ...
+
+ @overload
+ def health_get(
+ self, async_req: Optional[bool] = True, **kwargs
+ ) -> None: # noqa: E501
+ ...
+
+ @validate_arguments
+ def health_get(
+ self, async_req: Optional[bool] = None, **kwargs
+ ) -> Union[None, Awaitable[None]]: # noqa: E501
+ """health_get # noqa: E501
+
+ Health check # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.health_get(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ raise ValueError(
+ "Error! Please call the health_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data"
+ )
+ if async_req is not None:
+ kwargs["async_req"] = async_req
+ return self.health_get_with_http_info(**kwargs) # noqa: E501
+
+ @validate_arguments
+ def health_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501
+ """health_get # noqa: E501
+
+ Health check # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.health_get_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = []
+ _all_params.extend(
+ [
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method health_get" % _key
+ )
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
+ ) # noqa: E501
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ "/health",
+ "GET",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
diff --git a/packages/python-sdk/e2b/api/v1/client/api/envs_api.py b/packages/python-sdk/e2b/api/v1/client/api/envs_api.py
new file mode 100644
index 000000000..a2ba1d006
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/api/envs_api.py
@@ -0,0 +1,1345 @@
+# coding: utf-8
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+import re # noqa: F401
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+from typing import overload, Optional, Union, Awaitable
+
+from pydantic import StrictStr
+
+from typing import List
+
+from e2b.api.v1.client.models.environment import Environment
+from e2b.api.v1.client.models.environment_state_update import EnvironmentStateUpdate
+from e2b.api.v1.client.models.environment_title_update import EnvironmentTitleUpdate
+from e2b.api.v1.client.models.envs_get200_response_inner import EnvsGet200ResponseInner
+from e2b.api.v1.client.models.new_environment import NewEnvironment
+
+from e2b.api.v1.client.api_client import ApiClient
+from e2b.api.v1.client.api_response import ApiResponse
+from e2b.api.v1.client.exceptions import ApiTypeError, ApiValueError # noqa: F401
+
+
+class EnvsApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @overload
+ async def envs_code_snippet_id_delete(
+ self, api_key: StrictStr, code_snippet_id: StrictStr, **kwargs
+ ) -> None: # noqa: E501
+ ...
+
+ @overload
+ def envs_code_snippet_id_delete(
+ self,
+ api_key: StrictStr,
+ code_snippet_id: StrictStr,
+ async_req: Optional[bool] = True,
+ **kwargs
+ ) -> None: # noqa: E501
+ ...
+
+ @validate_arguments
+ def envs_code_snippet_id_delete(
+ self,
+ api_key: StrictStr,
+ code_snippet_id: StrictStr,
+ async_req: Optional[bool] = None,
+ **kwargs
+ ) -> Union[None, Awaitable[None]]: # noqa: E501
+ """envs_code_snippet_id_delete # noqa: E501
+
+ Delete the code snippet environment # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.envs_code_snippet_id_delete(api_key, code_snippet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param api_key: (required)
+ :type api_key: str
+ :param code_snippet_id: (required)
+ :type code_snippet_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ raise ValueError(
+ "Error! Please call the envs_code_snippet_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data"
+ )
+ if async_req is not None:
+ kwargs["async_req"] = async_req
+ return self.envs_code_snippet_id_delete_with_http_info(
+ api_key, code_snippet_id, **kwargs
+ ) # noqa: E501
+
+ @validate_arguments
+ def envs_code_snippet_id_delete_with_http_info(
+ self, api_key: StrictStr, code_snippet_id: StrictStr, **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """envs_code_snippet_id_delete # noqa: E501
+
+ Delete the code snippet environment # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.envs_code_snippet_id_delete_with_http_info(api_key, code_snippet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param api_key: (required)
+ :type api_key: str
+ :param code_snippet_id: (required)
+ :type code_snippet_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = ["api_key", "code_snippet_id"]
+ _all_params.extend(
+ [
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method envs_code_snippet_id_delete" % _key
+ )
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["code_snippet_id"]:
+ _path_params["codeSnippetID"] = _params["code_snippet_id"]
+
+ # process the query parameters
+ _query_params = []
+ if _params.get("api_key") is not None: # noqa: E501
+ _query_params.append(("api_key", _params["api_key"]))
+
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
+ ) # noqa: E501
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ "/envs/{codeSnippetID}",
+ "DELETE",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @overload
+ async def envs_code_snippet_id_patch(
+ self, api_key: StrictStr, code_snippet_id: StrictStr, **kwargs
+ ) -> None: # noqa: E501
+ ...
+
+ @overload
+ def envs_code_snippet_id_patch(
+ self,
+ api_key: StrictStr,
+ code_snippet_id: StrictStr,
+ async_req: Optional[bool] = True,
+ **kwargs
+ ) -> None: # noqa: E501
+ ...
+
+ @validate_arguments
+ def envs_code_snippet_id_patch(
+ self,
+ api_key: StrictStr,
+ code_snippet_id: StrictStr,
+ async_req: Optional[bool] = None,
+ **kwargs
+ ) -> Union[None, Awaitable[None]]: # noqa: E501
+ """envs_code_snippet_id_patch # noqa: E501
+
+ Update the environment of the code snippet to match the edit environment # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.envs_code_snippet_id_patch(api_key, code_snippet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param api_key: (required)
+ :type api_key: str
+ :param code_snippet_id: (required)
+ :type code_snippet_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ raise ValueError(
+ "Error! Please call the envs_code_snippet_id_patch_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data"
+ )
+ if async_req is not None:
+ kwargs["async_req"] = async_req
+ return self.envs_code_snippet_id_patch_with_http_info(
+ api_key, code_snippet_id, **kwargs
+ ) # noqa: E501
+
+ @validate_arguments
+ def envs_code_snippet_id_patch_with_http_info(
+ self, api_key: StrictStr, code_snippet_id: StrictStr, **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """envs_code_snippet_id_patch # noqa: E501
+
+ Update the environment of the code snippet to match the edit environment # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.envs_code_snippet_id_patch_with_http_info(api_key, code_snippet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param api_key: (required)
+ :type api_key: str
+ :param code_snippet_id: (required)
+ :type code_snippet_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = ["api_key", "code_snippet_id"]
+ _all_params.extend(
+ [
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method envs_code_snippet_id_patch" % _key
+ )
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["code_snippet_id"]:
+ _path_params["codeSnippetID"] = _params["code_snippet_id"]
+
+ # process the query parameters
+ _query_params = []
+ if _params.get("api_key") is not None: # noqa: E501
+ _query_params.append(("api_key", _params["api_key"]))
+
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
+ ) # noqa: E501
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ "/envs/{codeSnippetID}",
+ "PATCH",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @overload
+ async def envs_code_snippet_id_post(
+ self,
+ api_key: StrictStr,
+ code_snippet_id: StrictStr,
+ new_environment: NewEnvironment,
+ **kwargs
+ ) -> None: # noqa: E501
+ ...
+
+ @overload
+ def envs_code_snippet_id_post(
+ self,
+ api_key: StrictStr,
+ code_snippet_id: StrictStr,
+ new_environment: NewEnvironment,
+ async_req: Optional[bool] = True,
+ **kwargs
+ ) -> None: # noqa: E501
+ ...
+
+ @validate_arguments
+ def envs_code_snippet_id_post(
+ self,
+ api_key: StrictStr,
+ code_snippet_id: StrictStr,
+ new_environment: NewEnvironment,
+ async_req: Optional[bool] = None,
+ **kwargs
+ ) -> Union[None, Awaitable[None]]: # noqa: E501
+ """envs_code_snippet_id_post # noqa: E501
+
+ Create a new env for a code snippet # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.envs_code_snippet_id_post(api_key, code_snippet_id, new_environment, async_req=True)
+ >>> result = thread.get()
+
+ :param api_key: (required)
+ :type api_key: str
+ :param code_snippet_id: (required)
+ :type code_snippet_id: str
+ :param new_environment: (required)
+ :type new_environment: NewEnvironment
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ raise ValueError(
+ "Error! Please call the envs_code_snippet_id_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data"
+ )
+ if async_req is not None:
+ kwargs["async_req"] = async_req
+ return self.envs_code_snippet_id_post_with_http_info(
+ api_key, code_snippet_id, new_environment, **kwargs
+ ) # noqa: E501
+
+ @validate_arguments
+ def envs_code_snippet_id_post_with_http_info(
+ self,
+ api_key: StrictStr,
+ code_snippet_id: StrictStr,
+ new_environment: NewEnvironment,
+ **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """envs_code_snippet_id_post # noqa: E501
+
+ Create a new env for a code snippet # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.envs_code_snippet_id_post_with_http_info(api_key, code_snippet_id, new_environment, async_req=True)
+ >>> result = thread.get()
+
+ :param api_key: (required)
+ :type api_key: str
+ :param code_snippet_id: (required)
+ :type code_snippet_id: str
+ :param new_environment: (required)
+ :type new_environment: NewEnvironment
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = ["api_key", "code_snippet_id", "new_environment"]
+ _all_params.extend(
+ [
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method envs_code_snippet_id_post" % _key
+ )
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["code_snippet_id"]:
+ _path_params["codeSnippetID"] = _params["code_snippet_id"]
+
+ # process the query parameters
+ _query_params = []
+ if _params.get("api_key") is not None: # noqa: E501
+ _query_params.append(("api_key", _params["api_key"]))
+
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params["new_environment"] is not None:
+ _body_params = _params["new_environment"]
+
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
+ ) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get(
+ "_content_type",
+ self.api_client.select_header_content_type(["application/json"]),
+ )
+ if _content_types_list:
+ _header_params["Content-Type"] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ "/envs/{codeSnippetID}",
+ "POST",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @overload
+ async def envs_code_snippet_id_state_put(
+ self,
+ api_key: StrictStr,
+ code_snippet_id: StrictStr,
+ environment_state_update: EnvironmentStateUpdate,
+ **kwargs
+ ) -> None: # noqa: E501
+ ...
+
+ @overload
+ def envs_code_snippet_id_state_put(
+ self,
+ api_key: StrictStr,
+ code_snippet_id: StrictStr,
+ environment_state_update: EnvironmentStateUpdate,
+ async_req: Optional[bool] = True,
+ **kwargs
+ ) -> None: # noqa: E501
+ ...
+
+ @validate_arguments
+ def envs_code_snippet_id_state_put(
+ self,
+ api_key: StrictStr,
+ code_snippet_id: StrictStr,
+ environment_state_update: EnvironmentStateUpdate,
+ async_req: Optional[bool] = None,
+ **kwargs
+ ) -> Union[None, Awaitable[None]]: # noqa: E501
+ """envs_code_snippet_id_state_put # noqa: E501
+
+ Update the state of the environment # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.envs_code_snippet_id_state_put(api_key, code_snippet_id, environment_state_update, async_req=True)
+ >>> result = thread.get()
+
+ :param api_key: (required)
+ :type api_key: str
+ :param code_snippet_id: (required)
+ :type code_snippet_id: str
+ :param environment_state_update: (required)
+ :type environment_state_update: EnvironmentStateUpdate
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ raise ValueError(
+ "Error! Please call the envs_code_snippet_id_state_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data"
+ )
+ if async_req is not None:
+ kwargs["async_req"] = async_req
+ return self.envs_code_snippet_id_state_put_with_http_info(
+ api_key, code_snippet_id, environment_state_update, **kwargs
+ ) # noqa: E501
+
+ @validate_arguments
+ def envs_code_snippet_id_state_put_with_http_info(
+ self,
+ api_key: StrictStr,
+ code_snippet_id: StrictStr,
+ environment_state_update: EnvironmentStateUpdate,
+ **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """envs_code_snippet_id_state_put # noqa: E501
+
+ Update the state of the environment # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.envs_code_snippet_id_state_put_with_http_info(api_key, code_snippet_id, environment_state_update, async_req=True)
+ >>> result = thread.get()
+
+ :param api_key: (required)
+ :type api_key: str
+ :param code_snippet_id: (required)
+ :type code_snippet_id: str
+ :param environment_state_update: (required)
+ :type environment_state_update: EnvironmentStateUpdate
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = ["api_key", "code_snippet_id", "environment_state_update"]
+ _all_params.extend(
+ [
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method envs_code_snippet_id_state_put" % _key
+ )
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["code_snippet_id"]:
+ _path_params["codeSnippetID"] = _params["code_snippet_id"]
+
+ # process the query parameters
+ _query_params = []
+ if _params.get("api_key") is not None: # noqa: E501
+ _query_params.append(("api_key", _params["api_key"]))
+
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params["environment_state_update"] is not None:
+ _body_params = _params["environment_state_update"]
+
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
+ ) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get(
+ "_content_type",
+ self.api_client.select_header_content_type(["application/json"]),
+ )
+ if _content_types_list:
+ _header_params["Content-Type"] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ "/envs/{codeSnippetID}/state",
+ "PUT",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @overload
+ async def envs_code_snippet_id_title_put(
+ self,
+ api_key: StrictStr,
+ code_snippet_id: StrictStr,
+ environment_title_update: EnvironmentTitleUpdate,
+ **kwargs
+ ) -> None: # noqa: E501
+ ...
+
+ @overload
+ def envs_code_snippet_id_title_put(
+ self,
+ api_key: StrictStr,
+ code_snippet_id: StrictStr,
+ environment_title_update: EnvironmentTitleUpdate,
+ async_req: Optional[bool] = True,
+ **kwargs
+ ) -> None: # noqa: E501
+ ...
+
+ @validate_arguments
+ def envs_code_snippet_id_title_put(
+ self,
+ api_key: StrictStr,
+ code_snippet_id: StrictStr,
+ environment_title_update: EnvironmentTitleUpdate,
+ async_req: Optional[bool] = None,
+ **kwargs
+ ) -> Union[None, Awaitable[None]]: # noqa: E501
+ """envs_code_snippet_id_title_put # noqa: E501
+
+ Update the title of the environment # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.envs_code_snippet_id_title_put(api_key, code_snippet_id, environment_title_update, async_req=True)
+ >>> result = thread.get()
+
+ :param api_key: (required)
+ :type api_key: str
+ :param code_snippet_id: (required)
+ :type code_snippet_id: str
+ :param environment_title_update: (required)
+ :type environment_title_update: EnvironmentTitleUpdate
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ raise ValueError(
+ "Error! Please call the envs_code_snippet_id_title_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data"
+ )
+ if async_req is not None:
+ kwargs["async_req"] = async_req
+ return self.envs_code_snippet_id_title_put_with_http_info(
+ api_key, code_snippet_id, environment_title_update, **kwargs
+ ) # noqa: E501
+
+ @validate_arguments
+ def envs_code_snippet_id_title_put_with_http_info(
+ self,
+ api_key: StrictStr,
+ code_snippet_id: StrictStr,
+ environment_title_update: EnvironmentTitleUpdate,
+ **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """envs_code_snippet_id_title_put # noqa: E501
+
+ Update the title of the environment # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.envs_code_snippet_id_title_put_with_http_info(api_key, code_snippet_id, environment_title_update, async_req=True)
+ >>> result = thread.get()
+
+ :param api_key: (required)
+ :type api_key: str
+ :param code_snippet_id: (required)
+ :type code_snippet_id: str
+ :param environment_title_update: (required)
+ :type environment_title_update: EnvironmentTitleUpdate
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = ["api_key", "code_snippet_id", "environment_title_update"]
+ _all_params.extend(
+ [
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method envs_code_snippet_id_title_put" % _key
+ )
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["code_snippet_id"]:
+ _path_params["codeSnippetID"] = _params["code_snippet_id"]
+
+ # process the query parameters
+ _query_params = []
+ if _params.get("api_key") is not None: # noqa: E501
+ _query_params.append(("api_key", _params["api_key"]))
+
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params["environment_title_update"] is not None:
+ _body_params = _params["environment_title_update"]
+
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
+ ) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get(
+ "_content_type",
+ self.api_client.select_header_content_type(["application/json"]),
+ )
+ if _content_types_list:
+ _header_params["Content-Type"] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ "/envs/{codeSnippetID}/title",
+ "PUT",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @overload
+ async def envs_get(
+ self, api_key: StrictStr, **kwargs
+ ) -> List[EnvsGet200ResponseInner]: # noqa: E501
+ ...
+
+ @overload
+ def envs_get(
+ self, api_key: StrictStr, async_req: Optional[bool] = True, **kwargs
+ ) -> List[EnvsGet200ResponseInner]: # noqa: E501
+ ...
+
+ @validate_arguments
+ def envs_get(
+ self, api_key: StrictStr, async_req: Optional[bool] = None, **kwargs
+ ) -> Union[
+ List[EnvsGet200ResponseInner], Awaitable[List[EnvsGet200ResponseInner]]
+ ]: # noqa: E501
+ """envs_get # noqa: E501
+
+ List all environments # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.envs_get(api_key, async_req=True)
+ >>> result = thread.get()
+
+ :param api_key: (required)
+ :type api_key: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: List[EnvsGet200ResponseInner]
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ raise ValueError(
+ "Error! Please call the envs_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data"
+ )
+ if async_req is not None:
+ kwargs["async_req"] = async_req
+ return self.envs_get_with_http_info(api_key, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def envs_get_with_http_info(
+ self, api_key: StrictStr, **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """envs_get # noqa: E501
+
+ List all environments # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.envs_get_with_http_info(api_key, async_req=True)
+ >>> result = thread.get()
+
+ :param api_key: (required)
+ :type api_key: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(List[EnvsGet200ResponseInner], status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = ["api_key"]
+ _all_params.extend(
+ [
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method envs_get" % _key
+ )
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get("api_key") is not None: # noqa: E501
+ _query_params.append(("api_key", _params["api_key"]))
+
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
+ ) # noqa: E501
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ "200": "List[EnvsGet200ResponseInner]",
+ "401": "Error",
+ "500": "Error",
+ }
+
+ return self.api_client.call_api(
+ "/envs",
+ "GET",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @overload
+ async def envs_post(
+ self, api_key: StrictStr, new_environment: NewEnvironment, **kwargs
+ ) -> Environment: # noqa: E501
+ ...
+
+ @overload
+ def envs_post(
+ self,
+ api_key: StrictStr,
+ new_environment: NewEnvironment,
+ async_req: Optional[bool] = True,
+ **kwargs
+ ) -> Environment: # noqa: E501
+ ...
+
+ @validate_arguments
+ def envs_post(
+ self,
+ api_key: StrictStr,
+ new_environment: NewEnvironment,
+ async_req: Optional[bool] = None,
+ **kwargs
+ ) -> Union[Environment, Awaitable[Environment]]: # noqa: E501
+ """envs_post # noqa: E501
+
+ Create a new environment # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.envs_post(api_key, new_environment, async_req=True)
+ >>> result = thread.get()
+
+ :param api_key: (required)
+ :type api_key: str
+ :param new_environment: (required)
+ :type new_environment: NewEnvironment
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Environment
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ raise ValueError(
+ "Error! Please call the envs_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data"
+ )
+ if async_req is not None:
+ kwargs["async_req"] = async_req
+ return self.envs_post_with_http_info(
+ api_key, new_environment, **kwargs
+ ) # noqa: E501
+
+ @validate_arguments
+ def envs_post_with_http_info(
+ self, api_key: StrictStr, new_environment: NewEnvironment, **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """envs_post # noqa: E501
+
+ Create a new environment # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.envs_post_with_http_info(api_key, new_environment, async_req=True)
+ >>> result = thread.get()
+
+ :param api_key: (required)
+ :type api_key: str
+ :param new_environment: (required)
+ :type new_environment: NewEnvironment
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Environment, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = ["api_key", "new_environment"]
+ _all_params.extend(
+ [
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method envs_post" % _key
+ )
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get("api_key") is not None: # noqa: E501
+ _query_params.append(("api_key", _params["api_key"]))
+
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params["new_environment"] is not None:
+ _body_params = _params["new_environment"]
+
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
+ ) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get(
+ "_content_type",
+ self.api_client.select_header_content_type(["application/json"]),
+ )
+ if _content_types_list:
+ _header_params["Content-Type"] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ "200": "Environment",
+ "400": "Error",
+ "401": "Error",
+ "500": "Error",
+ }
+
+ return self.api_client.call_api(
+ "/envs",
+ "POST",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
diff --git a/packages/python-sdk/e2b/api/v1/client/api/sessions_api.py b/packages/python-sdk/e2b/api/v1/client/api/sessions_api.py
new file mode 100644
index 000000000..99b2a0a84
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/api/sessions_api.py
@@ -0,0 +1,748 @@
+# coding: utf-8
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+import re # noqa: F401
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+from typing import overload, Optional, Union, Awaitable
+
+from pydantic import StrictStr
+
+from typing import List, Optional
+
+from e2b.api.v1.client.models.new_session import NewSession
+from e2b.api.v1.client.models.session import Session
+from e2b.api.v1.client.models.sessions_get200_response_inner import (
+ SessionsGet200ResponseInner,
+)
+
+from e2b.api.v1.client.api_client import ApiClient
+from e2b.api.v1.client.api_response import ApiResponse
+from e2b.api.v1.client.exceptions import ApiTypeError, ApiValueError # noqa: F401
+
+
+class SessionsApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @overload
+ async def sessions_get(
+ self, api_key: StrictStr, **kwargs
+ ) -> List[SessionsGet200ResponseInner]: # noqa: E501
+ ...
+
+ @overload
+ def sessions_get(
+ self, api_key: StrictStr, async_req: Optional[bool] = True, **kwargs
+ ) -> List[SessionsGet200ResponseInner]: # noqa: E501
+ ...
+
+ @validate_arguments
+ def sessions_get(
+ self, api_key: StrictStr, async_req: Optional[bool] = None, **kwargs
+ ) -> Union[
+ List[SessionsGet200ResponseInner], Awaitable[List[SessionsGet200ResponseInner]]
+ ]: # noqa: E501
+ """sessions_get # noqa: E501
+
+ List all sessions # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.sessions_get(api_key, async_req=True)
+ >>> result = thread.get()
+
+ :param api_key: (required)
+ :type api_key: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: List[SessionsGet200ResponseInner]
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ raise ValueError(
+ "Error! Please call the sessions_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data"
+ )
+ if async_req is not None:
+ kwargs["async_req"] = async_req
+ return self.sessions_get_with_http_info(api_key, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def sessions_get_with_http_info(
+ self, api_key: StrictStr, **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """sessions_get # noqa: E501
+
+ List all sessions # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.sessions_get_with_http_info(api_key, async_req=True)
+ >>> result = thread.get()
+
+ :param api_key: (required)
+ :type api_key: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(List[SessionsGet200ResponseInner], status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = ["api_key"]
+ _all_params.extend(
+ [
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method sessions_get" % _key
+ )
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get("api_key") is not None: # noqa: E501
+ _query_params.append(("api_key", _params["api_key"]))
+
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
+ ) # noqa: E501
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ "200": "List[SessionsGet200ResponseInner]",
+ "401": "Error",
+ "500": "Error",
+ }
+
+ return self.api_client.call_api(
+ "/sessions",
+ "GET",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @overload
+ async def sessions_post(
+ self, new_session: NewSession, api_key: Optional[StrictStr] = None, **kwargs
+ ) -> Session: # noqa: E501
+ ...
+
+ @overload
+ def sessions_post(
+ self,
+ new_session: NewSession,
+ api_key: Optional[StrictStr] = None,
+ async_req: Optional[bool] = True,
+ **kwargs
+ ) -> Session: # noqa: E501
+ ...
+
+ @validate_arguments
+ def sessions_post(
+ self,
+ new_session: NewSession,
+ api_key: Optional[StrictStr] = None,
+ async_req: Optional[bool] = None,
+ **kwargs
+ ) -> Union[Session, Awaitable[Session]]: # noqa: E501
+ """sessions_post # noqa: E501
+
+ Create a session on the server # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.sessions_post(new_session, api_key, async_req=True)
+ >>> result = thread.get()
+
+ :param new_session: (required)
+ :type new_session: NewSession
+ :param api_key:
+ :type api_key: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Session
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ raise ValueError(
+ "Error! Please call the sessions_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data"
+ )
+ if async_req is not None:
+ kwargs["async_req"] = async_req
+ return self.sessions_post_with_http_info(
+ new_session, api_key, **kwargs
+ ) # noqa: E501
+
+ @validate_arguments
+ def sessions_post_with_http_info(
+ self, new_session: NewSession, api_key: Optional[StrictStr] = None, **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """sessions_post # noqa: E501
+
+ Create a session on the server # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.sessions_post_with_http_info(new_session, api_key, async_req=True)
+ >>> result = thread.get()
+
+ :param new_session: (required)
+ :type new_session: NewSession
+ :param api_key:
+ :type api_key: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Session, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = ["new_session", "api_key"]
+ _all_params.extend(
+ [
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method sessions_post" % _key
+ )
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get("api_key") is not None: # noqa: E501
+ _query_params.append(("api_key", _params["api_key"]))
+
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params["new_session"] is not None:
+ _body_params = _params["new_session"]
+
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
+ ) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get(
+ "_content_type",
+ self.api_client.select_header_content_type(["application/json"]),
+ )
+ if _content_types_list:
+ _header_params["Content-Type"] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ "201": "Session",
+ "401": "Error",
+ "400": "Error",
+ "500": "Error",
+ }
+
+ return self.api_client.call_api(
+ "/sessions",
+ "POST",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @overload
+ async def sessions_session_id_delete(
+ self, api_key: StrictStr, session_id: StrictStr, **kwargs
+ ) -> None: # noqa: E501
+ ...
+
+ @overload
+ def sessions_session_id_delete(
+ self,
+ api_key: StrictStr,
+ session_id: StrictStr,
+ async_req: Optional[bool] = True,
+ **kwargs
+ ) -> None: # noqa: E501
+ ...
+
+ @validate_arguments
+ def sessions_session_id_delete(
+ self,
+ api_key: StrictStr,
+ session_id: StrictStr,
+ async_req: Optional[bool] = None,
+ **kwargs
+ ) -> Union[None, Awaitable[None]]: # noqa: E501
+ """sessions_session_id_delete # noqa: E501
+
+ Delete a session on the server # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.sessions_session_id_delete(api_key, session_id, async_req=True)
+ >>> result = thread.get()
+
+ :param api_key: (required)
+ :type api_key: str
+ :param session_id: (required)
+ :type session_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ raise ValueError(
+ "Error! Please call the sessions_session_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data"
+ )
+ if async_req is not None:
+ kwargs["async_req"] = async_req
+ return self.sessions_session_id_delete_with_http_info(
+ api_key, session_id, **kwargs
+ ) # noqa: E501
+
+ @validate_arguments
+ def sessions_session_id_delete_with_http_info(
+ self, api_key: StrictStr, session_id: StrictStr, **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """sessions_session_id_delete # noqa: E501
+
+ Delete a session on the server # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.sessions_session_id_delete_with_http_info(api_key, session_id, async_req=True)
+ >>> result = thread.get()
+
+ :param api_key: (required)
+ :type api_key: str
+ :param session_id: (required)
+ :type session_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = ["api_key", "session_id"]
+ _all_params.extend(
+ [
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method sessions_session_id_delete" % _key
+ )
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["session_id"]:
+ _path_params["sessionID"] = _params["session_id"]
+
+ # process the query parameters
+ _query_params = []
+ if _params.get("api_key") is not None: # noqa: E501
+ _query_params.append(("api_key", _params["api_key"]))
+
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
+ ) # noqa: E501
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ "/sessions/{sessionID}",
+ "DELETE",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @overload
+ async def sessions_session_id_refresh_post(
+ self, session_id: StrictStr, api_key: Optional[StrictStr] = None, **kwargs
+ ) -> None: # noqa: E501
+ ...
+
+ @overload
+ def sessions_session_id_refresh_post(
+ self,
+ session_id: StrictStr,
+ api_key: Optional[StrictStr] = None,
+ async_req: Optional[bool] = True,
+ **kwargs
+ ) -> None: # noqa: E501
+ ...
+
+ @validate_arguments
+ def sessions_session_id_refresh_post(
+ self,
+ session_id: StrictStr,
+ api_key: Optional[StrictStr] = None,
+ async_req: Optional[bool] = None,
+ **kwargs
+ ) -> Union[None, Awaitable[None]]: # noqa: E501
+ """sessions_session_id_refresh_post # noqa: E501
+
+ Refresh the session extending its time to live # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.sessions_session_id_refresh_post(session_id, api_key, async_req=True)
+ >>> result = thread.get()
+
+ :param session_id: (required)
+ :type session_id: str
+ :param api_key:
+ :type api_key: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ raise ValueError(
+ "Error! Please call the sessions_session_id_refresh_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data"
+ )
+ if async_req is not None:
+ kwargs["async_req"] = async_req
+ return self.sessions_session_id_refresh_post_with_http_info(
+ session_id, api_key, **kwargs
+ ) # noqa: E501
+
+ @validate_arguments
+ def sessions_session_id_refresh_post_with_http_info(
+ self, session_id: StrictStr, api_key: Optional[StrictStr] = None, **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """sessions_session_id_refresh_post # noqa: E501
+
+ Refresh the session extending its time to live # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.sessions_session_id_refresh_post_with_http_info(session_id, api_key, async_req=True)
+ >>> result = thread.get()
+
+ :param session_id: (required)
+ :type session_id: str
+ :param api_key:
+ :type api_key: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = ["session_id", "api_key"]
+ _all_params.extend(
+ [
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method sessions_session_id_refresh_post" % _key
+ )
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["session_id"]:
+ _path_params["sessionID"] = _params["session_id"]
+
+ # process the query parameters
+ _query_params = []
+ if _params.get("api_key") is not None: # noqa: E501
+ _query_params.append(("api_key", _params["api_key"]))
+
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
+ ) # noqa: E501
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ "/sessions/{sessionID}/refresh",
+ "POST",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
diff --git a/packages/python-sdk/e2b/api/v1/client/api_client.py b/packages/python-sdk/e2b/api/v1/client/api_client.py
new file mode 100644
index 000000000..f7b0b69d2
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/api_client.py
@@ -0,0 +1,838 @@
+# coding: utf-8
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+import atexit
+import datetime
+from dateutil.parser import parse
+import json
+import mimetypes
+from multiprocessing.pool import ThreadPool
+import os
+import re
+import tempfile
+
+from urllib.parse import quote
+
+from e2b.api.v1.client.configuration import Configuration
+from e2b.api.v1.client.api_response import ApiResponse
+import e2b.api.v1.client.models
+from e2b.api.v1.client import rest
+from e2b.api.v1.client.exceptions import ApiValueError, ApiException
+
+
+class ApiClient(object):
+ """Generic API client for OpenAPI client library builds.
+
+ OpenAPI generic API client. This client handles the client-
+ server communication, and is invariant across implementations. Specifics of
+ the methods and models for each application are generated from the OpenAPI
+ templates.
+
+ :param configuration: .Configuration object for this client
+ :param header_name: a header to pass when making calls to the API.
+ :param header_value: a header value to pass when making calls to
+ the API.
+ :param cookie: a cookie to include in the header when making calls
+ to the API
+ :param pool_threads: The number of threads to use for async requests
+ to the API. More threads means more concurrent API requests.
+ """
+
+ PRIMITIVE_TYPES = (float, bool, bytes, str, int)
+ NATIVE_TYPES_MAPPING = {
+ "int": int,
+ "long": int, # TODO remove as only py3 is supported?
+ "float": float,
+ "str": str,
+ "bool": bool,
+ "date": datetime.date,
+ "datetime": datetime.datetime,
+ "object": object,
+ }
+ _pool = None
+
+ def __init__(
+ self,
+ configuration=None,
+ header_name=None,
+ header_value=None,
+ cookie=None,
+ pool_threads=1,
+ ):
+ # use default configuration if none is provided
+ if configuration is None:
+ configuration = Configuration.get_default()
+ self.configuration = configuration
+ self.pool_threads = pool_threads
+
+ self.rest_client = rest.RESTClientObject(configuration)
+ self.default_headers = {}
+ if header_name is not None:
+ self.default_headers[header_name] = header_value
+ self.cookie = cookie
+ # Set default User-Agent.
+ self.user_agent = "OpenAPI-Generator/1.0.0/python"
+ self.client_side_validation = configuration.client_side_validation
+
+ async def __aenter__(self):
+ return self
+
+ async def __aexit__(self, exc_type, exc_value, traceback):
+ await self.close()
+
+ async def close(self):
+ await self.rest_client.close()
+ if self._pool:
+ self._pool.close()
+ self._pool.join()
+ self._pool = None
+ if hasattr(atexit, "unregister"):
+ atexit.unregister(self.close)
+
+ @property
+ def pool(self):
+ """Create thread pool on first request
+ avoids instantiating unused threadpool for blocking clients.
+ """
+ if self._pool is None:
+ atexit.register(self.close)
+ self._pool = ThreadPool(self.pool_threads)
+ return self._pool
+
+ @property
+ def user_agent(self):
+ """User agent for this API client"""
+ return self.default_headers["User-Agent"]
+
+ @user_agent.setter
+ def user_agent(self, value):
+ self.default_headers["User-Agent"] = value
+
+ def set_default_header(self, header_name, header_value):
+ self.default_headers[header_name] = header_value
+
+ _default = None
+
+ @classmethod
+ def get_default(cls):
+ """Return new instance of ApiClient.
+
+ This method returns newly created, based on default constructor,
+ object of ApiClient class or returns a copy of default
+ ApiClient.
+
+ :return: The ApiClient object.
+ """
+ if cls._default is None:
+ cls._default = ApiClient()
+ return cls._default
+
+ @classmethod
+ def set_default(cls, default):
+ """Set default instance of ApiClient.
+
+ It stores default ApiClient.
+
+ :param default: object of ApiClient.
+ """
+ cls._default = default
+
+ async def __call_api(
+ self,
+ resource_path,
+ method,
+ path_params=None,
+ query_params=None,
+ header_params=None,
+ body=None,
+ post_params=None,
+ files=None,
+ response_types_map=None,
+ auth_settings=None,
+ _return_http_data_only=None,
+ collection_formats=None,
+ _preload_content=True,
+ _request_timeout=None,
+ _host=None,
+ _request_auth=None,
+ ):
+ config = self.configuration
+
+ # header parameters
+ header_params = header_params or {}
+ header_params.update(self.default_headers)
+ if self.cookie:
+ header_params["Cookie"] = self.cookie
+ if header_params:
+ header_params = self.sanitize_for_serialization(header_params)
+ header_params = dict(
+ self.parameters_to_tuples(header_params, collection_formats)
+ )
+
+ # path parameters
+ if path_params:
+ path_params = self.sanitize_for_serialization(path_params)
+ path_params = self.parameters_to_tuples(path_params, collection_formats)
+ for k, v in path_params:
+ # specified safe chars, encode everything
+ resource_path = resource_path.replace(
+ "{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param)
+ )
+
+ # post parameters
+ if post_params or files:
+ post_params = post_params if post_params else []
+ post_params = self.sanitize_for_serialization(post_params)
+ post_params = self.parameters_to_tuples(post_params, collection_formats)
+ post_params.extend(self.files_parameters(files))
+
+ # auth setting
+ self.update_params_for_auth(
+ header_params,
+ query_params,
+ auth_settings,
+ resource_path,
+ method,
+ body,
+ request_auth=_request_auth,
+ )
+
+ # body
+ if body:
+ body = self.sanitize_for_serialization(body)
+
+ # request url
+ if _host is None:
+ url = self.configuration.host + resource_path
+ else:
+ # use server/host defined in path or operation instead
+ url = _host + resource_path
+
+ # query parameters
+ if query_params:
+ query_params = self.sanitize_for_serialization(query_params)
+ url_query = self.parameters_to_url_query(query_params, collection_formats)
+ url += "?" + url_query
+
+ try:
+ # perform request and return response
+ response_data = await self.request(
+ method,
+ url,
+ query_params=query_params,
+ headers=header_params,
+ post_params=post_params,
+ body=body,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ )
+ except ApiException as e:
+ if e.body:
+ e.body = e.body.decode("utf-8")
+ raise e
+
+ self.last_response = response_data
+
+ return_data = None # assuming derialization is not needed
+ # data needs deserialization or returns HTTP data (deserialized) only
+ if _preload_content or _return_http_data_only:
+ response_type = response_types_map.get(str(response_data.status), None)
+
+ if response_type == "bytearray":
+ response_data.data = response_data.data
+ else:
+ match = None
+ content_type = response_data.getheader("content-type")
+ if content_type is not None:
+ match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
+ encoding = match.group(1) if match else "utf-8"
+ response_data.data = response_data.data.decode(encoding)
+
+ # deserialize response data
+ if response_type == "bytearray":
+ return_data = response_data.data
+ elif response_type:
+ return_data = self.deserialize(response_data, response_type)
+ else:
+ return_data = None
+
+ if _return_http_data_only:
+ return return_data
+ else:
+ return ApiResponse(
+ status_code=response_data.status,
+ data=return_data,
+ headers=response_data.getheaders(),
+ raw_data=response_data.data,
+ )
+
+ def sanitize_for_serialization(self, obj):
+ """Builds a JSON POST object.
+
+ If obj is None, return None.
+ If obj is str, int, long, float, bool, return directly.
+ If obj is datetime.datetime, datetime.date
+ convert to string in iso8601 format.
+ If obj is list, sanitize each element in the list.
+ If obj is dict, return the dict.
+ If obj is OpenAPI model, return the properties dict.
+
+ :param obj: The data to serialize.
+ :return: The serialized form of data.
+ """
+ if obj is None:
+ return None
+ elif isinstance(obj, self.PRIMITIVE_TYPES):
+ return obj
+ elif isinstance(obj, list):
+ return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj]
+ elif isinstance(obj, tuple):
+ return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj)
+ elif isinstance(obj, (datetime.datetime, datetime.date)):
+ return obj.isoformat()
+
+ if isinstance(obj, dict):
+ obj_dict = obj
+ else:
+ # Convert model obj to dict except
+ # attributes `openapi_types`, `attribute_map`
+ # and attributes which value is not None.
+ # Convert attribute name to json key in
+ # model definition for request.
+ obj_dict = obj.to_dict()
+
+ return {
+ key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()
+ }
+
+ def deserialize(self, response, response_type):
+ """Deserializes response into an object.
+
+ :param response: RESTResponse object to be deserialized.
+ :param response_type: class literal for
+ deserialized object, or string of class name.
+
+ :return: deserialized object.
+ """
+ # handle file downloading
+ # save response body into a tmp file and return the instance
+ if response_type == "file":
+ return self.__deserialize_file(response)
+
+ # fetch data from response object
+ try:
+ data = json.loads(response.data)
+ except ValueError:
+ data = response.data
+
+ return self.__deserialize(data, response_type)
+
+ def __deserialize(self, data, klass):
+ """Deserializes dict, list, str into an object.
+
+ :param data: dict, list or str.
+ :param klass: class literal, or string of class name.
+
+ :return: object.
+ """
+ if data is None:
+ return None
+
+ if type(klass) == str:
+ if klass.startswith("List["):
+ sub_kls = re.match(r"List\[(.*)]", klass).group(1)
+ return [self.__deserialize(sub_data, sub_kls) for sub_data in data]
+
+ if klass.startswith("Dict["):
+ sub_kls = re.match(r"Dict\[([^,]*), (.*)]", klass).group(2)
+ return {k: self.__deserialize(v, sub_kls) for k, v in data.items()}
+
+ # convert str to class
+ if klass in self.NATIVE_TYPES_MAPPING:
+ klass = self.NATIVE_TYPES_MAPPING[klass]
+ else:
+ klass = getattr(e2b.api.v1.client.models, klass)
+
+ if klass in self.PRIMITIVE_TYPES:
+ return self.__deserialize_primitive(data, klass)
+ elif klass == object:
+ return self.__deserialize_object(data)
+ elif klass == datetime.date:
+ return self.__deserialize_date(data)
+ elif klass == datetime.datetime:
+ return self.__deserialize_datetime(data)
+ else:
+ return self.__deserialize_model(data, klass)
+
+ def call_api(
+ self,
+ resource_path,
+ method,
+ path_params=None,
+ query_params=None,
+ header_params=None,
+ body=None,
+ post_params=None,
+ files=None,
+ response_types_map=None,
+ auth_settings=None,
+ async_req=None,
+ _return_http_data_only=None,
+ collection_formats=None,
+ _preload_content=True,
+ _request_timeout=None,
+ _host=None,
+ _request_auth=None,
+ ):
+ """Makes the HTTP request (synchronous) and returns deserialized data.
+
+ To make an async_req request, set the async_req parameter.
+
+ :param resource_path: Path to method endpoint.
+ :param method: Method to call.
+ :param path_params: Path parameters in the url.
+ :param query_params: Query parameters in the url.
+ :param header_params: Header parameters to be
+ placed in the request header.
+ :param body: Request body.
+ :param post_params dict: Request post form parameters,
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
+ :param auth_settings list: Auth Settings names for the request.
+ :param response: Response data type.
+ :param files dict: key -> filename, value -> filepath,
+ for `multipart/form-data`.
+ :param async_req bool: execute request asynchronously
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :param collection_formats: dict of collection formats for path, query,
+ header, and post parameters.
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_token: dict, optional
+ :return:
+ If async_req parameter is True,
+ the request will be called asynchronously.
+ The method will return the request thread.
+ If parameter async_req is False or missing,
+ then the method will return the response directly.
+ """
+ if not async_req:
+ return self.__call_api(
+ resource_path,
+ method,
+ path_params,
+ query_params,
+ header_params,
+ body,
+ post_params,
+ files,
+ response_types_map,
+ auth_settings,
+ _return_http_data_only,
+ collection_formats,
+ _preload_content,
+ _request_timeout,
+ _host,
+ _request_auth,
+ )
+
+ return self.pool.apply_async(
+ self.__call_api,
+ (
+ resource_path,
+ method,
+ path_params,
+ query_params,
+ header_params,
+ body,
+ post_params,
+ files,
+ response_types_map,
+ auth_settings,
+ _return_http_data_only,
+ collection_formats,
+ _preload_content,
+ _request_timeout,
+ _host,
+ _request_auth,
+ ),
+ )
+
+ def request(
+ self,
+ method,
+ url,
+ query_params=None,
+ headers=None,
+ post_params=None,
+ body=None,
+ _preload_content=True,
+ _request_timeout=None,
+ ):
+ """Makes the HTTP request using RESTClient."""
+ if method == "GET":
+ return self.rest_client.get_request(
+ url,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ headers=headers,
+ )
+ elif method == "HEAD":
+ return self.rest_client.head_request(
+ url,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ headers=headers,
+ )
+ elif method == "OPTIONS":
+ return self.rest_client.options_request(
+ url,
+ query_params=query_params,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ )
+ elif method == "POST":
+ return self.rest_client.post_request(
+ url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body,
+ )
+ elif method == "PUT":
+ return self.rest_client.put_request(
+ url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body,
+ )
+ elif method == "PATCH":
+ return self.rest_client.patch_request(
+ url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body,
+ )
+ elif method == "DELETE":
+ return self.rest_client.delete_request(
+ url,
+ query_params=query_params,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body,
+ )
+ else:
+ raise ApiValueError(
+ "http method must be `GET`, `HEAD`, `OPTIONS`,"
+ " `POST`, `PATCH`, `PUT` or `DELETE`."
+ )
+
+ def parameters_to_tuples(self, params, collection_formats):
+ """Get parameters as list of tuples, formatting collections.
+
+ :param params: Parameters as dict or list of two-tuples
+ :param dict collection_formats: Parameter collection formats
+ :return: Parameters as list of tuples, collections formatted
+ """
+ new_params = []
+ if collection_formats is None:
+ collection_formats = {}
+ for k, v in (
+ params.items() if isinstance(params, dict) else params
+ ): # noqa: E501
+ if k in collection_formats:
+ collection_format = collection_formats[k]
+ if collection_format == "multi":
+ new_params.extend((k, value) for value in v)
+ else:
+ if collection_format == "ssv":
+ delimiter = " "
+ elif collection_format == "tsv":
+ delimiter = "\t"
+ elif collection_format == "pipes":
+ delimiter = "|"
+ else: # csv is the default
+ delimiter = ","
+ new_params.append((k, delimiter.join(str(value) for value in v)))
+ else:
+ new_params.append((k, v))
+ return new_params
+
+ def parameters_to_url_query(self, params, collection_formats):
+ """Get parameters as list of tuples, formatting collections.
+
+ :param params: Parameters as dict or list of two-tuples
+ :param dict collection_formats: Parameter collection formats
+ :return: URL query string (e.g. a=Hello%20World&b=123)
+ """
+ new_params = []
+ if collection_formats is None:
+ collection_formats = {}
+ for k, v in (
+ params.items() if isinstance(params, dict) else params
+ ): # noqa: E501
+ if isinstance(v, (int, float)):
+ v = str(v)
+ if isinstance(v, bool):
+ v = str(v).lower()
+ if isinstance(v, dict):
+ v = json.dumps(v)
+
+ if k in collection_formats:
+ collection_format = collection_formats[k]
+ if collection_format == "multi":
+ new_params.extend((k, value) for value in v)
+ else:
+ if collection_format == "ssv":
+ delimiter = " "
+ elif collection_format == "tsv":
+ delimiter = "\t"
+ elif collection_format == "pipes":
+ delimiter = "|"
+ else: # csv is the default
+ delimiter = ","
+ new_params.append(
+ (k, delimiter.join(quote(str(value)) for value in v))
+ )
+ else:
+ new_params.append((k, quote(str(v))))
+
+ return "&".join(["=".join(item) for item in new_params])
+
+ def files_parameters(self, files=None):
+ """Builds form parameters.
+
+ :param files: File parameters.
+ :return: Form parameters with files.
+ """
+ params = []
+
+ if files:
+ for k, v in files.items():
+ if not v:
+ continue
+ file_names = v if type(v) is list else [v]
+ for n in file_names:
+ with open(n, "rb") as f:
+ filename = os.path.basename(f.name)
+ filedata = f.read()
+ mimetype = (
+ mimetypes.guess_type(filename)[0]
+ or "application/octet-stream"
+ )
+ params.append(tuple([k, tuple([filename, filedata, mimetype])]))
+
+ return params
+
+ def select_header_accept(self, accepts):
+ """Returns `Accept` based on an array of accepts provided.
+
+ :param accepts: List of headers.
+ :return: Accept (e.g. application/json).
+ """
+ if not accepts:
+ return
+
+ for accept in accepts:
+ if re.search("json", accept, re.IGNORECASE):
+ return accept
+
+ return accepts[0]
+
+ def select_header_content_type(self, content_types):
+ """Returns `Content-Type` based on an array of content_types provided.
+
+ :param content_types: List of content-types.
+ :return: Content-Type (e.g. application/json).
+ """
+ if not content_types:
+ return None
+
+ for content_type in content_types:
+ if re.search("json", content_type, re.IGNORECASE):
+ return content_type
+
+ return content_types[0]
+
+ def update_params_for_auth(
+ self,
+ headers,
+ queries,
+ auth_settings,
+ resource_path,
+ method,
+ body,
+ request_auth=None,
+ ):
+ """Updates header and query params based on authentication setting.
+
+ :param headers: Header parameters dict to be updated.
+ :param queries: Query parameters tuple list to be updated.
+ :param auth_settings: Authentication setting identifiers list.
+ :resource_path: A string representation of the HTTP request resource path.
+ :method: A string representation of the HTTP request method.
+ :body: A object representing the body of the HTTP request.
+ The object type is the return value of sanitize_for_serialization().
+ :param request_auth: if set, the provided settings will
+ override the token in the configuration.
+ """
+ if not auth_settings:
+ return
+
+ if request_auth:
+ self._apply_auth_params(
+ headers, queries, resource_path, method, body, request_auth
+ )
+ return
+
+ for auth in auth_settings:
+ auth_setting = self.configuration.auth_settings().get(auth)
+ if auth_setting:
+ self._apply_auth_params(
+ headers, queries, resource_path, method, body, auth_setting
+ )
+
+ def _apply_auth_params(
+ self, headers, queries, resource_path, method, body, auth_setting
+ ):
+ """Updates the request parameters based on a single auth_setting
+
+ :param headers: Header parameters dict to be updated.
+ :param queries: Query parameters tuple list to be updated.
+ :resource_path: A string representation of the HTTP request resource path.
+ :method: A string representation of the HTTP request method.
+ :body: A object representing the body of the HTTP request.
+ The object type is the return value of sanitize_for_serialization().
+ :param auth_setting: auth settings for the endpoint
+ """
+ if auth_setting["in"] == "cookie":
+ headers["Cookie"] = auth_setting["value"]
+ elif auth_setting["in"] == "header":
+ if auth_setting["type"] != "http-signature":
+ headers[auth_setting["key"]] = auth_setting["value"]
+ elif auth_setting["in"] == "query":
+ queries.append((auth_setting["key"], auth_setting["value"]))
+ else:
+ raise ApiValueError("Authentication token must be in `query` or `header`")
+
+ def __deserialize_file(self, response):
+ """Deserializes body to file
+
+ Saves response body into a file in a temporary folder,
+ using the filename from the `Content-Disposition` header if provided.
+
+ :param response: RESTResponse.
+ :return: file path.
+ """
+ fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
+ os.close(fd)
+ os.remove(path)
+
+ content_disposition = response.getheader("Content-Disposition")
+ if content_disposition:
+ filename = re.search(
+ r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition
+ ).group(1)
+ path = os.path.join(os.path.dirname(path), filename)
+
+ with open(path, "wb") as f:
+ f.write(response.data)
+
+ return path
+
+ def __deserialize_primitive(self, data, klass):
+ """Deserializes string to primitive type.
+
+ :param data: str.
+ :param klass: class literal.
+
+ :return: int, long, float, str, bool.
+ """
+ try:
+ return klass(data)
+ except UnicodeEncodeError:
+ return str(data)
+ except TypeError:
+ return data
+
+ def __deserialize_object(self, value):
+ """Return an original value.
+
+ :return: object.
+ """
+ return value
+
+ def __deserialize_date(self, string):
+ """Deserializes string to date.
+
+ :param string: str.
+ :return: date.
+ """
+ try:
+ return parse(string).date()
+ except ImportError:
+ return string
+ except ValueError:
+ raise rest.ApiException(
+ status=0, reason="Failed to parse `{0}` as date object".format(string)
+ )
+
+ def __deserialize_datetime(self, string):
+ """Deserializes string to datetime.
+
+ The string should be in iso8601 datetime format.
+
+ :param string: str.
+ :return: datetime.
+ """
+ try:
+ return parse(string)
+ except ImportError:
+ return string
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason=("Failed to parse `{0}` as datetime object".format(string)),
+ )
+
+ def __deserialize_model(self, data, klass):
+ """Deserializes list or dict to model.
+
+ :param data: dict, list.
+ :param klass: class literal.
+ :return: model object.
+ """
+
+ return klass.from_dict(data)
diff --git a/packages/python-sdk/e2b/api/v1/client/api_response.py b/packages/python-sdk/e2b/api/v1/client/api_response.py
new file mode 100644
index 000000000..0af0a2dd5
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/api_response.py
@@ -0,0 +1,26 @@
+"""API response object."""
+
+from __future__ import annotations
+from typing import Any, Dict, Optional
+from pydantic import Field, StrictInt, StrictStr
+
+
+class ApiResponse:
+ """
+ API response object
+ """
+
+ status_code: Optional[StrictInt] = Field(None, description="HTTP status code")
+ headers: Optional[Dict[StrictStr, StrictStr]] = Field(
+ None, description="HTTP headers"
+ )
+ data: Optional[Any] = Field(
+ None, description="Deserialized data given the data type"
+ )
+ raw_data: Optional[Any] = Field(None, description="Raw data (HTTP response body)")
+
+ def __init__(self, status_code=None, headers=None, data=None, raw_data=None):
+ self.status_code = status_code
+ self.headers = headers
+ self.data = data
+ self.raw_data = raw_data
diff --git a/packages/python-sdk/e2b/api/v1/client/configuration.py b/packages/python-sdk/e2b/api/v1/client/configuration.py
new file mode 100644
index 000000000..a206b6d70
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/configuration.py
@@ -0,0 +1,509 @@
+# coding: utf-8
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+import copy
+import logging
+import sys
+import urllib3
+
+import http.client as httplib
+from e2b.api.v1.client.exceptions import ApiValueError
+
+JSON_SCHEMA_VALIDATION_KEYWORDS = {
+ "multipleOf",
+ "maximum",
+ "exclusiveMaximum",
+ "minimum",
+ "exclusiveMinimum",
+ "maxLength",
+ "minLength",
+ "pattern",
+ "maxItems",
+ "minItems",
+}
+
+
+class Configuration(object):
+ """This class contains various settings of the API client.
+
+ :param host: Base url.
+ :param api_key: Dict to store API key(s).
+ Each entry in the dict specifies an API key.
+ The dict key is the name of the security scheme in the OAS specification.
+ The dict value is the API key secret.
+ :param api_key_prefix: Dict to store API prefix (e.g. Bearer).
+ The dict key is the name of the security scheme in the OAS specification.
+ The dict value is an API key prefix when generating the auth data.
+ :param username: Username for HTTP basic authentication.
+ :param password: Password for HTTP basic authentication.
+ :param access_token: Access token.
+ :param server_index: Index to servers configuration.
+ :param server_variables: Mapping with string values to replace variables in
+ templated server configuration. The validation of enums is performed for
+ variables with defined enum values before.
+ :param server_operation_index: Mapping from operation ID to an index to server
+ configuration.
+ :param server_operation_variables: Mapping from operation ID to a mapping with
+ string values to replace variables in templated server configuration.
+ The validation of enums is performed for variables with defined enum values before.
+ :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
+ in PEM format.
+
+ :Example:
+
+ API Key Authentication Example.
+ Given the following security scheme in the OpenAPI specification:
+ components:
+ securitySchemes:
+ cookieAuth: # name for the security scheme
+ type: apiKey
+ in: cookie
+ name: JSESSIONID # cookie name
+
+ You can programmatically set the cookie:
+
+ conf = e2b.api.v1.client.Configuration(
+ api_key={'cookieAuth': 'abc123'}
+ api_key_prefix={'cookieAuth': 'JSESSIONID'}
+ )
+
+ The following cookie will be added to the HTTP request:
+ Cookie: JSESSIONID abc123
+ """
+
+ _default = None
+
+ def __init__(
+ self,
+ host=None,
+ api_key=None,
+ api_key_prefix=None,
+ username=None,
+ password=None,
+ access_token=None,
+ server_index=None,
+ server_variables=None,
+ server_operation_index=None,
+ server_operation_variables=None,
+ ssl_ca_cert=None,
+ ):
+ """Constructor"""
+ self._base_path = "https://ondevbook.com" if host is None else host
+ """Default Base url
+ """
+ self.server_index = 0 if server_index is None and host is None else server_index
+ self.server_operation_index = server_operation_index or {}
+ """Default server index
+ """
+ self.server_variables = server_variables or {}
+ self.server_operation_variables = server_operation_variables or {}
+ """Default server variables
+ """
+ self.temp_folder_path = None
+ """Temp file folder for downloading files
+ """
+ # Authentication Settings
+ self.api_key = {}
+ if api_key:
+ self.api_key = api_key
+ """dict to store API key(s)
+ """
+ self.api_key_prefix = {}
+ if api_key_prefix:
+ self.api_key_prefix = api_key_prefix
+ """dict to store API prefix (e.g. Bearer)
+ """
+ self.refresh_api_key_hook = None
+ """function hook to refresh API key if expired
+ """
+ self.username = username
+ """Username for HTTP basic authentication
+ """
+ self.password = password
+ """Password for HTTP basic authentication
+ """
+ self.access_token = access_token
+ """Access token
+ """
+ self.logger = {}
+ """Logging Settings
+ """
+ self.logger["package_logger"] = logging.getLogger("e2b.api.v1.client")
+ self.logger["urllib3_logger"] = logging.getLogger("urllib3")
+ self.logger_format = "%(asctime)s %(levelname)s %(message)s"
+ """Log format
+ """
+ self.logger_stream_handler = None
+ """Log stream handler
+ """
+ self.logger_file_handler = None
+ """Log file handler
+ """
+ self.logger_file = None
+ """Debug file location
+ """
+ self.debug = False
+ """Debug switch
+ """
+
+ self.verify_ssl = True
+ """SSL/TLS verification
+ Set this to false to skip verifying SSL certificate when calling API
+ from https server.
+ """
+ self.ssl_ca_cert = ssl_ca_cert
+ """Set this to customize the certificate file to verify the peer.
+ """
+ self.cert_file = None
+ """client certificate file
+ """
+ self.key_file = None
+ """client key file
+ """
+ self.assert_hostname = None
+ """Set this to True/False to enable/disable SSL hostname verification.
+ """
+ self.tls_server_name = None
+ """SSL/TLS Server Name Indication (SNI)
+ Set this to the SNI value expected by the server.
+ """
+
+ self.connection_pool_maxsize = 100
+ """This value is passed to the aiohttp to limit simultaneous connections.
+ Default values is 100, None means no-limit.
+ """
+
+ self.proxy = None
+ """Proxy URL
+ """
+ self.proxy_headers = None
+ """Proxy headers
+ """
+ self.safe_chars_for_path_param = ""
+ """Safe chars for path_param
+ """
+ self.retries = None
+ """Adding retries to override urllib3 default value 3
+ """
+ # Enable client side validation
+ self.client_side_validation = True
+
+ self.socket_options = None
+ """Options to pass down to the underlying urllib3 socket
+ """
+
+ self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z"
+ """datetime format
+ """
+
+ self.date_format = "%Y-%m-%d"
+ """date format
+ """
+
+ def __deepcopy__(self, memo):
+ cls = self.__class__
+ result = cls.__new__(cls)
+ memo[id(self)] = result
+ for k, v in self.__dict__.items():
+ if k not in ("logger", "logger_file_handler"):
+ setattr(result, k, copy.deepcopy(v, memo))
+ # shallow copy of loggers
+ result.logger = copy.copy(self.logger)
+ # use setters to configure loggers
+ result.logger_file = self.logger_file
+ result.debug = self.debug
+ return result
+
+ def __setattr__(self, name, value):
+ object.__setattr__(self, name, value)
+
+ @classmethod
+ def set_default(cls, default):
+ """Set default instance of configuration.
+
+ It stores default configuration, which can be
+ returned by get_default_copy method.
+
+ :param default: object of Configuration
+ """
+ cls._default = default
+
+ @classmethod
+ def get_default_copy(cls):
+ """Deprecated. Please use `get_default` instead.
+
+ Deprecated. Please use `get_default` instead.
+
+ :return: The configuration object.
+ """
+ return cls.get_default()
+
+ @classmethod
+ def get_default(cls):
+ """Return the default configuration.
+
+ This method returns newly created, based on default constructor,
+ object of Configuration class or returns a copy of default
+ configuration.
+
+ :return: The configuration object.
+ """
+ if cls._default is None:
+ cls._default = Configuration()
+ return cls._default
+
+ @property
+ def logger_file(self):
+ """The logger file.
+
+ If the logger_file is None, then add stream handler and remove file
+ handler. Otherwise, add file handler and remove stream handler.
+
+ :param value: The logger_file path.
+ :type: str
+ """
+ return self.__logger_file
+
+ @logger_file.setter
+ def logger_file(self, value):
+ """The logger file.
+
+ If the logger_file is None, then add stream handler and remove file
+ handler. Otherwise, add file handler and remove stream handler.
+
+ :param value: The logger_file path.
+ :type: str
+ """
+ self.__logger_file = value
+ if self.__logger_file:
+ # If set logging file,
+ # then add file handler and remove stream handler.
+ self.logger_file_handler = logging.FileHandler(self.__logger_file)
+ self.logger_file_handler.setFormatter(self.logger_formatter)
+ for _, logger in self.logger.items():
+ logger.addHandler(self.logger_file_handler)
+
+ @property
+ def debug(self):
+ """Debug status
+
+ :param value: The debug status, True or False.
+ :type: bool
+ """
+ return self.__debug
+
+ @debug.setter
+ def debug(self, value):
+ """Debug status
+
+ :param value: The debug status, True or False.
+ :type: bool
+ """
+ self.__debug = value
+ if self.__debug:
+ # if debug status is True, turn on debug logging
+ for _, logger in self.logger.items():
+ logger.setLevel(logging.DEBUG)
+ # turn on httplib debug
+ httplib.HTTPConnection.debuglevel = 1
+ else:
+ # if debug status is False, turn off debug logging,
+ # setting log level to default `logging.WARNING`
+ for _, logger in self.logger.items():
+ logger.setLevel(logging.WARNING)
+ # turn off httplib debug
+ httplib.HTTPConnection.debuglevel = 0
+
+ @property
+ def logger_format(self):
+ """The logger format.
+
+ The logger_formatter will be updated when sets logger_format.
+
+ :param value: The format string.
+ :type: str
+ """
+ return self.__logger_format
+
+ @logger_format.setter
+ def logger_format(self, value):
+ """The logger format.
+
+ The logger_formatter will be updated when sets logger_format.
+
+ :param value: The format string.
+ :type: str
+ """
+ self.__logger_format = value
+ self.logger_formatter = logging.Formatter(self.__logger_format)
+
+ def get_api_key_with_prefix(self, identifier, alias=None):
+ """Gets API key (with prefix if set).
+
+ :param identifier: The identifier of apiKey.
+ :param alias: The alternative identifier of apiKey.
+ :return: The token for api key authentication.
+ """
+ if self.refresh_api_key_hook is not None:
+ self.refresh_api_key_hook(self)
+ key = self.api_key.get(
+ identifier, self.api_key.get(alias) if alias is not None else None
+ )
+ if key:
+ prefix = self.api_key_prefix.get(identifier)
+ if prefix:
+ return "%s %s" % (prefix, key)
+ else:
+ return key
+
+ def get_basic_auth_token(self):
+ """Gets HTTP basic authentication header (string).
+
+ :return: The token for basic HTTP authentication.
+ """
+ username = ""
+ if self.username is not None:
+ username = self.username
+ password = ""
+ if self.password is not None:
+ password = self.password
+ return urllib3.util.make_headers(basic_auth=username + ":" + password).get(
+ "authorization"
+ )
+
+ def auth_settings(self):
+ """Gets Auth Settings dict for api client.
+
+ :return: The Auth Settings information dict.
+ """
+ auth = {}
+ if "ApiKeyAuth" in self.api_key:
+ auth["ApiKeyAuth"] = {
+ "type": "api_key",
+ "in": "query",
+ "key": "api_key",
+ "value": self.get_api_key_with_prefix(
+ "ApiKeyAuth",
+ ),
+ }
+ return auth
+
+ def to_debug_report(self):
+ """Gets the essential information for debugging.
+
+ :return: The report for debugging.
+ """
+ return (
+ "Python SDK Debug Report:\n"
+ "OS: {env}\n"
+ "Python Version: {pyversion}\n"
+ "Version of the API: 1.0.0\n"
+ "SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version)
+ )
+
+ def get_host_settings(self):
+ """Gets an array of host settings
+
+ :return: An array of host settings
+ """
+ return [
+ {
+ "url": "https://ondevbook.com",
+ "description": "API endpoint",
+ },
+ {
+ "url": "https://{sessionID}-{clientID}.ondevbook.com",
+ "description": "Session endpoint without a specified port",
+ "variables": {
+ "sessionID": {
+ "description": "ID of the session",
+ "default_value": "_sessionID",
+ },
+ "clientID": {
+ "description": "ID of the client",
+ "default_value": "_clientID",
+ },
+ },
+ },
+ {
+ "url": "https://{port}-{sessionID}-{clientID}.ondevbook.com",
+ "description": "Session endpoint with a specificed port",
+ "variables": {
+ "sessionID": {
+ "description": "ID of the session",
+ "default_value": "_sessionID",
+ },
+ "clientID": {
+ "description": "ID of the client",
+ "default_value": "_clientID",
+ },
+ "port": {
+ "description": "Devbook Daemon default port",
+ "default_value": "49982",
+ },
+ },
+ },
+ ]
+
+ def get_host_from_settings(self, index, variables=None, servers=None):
+ """Gets host URL based on the index and variables
+ :param index: array index of the host settings
+ :param variables: hash of variable and the corresponding value
+ :param servers: an array of host settings or None
+ :return: URL based on host settings
+ """
+ if index is None:
+ return self._base_path
+
+ variables = {} if variables is None else variables
+ servers = self.get_host_settings() if servers is None else servers
+
+ try:
+ server = servers[index]
+ except IndexError:
+ raise ValueError(
+ "Invalid index {0} when selecting the host settings. "
+ "Must be less than {1}".format(index, len(servers))
+ )
+
+ url = server["url"]
+
+ # go through variables and replace placeholders
+ for variable_name, variable in server.get("variables", {}).items():
+ used_value = variables.get(variable_name, variable["default_value"])
+
+ if "enum_values" in variable and used_value not in variable["enum_values"]:
+ raise ValueError(
+ "The variable `{0}` in the host URL has invalid value "
+ "{1}. Must be {2}.".format(
+ variable_name, variables[variable_name], variable["enum_values"]
+ )
+ )
+
+ url = url.replace("{" + variable_name + "}", used_value)
+
+ return url
+
+ @property
+ def host(self):
+ """Return generated host."""
+ return self.get_host_from_settings(
+ self.server_index, variables=self.server_variables
+ )
+
+ @host.setter
+ def host(self, value):
+ """Fix base path."""
+ self._base_path = value
+ self.server_index = None
diff --git a/packages/python-sdk/e2b/api/v1/client/exceptions.py b/packages/python-sdk/e2b/api/v1/client/exceptions.py
new file mode 100644
index 000000000..442c03e60
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/exceptions.py
@@ -0,0 +1,154 @@
+# coding: utf-8
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+class OpenApiException(Exception):
+ """The base exception class for all OpenAPIExceptions"""
+
+
+class ApiTypeError(OpenApiException, TypeError):
+ def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None):
+ """Raises an exception for TypeErrors
+
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (list): a list of keys an indices to get to the
+ current_item
+ None if unset
+ valid_classes (tuple): the primitive classes that current item
+ should be an instance of
+ None if unset
+ key_type (bool): False if our value is a value in a dict
+ True if it is a key in a dict
+ False if our item is an item in a list
+ None if unset
+ """
+ self.path_to_item = path_to_item
+ self.valid_classes = valid_classes
+ self.key_type = key_type
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiTypeError, self).__init__(full_msg)
+
+
+class ApiValueError(OpenApiException, ValueError):
+ def __init__(self, msg, path_to_item=None):
+ """
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (list) the path to the exception in the
+ received_data dict. None if unset
+ """
+
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiValueError, self).__init__(full_msg)
+
+
+class ApiAttributeError(OpenApiException, AttributeError):
+ def __init__(self, msg, path_to_item=None):
+ """
+ Raised when an attribute reference or assignment fails.
+
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (None/list) the path to the exception in the
+ received_data dict
+ """
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiAttributeError, self).__init__(full_msg)
+
+
+class ApiKeyError(OpenApiException, KeyError):
+ def __init__(self, msg, path_to_item=None):
+ """
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (None/list) the path to the exception in the
+ received_data dict
+ """
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiKeyError, self).__init__(full_msg)
+
+
+class ApiException(OpenApiException):
+ def __init__(self, status=None, reason=None, http_resp=None):
+ if http_resp:
+ self.status = http_resp.status
+ self.reason = http_resp.reason
+ self.body = http_resp.data
+ self.headers = http_resp.getheaders()
+ else:
+ self.status = status
+ self.reason = reason
+ self.body = None
+ self.headers = None
+
+ def __str__(self):
+ """Custom error messages for exception"""
+ error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason)
+ if self.headers:
+ error_message += "HTTP response headers: {0}\n".format(self.headers)
+
+ if self.body:
+ error_message += "HTTP response body: {0}\n".format(self.body)
+
+ return error_message
+
+
+class NotFoundException(ApiException):
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(NotFoundException, self).__init__(status, reason, http_resp)
+
+
+class UnauthorizedException(ApiException):
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(UnauthorizedException, self).__init__(status, reason, http_resp)
+
+
+class ForbiddenException(ApiException):
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(ForbiddenException, self).__init__(status, reason, http_resp)
+
+
+class ServiceException(ApiException):
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(ServiceException, self).__init__(status, reason, http_resp)
+
+
+def render_path(path_to_item):
+ """Returns a string representation of a path"""
+ result = ""
+ for pth in path_to_item:
+ if isinstance(pth, int):
+ result += "[{0}]".format(pth)
+ else:
+ result += "['{0}']".format(pth)
+ return result
diff --git a/packages/python-sdk/e2b/api/v1/client/models/__init__.py b/packages/python-sdk/e2b/api/v1/client/models/__init__.py
new file mode 100644
index 000000000..964598998
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/models/__init__.py
@@ -0,0 +1,29 @@
+# coding: utf-8
+
+# flake8: noqa
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+# import models into model package
+from e2b.api.v1.client.models.environment import Environment
+from e2b.api.v1.client.models.environment_state import EnvironmentState
+from e2b.api.v1.client.models.environment_state_update import EnvironmentStateUpdate
+from e2b.api.v1.client.models.environment_title_update import EnvironmentTitleUpdate
+from e2b.api.v1.client.models.envs_get200_response_inner import EnvsGet200ResponseInner
+from e2b.api.v1.client.models.error import Error
+from e2b.api.v1.client.models.new_environment import NewEnvironment
+from e2b.api.v1.client.models.new_session import NewSession
+from e2b.api.v1.client.models.session import Session
+from e2b.api.v1.client.models.sessions_get200_response_inner import (
+ SessionsGet200ResponseInner,
+)
+from e2b.api.v1.client.models.template import Template
diff --git a/packages/python-sdk/e2b/api/v1/client/models/environment.py b/packages/python-sdk/e2b/api/v1/client/models/environment.py
new file mode 100644
index 000000000..42b722466
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/models/environment.py
@@ -0,0 +1,83 @@
+# coding: utf-8
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr
+
+
+class Environment(BaseModel):
+ """
+ Environment
+ """
+
+ id: StrictStr = Field(...)
+ template: Optional[StrictStr] = None
+ title: Optional[StrictStr] = None
+ __properties = ["id", "template", "title"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Environment:
+ """Create an instance of Environment from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Environment:
+ """Create an instance of Environment from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return Environment.parse_obj(obj)
+
+ # raise errors for additional fields in the input
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ raise ValueError(
+ "Error due to additional fields (not defined in Environment) in the input: "
+ + obj
+ )
+
+ _obj = Environment.parse_obj(
+ {
+ "id": obj.get("id"),
+ "template": obj.get("template"),
+ "title": obj.get("title"),
+ }
+ )
+ return _obj
diff --git a/packages/python-sdk/e2b/api/v1/client/models/environment_state.py b/packages/python-sdk/e2b/api/v1/client/models/environment_state.py
new file mode 100644
index 000000000..0674e93a0
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/models/environment_state.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+class EnvironmentState(str, Enum):
+ """
+ EnvironmentState
+ """
+
+ """
+ allowed enum values
+ """
+ BUILDING = "Building"
+ FAILED = "Failed"
+ DONE = "Done"
+
+ @classmethod
+ def from_json(cls, json_str: str) -> EnvironmentState:
+ """Create an instance of EnvironmentState from a JSON string"""
+ return EnvironmentState(json.loads(json_str))
diff --git a/packages/python-sdk/e2b/api/v1/client/models/environment_state_update.py b/packages/python-sdk/e2b/api/v1/client/models/environment_state_update.py
new file mode 100644
index 000000000..84adc9f33
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/models/environment_state_update.py
@@ -0,0 +1,75 @@
+# coding: utf-8
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from pydantic import BaseModel, Field
+from e2b.api.v1.client.models.environment_state import EnvironmentState
+
+
+class EnvironmentStateUpdate(BaseModel):
+ """
+ EnvironmentStateUpdate
+ """
+
+ state: EnvironmentState = Field(...)
+ __properties = ["state"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> EnvironmentStateUpdate:
+ """Create an instance of EnvironmentStateUpdate from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> EnvironmentStateUpdate:
+ """Create an instance of EnvironmentStateUpdate from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return EnvironmentStateUpdate.parse_obj(obj)
+
+ # raise errors for additional fields in the input
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ raise ValueError(
+ "Error due to additional fields (not defined in EnvironmentStateUpdate) in the input: "
+ + obj
+ )
+
+ _obj = EnvironmentStateUpdate.parse_obj({"state": obj.get("state")})
+ return _obj
diff --git a/packages/python-sdk/e2b/api/v1/client/models/environment_title_update.py b/packages/python-sdk/e2b/api/v1/client/models/environment_title_update.py
new file mode 100644
index 000000000..4bee57af1
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/models/environment_title_update.py
@@ -0,0 +1,75 @@
+# coding: utf-8
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictStr
+
+
+class EnvironmentTitleUpdate(BaseModel):
+ """
+ EnvironmentTitleUpdate
+ """
+
+ title: Optional[StrictStr] = None
+ __properties = ["title"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> EnvironmentTitleUpdate:
+ """Create an instance of EnvironmentTitleUpdate from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> EnvironmentTitleUpdate:
+ """Create an instance of EnvironmentTitleUpdate from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return EnvironmentTitleUpdate.parse_obj(obj)
+
+ # raise errors for additional fields in the input
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ raise ValueError(
+ "Error due to additional fields (not defined in EnvironmentTitleUpdate) in the input: "
+ + obj
+ )
+
+ _obj = EnvironmentTitleUpdate.parse_obj({"title": obj.get("title")})
+ return _obj
diff --git a/packages/python-sdk/e2b/api/v1/client/models/envs_get200_response_inner.py b/packages/python-sdk/e2b/api/v1/client/models/envs_get200_response_inner.py
new file mode 100644
index 000000000..0596a79f2
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/models/envs_get200_response_inner.py
@@ -0,0 +1,83 @@
+# coding: utf-8
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr
+
+
+class EnvsGet200ResponseInner(BaseModel):
+ """
+ EnvsGet200ResponseInner
+ """
+
+ id: StrictStr = Field(...)
+ template: Optional[StrictStr] = None
+ title: Optional[StrictStr] = None
+ __properties = ["id", "template", "title"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> EnvsGet200ResponseInner:
+ """Create an instance of EnvsGet200ResponseInner from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> EnvsGet200ResponseInner:
+ """Create an instance of EnvsGet200ResponseInner from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return EnvsGet200ResponseInner.parse_obj(obj)
+
+ # raise errors for additional fields in the input
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ raise ValueError(
+ "Error due to additional fields (not defined in EnvsGet200ResponseInner) in the input: "
+ + obj
+ )
+
+ _obj = EnvsGet200ResponseInner.parse_obj(
+ {
+ "id": obj.get("id"),
+ "template": obj.get("template"),
+ "title": obj.get("title"),
+ }
+ )
+ return _obj
diff --git a/packages/python-sdk/e2b/api/v1/client/models/error.py b/packages/python-sdk/e2b/api/v1/client/models/error.py
new file mode 100644
index 000000000..f5520fe65
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/models/error.py
@@ -0,0 +1,75 @@
+# coding: utf-8
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from pydantic import BaseModel, Field, StrictInt, StrictStr
+
+
+class Error(BaseModel):
+ """
+ Error
+ """
+
+ code: StrictInt = Field(..., description="Error code")
+ message: StrictStr = Field(..., description="Error")
+ __properties = ["code", "message"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Error:
+ """Create an instance of Error from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Error:
+ """Create an instance of Error from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return Error.parse_obj(obj)
+
+ # raise errors for additional fields in the input
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ raise ValueError(
+ "Error due to additional fields (not defined in Error) in the input: "
+ + obj
+ )
+
+ _obj = Error.parse_obj({"code": obj.get("code"), "message": obj.get("message")})
+ return _obj
diff --git a/packages/python-sdk/e2b/api/v1/client/models/new_environment.py b/packages/python-sdk/e2b/api/v1/client/models/new_environment.py
new file mode 100644
index 000000000..d8b17d845
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/models/new_environment.py
@@ -0,0 +1,78 @@
+# coding: utf-8
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr
+
+
+class NewEnvironment(BaseModel):
+ """
+ NewEnvironment
+ """
+
+ title: Optional[StrictStr] = None
+ template: StrictStr = Field(...)
+ __properties = ["title", "template"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> NewEnvironment:
+ """Create an instance of NewEnvironment from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> NewEnvironment:
+ """Create an instance of NewEnvironment from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return NewEnvironment.parse_obj(obj)
+
+ # raise errors for additional fields in the input
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ raise ValueError(
+ "Error due to additional fields (not defined in NewEnvironment) in the input: "
+ + obj
+ )
+
+ _obj = NewEnvironment.parse_obj(
+ {"title": obj.get("title"), "template": obj.get("template")}
+ )
+ return _obj
diff --git a/packages/python-sdk/e2b/api/v1/client/models/new_session.py b/packages/python-sdk/e2b/api/v1/client/models/new_session.py
new file mode 100644
index 000000000..23e0e4c35
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/models/new_session.py
@@ -0,0 +1,91 @@
+# coding: utf-8
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictBool, StrictStr
+
+
+class NewSession(BaseModel):
+ """
+ NewSession
+ """
+
+ edit_enabled: Optional[StrictBool] = Field(
+ False,
+ alias="editEnabled",
+ description="Option determining if the session is a shared persistent edit session",
+ )
+ code_snippet_id: StrictStr = Field(
+ ...,
+ alias="codeSnippetID",
+ description="Identifier of a code snippet which which is the environment associated",
+ )
+ __properties = ["editEnabled", "codeSnippetID"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> NewSession:
+ """Create an instance of NewSession from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> NewSession:
+ """Create an instance of NewSession from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return NewSession.parse_obj(obj)
+
+ # raise errors for additional fields in the input
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ raise ValueError(
+ "Error due to additional fields (not defined in NewSession) in the input: "
+ + obj
+ )
+
+ _obj = NewSession.parse_obj(
+ {
+ "edit_enabled": obj.get("editEnabled")
+ if obj.get("editEnabled") is not None
+ else False,
+ "code_snippet_id": obj.get("codeSnippetID"),
+ }
+ )
+ return _obj
diff --git a/packages/python-sdk/e2b/api/v1/client/models/session.py b/packages/python-sdk/e2b/api/v1/client/models/session.py
new file mode 100644
index 000000000..caca7dd75
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/models/session.py
@@ -0,0 +1,96 @@
+# coding: utf-8
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from pydantic import BaseModel, Field, StrictBool, StrictStr
+
+
+class Session(BaseModel):
+ """
+ Session
+ """
+
+ code_snippet_id: StrictStr = Field(
+ ...,
+ alias="codeSnippetID",
+ description="Identifier of a code snippet which which is the environment associated",
+ )
+ edit_enabled: StrictBool = Field(
+ ...,
+ alias="editEnabled",
+ description="Information if the session is a shared persistent edit session",
+ )
+ session_id: StrictStr = Field(
+ ..., alias="sessionID", description="Identifier of the session"
+ )
+ client_id: StrictStr = Field(
+ ..., alias="clientID", description="Identifier of the client"
+ )
+ __properties = ["codeSnippetID", "editEnabled", "sessionID", "clientID"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Session:
+ """Create an instance of Session from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Session:
+ """Create an instance of Session from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return Session.parse_obj(obj)
+
+ # raise errors for additional fields in the input
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ raise ValueError(
+ "Error due to additional fields (not defined in Session) in the input: "
+ + obj
+ )
+
+ _obj = Session.parse_obj(
+ {
+ "code_snippet_id": obj.get("codeSnippetID"),
+ "edit_enabled": obj.get("editEnabled"),
+ "session_id": obj.get("sessionID"),
+ "client_id": obj.get("clientID"),
+ }
+ )
+ return _obj
diff --git a/packages/python-sdk/e2b/api/v1/client/models/sessions_get200_response_inner.py b/packages/python-sdk/e2b/api/v1/client/models/sessions_get200_response_inner.py
new file mode 100644
index 000000000..9f451a51b
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/models/sessions_get200_response_inner.py
@@ -0,0 +1,96 @@
+# coding: utf-8
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from pydantic import BaseModel, Field, StrictBool, StrictStr
+
+
+class SessionsGet200ResponseInner(BaseModel):
+ """
+ SessionsGet200ResponseInner
+ """
+
+ code_snippet_id: StrictStr = Field(
+ ...,
+ alias="codeSnippetID",
+ description="Identifier of a code snippet which which is the environment associated",
+ )
+ edit_enabled: StrictBool = Field(
+ ...,
+ alias="editEnabled",
+ description="Information if the session is a shared persistent edit session",
+ )
+ session_id: StrictStr = Field(
+ ..., alias="sessionID", description="Identifier of the session"
+ )
+ client_id: StrictStr = Field(
+ ..., alias="clientID", description="Identifier of the client"
+ )
+ __properties = ["codeSnippetID", "editEnabled", "sessionID", "clientID"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> SessionsGet200ResponseInner:
+ """Create an instance of SessionsGet200ResponseInner from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> SessionsGet200ResponseInner:
+ """Create an instance of SessionsGet200ResponseInner from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return SessionsGet200ResponseInner.parse_obj(obj)
+
+ # raise errors for additional fields in the input
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ raise ValueError(
+ "Error due to additional fields (not defined in SessionsGet200ResponseInner) in the input: "
+ + obj
+ )
+
+ _obj = SessionsGet200ResponseInner.parse_obj(
+ {
+ "code_snippet_id": obj.get("codeSnippetID"),
+ "edit_enabled": obj.get("editEnabled"),
+ "session_id": obj.get("sessionID"),
+ "client_id": obj.get("clientID"),
+ }
+ )
+ return _obj
diff --git a/packages/python-sdk/e2b/api/v1/client/models/template.py b/packages/python-sdk/e2b/api/v1/client/models/template.py
new file mode 100644
index 000000000..daa6a22b8
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/models/template.py
@@ -0,0 +1,42 @@
+# coding: utf-8
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+class Template(str, Enum):
+ """
+ Template
+ """
+
+ """
+ allowed enum values
+ """
+ NODEJS = "Nodejs"
+ GO = "Go"
+ BASH = "Bash"
+ RUST = "Rust"
+ PYTHON3 = "Python3"
+ PHP = "PHP"
+ JAVA = "Java"
+ PERL = "Perl"
+ DOTNET = "DotNET"
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Template:
+ """Create an instance of Template from a JSON string"""
+ return Template(json.loads(json_str))
diff --git a/packages/python-sdk/e2b/api/v1/client/rest.py b/packages/python-sdk/e2b/api/v1/client/rest.py
new file mode 100644
index 000000000..1b9ff0eba
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client/rest.py
@@ -0,0 +1,311 @@
+# coding: utf-8
+
+"""
+ Devbook
+
+ Devbook API # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+"""
+
+
+import io
+import json
+import logging
+import re
+import ssl
+
+import aiohttp
+from urllib.parse import urlencode, quote_plus
+
+from e2b.api.v1.client.exceptions import ApiException, ApiValueError
+
+logger = logging.getLogger(__name__)
+
+
+class RESTResponse(io.IOBase):
+ def __init__(self, resp, data):
+ self.aiohttp_response = resp
+ self.status = resp.status
+ self.reason = resp.reason
+ self.data = data
+
+ def getheaders(self):
+ """Returns a CIMultiDictProxy of the response headers."""
+ return self.aiohttp_response.headers
+
+ def getheader(self, name, default=None):
+ """Returns a given response header."""
+ return self.aiohttp_response.headers.get(name, default)
+
+
+class RESTClientObject(object):
+ def __init__(self, configuration, pools_size=4, maxsize=None):
+ # maxsize is number of requests to host that are allowed in parallel
+ if maxsize is None:
+ maxsize = configuration.connection_pool_maxsize
+
+ ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert)
+ if configuration.cert_file:
+ ssl_context.load_cert_chain(
+ configuration.cert_file, keyfile=configuration.key_file
+ )
+
+ if not configuration.verify_ssl:
+ ssl_context.check_hostname = False
+ ssl_context.verify_mode = ssl.CERT_NONE
+
+ connector = aiohttp.TCPConnector(limit=maxsize, ssl=ssl_context)
+
+ self.proxy = configuration.proxy
+ self.proxy_headers = configuration.proxy_headers
+
+ # https pool manager
+ self.pool_manager = aiohttp.ClientSession(connector=connector, trust_env=True)
+
+ async def close(self):
+ await self.pool_manager.close()
+
+ async def request(
+ self,
+ method,
+ url,
+ query_params=None,
+ headers=None,
+ body=None,
+ post_params=None,
+ _preload_content=True,
+ _request_timeout=None,
+ ):
+ """Execute request
+
+ :param method: http request method
+ :param url: http request url
+ :param query_params: query parameters in the url
+ :param headers: http request headers
+ :param body: request json body, for `application/json`
+ :param post_params: request post parameters,
+ `application/x-www-form-urlencoded`
+ and `multipart/form-data`
+ :param _preload_content: this is a non-applicable field for
+ the AiohttpClient.
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ """
+ method = method.upper()
+ assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"]
+
+ if post_params and body:
+ raise ApiValueError(
+ "body parameter cannot be used with post_params parameter."
+ )
+
+ post_params = post_params or {}
+ headers = headers or {}
+ # url already contains the URL query string
+ # so reset query_params to empty dict
+ query_params = {}
+ timeout = _request_timeout or 5 * 60
+
+ if "Content-Type" not in headers:
+ headers["Content-Type"] = "application/json"
+
+ args = {"method": method, "url": url, "timeout": timeout, "headers": headers}
+
+ if self.proxy:
+ args["proxy"] = self.proxy
+ if self.proxy_headers:
+ args["proxy_headers"] = self.proxy_headers
+
+ if query_params:
+ args["url"] += "?" + urlencode(query_params)
+
+ # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
+ if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]:
+ if re.search("json", headers["Content-Type"], re.IGNORECASE):
+ if body is not None:
+ body = json.dumps(body)
+ args["data"] = body
+ elif (
+ headers["Content-Type"] == "application/x-www-form-urlencoded"
+ ): # noqa: E501
+ args["data"] = aiohttp.FormData(post_params)
+ elif headers["Content-Type"] == "multipart/form-data":
+ # must del headers['Content-Type'], or the correct
+ # Content-Type which generated by aiohttp
+ del headers["Content-Type"]
+ data = aiohttp.FormData()
+ for param in post_params:
+ k, v = param
+ if isinstance(v, tuple) and len(v) == 3:
+ data.add_field(k, value=v[1], filename=v[0], content_type=v[2])
+ else:
+ data.add_field(k, v)
+ args["data"] = data
+
+ # Pass a `bytes` parameter directly in the body to support
+ # other content types than Json when `body` argument is provided
+ # in serialized form
+ elif isinstance(body, bytes):
+ args["data"] = body
+ else:
+ # Cannot generate the request from given parameters
+ msg = """Cannot prepare a request message for provided
+ arguments. Please check that your arguments match
+ declared content type."""
+ raise ApiException(status=0, reason=msg)
+
+ r = await self.pool_manager.request(**args)
+ if _preload_content:
+ data = await r.read()
+ r = RESTResponse(r, data)
+
+ # log response body
+ logger.debug("response body: %s", r.data)
+
+ if not 200 <= r.status <= 299:
+ raise ApiException(http_resp=r)
+
+ return r
+
+ async def get_request(
+ self,
+ url,
+ headers=None,
+ query_params=None,
+ _preload_content=True,
+ _request_timeout=None,
+ ):
+ return await self.request(
+ "GET",
+ url,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ query_params=query_params,
+ )
+
+ async def head_request(
+ self,
+ url,
+ headers=None,
+ query_params=None,
+ _preload_content=True,
+ _request_timeout=None,
+ ):
+ return await self.request(
+ "HEAD",
+ url,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ query_params=query_params,
+ )
+
+ async def options_request(
+ self,
+ url,
+ headers=None,
+ query_params=None,
+ post_params=None,
+ body=None,
+ _preload_content=True,
+ _request_timeout=None,
+ ):
+ return await self.request(
+ "OPTIONS",
+ url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body,
+ )
+
+ async def delete_request(
+ self,
+ url,
+ headers=None,
+ query_params=None,
+ body=None,
+ _preload_content=True,
+ _request_timeout=None,
+ ):
+ return await self.request(
+ "DELETE",
+ url,
+ headers=headers,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body,
+ )
+
+ async def post_request(
+ self,
+ url,
+ headers=None,
+ query_params=None,
+ post_params=None,
+ body=None,
+ _preload_content=True,
+ _request_timeout=None,
+ ):
+ return await self.request(
+ "POST",
+ url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body,
+ )
+
+ async def put_request(
+ self,
+ url,
+ headers=None,
+ query_params=None,
+ post_params=None,
+ body=None,
+ _preload_content=True,
+ _request_timeout=None,
+ ):
+ return await self.request(
+ "PUT",
+ url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body,
+ )
+
+ async def patch_request(
+ self,
+ url,
+ headers=None,
+ query_params=None,
+ post_params=None,
+ body=None,
+ _preload_content=True,
+ _request_timeout=None,
+ ):
+ return await self.request(
+ "PATCH",
+ url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body,
+ )
diff --git a/packages/python-sdk/e2b/api/v1/client_README.md b/packages/python-sdk/e2b/api/v1/client_README.md
new file mode 100644
index 000000000..b8b83e196
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v1/client_README.md
@@ -0,0 +1,110 @@
+# e2b.api.v1.client
+Devbook API
+
+The `e2b.api.v1.client` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
+
+- API version: 1.0.0
+- Package version: 1.0.0
+- Build package: org.openapitools.codegen.languages.PythonNextgenClientCodegen
+
+## Requirements.
+
+Python 3.7+
+
+## Installation & Usage
+
+This python library package is generated without supporting files like setup.py or requirements files
+
+To be able to use it, you will need these dependencies in your own package that uses this library:
+
+* urllib3 >= 1.25.3
+* python-dateutil
+* aiohttp
+* pydantic
+* aenum
+
+## Getting Started
+
+In your own code, to use this library to connect and interact with e2b.api.v1.client,
+you can run the following:
+
+```python
+
+import time
+import e2b.api.v1.client
+from e2b.api.v1.client.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to https://ondevbook.com
+# See configuration.py for a list of all supported configuration parameters.
+configuration = e2b.api.v1.client.Configuration(
+ host = "https://ondevbook.com"
+)
+
+
+
+# Enter a context with an instance of the API client
+async with e2b.api.v1.client.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = e2b.api.v1.client.DefaultApi(api_client)
+
+ try:
+ await api_instance.health_get()
+ except ApiException as e:
+ print("Exception when calling DefaultApi->health_get: %s\n" % e)
+
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *https://ondevbook.com*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*DefaultApi* | [**health_get**](e2b/api/v1/client/docs/DefaultApi.md#health_get) | **GET** /health |
+*EnvsApi* | [**envs_code_snippet_id_delete**](e2b/api/v1/client/docs/EnvsApi.md#envs_code_snippet_id_delete) | **DELETE** /envs/{codeSnippetID} |
+*EnvsApi* | [**envs_code_snippet_id_patch**](e2b/api/v1/client/docs/EnvsApi.md#envs_code_snippet_id_patch) | **PATCH** /envs/{codeSnippetID} |
+*EnvsApi* | [**envs_code_snippet_id_post**](e2b/api/v1/client/docs/EnvsApi.md#envs_code_snippet_id_post) | **POST** /envs/{codeSnippetID} |
+*EnvsApi* | [**envs_code_snippet_id_state_put**](e2b/api/v1/client/docs/EnvsApi.md#envs_code_snippet_id_state_put) | **PUT** /envs/{codeSnippetID}/state |
+*EnvsApi* | [**envs_code_snippet_id_title_put**](e2b/api/v1/client/docs/EnvsApi.md#envs_code_snippet_id_title_put) | **PUT** /envs/{codeSnippetID}/title |
+*EnvsApi* | [**envs_get**](e2b/api/v1/client/docs/EnvsApi.md#envs_get) | **GET** /envs |
+*EnvsApi* | [**envs_post**](e2b/api/v1/client/docs/EnvsApi.md#envs_post) | **POST** /envs |
+*SessionsApi* | [**sessions_get**](e2b/api/v1/client/docs/SessionsApi.md#sessions_get) | **GET** /sessions |
+*SessionsApi* | [**sessions_post**](e2b/api/v1/client/docs/SessionsApi.md#sessions_post) | **POST** /sessions |
+*SessionsApi* | [**sessions_session_id_delete**](e2b/api/v1/client/docs/SessionsApi.md#sessions_session_id_delete) | **DELETE** /sessions/{sessionID} |
+*SessionsApi* | [**sessions_session_id_refresh_post**](e2b/api/v1/client/docs/SessionsApi.md#sessions_session_id_refresh_post) | **POST** /sessions/{sessionID}/refresh |
+
+
+## Documentation For Models
+
+ - [Environment](e2b/api/v1/client/docs/Environment.md)
+ - [EnvironmentState](e2b/api/v1/client/docs/EnvironmentState.md)
+ - [EnvironmentStateUpdate](e2b/api/v1/client/docs/EnvironmentStateUpdate.md)
+ - [EnvironmentTitleUpdate](e2b/api/v1/client/docs/EnvironmentTitleUpdate.md)
+ - [EnvsGet200ResponseInner](e2b/api/v1/client/docs/EnvsGet200ResponseInner.md)
+ - [Error](e2b/api/v1/client/docs/Error.md)
+ - [NewEnvironment](e2b/api/v1/client/docs/NewEnvironment.md)
+ - [NewSession](e2b/api/v1/client/docs/NewSession.md)
+ - [Session](e2b/api/v1/client/docs/Session.md)
+ - [SessionsGet200ResponseInner](e2b/api/v1/client/docs/SessionsGet200ResponseInner.md)
+ - [Template](e2b/api/v1/client/docs/Template.md)
+
+
+<a id="documentation-for-authorization"></a>
+## Documentation For Authorization
+
+
+Authentication schemes defined for the API:
+<a id="ApiKeyAuth"></a>
+### ApiKeyAuth
+
+- **Type**: API key
+- **API key parameter name**: api_key
+- **Location**: URL query string
+
+
+## Author
+
+
+
+
diff --git a/packages/python-sdk/e2b/api/v2/__init__.py b/packages/python-sdk/e2b/api/v2/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/packages/python-sdk/e2b/api/v2/client/__init__.py b/packages/python-sdk/e2b/api/v2/client/__init__.py
new file mode 100644
index 000000000..e93d907f1
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v2/client/__init__.py
@@ -0,0 +1,44 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+ Devbook
+
+ Devbook API
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+__version__ = "1.0.0"
+
+# import apis into sdk package
+from e2b.api.v2.client.api.default_api import DefaultApi
+from e2b.api.v2.client.api.envs_api import EnvsApi
+from e2b.api.v2.client.api.sessions_api import SessionsApi
+
+# import ApiClient
+from e2b.api.v2.client.api_response import ApiResponse
+from e2b.api.v2.client.api_client import ApiClient
+from e2b.api.v2.client.configuration import Configuration
+from e2b.api.v2.client.exceptions import OpenApiException
+from e2b.api.v2.client.exceptions import ApiTypeError
+from e2b.api.v2.client.exceptions import ApiValueError
+from e2b.api.v2.client.exceptions import ApiKeyError
+from e2b.api.v2.client.exceptions import ApiAttributeError
+from e2b.api.v2.client.exceptions import ApiException
+
+# import models into sdk package
+from e2b.api.v2.client.models.environment import Environment
+from e2b.api.v2.client.models.environment_state import EnvironmentState
+from e2b.api.v2.client.models.environment_state_update import EnvironmentStateUpdate
+from e2b.api.v2.client.models.environment_title_update import EnvironmentTitleUpdate
+from e2b.api.v2.client.models.error import Error
+from e2b.api.v2.client.models.new_environment import NewEnvironment
+from e2b.api.v2.client.models.new_session import NewSession
+from e2b.api.v2.client.models.session import Session
+from e2b.api.v2.client.models.template import Template
diff --git a/packages/python-sdk/e2b/api/v2/client/api/__init__.py b/packages/python-sdk/e2b/api/v2/client/api/__init__.py
new file mode 100644
index 000000000..bb625a8f4
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v2/client/api/__init__.py
@@ -0,0 +1,6 @@
+# flake8: noqa
+
+# import apis into api package
+from e2b.api.v2.client.api.default_api import DefaultApi
+from e2b.api.v2.client.api.envs_api import EnvsApi
+from e2b.api.v2.client.api.sessions_api import SessionsApi
diff --git a/packages/python-sdk/e2b/api/client/api/default_api.py b/packages/python-sdk/e2b/api/v2/client/api/default_api.py
similarity index 97%
rename from packages/python-sdk/e2b/api/client/api/default_api.py
rename to packages/python-sdk/e2b/api/v2/client/api/default_api.py
index cb769ea3b..687e35e19 100644
--- a/packages/python-sdk/e2b/api/client/api/default_api.py
+++ b/packages/python-sdk/e2b/api/v2/client/api/default_api.py
@@ -21,9 +21,9 @@ from typing_extensions import Annotated
from typing import overload, Optional, Union, Awaitable
-from e2b.api.client.api_client import ApiClient
-from e2b.api.client.api_response import ApiResponse
-from e2b.api.client.exceptions import ApiTypeError, ApiValueError # noqa: F401
+from e2b.api.v2.client.api_client import ApiClient
+from e2b.api.v2.client.api_response import ApiResponse
+from e2b.api.v2.client.exceptions import ApiTypeError, ApiValueError # noqa: F401
class DefaultApi:
diff --git a/packages/python-sdk/e2b/api/client/api/envs_api.py b/packages/python-sdk/e2b/api/v2/client/api/envs_api.py
similarity index 99%
rename from packages/python-sdk/e2b/api/client/api/envs_api.py
rename to packages/python-sdk/e2b/api/v2/client/api/envs_api.py
index 192086614..d8099fd8a 100644
--- a/packages/python-sdk/e2b/api/client/api/envs_api.py
+++ b/packages/python-sdk/e2b/api/v2/client/api/envs_api.py
@@ -24,14 +24,14 @@ from pydantic import StrictStr
from typing import List
-from e2b.api.client.models.environment import Environment
-from e2b.api.client.models.environment_state_update import EnvironmentStateUpdate
-from e2b.api.client.models.environment_title_update import EnvironmentTitleUpdate
-from e2b.api.client.models.new_environment import NewEnvironment
-
-from e2b.api.client.api_client import ApiClient
-from e2b.api.client.api_response import ApiResponse
-from e2b.api.client.exceptions import ApiTypeError, ApiValueError # noqa: F401
+from e2b.api.v2.client.models.environment import Environment
+from e2b.api.v2.client.models.environment_state_update import EnvironmentStateUpdate
+from e2b.api.v2.client.models.environment_title_update import EnvironmentTitleUpdate
+from e2b.api.v2.client.models.new_environment import NewEnvironment
+
+from e2b.api.v2.client.api_client import ApiClient
+from e2b.api.v2.client.api_response import ApiResponse
+from e2b.api.v2.client.exceptions import ApiTypeError, ApiValueError # noqa: F401
class EnvsApi:
diff --git a/packages/python-sdk/e2b/api/client/api/sessions_api.py b/packages/python-sdk/e2b/api/v2/client/api/sessions_api.py
similarity index 98%
rename from packages/python-sdk/e2b/api/client/api/sessions_api.py
rename to packages/python-sdk/e2b/api/v2/client/api/sessions_api.py
index 04bde092f..47031b9ef 100644
--- a/packages/python-sdk/e2b/api/client/api/sessions_api.py
+++ b/packages/python-sdk/e2b/api/v2/client/api/sessions_api.py
@@ -24,12 +24,12 @@ from pydantic import StrictStr
from typing import List, Optional
-from e2b.api.client.models.new_session import NewSession
-from e2b.api.client.models.session import Session
+from e2b.api.v2.client.models.new_session import NewSession
+from e2b.api.v2.client.models.session import Session
-from e2b.api.client.api_client import ApiClient
-from e2b.api.client.api_response import ApiResponse
-from e2b.api.client.exceptions import ApiTypeError, ApiValueError # noqa: F401
+from e2b.api.v2.client.api_client import ApiClient
+from e2b.api.v2.client.api_response import ApiResponse
+from e2b.api.v2.client.exceptions import ApiTypeError, ApiValueError # noqa: F401
class SessionsApi:
diff --git a/packages/python-sdk/e2b/api/client/api_client.py b/packages/python-sdk/e2b/api/v2/client/api_client.py
similarity index 98%
rename from packages/python-sdk/e2b/api/client/api_client.py
rename to packages/python-sdk/e2b/api/v2/client/api_client.py
index 21918aaaf..adad1647d 100644
--- a/packages/python-sdk/e2b/api/client/api_client.py
+++ b/packages/python-sdk/e2b/api/v2/client/api_client.py
@@ -24,11 +24,11 @@ import tempfile
from urllib.parse import quote
-from e2b.api.client.configuration import Configuration
-from e2b.api.client.api_response import ApiResponse
-import e2b.api.client.models
-from e2b.api.client import rest
-from e2b.api.client.exceptions import ApiValueError, ApiException
+from e2b.api.v2.client.configuration import Configuration
+from e2b.api.v2.client.api_response import ApiResponse
+import e2b.api.v2.client.models
+from e2b.api.v2.client import rest
+from e2b.api.v2.client.exceptions import ApiValueError, ApiException
class ApiClient:
@@ -371,7 +371,7 @@ class ApiClient:
if klass in self.NATIVE_TYPES_MAPPING:
klass = self.NATIVE_TYPES_MAPPING[klass]
else:
- klass = getattr(e2b.api.client.models, klass)
+ klass = getattr(e2b.api.v2.client.models, klass)
if klass in self.PRIMITIVE_TYPES:
return self.__deserialize_primitive(data, klass)
diff --git a/packages/python-sdk/e2b/api/client/api_response.py b/packages/python-sdk/e2b/api/v2/client/api_response.py
similarity index 100%
rename from packages/python-sdk/e2b/api/client/api_response.py
rename to packages/python-sdk/e2b/api/v2/client/api_response.py
diff --git a/packages/python-sdk/e2b/api/client/configuration.py b/packages/python-sdk/e2b/api/v2/client/configuration.py
similarity index 99%
rename from packages/python-sdk/e2b/api/client/configuration.py
rename to packages/python-sdk/e2b/api/v2/client/configuration.py
index a61cc64d7..a86e81724 100644
--- a/packages/python-sdk/e2b/api/client/configuration.py
+++ b/packages/python-sdk/e2b/api/v2/client/configuration.py
@@ -73,7 +73,7 @@ class Configuration:
You can programmatically set the cookie:
- conf = e2b.api.client.Configuration(
+ conf = e2b.api.v2.client.Configuration(
api_key={'cookieAuth': 'abc123'}
api_key_prefix={'cookieAuth': 'JSESSIONID'}
)
@@ -139,7 +139,7 @@ class Configuration:
self.logger = {}
"""Logging Settings
"""
- self.logger["package_logger"] = logging.getLogger("e2b.api.client")
+ self.logger["package_logger"] = logging.getLogger("e2b.api.v2.client")
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
self.logger_format = "%(asctime)s %(levelname)s %(message)s"
"""Log format
diff --git a/packages/python-sdk/e2b/api/client/exceptions.py b/packages/python-sdk/e2b/api/v2/client/exceptions.py
similarity index 100%
rename from packages/python-sdk/e2b/api/client/exceptions.py
rename to packages/python-sdk/e2b/api/v2/client/exceptions.py
diff --git a/packages/python-sdk/e2b/api/v2/client/models/__init__.py b/packages/python-sdk/e2b/api/v2/client/models/__init__.py
new file mode 100644
index 000000000..a1f74fef6
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v2/client/models/__init__.py
@@ -0,0 +1,25 @@
+# coding: utf-8
+
+# flake8: noqa
+"""
+ Devbook
+
+ Devbook API
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+# import models into model package
+from e2b.api.v2.client.models.environment import Environment
+from e2b.api.v2.client.models.environment_state import EnvironmentState
+from e2b.api.v2.client.models.environment_state_update import EnvironmentStateUpdate
+from e2b.api.v2.client.models.environment_title_update import EnvironmentTitleUpdate
+from e2b.api.v2.client.models.error import Error
+from e2b.api.v2.client.models.new_environment import NewEnvironment
+from e2b.api.v2.client.models.new_session import NewSession
+from e2b.api.v2.client.models.session import Session
+from e2b.api.v2.client.models.template import Template
diff --git a/packages/python-sdk/e2b/api/client/models/environment.py b/packages/python-sdk/e2b/api/v2/client/models/environment.py
similarity index 100%
rename from packages/python-sdk/e2b/api/client/models/environment.py
rename to packages/python-sdk/e2b/api/v2/client/models/environment.py
diff --git a/packages/python-sdk/e2b/api/client/models/environment_state.py b/packages/python-sdk/e2b/api/v2/client/models/environment_state.py
similarity index 100%
rename from packages/python-sdk/e2b/api/client/models/environment_state.py
rename to packages/python-sdk/e2b/api/v2/client/models/environment_state.py
diff --git a/packages/python-sdk/e2b/api/client/models/environment_state_update.py b/packages/python-sdk/e2b/api/v2/client/models/environment_state_update.py
similarity index 96%
rename from packages/python-sdk/e2b/api/client/models/environment_state_update.py
rename to packages/python-sdk/e2b/api/v2/client/models/environment_state_update.py
index 6b2a3b3ad..2388f0a23 100644
--- a/packages/python-sdk/e2b/api/client/models/environment_state_update.py
+++ b/packages/python-sdk/e2b/api/v2/client/models/environment_state_update.py
@@ -19,7 +19,7 @@ import json
from pydantic import BaseModel, Field
-from e2b.api.client.models.environment_state import EnvironmentState
+from e2b.api.v2.client.models.environment_state import EnvironmentState
class EnvironmentStateUpdate(BaseModel):
diff --git a/packages/python-sdk/e2b/api/client/models/environment_title_update.py b/packages/python-sdk/e2b/api/v2/client/models/environment_title_update.py
similarity index 100%
rename from packages/python-sdk/e2b/api/client/models/environment_title_update.py
rename to packages/python-sdk/e2b/api/v2/client/models/environment_title_update.py
diff --git a/packages/python-sdk/e2b/api/client/models/error.py b/packages/python-sdk/e2b/api/v2/client/models/error.py
similarity index 100%
rename from packages/python-sdk/e2b/api/client/models/error.py
rename to packages/python-sdk/e2b/api/v2/client/models/error.py
diff --git a/packages/python-sdk/e2b/api/client/models/new_environment.py b/packages/python-sdk/e2b/api/v2/client/models/new_environment.py
similarity index 100%
rename from packages/python-sdk/e2b/api/client/models/new_environment.py
rename to packages/python-sdk/e2b/api/v2/client/models/new_environment.py
diff --git a/packages/python-sdk/e2b/api/client/models/new_session.py b/packages/python-sdk/e2b/api/v2/client/models/new_session.py
similarity index 100%
rename from packages/python-sdk/e2b/api/client/models/new_session.py
rename to packages/python-sdk/e2b/api/v2/client/models/new_session.py
diff --git a/packages/python-sdk/e2b/api/client/models/session.py b/packages/python-sdk/e2b/api/v2/client/models/session.py
similarity index 100%
rename from packages/python-sdk/e2b/api/client/models/session.py
rename to packages/python-sdk/e2b/api/v2/client/models/session.py
diff --git a/packages/python-sdk/e2b/api/client/models/template.py b/packages/python-sdk/e2b/api/v2/client/models/template.py
similarity index 100%
rename from packages/python-sdk/e2b/api/client/models/template.py
rename to packages/python-sdk/e2b/api/v2/client/models/template.py
diff --git a/packages/python-sdk/e2b/api/client/rest.py b/packages/python-sdk/e2b/api/v2/client/rest.py
similarity index 99%
rename from packages/python-sdk/e2b/api/client/rest.py
rename to packages/python-sdk/e2b/api/v2/client/rest.py
index b477bd6ff..857a1d2ea 100644
--- a/packages/python-sdk/e2b/api/client/rest.py
+++ b/packages/python-sdk/e2b/api/v2/client/rest.py
@@ -21,7 +21,7 @@ import ssl
import aiohttp
from urllib.parse import urlencode, quote_plus
-from e2b.api.client.exceptions import ApiException, ApiValueError
+from e2b.api.v2.client.exceptions import ApiException, ApiValueError
logger = logging.getLogger(__name__)
diff --git a/packages/python-sdk/e2b/api/v2/client_README.md b/packages/python-sdk/e2b/api/v2/client_README.md
new file mode 100644
index 000000000..e08ae2cec
--- /dev/null
+++ b/packages/python-sdk/e2b/api/v2/client_README.md
@@ -0,0 +1,108 @@
+# e2b.api.v2.client
+Devbook API
+
+The `e2b.api.v2.client` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
+
+- API version: 1.0.0
+- Package version: 1.0.0
+- Build package: org.openapitools.codegen.languages.PythonClientCodegen
+
+## Requirements.
+
+Python 3.7+
+
+## Installation & Usage
+
+This python library package is generated without supporting files like setup.py or requirements files
+
+To be able to use it, you will need these dependencies in your own package that uses this library:
+
+* urllib3 >= 1.25.3
+* python-dateutil
+* aiohttp
+* pydantic
+* aenum
+
+## Getting Started
+
+In your own code, to use this library to connect and interact with e2b.api.v2.client,
+you can run the following:
+
+```python
+
+import time
+import e2b.api.v2.client
+from e2b.api.v2.client.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to https://ondevbook.com
+# See configuration.py for a list of all supported configuration parameters.
+configuration = e2b.api.v2.client.Configuration(
+ host = "https://ondevbook.com"
+)
+
+
+
+# Enter a context with an instance of the API client
+async with e2b.api.v2.client.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = e2b.api.v2.client.DefaultApi(api_client)
+
+ try:
+ await api_instance.health_get()
+ except ApiException as e:
+ print("Exception when calling DefaultApi->health_get: %s\n" % e)
+
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *https://ondevbook.com*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*DefaultApi* | [**health_get**](e2b/api/v2/client/docs/DefaultApi.md#health_get) | **GET** /health |
+*EnvsApi* | [**envs_code_snippet_id_delete**](e2b/api/v2/client/docs/EnvsApi.md#envs_code_snippet_id_delete) | **DELETE** /envs/{codeSnippetID} |
+*EnvsApi* | [**envs_code_snippet_id_patch**](e2b/api/v2/client/docs/EnvsApi.md#envs_code_snippet_id_patch) | **PATCH** /envs/{codeSnippetID} |
+*EnvsApi* | [**envs_code_snippet_id_post**](e2b/api/v2/client/docs/EnvsApi.md#envs_code_snippet_id_post) | **POST** /envs/{codeSnippetID} |
+*EnvsApi* | [**envs_code_snippet_id_state_put**](e2b/api/v2/client/docs/EnvsApi.md#envs_code_snippet_id_state_put) | **PUT** /envs/{codeSnippetID}/state |
+*EnvsApi* | [**envs_code_snippet_id_title_put**](e2b/api/v2/client/docs/EnvsApi.md#envs_code_snippet_id_title_put) | **PUT** /envs/{codeSnippetID}/title |
+*EnvsApi* | [**envs_get**](e2b/api/v2/client/docs/EnvsApi.md#envs_get) | **GET** /envs |
+*EnvsApi* | [**envs_post**](e2b/api/v2/client/docs/EnvsApi.md#envs_post) | **POST** /envs |
+*SessionsApi* | [**sessions_get**](e2b/api/v2/client/docs/SessionsApi.md#sessions_get) | **GET** /sessions |
+*SessionsApi* | [**sessions_post**](e2b/api/v2/client/docs/SessionsApi.md#sessions_post) | **POST** /sessions |
+*SessionsApi* | [**sessions_session_id_delete**](e2b/api/v2/client/docs/SessionsApi.md#sessions_session_id_delete) | **DELETE** /sessions/{sessionID} |
+*SessionsApi* | [**sessions_session_id_refresh_post**](e2b/api/v2/client/docs/SessionsApi.md#sessions_session_id_refresh_post) | **POST** /sessions/{sessionID}/refresh |
+
+
+## Documentation For Models
+
+ - [Environment](e2b/api/v2/client/docs/Environment.md)
+ - [EnvironmentState](e2b/api/v2/client/docs/EnvironmentState.md)
+ - [EnvironmentStateUpdate](e2b/api/v2/client/docs/EnvironmentStateUpdate.md)
+ - [EnvironmentTitleUpdate](e2b/api/v2/client/docs/EnvironmentTitleUpdate.md)
+ - [Error](e2b/api/v2/client/docs/Error.md)
+ - [NewEnvironment](e2b/api/v2/client/docs/NewEnvironment.md)
+ - [NewSession](e2b/api/v2/client/docs/NewSession.md)
+ - [Session](e2b/api/v2/client/docs/Session.md)
+ - [Template](e2b/api/v2/client/docs/Template.md)
+
+
+<a id="documentation-for-authorization"></a>
+## Documentation For Authorization
+
+
+Authentication schemes defined for the API:
+<a id="ApiKeyAuth"></a>
+### ApiKeyAuth
+
+- **Type**: API key
+- **API key parameter name**: api_key
+- **Location**: URL query string
+
+
+## Author
+
+
+
+
diff --git a/packages/python-sdk/e2b/session/code_snippet.py b/packages/python-sdk/e2b/session/code_snippet.py
index 8bd8f85f9..e4b322c70 100644
--- a/packages/python-sdk/e2b/session/code_snippet.py
+++ b/packages/python-sdk/e2b/session/code_snippet.py
@@ -1,6 +1,6 @@
from typing import Any, Callable, ClassVar, List, Optional
-from pydantic import BaseModel, ConfigDict
+from pydantic import BaseModel
from e2b.session.exception import MultipleExceptions, RpcException, SessionException
from e2b.session.session_connection import SessionConnection
@@ -16,7 +16,9 @@ ScanOpenedPortsHandler = Callable[[List[OpenPort]], Any]
class CodeSnippetManager(BaseModel):
- model_config = ConfigDict(arbitrary_types_allowed=True)
+ # TODO: Change to model_config = ConfigDict(arbitrary_types_allowed=True) when only pydantic 2.0 is used
+ class Config:
+ arbitrary_types_allowed = True
service_name: ClassVar[str] = "codeSnippet"
session: SessionConnection
diff --git a/packages/python-sdk/e2b/session/session_connection.py b/packages/python-sdk/e2b/session/session_connection.py
index a0a4b44fd..ea9f90082 100644
--- a/packages/python-sdk/e2b/session/session_connection.py
+++ b/packages/python-sdk/e2b/session/session_connection.py
@@ -8,10 +8,7 @@ from typing import Any, Awaitable, Callable, List, Literal, Optional, Union
import async_timeout
from pydantic import BaseModel
-from e2b.api.client import NewSession
-from e2b.api.client import Session as SessionInfo
-from e2b.api.client.rest import ApiException
-from e2b.api.main import client, configuration
+from e2b.api import client, configuration, exceptions, models
from e2b.constants import (
SESSION_DOMAIN,
SESSION_REFRESH_PERIOD,
@@ -87,7 +84,7 @@ class SessionConnection:
self._debug_dev_env = _debug_dev_env
self._on_close_child = on_close
- self._session: Optional[SessionInfo] = None
+ self._session: Optional[models.Session] = None
self._is_open = False
self._process_cleanup: List[Callable[[], Any]] = []
self._refreshing_task: Optional[asyncio.Future] = None
@@ -166,7 +163,7 @@ class SessionConnection:
api = client.SessionsApi(api_client)
self._session = await api.sessions_post(
- NewSession(codeSnippetID=self._id, editEnabled=False),
+ models.NewSession(codeSnippetID=self._id, editEnabled=False),
api_key=self._api_key,
)
logger.info(
@@ -337,7 +334,7 @@ class SessionConnection:
try:
await api.sessions_session_id_refresh_post(session_id)
logger.debug(f"Refreshed session {session_id}")
- except ApiException as e:
+ except exceptions.ApiException as e:
if e.status == 404:
raise SessionException(
f"Session {session_id} failed because it cannot be found"
diff --git a/packages/python-sdk/poetry.lock b/packages/python-sdk/poetry.lock
index 7ba1b3417..5c9af5d57 100644
--- a/packages/python-sdk/poetry.lock
+++ b/packages/python-sdk/poetry.lock
@@ -627,38 +627,38 @@ testing = ["pytest", "pytest-benchmark"]
[[package]]
name = "psycopg2"
-version = "2.9.7"
+version = "2.9.8"
description = "psycopg2 - Python-PostgreSQL Database Adapter"
optional = false
python-versions = ">=3.6"
files = [
- {file = "psycopg2-2.9.7-cp310-cp310-win32.whl", hash = "sha256:1a6a2d609bce44f78af4556bea0c62a5e7f05c23e5ea9c599e07678995609084"},
- {file = "psycopg2-2.9.7-cp310-cp310-win_amd64.whl", hash = "sha256:b22ed9c66da2589a664e0f1ca2465c29b75aaab36fa209d4fb916025fb9119e5"},
- {file = "psycopg2-2.9.7-cp311-cp311-win32.whl", hash = "sha256:44d93a0109dfdf22fe399b419bcd7fa589d86895d3931b01fb321d74dadc68f1"},
- {file = "psycopg2-2.9.7-cp311-cp311-win_amd64.whl", hash = "sha256:91e81a8333a0037babfc9fe6d11e997a9d4dac0f38c43074886b0d9dead94fe9"},
- {file = "psycopg2-2.9.7-cp37-cp37m-win32.whl", hash = "sha256:d1210fcf99aae6f728812d1d2240afc1dc44b9e6cba526a06fb8134f969957c2"},
- {file = "psycopg2-2.9.7-cp37-cp37m-win_amd64.whl", hash = "sha256:e9b04cbef584310a1ac0f0d55bb623ca3244c87c51187645432e342de9ae81a8"},
- {file = "psycopg2-2.9.7-cp38-cp38-win32.whl", hash = "sha256:d5c5297e2fbc8068d4255f1e606bfc9291f06f91ec31b2a0d4c536210ac5c0a2"},
- {file = "psycopg2-2.9.7-cp38-cp38-win_amd64.whl", hash = "sha256:8275abf628c6dc7ec834ea63f6f3846bf33518907a2b9b693d41fd063767a866"},
- {file = "psycopg2-2.9.7-cp39-cp39-win32.whl", hash = "sha256:c7949770cafbd2f12cecc97dea410c514368908a103acf519f2a346134caa4d5"},
- {file = "psycopg2-2.9.7-cp39-cp39-win_amd64.whl", hash = "sha256:b6bd7d9d3a7a63faae6edf365f0ed0e9b0a1aaf1da3ca146e6b043fb3eb5d723"},
- {file = "psycopg2-2.9.7.tar.gz", hash = "sha256:f00cc35bd7119f1fed17b85bd1007855194dde2cbd8de01ab8ebb17487440ad8"},
+ {file = "psycopg2-2.9.8-cp310-cp310-win32.whl", hash = "sha256:2f8594f92bbb5d8b59ffec04e2686c416401e2d4297de1193f8e75235937e71d"},
+ {file = "psycopg2-2.9.8-cp310-cp310-win_amd64.whl", hash = "sha256:f9ecbf504c4eaff90139d5c9b95d47275f2b2651e14eba56392b4041fbf4c2b3"},
+ {file = "psycopg2-2.9.8-cp311-cp311-win32.whl", hash = "sha256:65f81e72136d8b9ac8abf5206938d60f50da424149a43b6073f1546063c0565e"},
+ {file = "psycopg2-2.9.8-cp311-cp311-win_amd64.whl", hash = "sha256:f7e62095d749359b7854143843f27edd7dccfcd3e1d833b880562aa5702d92b0"},
+ {file = "psycopg2-2.9.8-cp37-cp37m-win32.whl", hash = "sha256:81b21424023a290a40884c7f8b0093ba6465b59bd785c18f757e76945f65594c"},
+ {file = "psycopg2-2.9.8-cp37-cp37m-win_amd64.whl", hash = "sha256:67c2f32f3aba79afb15799575e77ee2db6b46b8acf943c21d34d02d4e1041d50"},
+ {file = "psycopg2-2.9.8-cp38-cp38-win32.whl", hash = "sha256:287a64ef168ef7fb9f382964705ff664b342bfff47e7242bf0a04ef203269dd5"},
+ {file = "psycopg2-2.9.8-cp38-cp38-win_amd64.whl", hash = "sha256:dcde3cad4920e29e74bf4e76c072649764914facb2069e6b7fa1ddbebcd49e9f"},
+ {file = "psycopg2-2.9.8-cp39-cp39-win32.whl", hash = "sha256:d4ad050ea50a16731d219c3a85e8f2debf49415a070f0b8331ccc96c81700d9b"},
+ {file = "psycopg2-2.9.8-cp39-cp39-win_amd64.whl", hash = "sha256:d39bb3959788b2c9d7bf5ff762e29f436172b241cd7b47529baac77746fd7918"},
+ {file = "psycopg2-2.9.8.tar.gz", hash = "sha256:3da6488042a53b50933244085f3f91803f1b7271f970f3e5536efa69314f6a49"},
]
[[package]]
name = "pydantic"
-version = "2.4.0"
+version = "2.4.2"
description = "Data validation using Python type hints"
optional = false
python-versions = ">=3.7"
files = [
- {file = "pydantic-2.4.0-py3-none-any.whl", hash = "sha256:909b2b7d7be775a890631218e8c4b6b5418c9b6c57074ae153e5c09b73bf06a3"},
- {file = "pydantic-2.4.0.tar.gz", hash = "sha256:54216ccb537a606579f53d7f6ed912e98fffce35aff93b25cd80b1c2ca806fc3"},
+ {file = "pydantic-2.4.2-py3-none-any.whl", hash = "sha256:bc3ddf669d234f4220e6e1c4d96b061abe0998185a8d7855c0126782b7abc8c1"},
+ {file = "pydantic-2.4.2.tar.gz", hash = "sha256:94f336138093a5d7f426aac732dcfe7ab4eb4da243c88f891d65deb4a2556ee7"},
]
[package.dependencies]
annotated-types = ">=0.4.0"
-pydantic-core = "2.10.0"
+pydantic-core = "2.10.1"
typing-extensions = ">=4.6.1"
[package.extras]
@@ -666,117 +666,117 @@ email = ["email-validator (>=2.0.0)"]
[[package]]
name = "pydantic-core"
-version = "2.10.0"
+version = "2.10.1"
description = ""
optional = false
python-versions = ">=3.7"
files = [
- {file = "pydantic_core-2.10.0-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:daea90360d99ad06a3f686b3e628222ac3aa953b1982f13be5b69b2648c5e6bb"},
- {file = "pydantic_core-2.10.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5f76cb8d68d87fd05e56aba392c841d98eeb3ad378bcf5331b42bac7afee0d66"},
- {file = "pydantic_core-2.10.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5e816d042f80dd630aaedbc75c21084da9e1d7ea5918619b8089c7edaedd57e8"},
- {file = "pydantic_core-2.10.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7192492b09c1e4ad103e5cb98eb397f9b61a9037fce03e94cafe3238404dbe0f"},
- {file = "pydantic_core-2.10.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:312831c5bf50d9d432c11baf9bbd8d8961740608ccbc66fb1290d532aff21b18"},
- {file = "pydantic_core-2.10.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:873db84afcbcf3f1ed0040ed9c5534bc1af5d647d13c04be12f3568421f5dd3e"},
- {file = "pydantic_core-2.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0aa8bdc2d78afadd191148726f094be81d5e4b76011f8fa9300f317e06a1b732"},
- {file = "pydantic_core-2.10.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7cbf77664099345a25932ebe25d7bf9a330fc29acd9a909e8751ac0c42097fb3"},
- {file = "pydantic_core-2.10.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:a537e87ca600e59e532fbc770a60f9f3a5ebcff9bae8c60aceeec5beb326e1b8"},
- {file = "pydantic_core-2.10.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ed5f8d6cb834c80fb813d233f9bfb60d3453b7450c80c0814b8e78c23d1ea8bf"},
- {file = "pydantic_core-2.10.0-cp310-none-win32.whl", hash = "sha256:0e210107faf47d5965fcebc294c41891573adab36e5cf70731c57d0068fc7c5c"},
- {file = "pydantic_core-2.10.0-cp310-none-win_amd64.whl", hash = "sha256:9527cf9c25fd655617620c8d6cb43216c0ce5779871ab7f83175421267b85199"},
- {file = "pydantic_core-2.10.0-cp311-cp311-macosx_10_7_x86_64.whl", hash = "sha256:ab2d56dfa13244164f0ba8125d8315c799fa0150459b88fc42ed5c1e3c04d47a"},
- {file = "pydantic_core-2.10.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d1e79893a20207ff671f13f5562c1f0aaece030e6e30252683f536286ba89864"},
- {file = "pydantic_core-2.10.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:030ba2f59e78c8732445d8c9f093579674f2b5b93b3960945face14ec2e82682"},
- {file = "pydantic_core-2.10.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:705fad71297dfedc5c9e3c935702864aa0cc7812be11ac544f152677ba6ea430"},
- {file = "pydantic_core-2.10.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:394a8ce4a7495af8dbf33038daf57a6170be15f8d1d92a7b63c6f2211527d950"},
- {file = "pydantic_core-2.10.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:19c7aa3c0ff08ddc91597d8af08f8c4de59b27fe752b3bd1db9a67f6f08c4020"},
- {file = "pydantic_core-2.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb204346d3eda4e0c63cbeeec6398a52682ac51f9cf7379a13505863e47d3186"},
- {file = "pydantic_core-2.10.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b1fefe63baa04f1d9dd5b4564b1e73d133e1c745589933d7ef9718235915cc81"},
- {file = "pydantic_core-2.10.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:fa4bd88165d860111e860e8b43efd97afd137a9165cf24eb3cfb2371f57452bf"},
- {file = "pydantic_core-2.10.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9e21ab9c49cc58282c228ff89fb4a5e4b447233ccd53acb7f333d1cde58df37b"},
- {file = "pydantic_core-2.10.0-cp311-none-win32.whl", hash = "sha256:2a6f28e2b2a5cef3b52b5ac6c6d64fe810ca51ec57081554f447c818778eea09"},
- {file = "pydantic_core-2.10.0-cp311-none-win_amd64.whl", hash = "sha256:f94539aa4265ab5528d8c3dc4505a19369083c29d0713b8ed536f93b9bc1e94f"},
- {file = "pydantic_core-2.10.0-cp311-none-win_arm64.whl", hash = "sha256:2352f7cb8ef0cd21fbc582abe2a14105d7e8400f97a551ca2e3b05dee77525d2"},
- {file = "pydantic_core-2.10.0-cp312-cp312-macosx_10_7_x86_64.whl", hash = "sha256:c2a126c7271a9421005a0f57cf71294ad49c375e4d0a9198b93665796f49e7f7"},
- {file = "pydantic_core-2.10.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7440933341f655a64456065211cf7657c3cf3524d5b0b02f5d9b63ef5a7e0d49"},
- {file = "pydantic_core-2.10.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85d8225cd08aacb8a2843cf0a0a72f1c403c6ac6f18d4cfeecabe050f80c9ea3"},
- {file = "pydantic_core-2.10.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:573e89b3da5908f564ae54b6284e20b490158681e91e1776a59dfda17ec0a6a8"},
- {file = "pydantic_core-2.10.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b0061965942489e6da23f0399b1136fd10eff0a4f0cefae13369eba1776e22a6"},
- {file = "pydantic_core-2.10.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:725f0276402773a6b61b6f67bf9562f37ba08a8bfebdfb9990eea786ed5711b2"},
- {file = "pydantic_core-2.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:25cacd12689b1a357ae6212c7f5980ebf487720db5bbf1bb5d91085226b6a962"},
- {file = "pydantic_core-2.10.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e70c6c882ab101a72010c8f91e87db211fa2aaf6aa51acc7160fe5649630ed75"},
- {file = "pydantic_core-2.10.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:e079540fd4c45c23de4465cafb20cddcd8befe3b5f46505a2eb28e49b9d13ee2"},
- {file = "pydantic_core-2.10.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:98474284adb71c8738e5efb71ccb1382d8d66f042ad0875018c78bcb38ac0f47"},
- {file = "pydantic_core-2.10.0-cp312-none-win32.whl", hash = "sha256:ab1fa046ef9058ceef941b576c5e7711bab3d99be00a304fb4726cf4b94e05ff"},
- {file = "pydantic_core-2.10.0-cp312-none-win_amd64.whl", hash = "sha256:b4df023610af081d6da85328411fed7aacf19e939fe955bb31f29212f8dcf306"},
- {file = "pydantic_core-2.10.0-cp312-none-win_arm64.whl", hash = "sha256:f1a70f99d1a7270d4f321a8824e87d5b88acd64c2af6049915b7fd8215437e04"},
- {file = "pydantic_core-2.10.0-cp37-cp37m-macosx_10_7_x86_64.whl", hash = "sha256:f622778eb180cf7eba25e65d2fe37a57a0eadd8403df4c44606b56d204f686de"},
- {file = "pydantic_core-2.10.0-cp37-cp37m-macosx_11_0_arm64.whl", hash = "sha256:fb513fc74bdf5f649e6e855fc87ed9b81ee8b0be96717190f9e00683244f0616"},
- {file = "pydantic_core-2.10.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:82c3f0752547f928e4fcfb00151d6deb9124be7d35e012c567429fe93ec71b71"},
- {file = "pydantic_core-2.10.0-cp37-cp37m-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:100bbd622433d9d7ca8ee4fa63dfae90f9f38358558955173aed6ed56c573db8"},
- {file = "pydantic_core-2.10.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8f919d17581fdf6e71ff3d3fe4b02ed32aaa0429e0b4346798de7a1361e098ef"},
- {file = "pydantic_core-2.10.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f32df1d8d383e1b729674ad1053d8f43f7ed79848496d3cb6ca81a906318317b"},
- {file = "pydantic_core-2.10.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ab4d279c480e83c516e4e0b7b1f882f168f614d9c62e18ab779edef0cd13aaa9"},
- {file = "pydantic_core-2.10.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c394e9ed6f9e6f4af3618c34bc15f2af4237f7d1989b7f45588f8e855bc10e08"},
- {file = "pydantic_core-2.10.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:bc0a33779fded534ff0b5d8ef766a1c94d3e740877ea8adab65cbf1878ba03b4"},
- {file = "pydantic_core-2.10.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:c1041d8fcd313c68b77dec6a16bf1d690008270b50eec11e96d89e1b4ba756b1"},
- {file = "pydantic_core-2.10.0-cp37-none-win32.whl", hash = "sha256:68992f78507e95ed63ca87b8b177785d9806cde34ca3a9f98382188dd11d8720"},
- {file = "pydantic_core-2.10.0-cp37-none-win_amd64.whl", hash = "sha256:aa45f0846773cb142252ccef66b096d917bb76c6ef9da1aa747e6b44aa318192"},
- {file = "pydantic_core-2.10.0-cp38-cp38-macosx_10_7_x86_64.whl", hash = "sha256:a04054b91afc41282a0a7426147654849136b37a41da86412d4ff5ba51b9cd2f"},
- {file = "pydantic_core-2.10.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:1c1bfa2ca352bf43d34b7099f8ed675deb88113bd36c76880f4ca18fc0d3af50"},
- {file = "pydantic_core-2.10.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ba288fa675b2951e7898ebfdd8defa0e958e514d4d1cc7a5f6a8d627378c0c47"},
- {file = "pydantic_core-2.10.0-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fbba90179672707ab69ad19ef7d3c3f0a8e2f0a0579f0eb79649ffcdacf476d0"},
- {file = "pydantic_core-2.10.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7c6915a9b3dd16e016dba7e76070e667eca50530f957daa5b78c73abbf281b25"},
- {file = "pydantic_core-2.10.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9e72c1e06a20c10b9c5f7a3fe09ec46e0e208c65a69d2efb92a3e1b64443e6c3"},
- {file = "pydantic_core-2.10.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0b50848d1a614093c05c97d0fdf841ef547d8c087fbd06f6eafe8ef1d836d6c1"},
- {file = "pydantic_core-2.10.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ad7b5f4352f3dfcc481b008bce3b3931a485a93112deaa0a25bee2817d3f7b98"},
- {file = "pydantic_core-2.10.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:66c0169457733a4dfe72be51dd359414eddd0738b15dda07827f18a10e9f6ab7"},
- {file = "pydantic_core-2.10.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:e24d92d3a60d6eb19a1bd0f1f259369f478e0f34412a33e794da6cdaa36218be"},
- {file = "pydantic_core-2.10.0-cp38-none-win32.whl", hash = "sha256:30c5df611afc5a9f2ad48babe2192f9cf0d12ed6c0dd5eb57b3538491c113737"},
- {file = "pydantic_core-2.10.0-cp38-none-win_amd64.whl", hash = "sha256:d72a561d7c0738ae5d05a709c739b2953d05e18151539750ca9622f3438de041"},
- {file = "pydantic_core-2.10.0-cp39-cp39-macosx_10_7_x86_64.whl", hash = "sha256:7cecd7669b1ebee8ae90f5aa7d459770b6e79db7b95983aacc5b7392a050b9ab"},
- {file = "pydantic_core-2.10.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:923000ea46def1bdded511b5792ec19866909797a05dc8f75342c6a9cacb2d66"},
- {file = "pydantic_core-2.10.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:729a2fc4bc1564d164258eaf138ab4c03baa2080a5e3f91a9b3cb2d758248b8f"},
- {file = "pydantic_core-2.10.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6930eaf3aa2ba660ed3f64206902a534f454f9954e5de06354e20d890bebbd8a"},
- {file = "pydantic_core-2.10.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d0b17e8d08a1c94efb91d8d389ec76a32fc3f85ba06626b5ef0c2d6bffcbe066"},
- {file = "pydantic_core-2.10.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c61755149ba534123ae08e6aa814aa34f47c6ba45a622ea98ddd7860b5312767"},
- {file = "pydantic_core-2.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:22b126893f53c789ad2253c9288a59362171a5bafbb865190c43d430dc805edb"},
- {file = "pydantic_core-2.10.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:776eee60ca8ca3de83add0fb95a0034ac965a12590bb22ec09b05c87870ba401"},
- {file = "pydantic_core-2.10.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b1496f38e49c7960461002768c5f4c9ba9720fe259cd5c8b229cd0b3b0861844"},
- {file = "pydantic_core-2.10.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:cd175beab2ac845a90d31bb4ea8e6c1e8be12efaf14b9918d0ab4828dd3c916b"},
- {file = "pydantic_core-2.10.0-cp39-none-win32.whl", hash = "sha256:391805e8a4ad731e729a22d8e14bad2d724915d28618be6c66dc7ccb421a13a0"},
- {file = "pydantic_core-2.10.0-cp39-none-win_amd64.whl", hash = "sha256:7e2360b86b21e2aab8d4f1ce2551e2b731bc30610b7cc9324ea7517af4375b08"},
- {file = "pydantic_core-2.10.0-pp310-pypy310_pp73-macosx_10_7_x86_64.whl", hash = "sha256:b40221d1490f2c6e488d2576773a574d42436b5aba1faed91f59a9feb82c384b"},
- {file = "pydantic_core-2.10.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:9f3b25201efe20d182f3bd6fe8d99685f4ed01cac67b79c017c9cf688b747263"},
- {file = "pydantic_core-2.10.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:34a45943bb14275e9681fd4abafbe3acae1e7dac7248bebf38ac5bde492e00f7"},
- {file = "pydantic_core-2.10.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc5be7a29a6b25a186941e9e2b5f9281c05723628e1fdb244f429f4c1682ff49"},
- {file = "pydantic_core-2.10.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:17460ffd8f8e49ca52711b4926fefe2b336d01b63dc27aee432a576c2147c8ce"},
- {file = "pydantic_core-2.10.0-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:c1ab3701d660bd136a22e1ca95292bfed50245eb869adaee2e08f29d4dd5e360"},
- {file = "pydantic_core-2.10.0-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:09ac18617199704327d99c85893d697b8442c18b8c2db1ea636ba83313223541"},
- {file = "pydantic_core-2.10.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:e3f69d48191103587950981cf47c936064c808b6c18f57e745ed130a305c73a6"},
- {file = "pydantic_core-2.10.0-pp37-pypy37_pp73-macosx_10_7_x86_64.whl", hash = "sha256:792af9e4f78d6f1d0aabfb95162c5ed56b5369b25350eaa68b1495e8f675d4d9"},
- {file = "pydantic_core-2.10.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1ecd28fb4c98c97836046d092029017bcc35e060ea547484aa1234b8a592de17"},
- {file = "pydantic_core-2.10.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a622a8abf656cc51960766fa4d194504e8a9f85ae48032f87fb42c79462c7b8"},
- {file = "pydantic_core-2.10.0-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:52eb5c61de017bfee422f6aa9a3e76de5aa5a9189ba808bba63b9de67e55c4ca"},
- {file = "pydantic_core-2.10.0-pp37-pypy37_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:69772dcdcf90b677d0d2ecedafe4c6a610572f1fad15912cde28a6f8eb5654fd"},
- {file = "pydantic_core-2.10.0-pp37-pypy37_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:12470a4de172aaa1bbadb45744de4a9b0298fa8f974eb508314c3b5da0cb4aed"},
- {file = "pydantic_core-2.10.0-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:f9f2c70257f03db712658d4138e2b892bdd7c71472783eaebc2813a47fd29ef3"},
- {file = "pydantic_core-2.10.0-pp38-pypy38_pp73-macosx_10_7_x86_64.whl", hash = "sha256:8a5323d6778931ab1b3b22bac05fb7c961786d3b04a6c84f7c0ffcc331b4b998"},
- {file = "pydantic_core-2.10.0-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:5f00e83aa9aebbfd4382695a5ed94e6282ac01455fbb1a37d99d2effa29df30f"},
- {file = "pydantic_core-2.10.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c871820c60fc863c7b3f660612af6ce5bb8f5f69d6364f208e29d2ca7992d154"},
- {file = "pydantic_core-2.10.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c1bcb1b9b33573eeef218ffb3a2910c57fedc8831caf3c942e68a2222481d2cc"},
- {file = "pydantic_core-2.10.0-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d122a46c360c8069f7ac39c6f2c29cf99436baa48ba1e28ea5443336e9bbb838"},
- {file = "pydantic_core-2.10.0-pp38-pypy38_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:3ffb2a3462bb7905c4d849b95f536ac1f3948e92f5e0fc7e65bd3f3b0d132cf4"},
- {file = "pydantic_core-2.10.0-pp38-pypy38_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:b5d4eec8aba25b163a4d9dcc6be8354bc8f939040bc15a6400cbd62ba0511a5f"},
- {file = "pydantic_core-2.10.0-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:5cbfe4cd608cf6d032374961e4e07d0506acfaec7b1a69beade1d5f98dce00fd"},
- {file = "pydantic_core-2.10.0-pp39-pypy39_pp73-macosx_10_7_x86_64.whl", hash = "sha256:02b3d546342e7f583bf58f4a4618c7e97f44426db2358789393537dd4e9a921d"},
- {file = "pydantic_core-2.10.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:7820faf076216654ae54ad8a8443a296faaac9057a49ff404ce92ab85c9518a3"},
- {file = "pydantic_core-2.10.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f114130c44ae52b3bd2450dac8e1d3e1e92a92baecb24dbcdb6de2d2fc15bdb5"},
- {file = "pydantic_core-2.10.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f6f70680c15876c583a24bd476e49004327e87392be0282aedbc65773519ea8"},
- {file = "pydantic_core-2.10.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3f230d70be54447e12fcd0f1c2319dac74341244fafd2350d5675aa194f6c3f4"},
- {file = "pydantic_core-2.10.0-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:96b3007451863b46e8138f8096ef31aea6f7721a9910843b0554ce4ae17024a2"},
- {file = "pydantic_core-2.10.0-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:b196c4ace34be6c2953c6ec3906d1af88c418b93325d612d7f900ed30bf1e0ac"},
- {file = "pydantic_core-2.10.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:5958b1af7acd7b4a629e9758ce54a31c1910695e85e0ef847ba3daa4f25a0a08"},
- {file = "pydantic_core-2.10.0.tar.gz", hash = "sha256:8fe66506700efdfc699c613ccc4974ac7d8fceed8c74983e55ec380504db2e05"},
+ {file = "pydantic_core-2.10.1-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:d64728ee14e667ba27c66314b7d880b8eeb050e58ffc5fec3b7a109f8cddbd63"},
+ {file = "pydantic_core-2.10.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:48525933fea744a3e7464c19bfede85df4aba79ce90c60b94d8b6e1eddd67096"},
+ {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef337945bbd76cce390d1b2496ccf9f90b1c1242a3a7bc242ca4a9fc5993427a"},
+ {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a1392e0638af203cee360495fd2cfdd6054711f2db5175b6e9c3c461b76f5175"},
+ {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0675ba5d22de54d07bccde38997e780044dcfa9a71aac9fd7d4d7a1d2e3e65f7"},
+ {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:128552af70a64660f21cb0eb4876cbdadf1a1f9d5de820fed6421fa8de07c893"},
+ {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f6e6aed5818c264412ac0598b581a002a9f050cb2637a84979859e70197aa9e"},
+ {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ecaac27da855b8d73f92123e5f03612b04c5632fd0a476e469dfc47cd37d6b2e"},
+ {file = "pydantic_core-2.10.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b3c01c2fb081fced3bbb3da78510693dc7121bb893a1f0f5f4b48013201f362e"},
+ {file = "pydantic_core-2.10.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:92f675fefa977625105708492850bcbc1182bfc3e997f8eecb866d1927c98ae6"},
+ {file = "pydantic_core-2.10.1-cp310-none-win32.whl", hash = "sha256:420a692b547736a8d8703c39ea935ab5d8f0d2573f8f123b0a294e49a73f214b"},
+ {file = "pydantic_core-2.10.1-cp310-none-win_amd64.whl", hash = "sha256:0880e239827b4b5b3e2ce05e6b766a7414e5f5aedc4523be6b68cfbc7f61c5d0"},
+ {file = "pydantic_core-2.10.1-cp311-cp311-macosx_10_7_x86_64.whl", hash = "sha256:073d4a470b195d2b2245d0343569aac7e979d3a0dcce6c7d2af6d8a920ad0bea"},
+ {file = "pydantic_core-2.10.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:600d04a7b342363058b9190d4e929a8e2e715c5682a70cc37d5ded1e0dd370b4"},
+ {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:39215d809470f4c8d1881758575b2abfb80174a9e8daf8f33b1d4379357e417c"},
+ {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eeb3d3d6b399ffe55f9a04e09e635554012f1980696d6b0aca3e6cf42a17a03b"},
+ {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a7a7902bf75779bc12ccfc508bfb7a4c47063f748ea3de87135d433a4cca7a2f"},
+ {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3625578b6010c65964d177626fde80cf60d7f2e297d56b925cb5cdeda6e9925a"},
+ {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:caa48fc31fc7243e50188197b5f0c4228956f97b954f76da157aae7f67269ae8"},
+ {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:07ec6d7d929ae9c68f716195ce15e745b3e8fa122fc67698ac6498d802ed0fa4"},
+ {file = "pydantic_core-2.10.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e6f31a17acede6a8cd1ae2d123ce04d8cca74056c9d456075f4f6f85de055607"},
+ {file = "pydantic_core-2.10.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d8f1ebca515a03e5654f88411420fea6380fc841d1bea08effb28184e3d4899f"},
+ {file = "pydantic_core-2.10.1-cp311-none-win32.whl", hash = "sha256:6db2eb9654a85ada248afa5a6db5ff1cf0f7b16043a6b070adc4a5be68c716d6"},
+ {file = "pydantic_core-2.10.1-cp311-none-win_amd64.whl", hash = "sha256:4a5be350f922430997f240d25f8219f93b0c81e15f7b30b868b2fddfc2d05f27"},
+ {file = "pydantic_core-2.10.1-cp311-none-win_arm64.whl", hash = "sha256:5fdb39f67c779b183b0c853cd6b45f7db84b84e0571b3ef1c89cdb1dfc367325"},
+ {file = "pydantic_core-2.10.1-cp312-cp312-macosx_10_7_x86_64.whl", hash = "sha256:b1f22a9ab44de5f082216270552aa54259db20189e68fc12484873d926426921"},
+ {file = "pydantic_core-2.10.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8572cadbf4cfa95fb4187775b5ade2eaa93511f07947b38f4cd67cf10783b118"},
+ {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:db9a28c063c7c00844ae42a80203eb6d2d6bbb97070cfa00194dff40e6f545ab"},
+ {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0e2a35baa428181cb2270a15864ec6286822d3576f2ed0f4cd7f0c1708472aff"},
+ {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05560ab976012bf40f25d5225a58bfa649bb897b87192a36c6fef1ab132540d7"},
+ {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d6495008733c7521a89422d7a68efa0a0122c99a5861f06020ef5b1f51f9ba7c"},
+ {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14ac492c686defc8e6133e3a2d9eaf5261b3df26b8ae97450c1647286750b901"},
+ {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8282bab177a9a3081fd3d0a0175a07a1e2bfb7fcbbd949519ea0980f8a07144d"},
+ {file = "pydantic_core-2.10.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:aafdb89fdeb5fe165043896817eccd6434aee124d5ee9b354f92cd574ba5e78f"},
+ {file = "pydantic_core-2.10.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f6defd966ca3b187ec6c366604e9296f585021d922e666b99c47e78738b5666c"},
+ {file = "pydantic_core-2.10.1-cp312-none-win32.whl", hash = "sha256:7c4d1894fe112b0864c1fa75dffa045720a194b227bed12f4be7f6045b25209f"},
+ {file = "pydantic_core-2.10.1-cp312-none-win_amd64.whl", hash = "sha256:5994985da903d0b8a08e4935c46ed8daf5be1cf217489e673910951dc533d430"},
+ {file = "pydantic_core-2.10.1-cp312-none-win_arm64.whl", hash = "sha256:0d8a8adef23d86d8eceed3e32e9cca8879c7481c183f84ed1a8edc7df073af94"},
+ {file = "pydantic_core-2.10.1-cp37-cp37m-macosx_10_7_x86_64.whl", hash = "sha256:9badf8d45171d92387410b04639d73811b785b5161ecadabf056ea14d62d4ede"},
+ {file = "pydantic_core-2.10.1-cp37-cp37m-macosx_11_0_arm64.whl", hash = "sha256:ebedb45b9feb7258fac0a268a3f6bec0a2ea4d9558f3d6f813f02ff3a6dc6698"},
+ {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cfe1090245c078720d250d19cb05d67e21a9cd7c257698ef139bc41cf6c27b4f"},
+ {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e357571bb0efd65fd55f18db0a2fb0ed89d0bb1d41d906b138f088933ae618bb"},
+ {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b3dcd587b69bbf54fc04ca157c2323b8911033e827fffaecf0cafa5a892a0904"},
+ {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c120c9ce3b163b985a3b966bb701114beb1da4b0468b9b236fc754783d85aa3"},
+ {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15d6bca84ffc966cc9976b09a18cf9543ed4d4ecbd97e7086f9ce9327ea48891"},
+ {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5cabb9710f09d5d2e9e2748c3e3e20d991a4c5f96ed8f1132518f54ab2967221"},
+ {file = "pydantic_core-2.10.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:82f55187a5bebae7d81d35b1e9aaea5e169d44819789837cdd4720d768c55d15"},
+ {file = "pydantic_core-2.10.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:1d40f55222b233e98e3921df7811c27567f0e1a4411b93d4c5c0f4ce131bc42f"},
+ {file = "pydantic_core-2.10.1-cp37-none-win32.whl", hash = "sha256:14e09ff0b8fe6e46b93d36a878f6e4a3a98ba5303c76bb8e716f4878a3bee92c"},
+ {file = "pydantic_core-2.10.1-cp37-none-win_amd64.whl", hash = "sha256:1396e81b83516b9d5c9e26a924fa69164156c148c717131f54f586485ac3c15e"},
+ {file = "pydantic_core-2.10.1-cp38-cp38-macosx_10_7_x86_64.whl", hash = "sha256:6835451b57c1b467b95ffb03a38bb75b52fb4dc2762bb1d9dbed8de31ea7d0fc"},
+ {file = "pydantic_core-2.10.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b00bc4619f60c853556b35f83731bd817f989cba3e97dc792bb8c97941b8053a"},
+ {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fa467fd300a6f046bdb248d40cd015b21b7576c168a6bb20aa22e595c8ffcdd"},
+ {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d99277877daf2efe074eae6338453a4ed54a2d93fb4678ddfe1209a0c93a2468"},
+ {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fa7db7558607afeccb33c0e4bf1c9a9a835e26599e76af6fe2fcea45904083a6"},
+ {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:aad7bd686363d1ce4ee930ad39f14e1673248373f4a9d74d2b9554f06199fb58"},
+ {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:443fed67d33aa85357464f297e3d26e570267d1af6fef1c21ca50921d2976302"},
+ {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:042462d8d6ba707fd3ce9649e7bf268633a41018d6a998fb5fbacb7e928a183e"},
+ {file = "pydantic_core-2.10.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ecdbde46235f3d560b18be0cb706c8e8ad1b965e5c13bbba7450c86064e96561"},
+ {file = "pydantic_core-2.10.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ed550ed05540c03f0e69e6d74ad58d026de61b9eaebebbaaf8873e585cbb18de"},
+ {file = "pydantic_core-2.10.1-cp38-none-win32.whl", hash = "sha256:8cdbbd92154db2fec4ec973d45c565e767ddc20aa6dbaf50142676484cbff8ee"},
+ {file = "pydantic_core-2.10.1-cp38-none-win_amd64.whl", hash = "sha256:9f6f3e2598604956480f6c8aa24a3384dbf6509fe995d97f6ca6103bb8c2534e"},
+ {file = "pydantic_core-2.10.1-cp39-cp39-macosx_10_7_x86_64.whl", hash = "sha256:655f8f4c8d6a5963c9a0687793da37b9b681d9ad06f29438a3b2326d4e6b7970"},
+ {file = "pydantic_core-2.10.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e570ffeb2170e116a5b17e83f19911020ac79d19c96f320cbfa1fa96b470185b"},
+ {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:64322bfa13e44c6c30c518729ef08fda6026b96d5c0be724b3c4ae4da939f875"},
+ {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:485a91abe3a07c3a8d1e082ba29254eea3e2bb13cbbd4351ea4e5a21912cc9b0"},
+ {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7c2b8eb9fc872e68b46eeaf835e86bccc3a58ba57d0eedc109cbb14177be531"},
+ {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a5cb87bdc2e5f620693148b5f8f842d293cae46c5f15a1b1bf7ceeed324a740c"},
+ {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:25bd966103890ccfa028841a8f30cebcf5875eeac8c4bde4fe221364c92f0c9a"},
+ {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f323306d0556351735b54acbf82904fe30a27b6a7147153cbe6e19aaaa2aa429"},
+ {file = "pydantic_core-2.10.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0c27f38dc4fbf07b358b2bc90edf35e82d1703e22ff2efa4af4ad5de1b3833e7"},
+ {file = "pydantic_core-2.10.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:f1365e032a477c1430cfe0cf2856679529a2331426f8081172c4a74186f1d595"},
+ {file = "pydantic_core-2.10.1-cp39-none-win32.whl", hash = "sha256:a1c311fd06ab3b10805abb72109f01a134019739bd3286b8ae1bc2fc4e50c07a"},
+ {file = "pydantic_core-2.10.1-cp39-none-win_amd64.whl", hash = "sha256:ae8a8843b11dc0b03b57b52793e391f0122e740de3df1474814c700d2622950a"},
+ {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-macosx_10_7_x86_64.whl", hash = "sha256:d43002441932f9a9ea5d6f9efaa2e21458221a3a4b417a14027a1d530201ef1b"},
+ {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:fcb83175cc4936a5425dde3356f079ae03c0802bbdf8ff82c035f8a54b333521"},
+ {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:962ed72424bf1f72334e2f1e61b68f16c0e596f024ca7ac5daf229f7c26e4208"},
+ {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2cf5bb4dd67f20f3bbc1209ef572a259027c49e5ff694fa56bed62959b41e1f9"},
+ {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e544246b859f17373bed915182ab841b80849ed9cf23f1f07b73b7c58baee5fb"},
+ {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:c0877239307b7e69d025b73774e88e86ce82f6ba6adf98f41069d5b0b78bd1bf"},
+ {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:53df009d1e1ba40f696f8995683e067e3967101d4bb4ea6f667931b7d4a01357"},
+ {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a1254357f7e4c82e77c348dabf2d55f1d14d19d91ff025004775e70a6ef40ada"},
+ {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-macosx_10_7_x86_64.whl", hash = "sha256:524ff0ca3baea164d6d93a32c58ac79eca9f6cf713586fdc0adb66a8cdeab96a"},
+ {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f0ac9fb8608dbc6eaf17956bf623c9119b4db7dbb511650910a82e261e6600f"},
+ {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:320f14bd4542a04ab23747ff2c8a778bde727158b606e2661349557f0770711e"},
+ {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:63974d168b6233b4ed6a0046296803cb13c56637a7b8106564ab575926572a55"},
+ {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:417243bf599ba1f1fef2bb8c543ceb918676954734e2dcb82bf162ae9d7bd514"},
+ {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:dda81e5ec82485155a19d9624cfcca9be88a405e2857354e5b089c2a982144b2"},
+ {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:14cfbb00959259e15d684505263d5a21732b31248a5dd4941f73a3be233865b9"},
+ {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-macosx_10_7_x86_64.whl", hash = "sha256:631cb7415225954fdcc2a024119101946793e5923f6c4d73a5914d27eb3d3a05"},
+ {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:bec7dd208a4182e99c5b6c501ce0b1f49de2802448d4056091f8e630b28e9a52"},
+ {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:149b8a07712f45b332faee1a2258d8ef1fb4a36f88c0c17cb687f205c5dc6e7d"},
+ {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4d966c47f9dd73c2d32a809d2be529112d509321c5310ebf54076812e6ecd884"},
+ {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7eb037106f5c6b3b0b864ad226b0b7ab58157124161d48e4b30c4a43fef8bc4b"},
+ {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:154ea7c52e32dce13065dbb20a4a6f0cc012b4f667ac90d648d36b12007fa9f7"},
+ {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:e562617a45b5a9da5be4abe72b971d4f00bf8555eb29bb91ec2ef2be348cd132"},
+ {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:f23b55eb5464468f9e0e9a9935ce3ed2a870608d5f534025cd5536bca25b1402"},
+ {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-macosx_10_7_x86_64.whl", hash = "sha256:e9121b4009339b0f751955baf4543a0bfd6bc3f8188f8056b1a25a2d45099934"},
+ {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:0523aeb76e03f753b58be33b26540880bac5aa54422e4462404c432230543f33"},
+ {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e0e2959ef5d5b8dc9ef21e1a305a21a36e254e6a34432d00c72a92fdc5ecda5"},
+ {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:da01bec0a26befab4898ed83b362993c844b9a607a86add78604186297eb047e"},
+ {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f2e9072d71c1f6cfc79a36d4484c82823c560e6f5599c43c1ca6b5cdbd54f881"},
+ {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:f36a3489d9e28fe4b67be9992a23029c3cec0babc3bd9afb39f49844a8c721c5"},
+ {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f64f82cc3443149292b32387086d02a6c7fb39b8781563e0ca7b8d7d9cf72bd7"},
+ {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:b4a6db486ac8e99ae696e09efc8b2b9fea67b63c8f88ba7a1a16c24a057a0776"},
+ {file = "pydantic_core-2.10.1.tar.gz", hash = "sha256:0f8682dbdd2f67f8e1edddcbffcc29f60a6182b4901c367fc8c1c40d30bb0a82"},
]
[package.dependencies]
@@ -1089,4 +1089,4 @@ multidict = ">=4.0"
[metadata]
lock-version = "2.0"
python-versions = "^3.8"
-content-hash = "3e1a8be6a625876609484f89b16259eb58c4876f16a1125cbb92c9c27e8a7ffc"
+content-hash = "b91f1d0c814873b8713ba3ad427a53654ab44ff021a016991e94e6d88f74b81c"
diff --git a/packages/python-sdk/pyproject.toml b/packages/python-sdk/pyproject.toml
index e1bfcff4c..64d23a134 100644
--- a/packages/python-sdk/pyproject.toml
+++ b/packages/python-sdk/pyproject.toml
@@ -15,7 +15,7 @@ python = "^3.8"
urllib3 = ">= 1.25.3"
python-dateutil = ">=2.8.2"
aiohttp = ">= 3.8.4"
-pydantic = "^2.4.0"
+pydantic = "*"
aenum = ">=3.1.11"
websockets = "^11.0.3"
jsonrpcclient = "^4.0.3"
diff --git a/spec/openapi.yml b/spec/openapi.yml
index 5aeefcb6f..c6cb7dfab 100644
--- a/spec/openapi.yml
+++ b/spec/openapi.yml
@@ -1,34 +1,62 @@
openapi: 3.0.0
info:
- version: 0.1.0
- title: E2B API
+ version: 1.0.0
+ title: Devbook
+ description: Devbook API
servers:
- - url: "{server}/v1"
+ - url: https://ondevbook.com/
+ description: API endpoint
+ - url: https://{sessionID}-{clientID}.ondevbook.com/
+ description: Session endpoint without a specified port
variables:
- server:
- default: https://api.e2b.dev
+ sessionID:
+ description: ID of the session
+ default: _sessionID
+ clientID:
+ description: ID of the client
+ default: _clientID
+ - url: https://{port}-{sessionID}-{clientID}.ondevbook.com/
+ description: Session endpoint with a specificed port
+ variables:
+ sessionID:
+ description: ID of the session
+ default: _sessionID
+ clientID:
+ description: ID of the client
+ default: _clientID
+ port:
+ description: Devbook Daemon default port
+ default: "49982"
components:
securitySchemes:
ApiKeyAuth:
+ name: api_key
type: apiKey
- in: header
- name: X-API-Key
- AccessTokenAuth:
- type: http
- scheme: bearer
- bearerFormat: access_token
+ in: query
parameters:
- envID:
- name: envID
+ apiKeyOpt:
+ name: api_key
+ in: query
+ required: false
+ schema:
+ type: string
+ apiKeyReq:
+ name: api_key
+ in: query
+ required: true
+ schema:
+ type: string
+ codeSnippetID:
+ name: codeSnippetID
in: path
required: true
schema:
type: string
- instanceID:
- name: instanceID
+ sessionID:
+ name: sessionID
in: path
required: true
schema:
@@ -47,13 +75,6 @@ components:
application/json:
schema:
$ref: "#/components/schemas/Error"
- 404:
- description: Not found
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/Error"
-
500:
description: Server error
content:
@@ -62,38 +83,85 @@ components:
$ref: "#/components/schemas/Error"
schemas:
+ Template:
+ type: string
+ enum:
+ - Nodejs
+ - Go
+ - Bash
+ - Rust
+ - Python3
+ - PHP
+ - Java
+ - Perl
+ - DotNET
+
+ EnvironmentState:
+ type: string
+ enum:
+ - Building
+ - Failed
+ - Done
+
Environment:
required:
- - envID
- - status
- - public
+ - id
properties:
- envID:
+ id:
type: string
- description: Identifier of the environment
- status:
+ template:
+ type: string
+ title:
type: string
- description: Status of the environment
- enum:
- - building
- - ready
- - error
- public:
- type: boolean
- description: Whether the environment is public or only accessible by the team
- Instance:
+ NewEnvironment:
required:
- - envID
- - instanceID
+ - template
+ properties:
+ title:
+ type: string
+ template:
+ type: string
+
+ EnvironmentStateUpdate:
+ required:
+ - state
+ properties:
+ state:
+ $ref: "#/components/schemas/EnvironmentState"
+
+ EnvironmentTitleUpdate:
+ properties:
+ title:
+ type: string
+
+ NewSession:
+ required:
+ - codeSnippetID
+ properties:
+ editEnabled:
+ type: boolean
+ default: false
+ description: Option determining if the session is a shared persistent edit session
+ codeSnippetID:
+ type: string
+ description: Identifier of a code snippet which which is the environment associated
+ Session:
+ required:
+ - sessionID
- clientID
+ - editEnabled
+ - codeSnippetID
properties:
- envID:
+ codeSnippetID:
type: string
- description: Identifier of the environment from which is the instance created
- instanceID:
+ description: Identifier of a code snippet which which is the environment associated
+ editEnabled:
+ type: boolean
+ description: Information if the session is a shared persistent edit session
+ sessionID:
type: string
- description: Identifier of the instance
+ description: Identifier of the session
clientID:
type: string
description: Identifier of the client
@@ -112,8 +180,10 @@ components:
description: Error
tags:
- - name: instances
+ - name: sessions
+ description: Managing VM sessions
- name: envs
+ description: Environment for VM
paths:
/health:
@@ -125,26 +195,44 @@ paths:
401:
$ref: "#/components/responses/401"
-
- /instances:
+ /sessions:
+ get:
+ description: List all sessions
+ tags: [ sessions ]
+ parameters:
+ - $ref: "#/components/parameters/apiKeyReq"
+ responses:
+ 200:
+ description: Successfully returned all sessions
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ allOf:
+ - $ref: "#/components/schemas/Session"
+ 401:
+ $ref: "#/components/responses/401"
+ 500:
+ $ref: "#/components/responses/500"
post:
- description: Create an instance from the environment
- tags: [instances]
- security:
- - ApiKeyAuth: [ ]
+ description: Create a session on the server
+ tags: [ sessions ]
+ parameters:
+ - $ref: "#/components/parameters/apiKeyOpt"
requestBody:
required: true
content:
application/json:
schema:
- $ref: "#/components/schemas/Environment"
+ $ref: "#/components/schemas/NewSession"
responses:
- 202:
- description: The build has started
+ 201:
+ description: Successfully created a session
content:
application/json:
schema:
- $ref: "#/components/schemas/Instance"
+ $ref: "#/components/schemas/Session"
401:
$ref: "#/components/responses/401"
400:
@@ -152,21 +240,35 @@ paths:
500:
$ref: "#/components/responses/500"
- /instances/{instanceID}/refreshes:
+ /sessions/{sessionID}:
+ delete:
+ description: Delete a session on the server
+ tags: [ sessions ]
+ parameters:
+ - $ref: "#/components/parameters/apiKeyReq"
+ - $ref: "#/components/parameters/sessionID"
+ responses:
+ 204:
+ description: Successfully deleted the session
+ 401:
+ $ref: "#/components/responses/401"
+ 500:
+ $ref: "#/components/responses/500"
+
+ /sessions/{sessionID}/refresh:
post:
- description: Refresh the instance extending its time to live
- security:
- - ApiKeyAuth: [ ]
- tags: [ instances ]
+ description: Refresh the session extending its time to live
+ tags: [ sessions ]
parameters:
- - $ref: "#/components/parameters/instanceID"
+ - $ref: "#/components/parameters/apiKeyOpt"
+ - $ref: "#/components/parameters/sessionID"
responses:
204:
- description: Successfully refreshed the instance
+ description: Successfully refreshed the session
401:
$ref: "#/components/responses/401"
404:
- description: Error refreshing instance - not found
+ description: Error refreshing session - session not found
content:
application/json:
schema:
@@ -175,9 +277,9 @@ paths:
/envs:
get:
description: List all environments
- tags: [envs]
- security:
- - AccessTokenAuth: [ ]
+ tags: [ envs ]
+ parameters:
+ - $ref: "#/components/parameters/apiKeyReq"
responses:
200:
description: Successfully returned all environments
@@ -195,62 +297,124 @@ paths:
post:
description: Create a new environment
tags: [ envs ]
- security:
- - AccessTokenAuth: [ ]
+ parameters:
+ - $ref: "#/components/parameters/apiKeyReq"
requestBody:
required: true
content:
- multipart/form-data:
+ application/json:
schema:
- type: object
- required:
- - buildContext
- - dockerfile
- properties:
- buildContext:
- description: Docker build context
- type: string
- format: binary
- dockerfile:
- type: string
- description: Dockerfile content
- envID:
- type: string
- description: ID of the environment, only present if the environment should be rebuilt
- encoding:
- buildContext:
- contentType: application/octet-stream
-
+ $ref: "#/components/schemas/NewEnvironment"
responses:
200:
- description: Successfully returned all environments
+ description: Successfully created an environment
content:
application/json:
schema:
$ref: "#/components/schemas/Environment"
+ 400:
+ $ref: "#/components/responses/400"
401:
$ref: "#/components/responses/401"
500:
$ref: "#/components/responses/500"
- /envs/{envID}:
- get:
- description: Get environment info
- tags: [envs]
- security:
- - AccessTokenAuth: [ ]
+ # This method will be replaced by POST /envs
+ /envs/{codeSnippetID}:
+ post:
+ description: Create a new env for a code snippet
+ tags: [ envs ]
parameters:
- - $ref: "#/components/parameters/envID"
+ - $ref: "#/components/parameters/apiKeyReq"
+ - $ref: "#/components/parameters/codeSnippetID"
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/NewEnvironment"
responses:
- 200:
- description: Successfully returned the environment
+ 204:
+ description: Successfully created an environment
+ 400:
+ $ref: "#/components/responses/400"
+ 401:
+ $ref: "#/components/responses/401"
+ 500:
+ $ref: "#/components/responses/500"
+ delete:
+ description: Delete the code snippet environment
+ tags: [ envs ]
+ parameters:
+ - $ref: "#/components/parameters/apiKeyReq"
+ - $ref: "#/components/parameters/codeSnippetID"
+ responses:
+ 204:
+ description: Successfully deleted the environment
+ 400:
+ description: Cannot delete the environment
content:
application/json:
schema:
- $ref: "#/components/schemas/Environment"
+ $ref: "#/components/schemas/Error"
+ 401:
+ $ref: "#/components/responses/401"
+ 500:
+ $ref: "#/components/responses/500"
+ patch:
+ description: Update the environment of the code snippet to match the edit environment
+ tags: [ envs ]
+ parameters:
+ - $ref: "#/components/parameters/apiKeyReq"
+ - $ref: "#/components/parameters/codeSnippetID"
+ responses:
+ 204:
+ description: Updated the edit environment for code snippet
+ 400:
+ $ref: "#/components/responses/400"
401:
$ref: "#/components/responses/401"
- 404:
- $ref: "#/components/responses/404"
500:
$ref: "#/components/responses/500"
+
+ /envs/{codeSnippetID}/state:
+ put:
+ description: Update the state of the environment
+ tags: [ envs ]
+ parameters:
+ - $ref: "#/components/parameters/apiKeyReq"
+ - $ref: "#/components/parameters/codeSnippetID"
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/EnvironmentStateUpdate"
+ responses:
+ 204:
+ description: Updated the state of environment
+ 400:
+ $ref: "#/components/responses/400"
+ 401:
+ $ref: "#/components/responses/401"
+
+ /envs/{codeSnippetID}/title:
+ put:
+ description: Update the title of the environment
+ tags: [ envs ]
+ parameters:
+ - $ref: "#/components/parameters/apiKeyReq"
+ - $ref: "#/components/parameters/codeSnippetID"
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/EnvironmentTitleUpdate"
+ responses:
+ 204:
+ description: Updated the title of the code snippet
+ 400:
+ $ref: "#/components/responses/400"
+ 401:
+ $ref: "#/components/responses/401"
\ No newline at end of file