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 Valentabe15850b370e
diff --git a/api-service/.openapi-generator/FILES b/api-service/.openapi-generator/FILES
index 79cae4f14..518b6b636 100644
--- a/api-service/.openapi-generator/FILES
+++ b/api-service/.openapi-generator/FILES
@@ -3,10 +3,14 @@ playground_client/api/__init__.py
playground_client/api/default_api.py
playground_client/api_client.py
playground_client/configuration.py
+playground_client/docs/CreateMockDataRequest.md
playground_client/docs/CreateSessionsRequest.md
playground_client/docs/DefaultApi.md
playground_client/docs/EntryInfo.md
+playground_client/docs/File.md
playground_client/docs/ListFilesystemDirResponse.md
+playground_client/docs/MockDataResponse.md
+playground_client/docs/MockDataResponseMockData.md
playground_client/docs/OpenPort.md
playground_client/docs/OutStderrResponse.md
playground_client/docs/OutStdoutResponse.md
@@ -21,9 +25,13 @@ playground_client/docs/WriteFilesystemFileRequest.md
playground_client/docs/WriteProcessStdinRequest.md
playground_client/exceptions.py
playground_client/models/__init__.py
+playground_client/models/create_mock_data_request.py
playground_client/models/create_sessions_request.py
playground_client/models/entry_info.py
+playground_client/models/file.py
playground_client/models/list_filesystem_dir_response.py
+playground_client/models/mock_data_response.py
+playground_client/models/mock_data_response_mock_data.py
playground_client/models/open_port.py
playground_client/models/out_stderr_response.py
playground_client/models/out_stdout_response.py
@@ -38,10 +46,14 @@ 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_mock_data_request.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_file.py
playground_client/test/test_list_filesystem_dir_response.py
+playground_client/test/test_mock_data_response.py
+playground_client/test/test_mock_data_response_mock_data.py
playground_client/test/test_open_port.py
playground_client/test/test_out_stderr_response.py
playground_client/test/test_out_stdout_response.py
diff --git a/api-service/playground_client/__init__.py b/api-service/playground_client/__init__.py
index a0fea5b24..e48fdebe1 100644
--- a/api-service/playground_client/__init__.py
+++ b/api-service/playground_client/__init__.py
@@ -29,9 +29,13 @@ 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_mock_data_request import CreateMockDataRequest
from playground_client.models.create_sessions_request import CreateSessionsRequest
from playground_client.models.entry_info import EntryInfo
+from playground_client.models.file import File
from playground_client.models.list_filesystem_dir_response import ListFilesystemDirResponse
+from playground_client.models.mock_data_response import MockDataResponse
+from playground_client.models.mock_data_response_mock_data import MockDataResponseMockData
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
diff --git a/api-service/playground_client/api/default_api.py b/api-service/playground_client/api/default_api.py
index ce604cfb7..bed0f772b 100644
--- a/api-service/playground_client/api/default_api.py
+++ b/api-service/playground_client/api/default_api.py
@@ -21,8 +21,10 @@ from pydantic import Field, StrictBool, StrictStr
from typing import Optional
+from playground_client.models.create_mock_data_request import CreateMockDataRequest
from playground_client.models.create_sessions_request import CreateSessionsRequest
from playground_client.models.list_filesystem_dir_response import ListFilesystemDirResponse
+from playground_client.models.mock_data_response import MockDataResponse
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
@@ -49,6 +51,154 @@ class DefaultApi(object):
api_client = ApiClient.get_default()
self.api_client = api_client
+ @validate_arguments
+ def create_mock_data(self, create_mock_data_request : CreateMockDataRequest, **kwargs) -> MockDataResponse: # noqa: E501
+ """create_mock_data # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_mock_data(create_mock_data_request, async_req=True)
+ >>> result = thread.get()
+
+ :param create_mock_data_request: (required)
+ :type create_mock_data_request: CreateMockDataRequest
+ :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: MockDataResponse
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.create_mock_data_with_http_info(create_mock_data_request, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def create_mock_data_with_http_info(self, create_mock_data_request : CreateMockDataRequest, **kwargs): # noqa: E501
+ """create_mock_data # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_mock_data_with_http_info(create_mock_data_request, async_req=True)
+ >>> result = thread.get()
+
+ :param create_mock_data_request: (required)
+ :type create_mock_data_request: CreateMockDataRequest
+ :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(MockDataResponse, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'create_mock_data_request'
+ ]
+ _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 create_mock_data" % _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
+ if _params['create_mock_data_request']:
+ _body_params = _params['create_mock_data_request']
+
+ # 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': "MockDataResponse",
+ }
+
+ return self.api_client.call_api(
+ '/data/mock', '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'))
+
@validate_arguments
def create_sessions(self, create_sessions_request : CreateSessionsRequest, **kwargs) -> SessionResponse: # noqa: E501
"""create_sessions # noqa: E501
diff --git a/api-service/playground_client/docs/CreateMockDataRequest.md b/api-service/playground_client/docs/CreateMockDataRequest.md
new file mode 100644
index 000000000..e39253c63
--- /dev/null
+++ b/api-service/playground_client/docs/CreateMockDataRequest.md
@@ -0,0 +1,29 @@
+# CreateMockDataRequest
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**files** | [**List[File]**](File.md) | |
+**target_interface** | **str** | |
+
+## Example
+
+```python
+from playground_client.models.create_mock_data_request import CreateMockDataRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of CreateMockDataRequest from a JSON string
+create_mock_data_request_instance = CreateMockDataRequest.from_json(json)
+# print the JSON string representation of the object
+print CreateMockDataRequest.to_json()
+
+# convert the object into a dict
+create_mock_data_request_dict = create_mock_data_request_instance.to_dict()
+# create an instance of CreateMockDataRequest from a dict
+create_mock_data_request_form_dict = create_mock_data_request.from_dict(create_mock_data_request_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 75bf4374c..85a68e0ab 100644
--- a/api-service/playground_client/docs/DefaultApi.md
+++ b/api-service/playground_client/docs/DefaultApi.md
@@ -4,6 +4,7 @@ All URIs are relative to *https://localhost:9001*
Method | HTTP request | Description
------------- | ------------- | -------------
+[**create_mock_data**](DefaultApi.md#create_mock_data) | **POST** /data/mock |
[**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} |
@@ -18,6 +19,67 @@ Method | HTTP request | Description
[**write_process_stdin**](DefaultApi.md#write_process_stdin) | **POST** /sessions/{id}/processes/{processID}/stdin |
+# **create_mock_data**
+> MockDataResponse create_mock_data(create_mock_data_request)
+
+
+
+### 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)
+ create_mock_data_request = playground_client.CreateMockDataRequest() # CreateMockDataRequest |
+
+ try:
+ api_response = api_instance.create_mock_data(create_mock_data_request)
+ print("The response of DefaultApi->create_mock_data:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling DefaultApi->create_mock_data: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **create_mock_data_request** | [**CreateMockDataRequest**](CreateMockDataRequest.md)| |
+
+### Return type
+
+[**MockDataResponse**](MockDataResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **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)
+
# **create_sessions**
> SessionResponse create_sessions(create_sessions_request)
diff --git a/api-service/playground_client/docs/File.md b/api-service/playground_client/docs/File.md
new file mode 100644
index 000000000..d303049b0
--- /dev/null
+++ b/api-service/playground_client/docs/File.md
@@ -0,0 +1,29 @@
+# File
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | |
+**content** | **str** | |
+
+## Example
+
+```python
+from playground_client.models.file import File
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of File from a JSON string
+file_instance = File.from_json(json)
+# print the JSON string representation of the object
+print File.to_json()
+
+# convert the object into a dict
+file_dict = file_instance.to_dict()
+# create an instance of File from a dict
+file_form_dict = file.from_dict(file_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/MockDataResponse.md b/api-service/playground_client/docs/MockDataResponse.md
new file mode 100644
index 000000000..47bdee7e2
--- /dev/null
+++ b/api-service/playground_client/docs/MockDataResponse.md
@@ -0,0 +1,28 @@
+# MockDataResponse
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**mock_data** | [**MockDataResponseMockData**](MockDataResponseMockData.md) | |
+
+## Example
+
+```python
+from playground_client.models.mock_data_response import MockDataResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MockDataResponse from a JSON string
+mock_data_response_instance = MockDataResponse.from_json(json)
+# print the JSON string representation of the object
+print MockDataResponse.to_json()
+
+# convert the object into a dict
+mock_data_response_dict = mock_data_response_instance.to_dict()
+# create an instance of MockDataResponse from a dict
+mock_data_response_form_dict = mock_data_response.from_dict(mock_data_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/MockDataResponseMockData.md b/api-service/playground_client/docs/MockDataResponseMockData.md
new file mode 100644
index 000000000..38a33787a
--- /dev/null
+++ b/api-service/playground_client/docs/MockDataResponseMockData.md
@@ -0,0 +1,27 @@
+# MockDataResponseMockData
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+## Example
+
+```python
+from playground_client.models.mock_data_response_mock_data import MockDataResponseMockData
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MockDataResponseMockData from a JSON string
+mock_data_response_mock_data_instance = MockDataResponseMockData.from_json(json)
+# print the JSON string representation of the object
+print MockDataResponseMockData.to_json()
+
+# convert the object into a dict
+mock_data_response_mock_data_dict = mock_data_response_mock_data_instance.to_dict()
+# create an instance of MockDataResponseMockData from a dict
+mock_data_response_mock_data_form_dict = mock_data_response_mock_data.from_dict(mock_data_response_mock_data_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 6f28cbd47..ad919ee2e 100644
--- a/api-service/playground_client/models/__init__.py
+++ b/api-service/playground_client/models/__init__.py
@@ -14,9 +14,13 @@
from __future__ import absolute_import
# import models into model package
+from playground_client.models.create_mock_data_request import CreateMockDataRequest
from playground_client.models.create_sessions_request import CreateSessionsRequest
from playground_client.models.entry_info import EntryInfo
+from playground_client.models.file import File
from playground_client.models.list_filesystem_dir_response import ListFilesystemDirResponse
+from playground_client.models.mock_data_response import MockDataResponse
+from playground_client.models.mock_data_response_mock_data import MockDataResponseMockData
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
diff --git a/api-service/playground_client/models/create_mock_data_request.py b/api-service/playground_client/models/create_mock_data_request.py
new file mode 100644
index 000000000..612ee921c
--- /dev/null
+++ b/api-service/playground_client/models/create_mock_data_request.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, Field, StrictStr
+from playground_client.models.file import File
+
+class CreateMockDataRequest(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ files: List[File] = ...
+ target_interface: StrictStr = Field(..., alias="targetInterface")
+ __properties = ["files", "targetInterface"]
+
+ 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) -> CreateMockDataRequest:
+ """Create an instance of CreateMockDataRequest 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 files (list)
+ _items = []
+ if self.files:
+ for _item in self.files:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict['files'] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> CreateMockDataRequest:
+ """Create an instance of CreateMockDataRequest from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return CreateMockDataRequest.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 CreateMockDataRequest) in the input: " + obj)
+
+ _obj = CreateMockDataRequest.parse_obj({
+ "files": [File.from_dict(_item) for _item in obj.get("files")] if obj.get("files") is not None else None,
+ "target_interface": obj.get("targetInterface")
+ })
+ return _obj
+
diff --git a/api-service/playground_client/models/file.py b/api-service/playground_client/models/file.py
new file mode 100644
index 000000000..612d1fbaa
--- /dev/null
+++ b/api-service/playground_client/models/file.py
@@ -0,0 +1,77 @@
+# 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 pydantic import BaseModel, StrictStr
+
+class File(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ name: StrictStr = ...
+ content: StrictStr = ...
+ __properties = ["name", "content"]
+
+ 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) -> File:
+ """Create an instance of File 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) -> File:
+ """Create an instance of File from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return File.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 File) in the input: " + obj)
+
+ _obj = File.parse_obj({
+ "name": obj.get("name"),
+ "content": obj.get("content")
+ })
+ return _obj
+
diff --git a/api-service/playground_client/models/mock_data_response.py b/api-service/playground_client/models/mock_data_response.py
new file mode 100644
index 000000000..60e15e697
--- /dev/null
+++ b/api-service/playground_client/models/mock_data_response.py
@@ -0,0 +1,79 @@
+# 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 pydantic import BaseModel, Field
+from playground_client.models.mock_data_response_mock_data import MockDataResponseMockData
+
+class MockDataResponse(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ mock_data: MockDataResponseMockData = Field(..., alias="mockData")
+ __properties = ["mockData"]
+
+ 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) -> MockDataResponse:
+ """Create an instance of MockDataResponse 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 mock_data
+ if self.mock_data:
+ _dict['mockData'] = self.mock_data.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MockDataResponse:
+ """Create an instance of MockDataResponse from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return MockDataResponse.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 MockDataResponse) in the input: " + obj)
+
+ _obj = MockDataResponse.parse_obj({
+ "mock_data": MockDataResponseMockData.from_dict(obj.get("mockData")) if obj.get("mockData") is not None else None
+ })
+ return _obj
+
diff --git a/api-service/playground_client/models/mock_data_response_mock_data.py b/api-service/playground_client/models/mock_data_response_mock_data.py
new file mode 100644
index 000000000..41e0bcca2
--- /dev/null
+++ b/api-service/playground_client/models/mock_data_response_mock_data.py
@@ -0,0 +1,111 @@
+# 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 json
+import pprint
+import re # noqa: F401
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr, ValidationError, validator
+from typing import Any, List
+from pydantic import StrictStr, Field
+
+MOCKDATARESPONSEMOCKDATA_ANY_OF_SCHEMAS = ["object", "str"]
+
+class MockDataResponseMockData(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ # data type: str
+ anyof_schema_1_validator: Optional[StrictStr] = None
+ # data type: object
+ anyof_schema_2_validator: Optional[Dict[str, Any]] = Field(None, description="Construct a type with a set of properties K of type T")
+ actual_instance: Any
+ any_of_schemas: List[str] = Field(MOCKDATARESPONSEMOCKDATA_ANY_OF_SCHEMAS, const=True)
+
+ class Config:
+ validate_assignment = True
+
+ @validator('actual_instance')
+ def actual_instance_must_validate_anyof(cls, v):
+ instance = cls()
+ error_messages = []
+ # validate data type: str
+ try:
+ instance.anyof_schema_1_validator = v
+ return v
+ except ValidationError as e:
+ error_messages.append(str(e))
+ # validate data type: object
+ try:
+ instance.anyof_schema_2_validator = v
+ return v
+ except ValidationError as e:
+ error_messages.append(str(e))
+ if error_messages:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into MockDataResponseMockData with anyOf schemas: object, str. Details: " + ", ".join(error_messages))
+ else:
+ return v
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MockDataResponseMockData:
+ """Returns the object represented by the json string"""
+ instance = cls()
+ error_messages = []
+ # deserialize data into str
+ try:
+ # validation
+ instance.anyof_schema_1_validator = json.loads(json_str)
+ # assign value to actual_instance
+ instance.actual_instance = instance.anyof_schema_1_validator
+ return instance
+ except ValidationError as e:
+ error_messages.append(str(e))
+ # deserialize data into object
+ try:
+ # validation
+ instance.anyof_schema_2_validator = json.loads(json_str)
+ # assign value to actual_instance
+ instance.actual_instance = instance.anyof_schema_2_validator
+ return instance
+ except ValidationError as e:
+ error_messages.append(str(e))
+
+ if error_messages:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into MockDataResponseMockData with anyOf schemas: object, str. Details: " + ", ".join(error_messages))
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is not None:
+ return self.actual_instance.to_json()
+ else:
+ return "null"
+
+ def to_dict(self) -> dict:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is not None:
+ return self.actual_instance.to_dict()
+ else:
+ return dict()
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.dict())
+
diff --git a/api-service/playground_client/test/test_create_mock_data_request.py b/api-service/playground_client/test/test_create_mock_data_request.py
new file mode 100644
index 000000000..9f8e7dcc9
--- /dev/null
+++ b/api-service/playground_client/test/test_create_mock_data_request.py
@@ -0,0 +1,65 @@
+# 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.create_mock_data_request import CreateMockDataRequest # noqa: E501
+from playground_client.rest import ApiException
+
+class TestCreateMockDataRequest(unittest.TestCase):
+ """CreateMockDataRequest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test CreateMockDataRequest
+ 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 `CreateMockDataRequest`
+ """
+ model = playground_client.models.create_mock_data_request.CreateMockDataRequest() # noqa: E501
+ if include_optional :
+ return CreateMockDataRequest(
+ files = [
+ playground_client.models.file.File(
+ name = '',
+ content = '', )
+ ],
+ target_interface = ''
+ )
+ else :
+ return CreateMockDataRequest(
+ files = [
+ playground_client.models.file.File(
+ name = '',
+ content = '', )
+ ],
+ target_interface = '',
+ )
+ """
+
+ def testCreateMockDataRequest(self):
+ """Test CreateMockDataRequest"""
+ # 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/test/test_default_api.py b/api-service/playground_client/test/test_default_api.py
index 96722de6c..8f1112344 100644
--- a/api-service/playground_client/test/test_default_api.py
+++ b/api-service/playground_client/test/test_default_api.py
@@ -28,6 +28,12 @@ class TestDefaultApi(unittest.TestCase):
def tearDown(self):
pass
+ def test_create_mock_data(self):
+ """Test case for create_mock_data
+
+ """
+ pass
+
def test_create_sessions(self):
"""Test case for create_sessions
diff --git a/api-service/playground_client/test/test_file.py b/api-service/playground_client/test/test_file.py
new file mode 100644
index 000000000..839e05346
--- /dev/null
+++ b/api-service/playground_client/test/test_file.py
@@ -0,0 +1,57 @@
+# 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.file import File # noqa: E501
+from playground_client.rest import ApiException
+
+class TestFile(unittest.TestCase):
+ """File unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test File
+ 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 `File`
+ """
+ model = playground_client.models.file.File() # noqa: E501
+ if include_optional :
+ return File(
+ name = '',
+ content = ''
+ )
+ else :
+ return File(
+ name = '',
+ content = '',
+ )
+ """
+
+ def testFile(self):
+ """Test File"""
+ # 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/test/test_mock_data_response.py b/api-service/playground_client/test/test_mock_data_response.py
new file mode 100644
index 000000000..2ad47aa06
--- /dev/null
+++ b/api-service/playground_client/test/test_mock_data_response.py
@@ -0,0 +1,55 @@
+# 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.mock_data_response import MockDataResponse # noqa: E501
+from playground_client.rest import ApiException
+
+class TestMockDataResponse(unittest.TestCase):
+ """MockDataResponse unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MockDataResponse
+ 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 `MockDataResponse`
+ """
+ model = playground_client.models.mock_data_response.MockDataResponse() # noqa: E501
+ if include_optional :
+ return MockDataResponse(
+ mock_data = None
+ )
+ else :
+ return MockDataResponse(
+ mock_data = None,
+ )
+ """
+
+ def testMockDataResponse(self):
+ """Test MockDataResponse"""
+ # 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/test/test_mock_data_response_mock_data.py b/api-service/playground_client/test/test_mock_data_response_mock_data.py
new file mode 100644
index 000000000..8772ba108
--- /dev/null
+++ b/api-service/playground_client/test/test_mock_data_response_mock_data.py
@@ -0,0 +1,53 @@
+# 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.mock_data_response_mock_data import MockDataResponseMockData # noqa: E501
+from playground_client.rest import ApiException
+
+class TestMockDataResponseMockData(unittest.TestCase):
+ """MockDataResponseMockData unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MockDataResponseMockData
+ 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 `MockDataResponseMockData`
+ """
+ model = playground_client.models.mock_data_response_mock_data.MockDataResponseMockData() # noqa: E501
+ if include_optional :
+ return MockDataResponseMockData(
+ )
+ else :
+ return MockDataResponseMockData(
+ )
+ """
+
+ def testMockDataResponseMockData(self):
+ """Test MockDataResponseMockData"""
+ # 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 00c020155..83fd18ba0 100644
--- a/api-service/playground_client_README.md
+++ b/api-service/playground_client_README.md
@@ -47,14 +47,14 @@ configuration = playground_client.Configuration(
with playground_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = playground_client.DefaultApi(api_client)
- create_sessions_request = playground_client.CreateSessionsRequest() # CreateSessionsRequest |
+ create_mock_data_request = playground_client.CreateMockDataRequest() # CreateMockDataRequest |
try:
- api_response = api_instance.create_sessions(create_sessions_request)
- print("The response of DefaultApi->create_sessions:\n")
+ api_response = api_instance.create_mock_data(create_mock_data_request)
+ print("The response of DefaultApi->create_mock_data:\n")
pprint(api_response)
except ApiException as e:
- print("Exception when calling DefaultApi->create_sessions: %s\n" % e)
+ print("Exception when calling DefaultApi->create_mock_data: %s\n" % e)
```
@@ -64,6 +64,7 @@ All URIs are relative to *https://localhost:9001*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
+*DefaultApi* | [**create_mock_data**](playground_client/docs/DefaultApi.md#create_mock_data) | **POST** /data/mock |
*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} |
@@ -80,9 +81,13 @@ Class | Method | HTTP request | Description
## Documentation For Models
+ - [CreateMockDataRequest](playground_client/docs/CreateMockDataRequest.md)
- [CreateSessionsRequest](playground_client/docs/CreateSessionsRequest.md)
- [EntryInfo](playground_client/docs/EntryInfo.md)
+ - [File](playground_client/docs/File.md)
- [ListFilesystemDirResponse](playground_client/docs/ListFilesystemDirResponse.md)
+ - [MockDataResponse](playground_client/docs/MockDataResponse.md)
+ - [MockDataResponseMockData](playground_client/docs/MockDataResponseMockData.md)
- [OpenPort](playground_client/docs/OpenPort.md)
- [OutStderrResponse](playground_client/docs/OutStderrResponse.md)
- [OutStdoutResponse](playground_client/docs/OutStdoutResponse.md)