Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Generate playground API client

Tomas Valenta5aa28271da31
diff --git a/api-service/.openapi-generator/FILES b/api-service/.openapi-generator/FILES
index 38d835836..79cae4f14 100644
--- a/api-service/.openapi-generator/FILES
+++ b/api-service/.openapi-generator/FILES
@@ -3,11 +3,11 @@ playground_client/api/__init__.py
playground_client/api/default_api.py
playground_client/api_client.py
playground_client/configuration.py
-playground_client/docs/CreateSessionResponse.md
playground_client/docs/CreateSessionsRequest.md
playground_client/docs/DefaultApi.md
playground_client/docs/EntryInfo.md
playground_client/docs/ListFilesystemDirResponse.md
+playground_client/docs/OpenPort.md
playground_client/docs/OutStderrResponse.md
playground_client/docs/OutStdoutResponse.md
playground_client/docs/OutType.md
@@ -15,15 +15,16 @@ playground_client/docs/OutTypeStderr.md
playground_client/docs/OutTypeStdout.md
playground_client/docs/ProcessResponse.md
playground_client/docs/ReadFilesystemFileResponse.md
+playground_client/docs/SessionResponse.md
playground_client/docs/StartProcessParams.md
playground_client/docs/WriteFilesystemFileRequest.md
playground_client/docs/WriteProcessStdinRequest.md
playground_client/exceptions.py
playground_client/models/__init__.py
-playground_client/models/create_session_response.py
playground_client/models/create_sessions_request.py
playground_client/models/entry_info.py
playground_client/models/list_filesystem_dir_response.py
+playground_client/models/open_port.py
playground_client/models/out_stderr_response.py
playground_client/models/out_stdout_response.py
playground_client/models/out_type.py
@@ -31,16 +32,17 @@ playground_client/models/out_type_stderr.py
playground_client/models/out_type_stdout.py
playground_client/models/process_response.py
playground_client/models/read_filesystem_file_response.py
+playground_client/models/session_response.py
playground_client/models/start_process_params.py
playground_client/models/write_filesystem_file_request.py
playground_client/models/write_process_stdin_request.py
playground_client/rest.py
playground_client/test/__init__.py
-playground_client/test/test_create_session_response.py
playground_client/test/test_create_sessions_request.py
playground_client/test/test_default_api.py
playground_client/test/test_entry_info.py
playground_client/test/test_list_filesystem_dir_response.py
+playground_client/test/test_open_port.py
playground_client/test/test_out_stderr_response.py
playground_client/test/test_out_stdout_response.py
playground_client/test/test_out_type.py
@@ -48,6 +50,7 @@ playground_client/test/test_out_type_stderr.py
playground_client/test/test_out_type_stdout.py
playground_client/test/test_process_response.py
playground_client/test/test_read_filesystem_file_response.py
+playground_client/test/test_session_response.py
playground_client/test/test_start_process_params.py
playground_client/test/test_write_filesystem_file_request.py
playground_client/test/test_write_process_stdin_request.py
diff --git a/api-service/playground_client/__init__.py b/api-service/playground_client/__init__.py
index e15841a8e..a0fea5b24 100644
--- a/api-service/playground_client/__init__.py
+++ b/api-service/playground_client/__init__.py
@@ -29,10 +29,10 @@ from playground_client.exceptions import ApiKeyError
from playground_client.exceptions import ApiAttributeError
from playground_client.exceptions import ApiException
# import models into sdk package
-from playground_client.models.create_session_response import CreateSessionResponse
from playground_client.models.create_sessions_request import CreateSessionsRequest
from playground_client.models.entry_info import EntryInfo
from playground_client.models.list_filesystem_dir_response import ListFilesystemDirResponse
+from playground_client.models.open_port import OpenPort
from playground_client.models.out_stderr_response import OutStderrResponse
from playground_client.models.out_stdout_response import OutStdoutResponse
from playground_client.models.out_type import OutType
@@ -40,6 +40,7 @@ from playground_client.models.out_type_stderr import OutTypeStderr
from playground_client.models.out_type_stdout import OutTypeStdout
from playground_client.models.process_response import ProcessResponse
from playground_client.models.read_filesystem_file_response import ReadFilesystemFileResponse
+from playground_client.models.session_response import SessionResponse
from playground_client.models.start_process_params import StartProcessParams
from playground_client.models.write_filesystem_file_request import WriteFilesystemFileRequest
from playground_client.models.write_process_stdin_request import WriteProcessStdinRequest
diff --git a/api-service/playground_client/api/default_api.py b/api-service/playground_client/api/default_api.py
index ff52502bf..ce604cfb7 100644
--- a/api-service/playground_client/api/default_api.py
+++ b/api-service/playground_client/api/default_api.py
@@ -21,11 +21,11 @@ from pydantic import Field, StrictBool, StrictStr
from typing import Optional
-from playground_client.models.create_session_response import CreateSessionResponse
from playground_client.models.create_sessions_request import CreateSessionsRequest
from playground_client.models.list_filesystem_dir_response import ListFilesystemDirResponse
from playground_client.models.process_response import ProcessResponse
from playground_client.models.read_filesystem_file_response import ReadFilesystemFileResponse
+from playground_client.models.session_response import SessionResponse
from playground_client.models.start_process_params import StartProcessParams
from playground_client.models.write_filesystem_file_request import WriteFilesystemFileRequest
from playground_client.models.write_process_stdin_request import WriteProcessStdinRequest
@@ -50,7 +50,7 @@ class DefaultApi(object):
self.api_client = api_client
@validate_arguments
- def create_sessions(self, create_sessions_request : CreateSessionsRequest, **kwargs) -> CreateSessionResponse: # noqa: E501
+ def create_sessions(self, create_sessions_request : CreateSessionsRequest, **kwargs) -> SessionResponse: # noqa: E501
"""create_sessions # noqa: E501
This method makes a synchronous HTTP request by default. To make an
@@ -74,7 +74,7 @@ class DefaultApi(object):
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
- :rtype: CreateSessionResponse
+ :rtype: SessionResponse
"""
kwargs['_return_http_data_only'] = True
return self.create_sessions_with_http_info(create_sessions_request, **kwargs) # noqa: E501
@@ -112,7 +112,7 @@ class DefaultApi(object):
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
- :rtype: tuple(CreateSessionResponse, status_code(int), headers(HTTPHeaderDict))
+ :rtype: tuple(SessionResponse, status_code(int), headers(HTTPHeaderDict))
"""
_params = locals()
@@ -177,7 +177,7 @@ class DefaultApi(object):
_auth_settings = [] # noqa: E501
_response_types_map = {
- '200': "CreateSessionResponse",
+ '200': "SessionResponse",
}
return self.api_client.call_api(
@@ -613,7 +613,148 @@ class DefaultApi(object):
}
return self.api_client.call_api(
- '/sessions/{id}/process/{processID}', 'GET',
+ '/sessions/{id}/processes/{processID}', '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'))
+
+ @validate_arguments
+ def get_session(self, id : StrictStr, **kwargs) -> SessionResponse: # noqa: E501
+ """get_session # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_session(id, async_req=True)
+ >>> result = thread.get()
+
+ :param id: (required)
+ :type id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: 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: SessionResponse
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.get_session_with_http_info(id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_session_with_http_info(self, id : StrictStr, **kwargs): # noqa: E501
+ """get_session # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_session_with_http_info(id, async_req=True)
+ >>> result = thread.get()
+
+ :param id: (required)
+ :type id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: 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(SessionResponse, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ '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 get_session" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['id']:
+ _path_params['id'] = _params['id']
+
+ # 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 = {
+ '200': "SessionResponse",
+ }
+
+ return self.api_client.call_api(
+ '/sessions/{id}', 'GET',
_path_params,
_query_params,
_header_params,
@@ -1213,7 +1354,7 @@ class DefaultApi(object):
}
return self.api_client.call_api(
- '/sessions/{id}/process', 'POST',
+ '/sessions/{id}/processes', 'POST',
_path_params,
_query_params,
_header_params,
@@ -1368,7 +1509,7 @@ class DefaultApi(object):
}
return self.api_client.call_api(
- '/sessions/{id}/process/{processID}', 'DELETE',
+ '/sessions/{id}/processes/{processID}', 'DELETE',
_path_params,
_query_params,
_header_params,
@@ -1680,7 +1821,7 @@ class DefaultApi(object):
_response_types_map = {}
return self.api_client.call_api(
- '/sessions/{id}/process/{processID}/stdin', 'POST',
+ '/sessions/{id}/processes/{processID}/stdin', 'POST',
_path_params,
_query_params,
_header_params,
diff --git a/api-service/playground_client/docs/CreateSessionResponse.md b/api-service/playground_client/docs/CreateSessionResponse.md
deleted file mode 100644
index a20c893c4..000000000
--- a/api-service/playground_client/docs/CreateSessionResponse.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# CreateSessionResponse
-
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **str** | |
-
-## Example
-
-```python
-from playground_client.models.create_session_response import CreateSessionResponse
-
-# TODO update the JSON string below
-json = "{}"
-# create an instance of CreateSessionResponse from a JSON string
-create_session_response_instance = CreateSessionResponse.from_json(json)
-# print the JSON string representation of the object
-print CreateSessionResponse.to_json()
-
-# convert the object into a dict
-create_session_response_dict = create_session_response_instance.to_dict()
-# create an instance of CreateSessionResponse from a dict
-create_session_response_form_dict = create_session_response.from_dict(create_session_response_dict)
-```
-[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
-
diff --git a/api-service/playground_client/docs/DefaultApi.md b/api-service/playground_client/docs/DefaultApi.md
index 12c3d3a62..75bf4374c 100644
--- a/api-service/playground_client/docs/DefaultApi.md
+++ b/api-service/playground_client/docs/DefaultApi.md
@@ -7,18 +7,19 @@ Method | HTTP request | Description
[**create_sessions**](DefaultApi.md#create_sessions) | **POST** /sessions |
[**delete_filesystem_entry**](DefaultApi.md#delete_filesystem_entry) | **DELETE** /sessions/{id}/filesystem |
[**delete_session**](DefaultApi.md#delete_session) | **DELETE** /sessions/{id} |
-[**get_process**](DefaultApi.md#get_process) | **GET** /sessions/{id}/process/{processID} |
+[**get_process**](DefaultApi.md#get_process) | **GET** /sessions/{id}/processes/{processID} |
+[**get_session**](DefaultApi.md#get_session) | **GET** /sessions/{id} |
[**list_filesystem_dir**](DefaultApi.md#list_filesystem_dir) | **GET** /sessions/{id}/filesystem/dir |
[**make_filesystem_dir**](DefaultApi.md#make_filesystem_dir) | **PUT** /sessions/{id}/filesystem/dir |
[**read_filesystem_file**](DefaultApi.md#read_filesystem_file) | **GET** /sessions/{id}/filesystem/file |
-[**start_process**](DefaultApi.md#start_process) | **POST** /sessions/{id}/process |
-[**stop_process**](DefaultApi.md#stop_process) | **DELETE** /sessions/{id}/process/{processID} |
+[**start_process**](DefaultApi.md#start_process) | **POST** /sessions/{id}/processes |
+[**stop_process**](DefaultApi.md#stop_process) | **DELETE** /sessions/{id}/processes/{processID} |
[**write_filesystem_file**](DefaultApi.md#write_filesystem_file) | **PUT** /sessions/{id}/filesystem/file |
-[**write_process_stdin**](DefaultApi.md#write_process_stdin) | **POST** /sessions/{id}/process/{processID}/stdin |
+[**write_process_stdin**](DefaultApi.md#write_process_stdin) | **POST** /sessions/{id}/processes/{processID}/stdin |
# **create_sessions**
-> CreateSessionResponse create_sessions(create_sessions_request)
+> SessionResponse create_sessions(create_sessions_request)
@@ -60,7 +61,7 @@ Name | Type | Description | Notes
### Return type
-[**CreateSessionResponse**](CreateSessionResponse.md)
+[**SessionResponse**](SessionResponse.md)
### Authorization
@@ -263,6 +264,67 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+# **get_session**
+> SessionResponse get_session(id)
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import playground_client
+from playground_client.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to https://localhost:9001
+# See configuration.py for a list of all supported configuration parameters.
+configuration = playground_client.Configuration(
+ host = "https://localhost:9001"
+)
+
+
+# Enter a context with an instance of the API client
+with playground_client.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = playground_client.DefaultApi(api_client)
+ id = 'id_example' # str |
+
+ try:
+ api_response = api_instance.get_session(id)
+ print("The response of DefaultApi->get_session:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling DefaultApi->get_session: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **id** | **str**| |
+
+### Return type
+
+[**SessionResponse**](SessionResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Ok | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
# **list_filesystem_dir**
> ListFilesystemDirResponse list_filesystem_dir(id, path)
diff --git a/api-service/playground_client/docs/OpenPort.md b/api-service/playground_client/docs/OpenPort.md
new file mode 100644
index 000000000..5c9230720
--- /dev/null
+++ b/api-service/playground_client/docs/OpenPort.md
@@ -0,0 +1,30 @@
+# OpenPort
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**state** | **str** | |
+**ip** | **str** | |
+**port** | **float** | |
+
+## Example
+
+```python
+from playground_client.models.open_port import OpenPort
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of OpenPort from a JSON string
+open_port_instance = OpenPort.from_json(json)
+# print the JSON string representation of the object
+print OpenPort.to_json()
+
+# convert the object into a dict
+open_port_dict = open_port_instance.to_dict()
+# create an instance of OpenPort from a dict
+open_port_form_dict = open_port.from_dict(open_port_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/api-service/playground_client/docs/SessionResponse.md b/api-service/playground_client/docs/SessionResponse.md
new file mode 100644
index 000000000..3cc9ebdea
--- /dev/null
+++ b/api-service/playground_client/docs/SessionResponse.md
@@ -0,0 +1,29 @@
+# SessionResponse
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **str** | |
+**ports** | [**List[OpenPort]**](OpenPort.md) | |
+
+## Example
+
+```python
+from playground_client.models.session_response import SessionResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of SessionResponse from a JSON string
+session_response_instance = SessionResponse.from_json(json)
+# print the JSON string representation of the object
+print SessionResponse.to_json()
+
+# convert the object into a dict
+session_response_dict = session_response_instance.to_dict()
+# create an instance of SessionResponse from a dict
+session_response_form_dict = session_response.from_dict(session_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/api-service/playground_client/models/__init__.py b/api-service/playground_client/models/__init__.py
index 7baf60813..6f28cbd47 100644
--- a/api-service/playground_client/models/__init__.py
+++ b/api-service/playground_client/models/__init__.py
@@ -14,10 +14,10 @@
from __future__ import absolute_import
# import models into model package
-from playground_client.models.create_session_response import CreateSessionResponse
from playground_client.models.create_sessions_request import CreateSessionsRequest
from playground_client.models.entry_info import EntryInfo
from playground_client.models.list_filesystem_dir_response import ListFilesystemDirResponse
+from playground_client.models.open_port import OpenPort
from playground_client.models.out_stderr_response import OutStderrResponse
from playground_client.models.out_stdout_response import OutStdoutResponse
from playground_client.models.out_type import OutType
@@ -25,6 +25,7 @@ from playground_client.models.out_type_stderr import OutTypeStderr
from playground_client.models.out_type_stdout import OutTypeStdout
from playground_client.models.process_response import ProcessResponse
from playground_client.models.read_filesystem_file_response import ReadFilesystemFileResponse
+from playground_client.models.session_response import SessionResponse
from playground_client.models.start_process_params import StartProcessParams
from playground_client.models.write_filesystem_file_request import WriteFilesystemFileRequest
from playground_client.models.write_process_stdin_request import WriteProcessStdinRequest
diff --git a/api-service/playground_client/models/create_session_response.py b/api-service/playground_client/models/open_port.py
similarity index 69%
rename from api-service/playground_client/models/create_session_response.py
rename to api-service/playground_client/models/open_port.py
index bfc3e2ea4..b6d42be5d 100644
--- a/api-service/playground_client/models/create_session_response.py
+++ b/api-service/playground_client/models/open_port.py
@@ -18,16 +18,18 @@ import json
-from pydantic import BaseModel, StrictStr
+from pydantic import BaseModel, Field, StrictStr
-class CreateSessionResponse(BaseModel):
+class OpenPort(BaseModel):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
- id: StrictStr = ...
- __properties = ["id"]
+ state: StrictStr = Field(..., alias="State")
+ ip: StrictStr = Field(..., alias="Ip")
+ port: float = Field(..., alias="Port")
+ __properties = ["State", "Ip", "Port"]
class Config:
allow_population_by_field_name = True
@@ -42,8 +44,8 @@ class CreateSessionResponse(BaseModel):
return json.dumps(self.to_dict())
@classmethod
- def from_json(cls, json_str: str) -> CreateSessionResponse:
- """Create an instance of CreateSessionResponse from a JSON string"""
+ def from_json(cls, json_str: str) -> OpenPort:
+ """Create an instance of OpenPort from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self):
@@ -55,21 +57,23 @@ class CreateSessionResponse(BaseModel):
return _dict
@classmethod
- def from_dict(cls, obj: dict) -> CreateSessionResponse:
- """Create an instance of CreateSessionResponse from a dict"""
+ def from_dict(cls, obj: dict) -> OpenPort:
+ """Create an instance of OpenPort from a dict"""
if obj is None:
return None
if type(obj) is not dict:
- return CreateSessionResponse.parse_obj(obj)
+ return OpenPort.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 CreateSessionResponse) in the input: " + obj)
+ raise ValueError("Error due to additional fields (not defined in OpenPort) in the input: " + obj)
- _obj = CreateSessionResponse.parse_obj({
- "id": obj.get("id")
+ _obj = OpenPort.parse_obj({
+ "state": obj.get("State"),
+ "ip": obj.get("Ip"),
+ "port": obj.get("Port")
})
return _obj
diff --git a/api-service/playground_client/models/session_response.py b/api-service/playground_client/models/session_response.py
new file mode 100644
index 000000000..36fc84e88
--- /dev/null
+++ b/api-service/playground_client/models/session_response.py
@@ -0,0 +1,85 @@
+# coding: utf-8
+
+"""
+ playground
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List
+from pydantic import BaseModel, StrictStr
+from playground_client.models.open_port import OpenPort
+
+class SessionResponse(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ id: StrictStr = ...
+ ports: List[OpenPort] = ...
+ __properties = ["id", "ports"]
+
+ class Config:
+ 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) -> SessionResponse:
+ """Create an instance of SessionResponse 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)
+ # override the default output from pydantic by calling `to_dict()` of each item in ports (list)
+ _items = []
+ if self.ports:
+ for _item in self.ports:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict['ports'] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> SessionResponse:
+ """Create an instance of SessionResponse from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return SessionResponse.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 SessionResponse) in the input: " + obj)
+
+ _obj = SessionResponse.parse_obj({
+ "id": obj.get("id"),
+ "ports": [OpenPort.from_dict(_item) for _item in obj.get("ports")] if obj.get("ports") is not None else None
+ })
+ return _obj
+
diff --git a/api-service/playground_client/test/test_default_api.py b/api-service/playground_client/test/test_default_api.py
index d082bb255..96722de6c 100644
--- a/api-service/playground_client/test/test_default_api.py
+++ b/api-service/playground_client/test/test_default_api.py
@@ -52,6 +52,12 @@ class TestDefaultApi(unittest.TestCase):
"""
pass
+ def test_get_session(self):
+ """Test case for get_session
+
+ """
+ pass
+
def test_list_filesystem_dir(self):
"""Test case for list_filesystem_dir
diff --git a/api-service/playground_client/test/test_create_session_response.py b/api-service/playground_client/test/test_open_port.py
similarity index 61%
rename from api-service/playground_client/test/test_create_session_response.py
rename to api-service/playground_client/test/test_open_port.py
index 2a1ad592a..3e8090a49 100644
--- a/api-service/playground_client/test/test_create_session_response.py
+++ b/api-service/playground_client/test/test_open_port.py
@@ -16,11 +16,11 @@ import unittest
import datetime
import playground_client
-from playground_client.models.create_session_response import CreateSessionResponse # noqa: E501
+from playground_client.models.open_port import OpenPort # noqa: E501
from playground_client.rest import ApiException
-class TestCreateSessionResponse(unittest.TestCase):
- """CreateSessionResponse unit test stubs"""
+class TestOpenPort(unittest.TestCase):
+ """OpenPort unit test stubs"""
def setUp(self):
pass
@@ -29,25 +29,29 @@ class TestCreateSessionResponse(unittest.TestCase):
pass
def make_instance(self, include_optional):
- """Test CreateSessionResponse
+ """Test OpenPort
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
- # uncomment below to create an instance of `CreateSessionResponse`
+ # uncomment below to create an instance of `OpenPort`
"""
- model = playground_client.models.create_session_response.CreateSessionResponse() # noqa: E501
+ model = playground_client.models.open_port.OpenPort() # noqa: E501
if include_optional :
- return CreateSessionResponse(
- id = ''
+ return OpenPort(
+ state = '',
+ ip = '',
+ port = 1.337
)
else :
- return CreateSessionResponse(
- id = '',
+ return OpenPort(
+ state = '',
+ ip = '',
+ port = 1.337,
)
"""
- def testCreateSessionResponse(self):
- """Test CreateSessionResponse"""
+ def testOpenPort(self):
+ """Test OpenPort"""
# inst_req_only = self.make_instance(include_optional=False)
# inst_req_and_optional = self.make_instance(include_optional=True)
diff --git a/api-service/playground_client/test/test_session_response.py b/api-service/playground_client/test/test_session_response.py
new file mode 100644
index 000000000..78faba713
--- /dev/null
+++ b/api-service/playground_client/test/test_session_response.py
@@ -0,0 +1,67 @@
+# coding: utf-8
+
+"""
+ playground
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import playground_client
+from playground_client.models.session_response import SessionResponse # noqa: E501
+from playground_client.rest import ApiException
+
+class TestSessionResponse(unittest.TestCase):
+ """SessionResponse unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test SessionResponse
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `SessionResponse`
+ """
+ model = playground_client.models.session_response.SessionResponse() # noqa: E501
+ if include_optional :
+ return SessionResponse(
+ id = '',
+ ports = [
+ playground_client.models.open_port.OpenPort(
+ state = '',
+ ip = '',
+ port = 1.337, )
+ ]
+ )
+ else :
+ return SessionResponse(
+ id = '',
+ ports = [
+ playground_client.models.open_port.OpenPort(
+ state = '',
+ ip = '',
+ port = 1.337, )
+ ],
+ )
+ """
+
+ def testSessionResponse(self):
+ """Test SessionResponse"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/api-service/playground_client_README.md b/api-service/playground_client_README.md
index 0cedb2f23..00c020155 100644
--- a/api-service/playground_client_README.md
+++ b/api-service/playground_client_README.md
@@ -67,22 +67,23 @@ Class | Method | HTTP request | Description
*DefaultApi* | [**create_sessions**](playground_client/docs/DefaultApi.md#create_sessions) | **POST** /sessions |
*DefaultApi* | [**delete_filesystem_entry**](playground_client/docs/DefaultApi.md#delete_filesystem_entry) | **DELETE** /sessions/{id}/filesystem |
*DefaultApi* | [**delete_session**](playground_client/docs/DefaultApi.md#delete_session) | **DELETE** /sessions/{id} |
-*DefaultApi* | [**get_process**](playground_client/docs/DefaultApi.md#get_process) | **GET** /sessions/{id}/process/{processID} |
+*DefaultApi* | [**get_process**](playground_client/docs/DefaultApi.md#get_process) | **GET** /sessions/{id}/processes/{processID} |
+*DefaultApi* | [**get_session**](playground_client/docs/DefaultApi.md#get_session) | **GET** /sessions/{id} |
*DefaultApi* | [**list_filesystem_dir**](playground_client/docs/DefaultApi.md#list_filesystem_dir) | **GET** /sessions/{id}/filesystem/dir |
*DefaultApi* | [**make_filesystem_dir**](playground_client/docs/DefaultApi.md#make_filesystem_dir) | **PUT** /sessions/{id}/filesystem/dir |
*DefaultApi* | [**read_filesystem_file**](playground_client/docs/DefaultApi.md#read_filesystem_file) | **GET** /sessions/{id}/filesystem/file |
-*DefaultApi* | [**start_process**](playground_client/docs/DefaultApi.md#start_process) | **POST** /sessions/{id}/process |
-*DefaultApi* | [**stop_process**](playground_client/docs/DefaultApi.md#stop_process) | **DELETE** /sessions/{id}/process/{processID} |
+*DefaultApi* | [**start_process**](playground_client/docs/DefaultApi.md#start_process) | **POST** /sessions/{id}/processes |
+*DefaultApi* | [**stop_process**](playground_client/docs/DefaultApi.md#stop_process) | **DELETE** /sessions/{id}/processes/{processID} |
*DefaultApi* | [**write_filesystem_file**](playground_client/docs/DefaultApi.md#write_filesystem_file) | **PUT** /sessions/{id}/filesystem/file |
-*DefaultApi* | [**write_process_stdin**](playground_client/docs/DefaultApi.md#write_process_stdin) | **POST** /sessions/{id}/process/{processID}/stdin |
+*DefaultApi* | [**write_process_stdin**](playground_client/docs/DefaultApi.md#write_process_stdin) | **POST** /sessions/{id}/processes/{processID}/stdin |
## Documentation For Models
- - [CreateSessionResponse](playground_client/docs/CreateSessionResponse.md)
- [CreateSessionsRequest](playground_client/docs/CreateSessionsRequest.md)
- [EntryInfo](playground_client/docs/EntryInfo.md)
- [ListFilesystemDirResponse](playground_client/docs/ListFilesystemDirResponse.md)
+ - [OpenPort](playground_client/docs/OpenPort.md)
- [OutStderrResponse](playground_client/docs/OutStderrResponse.md)
- [OutStdoutResponse](playground_client/docs/OutStdoutResponse.md)
- [OutType](playground_client/docs/OutType.md)
@@ -90,6 +91,7 @@ Class | Method | HTTP request | Description
- [OutTypeStdout](playground_client/docs/OutTypeStdout.md)
- [ProcessResponse](playground_client/docs/ProcessResponse.md)
- [ReadFilesystemFileResponse](playground_client/docs/ReadFilesystemFileResponse.md)
+ - [SessionResponse](playground_client/docs/SessionResponse.md)
- [StartProcessParams](playground_client/docs/StartProcessParams.md)
- [WriteFilesystemFileRequest](playground_client/docs/WriteFilesystemFileRequest.md)
- [WriteProcessStdinRequest](playground_client/docs/WriteProcessStdinRequest.md)